/* Shared design rules. Theme scopes keep the two existing palettes independent. */

/* Teal dashboard, customers, billing, broadcasts and payments. */

:root:where(.theme-teal) {
  --color-bg: #eef4f3;
  --color-surface: #ffffff;
  --color-ink: #0b2b33;
  --color-ink-muted: #5c7b80;
  --color-ink-faint: #93aeb2;

  --color-primary: #0b4f6c;
  --color-primary-deep: #073345;
  --color-primary-light: #146c94;
  --color-accent: #da8a31;
  --color-accent-deep: #b4740e;

  --color-success: #2e7d4f;
  --color-success-bg: #e1f3e7;
  --color-danger: #b23a48;
  --color-danger-bg: #fbe4e6;
  --color-warning: #b4740e;
  --color-warning-bg: #fbf0da;

  --color-border: #dce6e5;
  --color-border-strong: #c3d3d2;

  --sidebar-bg: #082430;
  --sidebar-bg-hover: #123b49;
  --sidebar-active: #146c94;
  --sidebar-text: #9fc1c7;
  --sidebar-text-active: #ffffff;

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(8, 36, 48, 0.06);
  --shadow-md: 0 6px 20px -6px rgba(8, 36, 48, 0.14);

  --font-display: 'Manrope', 'Segoe UI', sans-serif;
  --font-body: 'Public Sans', 'Segoe UI', sans-serif;

  --sidebar-w: 264px;
}

:where(html.theme-teal) * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html:where(.theme-teal) {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

:where(html.theme-teal) body {
  background-color: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

:where(html.theme-teal) h1,
:where(html.theme-teal) h2,
:where(html.theme-teal) h3,
:where(html.theme-teal) .num {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

:where(html.theme-teal) button {
  font-family: inherit;
  cursor: pointer;
}

:where(html.theme-teal) img,
:where(html.theme-teal) svg {
  display: block;
  max-width: 100%;
}

:where(html.theme-teal) .tabular {
  font-variant-numeric: tabular-nums;
}

:where(html.theme-teal) .app-shell {
  display: flex;
  min-height: 100vh;
}

:where(html.theme-teal) .sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  transform: translateX(0);
  transition: transform 0.28s ease;
}

:where(html.theme-teal) .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

:where(html.theme-teal) .brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  background: linear-gradient(160deg, var(--color-primary-light), var(--color-primary-deep));
  display: flex;
  align-items: center;
  justify-content: center;
}

:where(html.theme-teal) .brand-mark svg {
  width: 20px;
  height: 20px;
}

:where(html.theme-teal) .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

:where(html.theme-teal) .brand-text .brand-title {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
}

:where(html.theme-teal) .brand-text .brand-sub {
  font-size: 0.72rem;
  color: var(--sidebar-text);
}

:where(html.theme-teal) .sidebar-menu {
  list-style: none;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
  overflow-y: auto;
}

:where(html.theme-teal) .sidebar-menu-item {
  text-decoration: none;
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 0.89rem;
  font-weight: 500;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

:where(html.theme-teal) .sidebar-menu-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  opacity: 0.85;
}

:where(html.theme-teal) .sidebar-menu-item:hover {
  background-color: var(--sidebar-bg-hover);
  color: #fff;
}

:where(html.theme-teal) .sidebar-menu-item.active {
  background-color: var(--sidebar-active);
  color: var(--sidebar-text-active);
}

:where(html.theme-teal) .sidebar-menu-item.active svg {
  opacity: 1;
}

:where(html.theme-teal) .sidebar-foot {
  padding: 16px 22px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.76rem;
  color: var(--sidebar-text);
}

:where(html.theme-teal) .mobile-topbar {
  display: none;
}

:where(html.theme-teal) .sidebar-overlay {
  display: none;
}

:where(html.theme-teal) .main-content {
  margin-left: var(--sidebar-w);
  flex-grow: 1;
  min-width: 0;
  padding: 34px 40px 56px;
  max-width: 1440px;
}

:where(html.theme-teal) .page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

:where(html.theme-teal) .page-header h1 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--color-primary-deep);
  margin-bottom: 5px;
}

:where(html.theme-teal) .page-header p {
  color: var(--color-ink-muted);
  font-size: 0.92rem;
  max-width: 46ch;
}

