:root{
  --bg:#0b0f14;
  --panel:#121924;
  --panel2:#0f1621;
  --text:#e7eef7;
  --muted:#a9b6c6;
  --line:#233042;
  --accent:#4aa3ff;
  --good:#3ddc97;
  --bad:#ff5c72;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(74,163,255,.15), transparent 60%),
              radial-gradient(900px 500px at 80% 20%, rgba(61,220,151,.12), transparent 60%),
              var(--bg);
  color:var(--text);
}

.app{min-height:100%; display:flex; flex-direction:column}
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background: rgba(10,14,20,.75);
  backdrop-filter: blur(10px);
}
.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:38px; height:38px; border-radius:12px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(74,163,255,.35), rgba(61,220,151,.25));
  border:1px solid rgba(255,255,255,.08);
  font-weight:800;
}
.brand-title{font-weight:800}
.brand-sub{font-size:12px; color:var(--muted)}
.topbar-right{display:flex; gap:10px; align-items:center}
.user-badge{display:flex; gap:12px; align-items:center}
.user-email{font-size:13px; color:var(--muted); max-width:45ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}

.view{flex:1; display:grid; place-items:center; padding:22px}
.layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

@media (min-width: 1200px) {
  .layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .layout section:last-child {
    grid-column: span 2;
  }
}

.card{
  width:min(720px, 96vw);
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 25%), var(--panel);
  border:1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
}
.layout .card{width:auto}

.card h1{margin:0 0 8px 0}
.card h2{margin:0}
.card-head{
  display:flex; justify-content:space-between; align-items:center;
  gap:12px; margin-bottom:10px;
}
.actions{display:flex; gap:10px; flex-wrap:wrap}

.muted{color:var(--muted)}
.small{font-size:12px}
.hr{height:1px; background:var(--line); margin:14px 0}

.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
@media (max-width: 980px){
  .grid{grid-template-columns: repeat(2, 1fr)}
}
@media (max-width: 620px){
  .grid{grid-template-columns: 1fr}
}
.field{display:flex; flex-direction:column; gap:6px}
.field-wide{grid-column: 1 / -1}
label{font-size:12px; color:var(--muted)}
input, select, textarea{
  background: var(--panel2);
  border:1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  padding:10px 12px;
  color:var(--text);
  outline:none;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(74,163,255,.55);
  box-shadow: 0 0 0 4px rgba(74,163,255,.12);
}
.hint{font-size:11px; color:rgba(169,182,198,.8)}

.btn{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  color:var(--text);
  padding:9px 12px;
  border-radius: 12px;
  cursor:pointer;
}
.btn:hover{border-color: rgba(255,255,255,.22)}
.btn-primary{
  background: linear-gradient(135deg, rgba(74,163,255,.45), rgba(61,220,151,.18));
  border-color: rgba(74,163,255,.45);
}
.btn-ghost{
  background: transparent;
}

.table-wrap{overflow:auto; border-radius:12px; border:1px solid rgba(255,255,255,.08)}
.table{width:100%; border-collapse:collapse; min-width:780px; background: rgba(0,0,0,.15)}
.table th, .table td{
  padding:10px 10px;
  border-bottom:1px solid rgba(255,255,255,.06);
  vertical-align:top;
  font-size:13px;
}
.table th{color:var(--muted); font-weight:600; text-align:left}
.table td input{
  width:100%;
  padding:8px 10px;
  border-radius:10px;
}
.table td .btn{
  padding:6px 10px;
  border-radius:10px;
}

.totals{
  display:flex; justify-content:space-between; align-items:baseline;
  padding:12px 2px 0 2px;
}
.total-amt{font-size:22px; font-weight:800}

.alert{
  margin-top:12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}
.alert.ok{border-color: rgba(61,220,151,.35)}
.alert.bad{border-color: rgba(255,92,114,.40)}
.hidden{display:none}

.export-result{
  margin-top:12px;
  display:grid;
  gap:8px;
}
.export-item{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
}
.export-item a{color: var(--accent); text-decoration:none}
.export-item a:hover{text-decoration:underline}

.footer{
  padding:14px 18px;
  border-top:1px solid var(--line);
  background: rgba(10,14,20,.6);
}