:root {
  --bg: #0b1020;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --line: rgba(255,255,255,0.12);
  --accent: #7dd3fc;
  --danger: #fb7185;
  --shadow: 0 18px 40px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 20% 10%, rgba(125,211,252,0.25), transparent 60%),
              radial-gradient(900px 700px at 80% 15%, rgba(56,189,248,0.18), transparent 55%),
              var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 250px; }
.logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  font-weight: 800;
}
.title { font-weight: 800; letter-spacing: 0.2px; }
.subtitle { color: var(--muted); font-size: 12px; margin-top: 2px; }

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.export-group { display: flex; gap: 10px; }

.wrap {
  max-width: 1100px;
  margin: 20px auto 60px;
  padding: 0 14px;
  display: grid;
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.card-header h2 { margin: 0 0 6px; }
.muted { color: var(--muted); }
.bullets { margin: 10px 0 0 18px; color: var(--muted); }
.bullets li { margin: 6px 0; }

.btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 650;
}
.btn:hover { background: rgba(255,255,255,0.10); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  border-color: rgba(125,211,252,0.35);
  background: rgba(125,211,252,0.16);
}
.btn-primary:hover { background: rgba(125,211,252,0.22); }

.btn-ghost { background: transparent; }
.btn-danger {
  border-color: rgba(251,113,133,0.35);
  background: rgba(251,113,133,0.12);
}
.btn-danger:hover { background: rgba(251,113,133,0.18); }

.select, input[type="text"], input[type="number"] {
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  outline: none;
}
.select:focus, input:focus { border-color: rgba(125,211,252,0.55); }

.section {
  padding: 14px 16px 0;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-title h3 { margin: 0; }
.section-subtotal { color: var(--muted); font-weight: 700; }

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.12);
}
.table th, .table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.table tr:last-child td { border-bottom: none; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.count {
  width: 110px;
  text-align: right;
}
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 12px;
}

.totals {
  margin: 14px 16px 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.14);
  border-radius: 14px;
  padding: 10px 12px;
}
.total-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.total-row:last-child { border-bottom: none; }
.total-row.grand {
  font-size: 20px;
  font-weight: 900;
}
.total-label { color: var(--muted); font-weight: 800; }
.total-value { font-weight: 900; }

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}
.hidden { display: none !important; }

.modal {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10,14,26,0.95);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.10); }

.modal-body { padding: 14px; display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field span { color: var(--muted); font-size: 13px; font-weight: 700; }
.field small { line-height: 1.25; }

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.spacer { flex: 1; }

@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .actions { justify-content: flex-start; }
  .count { width: 90px; }
}