:where(html.theme-teal) .header-meta {
  font-size: 0.82rem;
  color: var(--color-ink-muted);
  text-align: right;
  white-space: nowrap;
}

:where(html.theme-teal) .header-meta strong {
  display: block;
  color: var(--color-ink);
  font-weight: 700;
  font-size: 0.88rem;
}

:where(html.theme-teal) .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

:where(html.theme-teal) .stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

:where(html.theme-teal) .stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

:where(html.theme-teal) .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-ink-muted);
}

:where(html.theme-teal) .stat-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

:where(html.theme-teal) .stat-icon svg {
  width: 17px;
  height: 17px;
}

:where(html.theme-teal) .stat-icon.tone-primary {
  background: #dceaf0;
  color: var(--color-primary);
}

:where(html.theme-teal) .stat-icon.tone-accent {
  background: var(--color-warning-bg);
  color: var(--color-accent-deep);
}

:where(html.theme-teal) .stat-icon.tone-aqua {
  background: #d7eef1;
  color: var(--color-primary-light);
}

:where(html.theme-teal) .stat-icon.tone-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

:where(html.theme-teal) .stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--color-ink);
  margin-bottom: 8px;
}

:where(html.theme-teal) .stat-trend {
  font-size: 0.79rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

:where(html.theme-teal) .stat-trend svg {
  width: 13px;
  height: 13px;
}

:where(html.theme-teal) .stat-trend.up {
  color: var(--color-success);
}

:where(html.theme-teal) .stat-trend.down {
  color: var(--color-danger);
}

:where(html.theme-teal) .stat-trend .vs {
  color: var(--color-ink-faint);
  font-weight: 500;
  margin-left: 2px;
}

:where(html.theme-teal) .panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

:where(html.theme-teal) .panel-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border);
}

:where(html.theme-teal) .panel-header h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 3px;
}

:where(html.theme-teal) .panel-header p {
  font-size: 0.83rem;
  color: var(--color-ink-muted);
}

:where(html.theme-teal) .panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

:where(html.theme-teal) .btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  font-weight: 700;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-ink);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

:where(html.theme-teal) .btn svg {
  width: 14px;
  height: 14px;
}

:where(html.theme-teal) .btn:hover {
  background-color: var(--color-bg);
  border-color: var(--color-primary-light);
}

:where(html.theme-teal) .btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

:where(html.theme-teal) .btn-primary:hover {
  background: var(--color-primary-deep);
  border-color: var(--color-primary-deep);
}

:where(html.theme-teal) .table-scroll {
  overflow-x: auto;
}

:where(html.theme-teal) table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  min-width: 720px;
}

:where(html.theme-teal) thead th {
  text-align: left;
  background: #f6faf9;
  color: var(--color-ink-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

:where(html.theme-teal) tbody td {
  padding: 15px 22px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

:where(html.theme-teal) tbody tr:last-child td {
  border-bottom: none;
}

:where(html.theme-teal) tbody tr:hover {
  background-color: #f8fbfa;
}

:where(html.theme-teal) .acc-no {
  font-weight: 700;
  color: var(--color-primary-deep);
  font-variant-numeric: tabular-nums;
}

:where(html.theme-teal) .cust-name {
  font-weight: 600;
}

:where(html.theme-teal) .cust-name .barangay-mobile {
  display: none;
}

:where(html.theme-teal) .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
}

:where(html.theme-teal) .badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

:where(html.theme-teal) .badge-paid {
  background: var(--color-success-bg);
  color: var(--color-success);
}

:where(html.theme-teal) .badge-unpaid {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

:where(html.theme-teal) .badge-overdue {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

:where(html.theme-teal) .action-btns {
  display: flex;
  gap: 8px;
}

:where(html.theme-teal) .btn-view,
:where(html.theme-teal) .btn-edit {
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.79rem;
  font-weight: 700;
  transition: background-color 0.15s ease;
}

:where(html.theme-teal) .btn-view {
  background: #dceaf0;
  color: var(--color-primary);
  border: none;
}

:where(html.theme-teal) .btn-view:hover {
  background: #c9dfe8;
}

:where(html.theme-teal) .btn-edit {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  color: var(--color-ink);
}

:where(html.theme-teal) .btn-edit:hover {
  background: var(--color-bg);
}

:where(html.theme-teal) .panel-footer {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--color-border);
}

:where(html.theme-teal) .footer-info {
  font-size: 0.83rem;
  color: var(--color-ink-muted);
}

:where(html.theme-teal) .pagination {
  display: flex;
  gap: 6px;
}

:where(html.theme-teal) .page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--color-ink);
}

:where(html.theme-teal) .page-btn:hover:not(.active) {
  background-color: var(--color-bg);
}

:where(html.theme-teal) .page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

:where(html.theme-teal) .analytics-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

:where(html.theme-teal) .chart-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 24px 26px 26px;
}

