:root {
  --background: #020617;
  --foreground: #f8fafc;
  --card: rgba(15, 23, 42, 0.84);
  --card-foreground: #ffffff;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --primary: #00338d;
  --accent: #c60c30;
  --ring: rgba(158, 197, 255, 0.45);
  --radius: 1.5rem;
  --page-gradient: radial-gradient(circle at top, rgba(0, 51, 141, 0.12), transparent 40%), #111827;
  --sidebar-bg: rgba(2, 6, 23, 0.96);
  --sidebar-foreground: #f8fafc;
  --sidebar-muted: rgba(248, 250, 252, 0.72);
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-border: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] {
  --background: #f3f5f9;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --primary: #00338d;
  --accent: #c60c30;
  --ring: rgba(0, 51, 141, 0.15);
  --page-gradient: #f3f5f9;
  --sidebar-bg: #ffffff;
  --sidebar-foreground: #0f172a;
  --sidebar-muted: #64748b;
  --sidebar-hover: rgba(15, 23, 42, 0.06);
  --sidebar-border: rgba(15, 23, 42, 0.08);
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--background);
  color: var(--foreground);
}

[data-theme="dark"] body {
  background: var(--page-gradient);
}

.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  color: var(--card-foreground);
}

[data-theme="light"] .card {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  backdrop-filter: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="light"] .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.hero-card {
  background: linear-gradient(135deg, rgba(0, 51, 141, 0.92), rgba(198, 12, 48, 0.42));
}

[data-theme="light"] .hero-card {
  background: linear-gradient(135deg, rgba(0, 51, 141, 0.08), rgba(198, 12, 48, 0.08));
  color: #0f172a;
}

