/* ============================================================
   UTANG NA LOOB — style.css (consolidated, all pages)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ── Variables dark (default) ── */
:root {
  --ink: #0A1628;
  --ink-2: #101C34;
  --ink-3: #16254A;
  --gold: #C9A84C;
  --gold-dim: rgba(201, 168, 76, .18);
  --teal: #1A7A6E;
  --teal-dim: rgba(26, 122, 110, .18);
  --muted: #6B7A8D;
  --text: #E8ECF0;
  --border: rgba(201, 168, 76, .18);
  --border-w: rgba(255, 255, 255, .07);
  --radius: 14px;
  --sidebar-w: 260px;
  --transition: .22s cubic-bezier(.4, 0, .2, 1);
  --chart-tick: #E8ECF0;
  --chart-grid: rgba(255, 255, 255, .08);
  --chart-legend: #E8ECF0;
}

/* ── Variables light ── */
body.light-mode {
  --ink: #F0F2F5;
  --ink-2: #FFFFFF;
  --ink-3: #E4E8EF;
  --gold: #A07830;
  --gold-dim: rgba(160, 120, 48, .12);
  --teal: #1A7A6E;
  --teal-dim: rgba(26, 122, 110, .12);
  --muted: #5A6A7A;
  --text: #0A1628;
  --border: rgba(160, 120, 48, .25);
  --border-w: rgba(0, 0, 0, .1);
  --chart-tick: #0A1628;
  --chart-grid: rgba(0, 0, 0, .08);
  --chart-legend: #0A1628;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--ink);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .3s, color .3s;
  margin: 0;
  padding: 0;
}

body:has(.auth-card) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

/* ── App shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--ink-2);
  border-right: 1px solid var(--border-w);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition), background .3s;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border-w);
}

.sidebar-logo .logo-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: -.02em;
}

.sidebar-logo .logo-tag {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .05);
  color: var(--text);
}

.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold);
}

.nav-item .nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--teal);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 7px;
}

.sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--border-w);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.sidebar-user-info .uname {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
}

.sidebar-user-info .utag {
  font-size: .73rem;
  color: var(--muted);
}

.sidebar-logout {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  transition: color .2s;
  padding: 4px;
}

.sidebar-logout:hover {
  color: #e74c3c;
}

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px;
  min-height: 100vh;
  background: var(--ink);
  transition: background .3s;
}

/* ── Page panels ── */
.page-panel {
  display: none;
}

.page-panel.active {
  display: block;
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.page-sub {
  font-size: .85rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Cards ── */
.card {
  background: var(--ink-2);
  border: 1px solid var(--border-w);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition), background .3s;
}

.card:hover {
  border-color: rgba(201, 168, 76, .25);
}

.card-sm {
  padding: 16px 20px;
}

.stat-card {
  background: var(--ink-2);
  border: 1px solid var(--border-w);
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), background .3s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
}

.stat-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
}

.stat-delta {
  font-size: .78rem;
  color: var(--teal);
  margin-top: 4px;
}

.stat-icon {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 2rem;
  opacity: .25;
}

/* ── Grids ── */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-gold {
  background: linear-gradient(135deg, #C9A84C, #A07830);
  color: #fff;
  box-shadow: 0 4px 16px rgba(201, 168, 76, .3);
}

.btn-gold:hover {
  box-shadow: 0 8px 24px rgba(201, 168, 76, .4);
  transform: translateY(-1px);
}

.btn-teal {
  background: linear-gradient(135deg, #1A7A6E, #0E5A50);
  color: #fff;
  box-shadow: 0 4px 16px rgba(26, 122, 110, .3);
}

.btn-teal:hover {
  box-shadow: 0 8px 24px rgba(26, 122, 110, .4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-w);
  color: var(--muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  border-color: var(--border);
}

.btn-danger {
  background: rgba(231, 76, 60, .15);
  border: 1px solid rgba(231, 76, 60, .3);
  color: #e74c3c;
}

.btn-danger:hover {
  background: rgba(231, 76, 60, .25);
}

.btn-sm {
  padding: 7px 14px;
  font-size: .8rem;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* ── Forms ── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: .92rem;
  transition: border-color .2s, box-shadow .2s, background .3s, color .3s;
  outline: none;
  -webkit-appearance: none;
}

body.light-mode .form-control {
  background: rgba(0, 0, 0, .04);
  border-color: rgba(0, 0, 0, .12);
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, .12);
}

.form-control::placeholder {
  color: var(--muted);
}

select.form-control {
  cursor: pointer;
}

select.form-control option {
  background: var(--ink-2);
  color: var(--text);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

.input-wrap {
  position: relative;
}

.input-wrap .form-control {
  padding-right: 44px;
}

.eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  padding: 4px;
  line-height: 1;
  transition: color .2s;
}

.eye-btn:hover {
  color: var(--gold);
}

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}

.badge-gold {
  background: var(--gold-dim);
  color: var(--gold);
}

.badge-teal {
  background: var(--teal-dim);
  color: #3ecfbf;
}

.badge-muted {
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
}

.badge-danger {
  background: rgba(231, 76, 60, .15);
  color: #e74c3c;
}

.badge-success {
  background: rgba(46, 204, 113, .15);
  color: #2ecc71;
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  width: min(520px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .35s cubic-bezier(.16, 1, .3, 1);
  transition: background .3s;
}

.modal-box.modal-lg {
  width: min(700px, 96vw);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close-btn {
  background: none;
  border: 1px solid var(--border-w);
  border-radius: 8px;
  color: var(--muted);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  transition: all .2s;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ── Table ── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-w);
  text-align: left;
  font-weight: 500;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  font-size: .88rem;
  vertical-align: middle;
  color: var(--text);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, .02);
}

/* ── Chips ── */
.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border-w);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
}

