:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --muted: #6c7685;
  --text: #152033;
  --primary: #0d6b6f;
  --primary-soft: #d9f0f1;
  --danger: #c43939;
  --border: #dce4ef;
  --shadow: 0 10px 28px rgba(11, 38, 59, 0.08);
}

html[data-theme="dark"] {
  --bg: #121a24;
  --surface: #1a2532;
  --muted: #9bb0c9;
  --text: #e8f1ff;
  --primary: #5ec6cc;
  --primary-soft: #1f3a45;
  --danger: #ef7777;
  --border: #2d3d50;
  --shadow: 0 12px 30px rgba(2, 8, 14, 0.5);
}

* { box-sizing: border-box; }
body {
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(13, 107, 111, 0.2), transparent 40%),
    radial-gradient(circle at 100% 0, rgba(196, 57, 57, 0.12), transparent 35%),
    var(--bg);
  margin: 0;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-shell { width: min(440px, 92vw); }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 18px;
  padding: 1.5rem;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #10253a 0%, #0b1726 100%);
  color: #f5f8ff;
  padding: 1.2rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.brand-mark {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.menu-link {
  color: #dce7f8;
  text-decoration: none;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.menu-link:hover,
.menu-link.active {
  background: rgba(94, 198, 204, 0.18);
  color: #fff;
}

.main-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.4rem;
  background: color-mix(in oklab, var(--surface), transparent 10%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-pill {
  background: var(--primary-soft);
  color: var(--text);
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.content-area {
  padding: 1.2rem 1.4rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.panel-header {
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.3rem;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.metric-card strong {
  font-size: 1.3rem;
}

.year-filter-bar {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.year-filter-btn {
  text-decoration: none;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  color: var(--text);
  background: color-mix(in oklab, var(--surface), transparent 8%);
  font-weight: 700;
  min-width: 88px;
  text-align: center;
}

.year-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.year-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
}

.form-control,
.form-select,
.btn {
  border-radius: 10px;
}

.alert {
  border-radius: 10px;
}

@media (max-width: 992px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}