[data-theme="light"] .hero-card h1,
[data-theme="light"] .hero-card h2,
[data-theme="light"] .hero-card h3,
[data-theme="light"] .hero-card h4,
[data-theme="light"] .hero-card p,
[data-theme="light"] .hero-card strong,
[data-theme="light"] .hero-card span {
  color: #0f172a !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mini-stat {
  padding: 1rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.mini-stat span {
  display: block;
  color: #cbd5e1;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.mini-stat strong {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.75rem;
}

[data-theme="light"] .hero-card .badge {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #334155 !important;
}

[data-theme="light"] .hero-card .mini-stat {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .hero-card .mini-stat span,
[data-theme="light"] .hero-card .mini-stat strong {
  color: #0f172a !important;
}

.theme-logo-wrap {
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, #00338d, #c60c30);
  color: #fff;
  font-weight: 700;
}

.text-light-emphasis {
  color: rgba(255, 255, 255, 0.8) !important;
}

#bills-dashboard-app a,
.card a {
  color: inherit;
  text-decoration: none;
}

#bills-dashboard-app a:hover,
.card a:hover {
  color: #9ec5ff;
}

[data-theme="light"] #bills-dashboard-app a,
[data-theme="light"] .card a {
  color: #00338d;
}

[data-theme="light"] #bills-dashboard-app a:hover,
[data-theme="light"] .card a:hover {
  color: #1d4ed8;
}

[data-theme="light"] .text-secondary,
[data-theme="light"] .small.text-secondary {
  color: #64748b !important;
}

[data-theme="light"] .border-secondary-subtle {
  border-color: rgba(15, 23, 42, 0.08) !important;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

[data-theme="light"] .app-layout,
[data-theme="light"] main.app-layout,
[data-theme="light"] .app-content,
[data-theme="light"] #page,
[data-theme="light"] #content,
[data-theme="light"] .site,
[data-theme="light"] .site-main {
  background: #f3f5f9 !important;
}

.app-sidebar {
  width: 280px;
  flex: 0 0 280px;
  background: var(--sidebar-bg) !important;
  color: var(--sidebar-foreground);
  border-right: 1px solid var(--sidebar-border);
  transition: width 0.25s ease, flex-basis 0.25s ease, transform 0.25s ease;
  overflow: hidden;
  position: sticky;
  top: 0;
  height: 100vh;
}

.app-sidebar.collapsed {
  width: 88px;
  flex-basis: 88px;
}

.app-sidebar-inner {
  padding: 1.25rem 1rem;
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.25rem 0.5rem;
}

.app-sidebar-logo {
  width: 48px;
  height: 48px;
  border-radius: 1rem;
  background: linear-gradient(135deg, #00338d, #c60c30);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.app-sidebar-brand .fw-semibold {
  color: var(--sidebar-foreground);
}

.app-sidebar-brand .text-body-secondary,
.app-sidebar-brand .small {
  color: var(--sidebar-muted) !important;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-sidebar-menu li {
  margin: 0;
  padding: 0;
}

.app-sidebar-menu li a,
.app-nav-link {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  text-decoration: none;
  color: var(--sidebar-foreground);
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.app-sidebar-menu li a:hover,
.app-sidebar-menu li.current-menu-item > a,
.app-sidebar-menu li.current_page_item > a,
.app-sidebar-menu li.current-menu-ancestor > a,
.app-nav-link:hover,
.app-nav-link.active {
  background: var(--sidebar-hover);
  color: var(--sidebar-foreground);
}

.app-content {
  flex: 1 1 auto;
  min-width: 0;
}

.app-sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
}

.app-sidebar-toggle,
.app-theme-toggle {
  min-height: 46px;
  border-radius: 0.9rem;
  width: 100%;
}

.app-sidebar-toggle-icon,
.app-theme-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.app-sidebar-toggle-label,
.app-theme-toggle-label {
  white-space: nowrap;
}

.app-theme-toggle-wrap {
  border-top: 1px solid var(--sidebar-border);
}

/* Keep Bootstrap button theming, only remove heavy shadows */
.app-sidebar .btn {
  box-shadow: none;
}

.app-sidebar.collapsed .app-sidebar-brand > div:last-child,
.app-sidebar.collapsed .app-sidebar-cta,
.app-sidebar.collapsed .small.text-secondary {
  overflow: hidden;
  text-indent: -9999px;
  position: relative;
}

.app-sidebar.collapsed .app-sidebar-menu li a {
  overflow: hidden;
  text-indent: -9999px;
  position: relative;
}

.app-sidebar.collapsed .app-nav-link {
  overflow: hidden;
  text-indent: -9999px;
  position: relative;
}

.app-sidebar.collapsed .app-sidebar-toggle,
.app-sidebar.collapsed .app-theme-toggle {
  width: 100%;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
}

.app-sidebar.collapsed .app-sidebar-toggle-label,
.app-sidebar.collapsed .app-theme-toggle-label {
  display: none;
}

.app-sidebar.collapsed .app-sidebar-toggle-icon,
.app-sidebar.collapsed .app-theme-toggle-icon {
  display: inline-flex;
}

.app-sidebar.collapsed .app-sidebar-menu li a::before {
  text-indent: 0;
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sidebar-foreground);
}

.app-sidebar.collapsed .app-nav-link::before {
  text-indent: 0;
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sidebar-foreground);
}

.app-sidebar.collapsed .app-sidebar-menu li:nth-child(1) a::before { content: "1"; }
.app-sidebar.collapsed .app-sidebar-menu li:nth-child(2) a::before { content: "2"; }
.app-sidebar.collapsed .app-sidebar-menu li:nth-child(3) a::before { content: "3"; }
.app-sidebar.collapsed .app-sidebar-menu li:nth-child(4) a::before { content: "4"; }
.app-sidebar.collapsed .app-sidebar-menu li:nth-child(5) a::before { content: "5"; }
.app-sidebar.collapsed .app-sidebar-menu li:nth-child(6) a::before { content: "6"; }
.app-sidebar.collapsed .app-sidebar-menu li:nth-child(7) a::before { content: "7"; }
.app-sidebar.collapsed .app-sidebar-menu li:nth-child(8) a::before { content: "8"; }

.app-sidebar.collapsed .app-nav-link:nth-child(1)::before { content: "O"; }
.app-sidebar.collapsed .app-nav-link:nth-child(2)::before { content: "L"; }
.app-sidebar.collapsed .app-nav-link:nth-child(3)::before { content: "S"; }
.app-sidebar.collapsed .app-nav-link:nth-child(4)::before { content: "P"; }
.app-sidebar.collapsed .app-nav-link:nth-child(5)::before { content: "N"; }
.app-sidebar.collapsed .app-nav-link:nth-child(6)::before { content: "I"; }
.app-sidebar.collapsed .app-nav-link:nth-child(7)::before { content: "A"; }
.app-sidebar.collapsed .app-nav-link:nth-child(8)::before { content: "F"; }

.season-filter-wrap {
  min-width: 220px;
}

.season-filter-wrap .form-select {
  min-width: 220px;
}

@media (max-width: 991.98px) {
  .app-layout {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transform: translateX(-100%);
    width: 280px;
    height: 100vh;
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .app-sidebar.collapsed {
    width: 280px;
    flex-basis: 280px;
  }

  .app-sidebar.collapsed .app-sidebar-brand > div:last-child,
  .app-sidebar.collapsed .app-sidebar-cta,
  .app-sidebar.collapsed .small.text-secondary,
  .app-sidebar.collapsed .app-sidebar-menu li a,
  .app-sidebar.collapsed .app-nav-link {
    text-indent: 0;
    overflow: visible;
  }

  .app-sidebar.collapsed .app-sidebar-toggle-label,
  .app-sidebar.collapsed .app-theme-toggle-label {
    display: inline;
  }

  .app-sidebar.collapsed .app-sidebar-menu li a::before,
  .app-sidebar.collapsed .app-nav-link::before {
    content: none;
  }

  .app-content {
    width: 100%;
  }

  .mobile-nav-toggle {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 1060;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  display: none;
}

.mobile-nav-overlay {
  display: none;
}

@media (max-width: 991.98px) {
  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
    width: 280px;
    border-right: 0;
    border-left: 1px solid var(--sidebar-border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.18);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 1039;
    background: rgba(15, 23, 42, 0.45);
  }

  .mobile-nav-overlay.active {
    display: block;
  }

  .draft-countdown {
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
  }
}
}