.chip:hover {
  background: rgba(255, 255, 255, .1);
  color: var(--text);
}

.chip.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  background: var(--ink-3);
  border: 1px solid var(--border-w);
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
}

.suggestion-chip:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Search box ── */
.search-box {
  position: relative;
}

.search-box .form-control {
  padding-left: 40px;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ── Group card ── */
.group-card {
  background: var(--ink-2);
  border: 1px solid var(--border-w);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.group-card:hover {
  border-color: rgba(201, 168, 76, .35);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
}

.group-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 1.75rem;
  margin-bottom: 8px;
}

.group-card-name {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-admin-badge {
  flex-shrink: 0;
  align-self: center;
}

.group-card-meta {
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.group-card-code {
  font-family: monospace;
  font-size: .78rem;
  background: var(--gold-dim);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 6px;
}

/* ── Activity feed ── */
.activity-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.activity-msg {
  font-size: .87rem;
  color: var(--text);
  line-height: 1.4;
}

.activity-meta {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Plan card ── */
.plan-card {
  background: var(--ink-2);
  border: 1px solid var(--border-w);
  border-radius: var(--radius);
  padding: 20px;
}

.plan-progress {
  height: 4px;
  background: rgba(255, 255, 255, .08);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.plan-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  transition: width .4s;
}

.plan-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.plan-item:last-child {
  border-bottom: none;
}

.plan-item input[type=checkbox] {
  accent-color: var(--teal);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.plan-item.done label {
  text-decoration: line-through;
  opacity: .5;
}

.plan-checklist .plan-item label {
  font-size: .85rem;
  flex: 1;
  cursor: pointer;
  color: var(--text);
}

/* ── Balance indicators ── */
.bal-positive {
  color: #2ecc71;
}

.bal-negative {
  color: #e74c3c;
}

.bal-zero {
  color: var(--muted);
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--ink-2);
  border: 1px solid var(--border-w);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: .88rem;
  color: var(--text);
  min-width: 240px;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
  animation: slideInRight .35s cubic-bezier(.16, 1, .3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
}

.toast.removing {
  animation: slideOutRight .3s forwards;
}

.toast-success {
  border-color: rgba(46, 204, 113, .3);
}

.toast-error {
  border-color: rgba(231, 76, 60, .3);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

@keyframes slideOutRight {
  to {
    opacity: 0;
    transform: translateX(40px)
  }
}

/* ── Mobile toggle ── */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--ink-2);
  border: 1px solid var(--border-w);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
}

/* ── Theme toggle ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-w);
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 7px 11px;
  transition: all .2s;
  line-height: 1;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--gold);
}

body.light-mode .theme-toggle:hover {
  background: rgba(0, 0, 0, .06);
}

/* ── Chart controls ── */
.chart-period-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chart-period-btns .chip {
  padding: 5px 12px;
  font-size: .75rem;
}

.year-select {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border-w);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--text);
  font-size: .82rem;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  transition: border-color .2s, background .3s;
}

body.light-mode .year-select {
  background: rgba(0, 0, 0, .05);
}

.year-select:focus {
  border-color: var(--gold);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: .9rem;
}

/* ── Explore ── */
.suggest-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.group-search-results {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.public-group-card {
  background: var(--ink-3);
  border: 1px solid var(--border-w);
  border-radius: 12px;
  padding: 16px;
  transition: all .2s;
}

.public-group-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.public-group-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 4px;
  color: var(--text);
}

.public-group-meta {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── Avatar picker ── */
.avatar-option {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 50%;
  transition: border-color .2s, box-shadow .2s;
}

.avatar-option:hover {
  border-color: var(--gold);
}

.selected-avatar {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px var(--gold-dim);
}

/* ── Group view shell ── */
.gv-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.gv-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--ink-2);
  border: 1px solid var(--border-w);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}

.gv-back {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  transition: color .2s;
  white-space: nowrap;
}

.gv-back:hover {
  color: var(--gold);
}

.gv-group-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.gv-group-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.gv-group-code {
  font-family: monospace;
  font-size: .82rem;
  background: var(--gold-dim);
  color: var(--gold);
  padding: 3px 10px;
  border-radius: 6px;
}

.gv-topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.gv-tabs {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-w);
  margin-bottom: 20px;
}

