:root {
  --bg: #0f1226;
  --bg-2: #151936;
  --card: #1a2042;
  --soft: #202759;
  --text: #e9ecff;
  --muted: #aab1d6;
  --primary: #6c8cff;
  --primary-2: #87f1ff;
  --accent: #b794f4;
  --success: #2dd4bf;
  --danger: #ef4444;
  --warning: #f59e0b;
  --ring: rgba(108, 140, 255, 0.5);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% 0%, rgba(135,241,255,0.12), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(183,148,244,0.14), transparent 60%),
              linear-gradient(180deg, var(--bg), var(--bg-2));
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: rgba(10, 12, 28, 0.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.2px; }
.brand i { color: var(--primary-2); }

.nav { display: flex; gap: 10px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); text-decoration: none;
  padding: 8px 12px; border-radius: 10px; transition: 200ms ease;
}
.nav-link:hover { background: rgba(255,255,255,0.06); }
.nav-link.active { background: linear-gradient(135deg, rgba(108,140,255,0.20), rgba(135,241,255,0.18)); }

.container {
  max-width: 1100px; margin: 24px auto; padding: 0 16px;
  display: grid; grid-template-columns: 1fr; gap: 20px;
}

.section { display: none; }
.section.active { display: block; }

.card {
  background: linear-gradient(180deg, rgba(26,32,66,0.9), rgba(26,32,66,0.86));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.card h2, .card h3, .card h4 { margin: 8px 0 14px; }

.card.soft { background: linear-gradient(180deg, rgba(32,39,89,0.75), rgba(32,39,89,0.68)); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.responsive-stack { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; }
@media (max-width: 840px) {
  .grid-2, .grid-3, .responsive-stack { grid-template-columns: 1fr; }
}

.form-field { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; color: var(--muted); font-size: 0.9rem; }

input, select {
  width: 100%; padding: 12px 12px;
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text); outline: none; transition: 150ms ease;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 6px var(--ring); }

.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon i { position: absolute; left: 12px; color: var(--muted); }
.input-with-icon input { padding-left: 32px; }

.inline { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

.hint { color: var(--muted); font-size: 0.8rem; }

.actions { display: flex; gap: 10px; margin-top: 10px; }
.actions.right { justify-content: flex-end; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 12px;
  color: var(--text); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); cursor: pointer;
  transition: transform 120ms ease, background 200ms ease, border-color 200ms ease;
}
.btn:hover { background: rgba(255,255,255,0.10); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, rgba(108,140,255,0.25), rgba(135,241,255,0.22));
  border-color: rgba(135,241,255,0.35);
}
.btn.ghost { background: transparent; }

.icon-btn {
  background: transparent; border: none; color: var(--text); cursor: pointer;
  padding: 8px; border-radius: 10px;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); }

.message { margin-top: 10px; min-height: 22px; font-size: 0.92rem; }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }

.filters { display: flex; flex-direction: column; gap: 12px; }

.summary-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 8px 12px; border-radius: 999px; color: var(--text);
}

.history-list { display: grid; gap: 12px; }
.day-group {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  border-radius: 12px; overflow: hidden;
}
.day-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; cursor: pointer;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
}
.day-header:hover { background: rgba(255,255,255,0.08); }
.day-header .title { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.day-header .total { font-weight: 700; }

.day-body { display: none; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.day-body.open { display: block; }

.table-wrap { width: 100%; overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; font-size: 0.95rem;
}
.table th, .table td {
  padding: 10px 8px; border-bottom: 1px dashed rgba(255,255,255,0.10);
}
.table th { text-align: left; color: var(--muted); font-weight: 600; }
.table .num { text-align: right; }

.empty {
  text-align: center; color: var(--muted);
  display: grid; gap: 8px; padding: 20px;
}
.empty i { font-size: 2rem; }
.hidden { display: none !important; }

.modal {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,0.55);
}
.modal.hidden { display: none; }
.modal-content {
  width: min(100% - 24px, 980px);
  background: linear-gradient(180deg, rgba(24,29,66,0.96), rgba(24,29,66,0.92));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; box-shadow: var(--shadow);
  max-height: 90vh; overflow: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; position: sticky; top: 0; background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-body { padding: 14px 18px 18px; display: grid; gap: 12px; }
.report-meta { display: flex; gap: 10px; flex-wrap: wrap; }

.footer {
  text-align: center; color: var(--muted); padding: 20px 0 40px;
}