:where(html.theme-teal) .chart-card-header {
  margin-bottom: 24px;
}

:where(html.theme-teal) .chart-card-header h3 {
  font-size: 1.02rem;
  font-weight: 800;
  margin-bottom: 3px;
}

:where(html.theme-teal) .chart-card-header p {
  font-size: 0.83rem;
  color: var(--color-ink-muted);
}

:where(html.theme-teal) .tank-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  height: 210px;
}

:where(html.theme-teal) .tank {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

:where(html.theme-teal) .tank-value {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--color-primary-deep);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

:where(html.theme-teal) .tank-fill {
  width: 100%;
  max-width: 40px;
  border-radius: var(--radius-pill) var(--radius-pill) 4px 4px;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  position: relative;
}

:where(html.theme-teal) .tank-fill::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 6px;
  right: 6px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.45);
}

:where(html.theme-teal) .tank-label {
  margin-top: 10px;
  font-size: 0.76rem;
  color: var(--color-ink-muted);
  font-weight: 600;
  text-align: center;
}

:where(html.theme-teal) .ring-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

:where(html.theme-teal) .ring {
  --ring-size: 168px;
  width: var(--ring-size);
  height: var(--ring-size);
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(
    var(--color-success) 0deg 216deg,
    var(--color-danger) 216deg 306deg,
    var(--color-warning) 306deg 360deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

:where(html.theme-teal) .ring-hole {
  width: 68%;
  height: 68%;
  border-radius: 50%;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 3px rgba(8, 36, 48, 0.08);
}

:where(html.theme-teal) .ring-hole .num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-ink);
  line-height: 1;
}

:where(html.theme-teal) .ring-hole .lbl {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--color-ink-muted);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

:where(html.theme-teal) .ring-legend {
  display: flex;
  flex-direction: column;
  gap: 13px;
  flex-grow: 1;
  min-width: 170px;
}

:where(html.theme-teal) .legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.87rem;
}