.gv-tab {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  font-weight: 500;
  color: var(--muted);
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  margin-bottom: -1px;
}

.gv-tab:hover {
  color: var(--text);
}

.gv-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.gv-body {
  min-height: 400px;
}

.gv-panel {
  display: none;
}

.gv-panel.active {
  display: block;
  animation: fadeIn .25s ease;
}

/* ── Auth pages ── */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 80%, rgba(26, 122, 110, .18) 0%, transparent 60%), radial-gradient(ellipse 60% 50% at 80% 20%, rgba(201, 168, 76, .12) 0%, transparent 55%), #0A1628;
}

.bg-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C9A84C' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-card {
  position: relative;
  z-index: 1;
  background: rgba(16, 28, 52, .88);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 36px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(201, 168, 76, .15);
  animation: slideUp .6s cubic-bezier(.16, 1, .3, 1) both;
  width: min(440px, 96vw);
}

.register-card {
  width: min(500px, 96vw);
}

.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-brand .brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -.03em;
  color: var(--gold);
}

.auth-brand .brand-sub {
  font-size: .85rem;
  color: var(--muted);
  margin-top: 4px;
}

.alert-timeout {
  background: rgba(201, 168, 76, .12);
  border: 1px solid rgba(201, 168, 76, .3);
  color: var(--gold);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .84rem;
  margin-bottom: 20px;
  text-align: center;
}

.btn-auth {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #1A7A6E, #0E5A50);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 20px rgba(26, 122, 110, .4);
  transition: transform .15s, box-shadow .2s, opacity .2s;
}

.btn-auth:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(26, 122, 110, .5);
}

.btn-auth:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.auth-divider {
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  margin: 22px 0;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: rgba(255, 255, 255, .08);
}

.auth-divider::before {
  left: 0;
}

.auth-divider::after {
  right: 0;
}

.auth-link {
  text-align: center;
  font-size: .88rem;
  color: var(--muted);
}

.auth-link a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}

.auth-link a:hover {
  text-decoration: underline;
}

.strength-bar {
  height: 3px;
  border-radius: 2px;
  margin-top: 6px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s, background .3s;
  width: 0;
}

.strength-label {
  font-size: .72rem;
  margin-top: 3px;
  color: var(--muted);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.check-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
}

.check-group input[type=checkbox] {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.check-group label {
  font-size: .83rem;
  color: var(--muted);
  cursor: pointer;
}

.check-group a {
  color: var(--gold);
  text-decoration: none;
}

.check-group a:hover {
  text-decoration: underline;
}

.terms-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.terms-modal-overlay.open {
  display: flex;
}

.terms-modal-box {
  background: #101c34;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 96vw;
  max-height: 82vh;
  overflow-y: auto;
}

.terms-modal-box h4 {
  font-family: 'Syne', sans-serif;
  color: var(--gold);
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.terms-modal-box p {
  font-size: .88rem;
  color: #aab;
  line-height: 1.65;
  margin-bottom: 10px;
}

.terms-modal-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px;
  color: #fff;
  padding: 8px 20px;
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
  font-size: .9rem;
  transition: background .2s;
}

.terms-modal-close:hover {
  background: rgba(255, 255, 255, .08);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: 3px;
}

/* ── Responsive ── */
@media(max-width:1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width:768px) {

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .row-2 {
    grid-template-columns: 1fr;
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-top: 58px;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .5);
  }

  .mobile-toggle {
    display: block;
  }

  .gv-topbar-actions .btn {
    font-size: .78rem;
    padding: 7px 10px;
  }

  .gv-tab {
    padding: 10px 10px;
    font-size: .8rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-box {
    padding: 20px;
  }

  .auth-card {
    padding: 32px 20px;
  }
}

@media(max-width:480px) {
  .gv-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .gv-topbar-actions {
    margin-left: 0;
    width: 100%;
  }

  .gv-topbar-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .page-title {
    font-size: 1.25rem;
  }
}