:where(html.theme-teal) .legend-key {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

:where(html.theme-teal) .legend-dot {
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

:where(html.theme-teal) .dot-paid {
  background: var(--color-success);
}

:where(html.theme-teal) .dot-unpaid {
  background: var(--color-danger);
}

:where(html.theme-teal) .dot-overdue {
  background: var(--color-warning);
}

:where(html.theme-teal) .legend-count {
  color: var(--color-ink-muted);
  font-weight: 700;
}

@media (max-width: 1180px) {
  :where(html.theme-teal) .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  :where(html.theme-teal) .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  :root:where(.theme-teal) {
    --sidebar-w: 250px;
  }
  :where(html.theme-teal) .sidebar {
    transform: translateX(-100%);
    padding-top: env(safe-area-inset-top, 0px);
    width: min(var(--sidebar-w), 82vw);
  }
  :where(html.theme-teal) .sidebar.is-open {
    transform: translateX(0);
  }
  :where(html.theme-teal) .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(6, 20, 26, 0.45);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  :where(html.theme-teal) .sidebar-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  :where(html.theme-teal) .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--sidebar-bg);
    color: #fff;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 14px;
  }
  :where(html.theme-teal) .mobile-topbar .brand-text .brand-title {
    color: #fff;
  }
  :where(html.theme-teal) .menu-toggle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  :where(html.theme-teal) .menu-toggle svg {
    width: 19px;
    height: 19px;
  }
  :where(html.theme-teal) .main-content {
    margin-left: 0;
    padding: 20px 16px 90px;
  }
  :where(html.theme-teal) .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  :where(html.theme-teal) .header-meta {
    text-align: left;
  }
  :where(html.theme-teal) .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  :where(html.theme-teal) .stat-card {
    padding: 16px;
  }
  :where(html.theme-teal) .stat-value {
    font-size: 1.35rem;
  }
  :where(html.theme-teal) .panel-header {
    padding: 16px 16px;
  }
  :where(html.theme-teal) .panel-actions {
    width: 100%;
  }
  :where(html.theme-teal) .panel-actions .btn {
    flex: 1;
    justify-content: center;
  }
  :where(html.theme-teal) .chart-card {
    padding: 18px 16px 20px;
  }
  :where(html.theme-teal) .table-scroll,
  :where(html.theme-teal) .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  :where(html.theme-teal) table {
    min-width: 640px;
    font-size: 0.8rem;
  }
  :where(html.theme-teal) thead th,
  :where(html.theme-teal) tbody td {
    padding: 12px 14px;
    text-align: left;
  }
  :where(html.theme-teal) .action-btns {
    flex-wrap: nowrap;
  }
  :where(html.theme-teal) .panel-footer {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  :where(html.theme-teal) .pagination {
    justify-content: center;
  }
}

@media (max-width: 400px) {
  :where(html.theme-teal) .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Blue dashboard, reports and settings. */

:root:where(.theme-blue) {
  --bg-page: #f1f5f9;
  --bg-sidebar: #0f172a;
  --sidebar-active: #2563eb;
  --sidebar-hover: #1e293b;
  --text-sidebar-muted: #94a3b8;
  --text-sidebar-active: #ffffff;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --badge-green-bg: #dcfce7;
  --badge-green-text: #15803d;
  --badge-red-bg: #ffe4e6;
  --badge-red-text: #be123c;
  --badge-orange-bg: #fef3c7;
  --badge-orange-text: #b45309;
  --btn-view-bg: #e0f2fe;
  --btn-view-text: #0284c7;
  --btn-view-hover: #bae6fd;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --radius-main: 12px;
  --radius-badge: 9999px;
}

:where(html.theme-blue) * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

:where(html.theme-blue) body {
  background-color: var(--bg-page);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Reusable presentation classes extracted from HTML style attributes. */

:is(#presentation-override, .style-1) {
  flex-grow: 1;
  min-width: 0;
}

:is(#presentation-override, .style-2) {
  display: flex;
  align-items: center;
  gap: 11px;
}

:is(#presentation-override, .style-3) {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-ink-muted);
}

:is(#presentation-override, .style-4) {
  width: 0%;
}

:is(#presentation-override, .style-5) {
  display: flex;
  gap: 10px;
}

:is(#presentation-override, .style-6) {
  min-height: 70px;
}

:is(#presentation-override, .style-7) {
  display: none;
}

:is(#presentation-override, .style-8) {
  min-width: 0;
}

:is(#presentation-override, .style-9) {
  height: 100%;
}

:is(#presentation-override, .style-10) {
  height: 84%;
}

:is(#presentation-override, .style-11) {
  height: 69%;
}

:is(#presentation-override, .style-12) {
  height: 58%;
}

:is(#presentation-override, .style-13) {
  height: 47%;
}

:is(#presentation-override, .style-14) {
  height: 36%;
}

:is(#presentation-override, .style-15) {
  height: 100%;
  background-color: #0284c7;
}

:is(#presentation-override, .style-16) {
  height: 84%;
  background-color: #0ea5e9;
}

:is(#presentation-override, .style-17) {
  height: 68%;
  background-color: #38bdf8;
}

:is(#presentation-override, .style-18) {
  height: 57%;
  background-color: #7dd3fc;
}

:is(#presentation-override, .style-19) {
  height: 46%;
  background-color: #bae6fd;
}

:is(#presentation-override, .style-20) {
  height: 35%;
  background-color: #e0f2fe;
}

:is(#presentation-override, .style-21) {
  width: 66%;
}

:is(#presentation-override, .style-22) {
  width: 60%;
}

:is(#presentation-override, .style-23) {
  width: 64%;
}

:is(#presentation-override, .style-24) {
  width: 58%;
}

:is(#presentation-override, .style-25) {
  width: 42%;
}

:is(#presentation-override, .style-26) {
  height: 66%;
}

:is(#presentation-override, .style-27) {
  height: 34%;
}

:is(#presentation-override, .style-28) {
  height: 60%;
}

:is(#presentation-override, .style-29) {
  height: 40%;
}

:is(#presentation-override, .style-30) {
  height: 64%;
}

:is(#presentation-override, .style-31) {
  height: 36%;
}

:is(#presentation-override, .style-32) {
  height: 58%;
}

:is(#presentation-override, .style-33) {
  height: 42%;
}

/* Additional shared components and responsive rules, scoped to their pages. */

:root:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports']) {
}

:where(html.theme-blue[data-page='reports'], html.theme-blue[data-page='settings']) .icon {
  width: 1.15em;
  height: 1.15em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar-muted);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  transition: transform 0.3s ease;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .sidebar-menu {
  list-style: none;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .sidebar-menu-item {
  text-decoration: none;
  color: var(--text-sidebar-muted);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .sidebar-menu-item:hover {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .sidebar-menu-item.active {
  background-color: var(--sidebar-active);
  color: var(--text-sidebar-active);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .main-container {
  flex-grow: 1;
  padding: 32px 40px;
  overflow-y: auto;
  max-width: 1400px;
}

:where(html.theme-blue[data-page='reports'], html.theme-blue[data-page='settings']) .page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .page-header
  h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .page-header
  p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

:where(html.theme-blue[data-page='reports'], html.theme-blue[data-page='settings'])
  .page-header-actions {
  display: flex;
  gap: 12px;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-main);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .stat-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .icon-blue {
  background-color: #e0f2fe;
  color: #0284c7;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .icon-green {
  background-color: #dcfce7;
  color: #16a34a;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .icon-cyan {
  background-color: #e0f7fa;
  color: #00acc1;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .icon-red {
  background-color: #ffe4e6;
  color: #e11d48;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .stat-trend {
  font-size: 0.825rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .stat-trend.up {
  color: #16a34a;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .stat-trend.down {
  color: #e11d48;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .stat-trend
  span {
  color: var(--text-muted);
  font-weight: 400;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .card-panel {
  background: var(--card-bg);
  border-radius: var(--radius-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
  overflow: hidden;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .panel-header {
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .panel-title
  h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .panel-title
  p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.2s ease;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .btn:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

:where(html.theme-blue[data-page='reports'], html.theme-blue[data-page='settings']) .btn-primary {
  background-color: var(--sidebar-active);
  border-color: var(--sidebar-active);
  color: #ffffff;
}

:where(html.theme-blue[data-page='reports'], html.theme-blue[data-page='settings'])
  .btn-primary:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .table-wrapper {
  overflow-x: auto;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  th {
  background-color: #f8fafc;
  padding: 14px 24px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid var(--border-color);
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports']) td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  tr:last-child
  td {
  border-bottom: none;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-badge);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .badge-paid {
  background-color: var(--badge-green-bg);
  color: var(--badge-green-text);
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .badge-unpaid {
  background-color: var(--badge-red-bg);
  color: var(--badge-red-text);
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .badge-overdue {
  background-color: var(--badge-orange-bg);
  color: var(--badge-orange-text);
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .action-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .btn-view {
  background-color: var(--btn-view-bg);
  color: var(--btn-view-text);
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .btn-view:hover {
  background-color: var(--btn-view-hover);
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .panel-footer {
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

:where(
    html.theme-blue[data-page='legacy-dashboard'],
    html.theme-blue[data-page='reports'],
    html.theme-blue[data-page='settings']
  )
  .footer-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='settings'])
  .pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='settings'])
  .page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='settings'])
  .page-btn:hover:not(.active) {
  background-color: #f8fafc;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='settings'])
  .page-btn.active {
  background-color: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  font-weight: 600;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .chart-card {
  background: var(--card-bg);
  border-radius: var(--radius-main);
  border: 1px solid var(--border-color);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .chart-card-header
  h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .chart-card-header
  p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .bar-chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 220px;
  padding-top: 30px;
  gap: 12px;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .bar-tooltip {
  position: absolute;
  top: -28px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .bar-fill {
  width: 100%;
  max-width: 44px;
  border-radius: 6px 6px 0 0;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .bar-label {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .donut-container {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 24px;
  min-height: 220px;
  flex-wrap: wrap;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .donut-chart-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(#16a34a 0deg 216deg, #dc2626 216deg 306deg, #d97706 306deg 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .donut-center {
  width: 120px;
  height: 120px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .donut-center
  .total-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  margin-bottom: 4px;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .donut-center
  .total-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .donut-legend {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
  min-width: 180px;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .legend-label-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .dot-paid {
  background-color: #16a34a;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .dot-unpaid {
  background-color: #dc2626;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .dot-overdue {
  background-color: #d97706;
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .legend-text {
  font-weight: 500;
  color: var(--text-main);
}

:where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
  .legend-val {
  font-weight: 600;
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  :where(
      html.theme-blue[data-page='legacy-dashboard'],
      html.theme-blue[data-page='reports'],
      html.theme-blue[data-page='settings']
    )
    body {
    flex-direction: column;
  }
}

@media (max-width: 1024px) {
  :where(
      html.theme-blue[data-page='legacy-dashboard'],
      html.theme-blue[data-page='reports'],
      html.theme-blue[data-page='settings']
    )
    .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
}

@media (max-width: 1024px) {
  :where(
      html.theme-blue[data-page='legacy-dashboard'],
      html.theme-blue[data-page='reports'],
      html.theme-blue[data-page='settings']
    )
    .sidebar-menu {
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
  }
}

@media (max-width: 1024px) {
  :where(
      html.theme-blue[data-page='legacy-dashboard'],
      html.theme-blue[data-page='reports'],
      html.theme-blue[data-page='settings']
    )
    .sidebar-menu-item {
    white-space: nowrap;
  }
}

@media (max-width: 1024px) {
  :where(
      html.theme-blue[data-page='legacy-dashboard'],
      html.theme-blue[data-page='reports'],
      html.theme-blue[data-page='settings']
    )
    .main-container {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  :where(
      html.theme-blue[data-page='legacy-dashboard'],
      html.theme-blue[data-page='reports'],
      html.theme-blue[data-page='settings']
    )
    .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
    .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :where(html.theme-blue[data-page='legacy-dashboard'], html.theme-blue[data-page='reports'])
    .donut-container {
    flex-direction: column;
  }
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border);
  background: #fbfdfc;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .search-box {
  position: relative;
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 320px;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .search-box
  svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-ink-faint);
  pointer-events: none;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .search-box
  input {
  width: 100%;
  padding: 9px 14px 9px 37px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--color-ink);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .search-box
  input:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 1px;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .search-box
  input::placeholder {
  color: var(--color-ink-faint);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .filter-chip {
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-ink-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
  white-space: nowrap;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .filter-chip:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .filter-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .filter-count {
  padding: 16px 24px 0;
  font-size: 0.82rem;
  color: var(--color-ink-muted);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .filter-count
  strong {
  color: var(--color-ink);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .badge-neutral {
  background: #eef2f1;
  color: var(--color-ink-muted);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 20, 26, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-md);
  transform: translateY(10px);
  transition: transform 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-overlay.is-open
  .modal {
  transform: translateY(0);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--color-border);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-header
  h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 4px;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-header
  p {
  font-size: 0.83rem;
  color: var(--color-ink-muted);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-close {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink-muted);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-close
  svg {
  width: 14px;
  height: 14px;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-close:hover {
  background: var(--color-bg);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-body {
  padding: 20px 24px;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone {
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone:hover,
:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone.is-dragover {
  border-color: var(--color-primary-light);
  background: #eaf3f5;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #dceaf0;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone-icon
  svg {
  width: 20px;
  height: 20px;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: 4px;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone-sub {
  font-size: 0.8rem;
  color: var(--color-ink-muted);
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone-sub
  .link-text {
  color: var(--color-primary);
  font-weight: 700;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone-file {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 0.83rem;
  text-align: left;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone-file.is-visible {
  display: flex;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone-file
  svg {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
  flex-shrink: 0;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone-file
  .file-name {
  font-weight: 700;
  color: var(--color-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .dropzone-file
  .file-meta {
  color: var(--color-ink-muted);
  font-size: 0.78rem;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .template-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--color-ink-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .template-note
  a {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .template-note
  a:hover {
  text-decoration: underline;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='payment-history']
  )
  .modal-footer
  .btn {
  flex: 0 0 auto;
}

@media (max-width: 860px) {
  :where(
      html[data-page='billing'],
      html[data-page='broadcast'],
      html[data-page='customers'],
      html[data-page='payment-history']
    )
    .filter-bar {
    padding: 14px 16px;
  }
}

@media (max-width: 860px) {
  :where(
      html[data-page='billing'],
      html[data-page='broadcast'],
      html[data-page='customers'],
      html[data-page='payment-history']
    )
    .search-box {
    max-width: none;
    flex-basis: 100%;
  }
}

@media (max-width: 860px) {
  :where(
      html[data-page='billing'],
      html[data-page='broadcast'],
      html[data-page='customers'],
      html[data-page='payment-history']
    )
    .modal-footer
    .btn {
    flex: 1;
    justify-content: center;
  }
}

:where(html[data-page='billing'], html[data-page='broadcast'], html[data-page='payment-history'])
  .field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

:where(html[data-page='billing'], html[data-page='broadcast'], html[data-page='payment-history'])
  .field-group
  label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-ink);
}

:where(html[data-page='billing'], html[data-page='broadcast'], html[data-page='payment-history'])
  .field-hint {
  font-size: 0.76rem;
  color: var(--color-ink-muted);
  font-weight: 500;
}

:where(html[data-page='broadcast'], html[data-page='payment-history']) .field-input,
:where(html[data-page='broadcast'], html[data-page='payment-history']) .field-select,
:where(html[data-page='broadcast'], html[data-page='payment-history']) textarea.field-input {
  font-family: inherit;
  font-size: 0.87rem;
  color: var(--color-ink);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  background: var(--color-surface);
  width: 100%;
}

:where(html[data-page='billing'], html[data-page='broadcast'], html[data-page='payment-history'])
  .field-input:focus-visible,
:where(html[data-page='billing'], html[data-page='broadcast'], html[data-page='payment-history'])
  .field-select:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 1px;
}

:where(html[data-page='billing'], html[data-page='payment-history']) .field-prefix-wrap {
  position: relative;
}

:where(html[data-page='billing'], html[data-page='payment-history']) .field-prefix-wrap .prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-ink-muted);
  font-weight: 700;
  font-size: 0.87rem;
  pointer-events: none;
}

:where(html[data-page='billing'], html[data-page='payment-history'])
  .field-prefix-wrap
  .field-input {
  padding-left: 28px;
}

:where(html[data-page='broadcast'], html[data-page='payment-history']) .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

:where(html[data-page='broadcast'], html[data-page='payment-history']) .form-grid .span-2 {
  grid-column: 1 / -1;
}

@media (max-width: 520px) {
  :where(html[data-page='broadcast'], html[data-page='payment-history']) .form-grid {
    grid-template-columns: 1fr;
  }
}

:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='dashboard'],
    html[data-page='payment-history']
  )
  a:focus-visible,
:where(
    html[data-page='billing'],
    html[data-page='broadcast'],
    html[data-page='customers'],
    html[data-page='dashboard'],
    html[data-page='payment-history']
  )
  button:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  :where(
      html[data-page='billing'],
      html[data-page='broadcast'],
      html[data-page='customers'],
      html[data-page='dashboard'],
      html[data-page='payment-history']
    )
    * {
    transition: none !important;
  }
}
/* Only animate colors during a deliberate theme switch. */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition:
    background-color 0.4s ease,
    color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  html.theme-switching,
  html.theme-switching *,
  html.theme-switching *::before,
  html.theme-switching *::after {
    transition: none !important;
  }
}

/* Consistent scrollbars for the page, tables, menus and dialogs. */
:root {
  --scrollbar-thumb: #93afbf;
  --scrollbar-hover: #537d96;
}
:root[data-theme='dark'] {
  --scrollbar-thumb: #426074;
  --scrollbar-hover: #6e9ab5;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border: 2px solid var(--color-surface, #fff);
  border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-hover);
}
::-webkit-scrollbar-corner {
  background: transparent;
}
@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
  }
}
.sidebar-menu-item { position: relative; }
.feedback-unread-dot {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: #ef4444;
  box-shadow: 0 0 0 2px var(--sidebar-bg, #123447);
}
.feedback-unread-dot[hidden] { display: none; }
