/*
 * dashboard.css
 * Pixora SA — Internal Business Dashboard
 * Standalone page, not part of the main website nav.
 */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Themed scrollbars ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(10, 20, 36, 0.6); }
::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, 0.28); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(56, 189, 248, 0.5); }
* { scrollbar-width: thin; scrollbar-color: rgba(56, 189, 248, 0.28) rgba(10, 20, 36, 0.6); }

:root {
  --accent:       #0f172a;
  --accent-2:     #14b8a6;
  --accent-pale:  #7dd3fc;
  --bg:           #111d31;
  --bg-card:      rgba(28, 46, 72, 0.84);
  --bg-card-2:    rgba(24, 40, 63, 0.9);
  --border:       rgba(56, 189, 248, 0.24);
  --border-light: rgba(56, 189, 248, 0.14);
  --muted:        rgba(223, 234, 250, 0.62);
  --muted-2:      rgba(223, 234, 250, 0.42);
  --text:         #eaf2ff;
  --sidebar-w:    260px;
  --sidebar-w-sm: 72px;
  --topbar-h:     64px;
  --trans:        0.3s cubic-bezier(0.22, 1, 0.36, 1);
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 16px 48px rgba(8, 6, 4, 0.46);
  --font-body:    'Manrope', system-ui, sans-serif;
  --font-head:    'Fraunces', Georgia, serif;
  --z-overlay:    1000;
  --z-sidebar:    1100;
  --z-topbar:     900;

  /* Status colours */
  --status-active:    #f2f2f2;
  --status-review:    #c9c9c9;
  --status-complete:  #ababab;
  --status-onhold:    #8f8f8f;
  --status-cancelled: #757575;
}

html {
  background: #111d31;
  scroll-behavior: smooth;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: #111d31;
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; }
img { max-width: 100%; display: block; }

/* ── Fixed background layers ── */
#hero-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 35%, black 30%, transparent 100%);
}

#spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 50%),
    rgba(20, 184, 166, 0.2) 0%,
    rgba(59, 130, 246, 0.1) 35%,
    transparent 65%
  );
}

/* ── App shell ── */
.dash-shell {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: rgba(17, 30, 48, 0.94);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: transform var(--trans), width var(--trans), background var(--trans);
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-w-sm);
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-nav-label,
.sidebar.collapsed .link-text,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-brand-sub {
  display: none !important;
}

.sidebar.collapsed .sidebar-brand {
  padding: 20px 0;
  justify-content: center;
}

.sidebar.collapsed .sidebar-link {
  padding: 12px;
  justify-content: center;
  margin: 0 10px;
}

.sidebar.collapsed .sidebar-user {
  padding: 8px;
  justify-content: center;
}

.sidebar.collapsed .sidebar-avatar {
  margin: 0;
}

.sidebar.collapsed .sidebar-footer {
  padding: 16px 8px;
}

.sidebar.collapsed .link-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  margin: 0;
  font-size: 0.6rem;
  padding: 1px 4px;
  min-width: 16px;
  text-align: center;
}

.sidebar.collapsed .sidebar-link {
  position: relative;
}

.sidebar.collapsed .sidebar-nav {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-brand-toggle {
  margin-left: auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.sidebar-brand-toggle svg {
  width: 16px;
  height: 16px;
}

.sidebar-brand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  flex-shrink: 0;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-brand-name {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-brand-sub {
  font-size: 0.68rem;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted-2);
  padding: 12px 22px 4px;
  white-space: nowrap;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  margin: 0 8px;
  color: rgba(245, 245, 245, 0.6);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.2s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.sidebar-link:hover svg { opacity: 1; }

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(220, 220, 220, 0.08));
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-link.active svg { opacity: 1; }

.sidebar-link .link-badge {
  margin-left: auto;
  background: rgba(255, 255, 255,0.25);
  color: var(--accent-pale);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.sidebar-link--branded {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 12px;
}

.sidebar-link--branded:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  cursor: default;
}

.sidebar-user:hover { background: rgba(255, 255, 255, 0.08); }

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--muted-2);
  white-space: nowrap;
}

.sidebar-user-logout {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.sidebar-user-logout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-color: var(--border);
  transform: translateY(-1px);
}

.sidebar-user-logout svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
}

.sidebar.collapsed .sidebar-user-logout {
  display: none;
}

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.dash-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--trans);
}

.dash-shell.sb-mini .dash-main {
  margin-left: var(--sidebar-w-sm);
}


/* Top bar */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: var(--topbar-h);
  background: rgba(18, 34, 54, 0.78);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
}

.topbar-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-time {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-pale);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.topbar-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--text);
}

.topbar-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.theme-toggle-btn {
  min-width: 98px;
  justify-content: center;
}

.login-theme-toggle {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.login-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.theme-toggle-icon {
  width: 22px;
  height: 22px;
  display: block;
  position: relative;
}

.theme-toggle-icon::before,
.theme-toggle-icon::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  transition: all 0.35s cubic-bezier(0.77, 0, 0.18, 1);
}

.theme-toggle-icon::before {
  inset: 1px;
  background: linear-gradient(135deg, #7dd3fc 0%, #14b8a6 100%);
  box-shadow: 0 0 16px rgba(20, 184, 166, 0.35);
}

.theme-toggle-icon::after {
  width: 12px;
  height: 12px;
  top: 2px;
  right: 1px;
  background: var(--bg-card-2);
}

html:not(.dark-mode) .theme-toggle-icon::after {
  width: 6px;
  height: 6px;
  top: 3px;
  right: 3px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.topbar-btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

.topbar-btn--primary:hover {
  opacity: 0.88;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  color: var(--text);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: calc(var(--z-topbar) + 1);
  transition: background 0.2s, border-color 0.2s;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.menu-toggle svg { width: 20px; height: 20px; }

.menu-toggle--mobile {
  display: none;
}

/* Page content */
.dash-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex: 1;
}

/* Section header */
.section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-hd h2 {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-hd .eyebrow {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-all {
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.2s;
}

.view-all:hover { color: var(--accent-pale); }

/* ══════════════════════════════════════
   KPI CARDS
══════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.kpi-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 16px 48px rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.kpi-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kpi-label-row,
.watch-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.kpi-help {
  position: relative;
  z-index: 20;
}

.kpi-help summary {
  list-style: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #eaf2ff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.kpi-help summary::-webkit-details-marker {
  display: none;
}

.kpi-help-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(300px, 72vw);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.4);
  background: rgba(10, 22, 38, 0.96);
  color: rgba(234, 242, 255, 0.92);
  font-size: 0.74rem;
  line-height: 1.45;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.kpi-help[open] summary {
  border-color: rgba(125, 211, 252, 0.75);
  color: #7dd3fc;
}

.kpi-help[open] {
  z-index: 30;
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
}

.kpi-icon--purple {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

.kpi-icon--cyan {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
}

.kpi-icon--green {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.kpi-icon--amber {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.kpi-icon--red {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.kpi-val {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.kpi-badge--up {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.kpi-badge--down {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

/* ══════════════════════════════════════
   CHART CARD
══════════════════════════════════════ */
.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 32px rgba(8, 6, 4, 0.28);
  overflow: hidden;
}

.card__body { padding: 24px; }

.chart-wrap {
  position: relative;
  height: 240px;
}

/* Donut chart card */
.donut-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  margin-bottom: 20px;
}

.donut-center {
  position: absolute;
  text-align: center;
}

.donut-center-val {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.donut-center-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.donut-legend { display: flex; flex-direction: column; gap: 8px; }

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: rgba(245, 245, 245, 0.7);
}

.donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-item span:last-child {
  margin-left: auto;
  font-weight: 600;
  color: var(--text);
}

/* ══════════════════════════════════════
   PROJECTS TABLE
══════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead tr {
  border-bottom: 1px solid var(--border-light);
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.2s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

tbody td {
  padding: 12px 14px;
  color: rgba(245, 245, 245, 0.8);
  vertical-align: middle;
}

.proj-name { font-weight: 600; color: var(--text); }
.proj-client { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* Status badge */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status--active    { background: rgba(220, 220, 220, 0.12);  color: var(--status-active); }
.status--review    { background: rgba(201, 201, 201, 0.12); color: var(--status-review); }
.status--complete  { background: rgba(171, 171, 171, 0.12); color: var(--status-complete); }
.status--onhold    { background: rgba(143, 143, 143, 0.12); color: var(--status-onhold); }
.status--cancelled { background: rgba(117, 117, 117, 0.12); color: var(--status-cancelled); }

/* Progress bar */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-val {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.deadline {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.deadline--overdue { color: #cfcfcf; }
.deadline--soon    { color: #e3e3e3; }

/* ══════════════════════════════════════
   BOTTOM GRID (clients + activity)
══════════════════════════════════════ */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Client roster */
.client-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  cursor: default;
}

.client-row:hover { background: rgba(255, 255, 255, 0.06); }

.client-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.client-info { flex: 1; min-width: 0; }

.client-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-url {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-plan {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.plan--starter  { background: rgba(255, 255, 255,0.12);  color: var(--accent-pale); }
.plan--pro      { background: rgba(220, 220, 220,0.12);  color: #e0e0e0; }
.plan--business { background: rgba(255,255,255,0.12);  color: #f2f2f2; }
.plan--retainer { background: rgba(190,190,190,0.14);  color: #d8d8d8; }
.plan--active   { background: rgba(255,255,255,0.12);  color: #f2f2f2; }
.plan--inactive { background: rgba(160,160,160,0.12); color: #c8c8c8; }

/* Activity feed */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  position: relative;
}

.activity-item::before {
  content: '';
  position: absolute;
  left: 33px;
  top: 44px;
  bottom: -12px;
  width: 1px;
  background: var(--border-light);
}

.activity-item:last-child::before { display: none; }

.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.activity-icon svg {
  width: 14px;
  height: 14px;
}

.ai--launch   { background: rgba(255, 255, 255, 0.12); color: #f2f2f2; }
.ai--invoice  { background: rgba(220, 220, 220, 0.12); color: #e0e0e0; }
.ai--quote    { background: rgba(255, 255, 255, 0.15); color: var(--accent-pale); }
.ai--client   { background: rgba(190, 190, 190, 0.14); color: #d8d8d8; }
.ai--update   { background: rgba(200,200,200, 0.12);  color: #e5e5e5; }

.activity-body { flex: 1; }

.activity-text {
  font-size: 0.83rem;
  color: rgba(245, 245, 245, 0.8);
  line-height: 1.5;
}

.activity-text strong { color: var(--text); font-weight: 600; }

.activity-time {
  font-size: 0.7rem;
  color: var(--muted-2);
  margin-top: 2px;
}

/* ══════════════════════════════════════
   QUICK ACTIONS
══════════════════════════════════════ */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: rgba(245, 245, 245, 0.75);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  backdrop-filter: blur(12px);
}

.action-btn svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text);
  transform: translateY(-1px);
}

.action-btn:hover svg { opacity: 1; }

.action-btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

.action-btn--primary:hover {
  opacity: 0.9;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transform: translateY(-1px);
}

/* ══════════════════════════════════════
   SCROLL REVEAL
══════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1),
              transform 0.7s cubic-bezier(0.22,1,0.36,1);
}

.reveal.visible { opacity: 1; transform: none; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 0px;
    --sidebar-mobile-w: min(88vw, 340px);
  }

  .sidebar {
    left: calc(-1 * var(--sidebar-mobile-w));
    transform: none !important;
    width: var(--sidebar-mobile-w);
    max-width: 340px;
    min-width: 280px;
    min-height: 100dvh;
    background: #0b1320;
    filter: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: left var(--trans), width var(--trans), background var(--trans);
    box-shadow: 20px 0 60px rgba(0,0,0,0.8);
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
  }

  .sidebar,
  .sidebar * {
    filter: none !important;
    text-shadow: none;
  }

  .sidebar.is-open {
    left: 0;
  }

  .sidebar-brand {
    padding: 18px;
  }

  .sidebar-brand-name {
    font-size: 1.12rem;
    color: rgba(234, 242, 255, 0.98);
  }

  .sidebar-brand-sub,
  .sidebar-nav-label {
    color: rgba(223, 234, 250, 0.72);
  }

  .sidebar-link {
    min-height: 50px;
    padding: 13px 18px;
    font-size: 1rem;
    color: rgba(234, 242, 255, 0.94);
  }

  .sidebar-link svg {
    opacity: 0.95;
  }

  .sidebar-link.active {
    border-color: rgba(125, 211, 252, 0.4);
    background: rgba(255, 255, 255, 0.1);
  }

  .dash-main { margin-left: 0; }
  .menu-toggle--mobile { display: inline-flex; }
  .dash-content { padding: 24px 20px; }
  .dash-topbar { padding: 10px 14px; min-height: 72px; height: auto; }

  #export-pdf-btn,
  #export-csv-btn {
    display: none;
  }

  .topbar-title { max-width: 260px; font-size: 1rem; }
  .topbar-right {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
  }

  .bottom-grid { grid-template-columns: 1fr; }

  .sidebar-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(5, 10, 18, 0.78);
  }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar-time { display: none; }
  .dash-topbar {
    align-items: center;
  }
  .topbar-right {
    flex-shrink: 0;
    gap: 8px;
  }
  .refresh-label { display: none; }
  .theme-toggle-btn {
    font-size: 0;
    min-width: unset;
    padding: 8px;
  }
  .topbar-btn {
    padding: 7px 11px;
    font-size: 0.76rem;
  }
  .kpi-val { font-size: 1.4rem; }
  .kpi-card { padding: 16px 14px; }
  .section-hd h2 { font-size: 0.95rem; }
  .dash-content { gap: 24px; }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(5, 10, 18, 0.78);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sidebar-overlay.visible { display: block; }

/* ══════════════════════════════════════
   LOGIN OVERLAY
══════════════════════════════════════ */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(24px);
  padding: 24px;
}

.login-card {
  background: rgba(24, 24, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-in {
  from { opacity: 0; transform: scale(0.95) translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.login-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 28px;
  transition: color 0.2s;
}

.login-back-link:hover {
  color: var(--accent-pale);
}

.login-back-link svg {
  width: 14px;
  height: 14px;
}

.login-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.login-brand-name {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-lock {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent-pale);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.login-lock svg { width: 26px; height: 26px; }

.login-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.login-sub {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 28px;
}

/* Login form inputs */
.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.form-group input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  caret-color: var(--accent-pale);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input::placeholder {
  color: rgba(245, 245, 245, 0.45);
}

.form-group input:focus {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.login-error {
  font-size: 0.78rem;
  color: #e3e3e3;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0;
  display: block;
  line-height: 1.5;
  text-align: left;
}

.login-error:empty { display: none; }

.invite-email-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-pale);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
  display: block;
  text-align: left;
}

.invite-email-label:empty { display: none; }


.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.3);
  margin-bottom: 20px;
}

.login-btn svg { width: 18px; height: 18px; }

.login-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.login-btn:active { opacity: 1; transform: none; }

.login-footer {
  font-size: 0.72rem;
  color: var(--muted-2);
}

.login-note {
  font-size: 0.75rem;
  color: #dcdcdc;
  background: rgba(180, 180, 180, 0.1);
  border: 1px solid rgba(180, 180, 180, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
  display: block;
  max-width: 320px;
  text-align: left;
}

.login-note:empty { display: none; }

@media (max-width: 480px) {
  .login-card { padding: 36px 24px; }
  .login-title { font-size: 1.3rem; }
}

html:not(.dark-mode) {
  --accent: #0f172a;
  --accent-2: #0891b2;
  --accent-pale: #0369a1;
  --bg: #e3edf4;
  --bg-card: rgba(232, 239, 245, 0.94);
  --bg-card-2: rgba(220, 230, 238, 0.97);
  --border: rgba(14, 116, 144, 0.18);
  --border-light: rgba(14, 116, 144, 0.1);
  --muted: rgba(15, 23, 42, 0.66);
  --muted-2: rgba(15, 23, 42, 0.46);
  --text: #10233a;
  color-scheme: light;
}

html:not(.dark-mode),
html:not(.dark-mode) body {
  background: #e3edf4;
}

html:not(.dark-mode) #grid-overlay {
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.06) 1px, transparent 1px);
}

html:not(.dark-mode) #spotlight {
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 50%),
    rgba(20, 184, 166, 0.08) 0%,
    rgba(59, 130, 246, 0.05) 35%,
    transparent 65%
  );
}

html:not(.dark-mode) .sidebar {
  background: rgba(240, 247, 252, 0.95);
  box-shadow: 6px 0 28px rgba(15, 23, 42, 0.06);
}

html:not(.dark-mode) .sidebar-link,
html:not(.dark-mode) .sidebar-user-logout,
html:not(.dark-mode) .sidebar-user-role,
html:not(.dark-mode) .topbar-time,
html:not(.dark-mode) .kpi-label,
html:not(.dark-mode) .kpi-meta,
html:not(.dark-mode) .activity-time,
html:not(.dark-mode) .activity-text,
html:not(.dark-mode) .chart-disclaimer,
html:not(.dark-mode) .login-sub,
html:not(.dark-mode) .login-back-link,
html:not(.dark-mode) .form-group label,
html:not(.dark-mode) .login-footer {
  color: var(--muted);
}

html:not(.dark-mode) .sidebar-link:hover,
html:not(.dark-mode) .sidebar-user:hover,
html:not(.dark-mode) .topbar-btn:hover,
html:not(.dark-mode) .menu-toggle:hover,
html:not(.dark-mode) .action-btn:hover {
  background: rgba(56, 189, 248, 0.1);
}

html:not(.dark-mode) .sidebar-link.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(20, 184, 166, 0.08));
  border-color: rgba(56, 189, 248, 0.2);
}

html:not(.dark-mode) .sidebar-link .link-badge {
  background: rgba(56, 189, 248, 0.12);
  color: #0369a1;
}

html:not(.dark-mode) .dash-topbar {
  background: rgba(227, 237, 244, 0.86);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

html:not(.dark-mode) .topbar-btn,
html:not(.dark-mode) .action-btn,
html:not(.dark-mode) .menu-toggle,
html:not(.dark-mode) .drawer-close,
html:not(.dark-mode) .login-theme-toggle {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.2);
  color: #0f172a;
}

html:not(.dark-mode) .kpi-card,
html:not(.dark-mode) .agency-chart-card,
html:not(.dark-mode) .drawer-content,
html:not(.dark-mode) .login-card,
html:not(.dark-mode) .activity-item,
html:not(.dark-mode) .chart-card,
html:not(.dark-mode) .table-card,
html:not(.dark-mode) .ssl-card,
html:not(.dark-mode) .client-card,
html:not(.dark-mode) .total-card {
  background: var(--bg-card);
  border-color: rgba(14, 116, 144, 0.14);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

html:not(.dark-mode) .kpi-card::before {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, transparent 60%);
}

html:not(.dark-mode) .kpi-card:hover {
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

html:not(.dark-mode) .kpi-icon--purple {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

html:not(.dark-mode) .kpi-icon--cyan {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
}

html:not(.dark-mode) .kpi-icon--green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

html:not(.dark-mode) .kpi-icon--amber {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

html:not(.dark-mode) .kpi-icon--red {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

html:not(.dark-mode) .login-lock,
html:not(.dark-mode) .ai--launch,
html:not(.dark-mode) .ai--invoice,
html:not(.dark-mode) .ai--quote,
html:not(.dark-mode) .ai--client,
html:not(.dark-mode) .ai--update {
  background: rgba(56, 189, 248, 0.1);
  color: #0369a1;
}

html:not(.dark-mode) .login-overlay {
  background: rgba(218, 229, 238, 0.9);
}

html:not(.dark-mode) .login-card {
  border-color: rgba(56, 189, 248, 0.16);
}

html:not(.dark-mode) .form-group input {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(56, 189, 248, 0.18);
  color: var(--text);
  box-shadow: none;
}

html:not(.dark-mode) .form-group input::placeholder {
  color: rgba(15, 23, 42, 0.38);
}

html:not(.dark-mode) .form-group input:focus {
  border-color: rgba(8, 145, 178, 0.45);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

html:not(.dark-mode) .login-error,
html:not(.dark-mode) .invite-email-label,
html:not(.dark-mode) .login-note,
html:not(.dark-mode) .error-banner {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.18);
  color: #0f172a;
}

html:not(.dark-mode) .client-card__metrics,
html:not(.dark-mode) .telemetry-backoff-badge,
html:not(.dark-mode) .client-finance-info,
html:not(.dark-mode) .drawer-header,
html:not(.dark-mode) .drawer-section,
html:not(.dark-mode) .drawer-list-item,
html:not(.dark-mode) footer[style] {
  border-color: var(--border-light);
}

html:not(.dark-mode) .client-card__metrics,
html:not(.dark-mode) .telemetry-backoff-badge,
html:not(.dark-mode) .drawer-list-item,
html:not(.dark-mode) .chart-header {
  background: rgba(221, 231, 238, 0.9);
}

html:not(.dark-mode) .client-card__metrics {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

html:not(.dark-mode) .client-card:hover,
html:not(.dark-mode) .kpi-card:hover,
html:not(.dark-mode) .ssl-card:hover,
html:not(.dark-mode) .chart-card:hover,
html:not(.dark-mode) .table-card:hover {
  background: rgba(227, 236, 243, 0.96);
}

html:not(.dark-mode) .switch .slider {
  background-color: rgba(56, 189, 248, 0.22);
}

/* ── Light-mode: eyebrow text (hardcoded white otherwise) ── */
html:not(.dark-mode) .section-hd .eyebrow {
  color: var(--accent-2);
}

/* ── Light-mode: info (i) button on KPI cards ── */
html:not(.dark-mode) .kpi-help summary {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  color: #0f172a;
}

html:not(.dark-mode) .kpi-help[open] summary {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

/* ── Light-mode: KPI info popover (dark bg otherwise) ── */
html:not(.dark-mode) .kpi-help-pop {
  background: rgba(240, 247, 252, 0.98);
  color: #10233a;
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

/* ── Light-mode: KPI card hover glow (white shadow otherwise) ── */
html:not(.dark-mode) .kpi-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 16px 48px rgba(56, 189, 248, 0.12);
}

/* ── Light-mode: .card base (used by health-watch-card, chart-card etc.) ── */
html:not(.dark-mode) .card {
  background: var(--bg-card);
  border-color: rgba(56, 189, 248, 0.14);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

/* ── Light-mode: dark-toggle button (white glass otherwise) ── */
html:not(.dark-mode) .dark-toggle {
  background: rgba(15, 23, 42, 0.06) !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
  color: #0f172a !important;
}

html:not(.dark-mode) .dark-toggle:hover {
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
}

/* ── Light-mode: sidebar overlay tint ── */
html:not(.dark-mode) .sidebar-overlay {
  background: rgba(15, 23, 42, 0.4);
}

/* ── Light-mode: mobile sidebar (hardcoded #0b1320 in media query) ── */
@media (max-width: 900px) {
  html:not(.dark-mode) .sidebar {
    background: rgba(240, 247, 252, 0.98) !important;
    box-shadow: 20px 0 60px rgba(15, 23, 42, 0.1) !important;
  }

  html:not(.dark-mode) .sidebar-brand {
    border-bottom-color: rgba(56, 189, 248, 0.15);
  }

  html:not(.dark-mode) .sidebar-brand-name {
    color: #10233a;
  }

  html:not(.dark-mode) .sidebar-brand-sub,
  html:not(.dark-mode) .sidebar-nav-label {
    color: rgba(15, 23, 42, 0.5);
  }

  html:not(.dark-mode) .sidebar-link {
    color: rgba(19, 34, 58, 0.82);
  }

  html:not(.dark-mode) .sidebar-link.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.28);
    color: #0f172a;
  }

  html:not(.dark-mode) .sidebar-link:hover {
    background: rgba(56, 189, 248, 0.08);
    color: #0f172a;
  }
}

/* ── Light-mode: SSL/renewal watch list items ── */
html:not(.dark-mode) .ssl-item {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(56, 189, 248, 0.08);
}

html:not(.dark-mode) .ssl-item:hover {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.2);
}

html:not(.dark-mode) .ssl-name {
  color: var(--text);
}

/* ── Light-mode: financial summary pill ── */
html:not(.dark-mode) .financial-summary {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(56, 189, 248, 0.2);
}

html:not(.dark-mode) .bank-total strong {
  color: var(--text);
}

/* ── Light-mode: renewal tag – SSL (red is fine, just ensure contrast) ── */
html:not(.dark-mode) .renewal-tag--ssl {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.25);
  color: #b91c1c;
}

html:not(.dark-mode) .renewal-status--alert {
  color: #b45309;
}

/* ── Light-mode: topbar title + greeting ── */
html:not(.dark-mode) .topbar-title,
html:not(.dark-mode) #topbar-greeting {
  color: var(--text);
}

/* ── Light-mode: search box input ── */
html:not(.dark-mode) .search-box input {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(56, 189, 248, 0.2);
  color: var(--text);
}

html:not(.dark-mode) .search-box input:focus {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(8, 145, 178, 0.45);
}

html:not(.dark-mode) .search-box input::placeholder {
  color: var(--muted-2);
}

/* ── Light-mode: refresh/toggle control ── */
html:not(.dark-mode) .refresh-control {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(56, 189, 248, 0.18);
}

/* ── Light-mode: activity items (white ghost bg otherwise) ── */
html:not(.dark-mode) .activity-item {
  background: transparent;
  border-color: rgba(56, 189, 248, 0.1);
}

/* ── Light-mode: inquiries table ── */
html:not(.dark-mode) .proj-name,
html:not(.dark-mode) .proj-client {
  color: var(--text);
}

html:not(.dark-mode) .deadline {
  color: var(--muted);
}

/* ── Light-mode: footer text ── */
html:not(.dark-mode) footer span {
  color: var(--muted-2);
}

/* ══════════════════════════════════════
   EXPANDED ZONES & BENTO STYLES
══════════════════════════════════════ */

.financial-summary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 4px 14px;
}

.bank-total {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bank-total strong {
  color: #f0f0f0;
  margin-left: 4px;
  font-family: var(--font-body);
}

/* Legend items for Chart */
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot--purple { background: var(--accent); }
.dot--red    { background: #c8c8c8; }

/* Infrastructure Health Grid */
.health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.health-grid > .kpi-card,
.health-grid > .health-watch-card {
  position: relative;
  z-index: 1;
}

.health-grid > .kpi-card:focus-within,
.health-grid > .health-watch-card:focus-within,
.health-grid > .kpi-card:hover,
.health-grid > .health-watch-card:hover {
  z-index: 12;
}

@media (max-width: 1200px) {
  .health-grid { grid-template-columns: 1fr 1fr; }
  .health-watch-card { grid-column: span 2; }
}

@media (max-width: 600px) {
  .health-grid { grid-template-columns: 1fr; }
  .health-watch-card { grid-column: span 1; }
}

.health-watch-card {
  grid-column: 1 / -1;
  border-color: rgba(220, 220, 220, 0.2);
  overflow: visible;
}

.health-grid .kpi-card {
  overflow: visible;
}

.watch-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.watch-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
}

.watch-status {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* SSL List Items */
.ssl-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ssl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.2s;
}

.ssl-item:hover {
  background: rgba(220, 220, 220, 0.05);
  border-color: rgba(220, 220, 220, 0.1);
}

.ssl-info { flex: 1; min-width: 0; }
.ssl-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ssl-days {
  font-size: 0.68rem;
  color: var(--muted-2);
}

.ssl-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Indicator colors */
.bg--ready   { background: #f0f0f0; box-shadow: 0 0 12px rgba(255, 255, 255, 0.35); }
.bg--warning { background: #d0d0d0; box-shadow: 0 0 12px rgba(208, 208, 208, 0.35); }
.bg--danger  { background: #b8b8b8; box-shadow: 0 0 12px rgba(184, 184, 184, 0.35); }

.ssl-item-placeholder {
  text-align: center;
  padding: 12px;
  font-size: 0.75rem;
  color: var(--muted-2);
}

/* All-clear empty state for watch cards */
.watch-all-good {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.07);
  border: 1px solid rgba(34, 197, 94, 0.18);
  color: #4ade80;
  font-size: 0.8rem;
  font-weight: 500;
}

.watch-all-good svg {
  flex-shrink: 0;
  color: #4ade80;
  opacity: 0.9;
}

html:not(.dark-mode) .watch-all-good {
  background: rgba(22, 163, 74, 0.07);
  border-color: rgba(22, 163, 74, 0.2);
  color: #15803d;
}

html:not(.dark-mode) .watch-all-good svg {
  color: #16a34a;
}

/* Renewal alert neutral dot */
.bg--neutral { background: #6b7280; box-shadow: 0 0 8px rgba(107, 114, 128, 0.3); }

/* Renewal tag pills */
.renewal-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.renewal-tag--domain {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.renewal-tag--ssl {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

/* Renewal card badge */
.renewal-status--alert {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f59e0b;
}

/* ══════════════════════════════════════
   UX POWER-UPS (Search, Toggle, Refresh)
══════════════════════════════════════ */

.refresh-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.refresh-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* Switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(14px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* Roster Actions & Search */
.roster-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .roster-actions { gap: 10px; width: 100%; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; font-size: 16px; } /* Prevent iOS zoom */
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 12px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}

.search-box input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 14px 6px 34px;
  color: var(--text);
  font-size: 0.8rem;
  width: 200px;
  transition: width 0.3s, border-color 0.3s, background 0.3s;
  outline: none;
}

.search-box input:focus {
  width: 280px;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

.search-box input::placeholder { color: var(--muted-2); }

/* ══════════════════════════════════════
   CLIENT CARD GRID
══════════════════════════════════════ */

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
}

.client-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.client-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 255, 255, 0.1);
}

.card-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}

.client-card:hover .card-glow {
  opacity: 1;
}

.client-card__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.client-meta {
  flex: 1;
  min-width: 0;
}

.client-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-url {
  font-size: 0.75rem;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.client-card__status {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.client-card__metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px 0;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.client-m-item {
  text-align: center;
}

.client-m-item:nth-child(1) {
  grid-column: 1 / 3;
  grid-row: 1;
}

.client-m-item:nth-child(2) {
  grid-column: 3 / 5;
  grid-row: 1;
}

.client-m-item:nth-child(3) {
  grid-column: 5 / 7;
  grid-row: 1;
}

.client-m-item:nth-child(4) {
  grid-column: 1 / 4;
  grid-row: 2;
}

.client-m-item:nth-child(5) {
  grid-column: 4 / 7;
  grid-row: 2;
}

.telemetry-backoff-badge {
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px dashed rgba(251, 191, 36, 0.45);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.08);
  color: #fcd34d;
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  text-align: center;
}

/* Mobile Responsiveness for cards under 480px */
@media (max-width: 479px) {
  .client-card__metrics {
    grid-template-columns: repeat(2, 1fr);
    padding: 8px;
    gap: 8px 0;
  }

  .client-m-item:nth-child(1),
  .client-m-item:nth-child(2),
  .client-m-item:nth-child(3),
  .client-m-item:nth-child(4),
  .client-m-item:nth-child(5) {
    grid-column: auto;
    grid-row: auto;
  }

  .client-m-val {
    font-size: 1rem;
  }

  .client-m-lbl {
    font-size: 0.55rem;
  }

  .client-finance-info {
    font-size: 0.65rem !important;
    margin-top: 6px !important;
    padding-top: 6px !important;
    flex-direction: column;
    gap: 4px;
  }

  .client-finance-info .invoice-date,
  .client-finance-info .next-action {
    width: 100%;
  }

  .telemetry-backoff-badge {
    font-size: 0.62rem;
    padding: 5px 7px;
  }
}

.client-m-val {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
}

.client-m-lbl {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  margin-top: 4px;
}

.client-finance-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.7rem;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.invoice-date {
  flex: 1;
  color: var(--muted-2);
  word-break: break-word;
}

.next-action {
  flex: 1;
  text-align: right;
  font-weight: 600;
  color: var(--muted-2);
  word-break: break-word;
}

@media (max-width: 600px) {
  .client-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════
   CLIENT DETAIL DRAWER
══════════════════════════════════════ */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  visibility: hidden;
  transition: visibility var(--trans);
}

.drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.drawer.is-open .drawer-overlay {
  opacity: 1;
}

.drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 500px;
  background: rgba(24, 24, 24, 0.95);
  backdrop-filter: blur(32px);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 50px rgba(0,0,0,0.5);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1);
  display: flex;
  flex-direction: column;
}

.drawer.is-open .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-client-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.drawer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  background: var(--accent);
  color: #fff;
}

.drawer-close {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.drawer-close:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Totals */
.drawer-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.total-card {
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.total-lbl {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.total-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.val--success { color: #f0f0f0; }
.val--danger { color: #c8c8c8; }

.drawer-section {
  margin-bottom: 32px;
}

.drawer-section h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--accent-pale);
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-item {
  padding: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s;
}

.drawer-item:hover {
  border-color: var(--border);
}

.item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-title {
  font-size: 0.88rem;
  font-weight: 600;
}

.item-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.item-price {
  text-align: right;
}

.item-amount {
  font-weight: 600;
  display: block;
}

.item-status {
  font-size: 0.65rem;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
}

.status--paid { color: #f0f0f0; background: rgba(255, 255, 255, 0.1); }
.status--overdue { color: #c8c8c8; background: rgba(180, 180, 180, 0.12); }
.status--sent { color: #e0e0e0; background: rgba(210, 210, 210, 0.1); }

/* Loader & Error */
.drawer-loader, .drawer-error {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .drawer-content {
    max-width: 100%;
  }
  .drawer-totals {
    grid-template-columns: 1fr;
  }
}

/* Agency Specific Cards in Drawer */
.agency-charts-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.agency-chart-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-label {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.chart-period {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-canvas-wrap {
  height: 240px;
  position: relative;
}

.chart-disclaimer {
  font-size: 0.68rem;
  color: var(--muted-2);
  margin-top: 12px;
  font-style: italic;
}

.donut-flex {
  display: flex;
  align-items: center;
  gap: 24px;
}

.donut-canvas-wrap {
  width: 140px;
  height: 140px;
  position: relative;
  flex-shrink: 0;
}

.donut-center-agency {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-total {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.donut-lbl {
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.donut-legend-agency {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 4px 0;
}

.legend-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-val {
  font-weight: 600;
  color: #fff;
}
/* ── Chart Period Select ── */
.chart-period-select {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 12px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.chart-period-select option {
  background-color: #1a1a1a;
  color: #fff;
  padding: 10px;
}

.chart-period-select:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

.chart-period-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
}

/* ── Ticketing ── */
.ticketing-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 20px;
}

.ticketing-title {
  margin: 0 0 14px;
  font-family: var(--font-head);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.ticket-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-form-grid {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 12px;
}

.ticket-form .form-group label {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ticket-form input,
.ticket-form textarea,
.ticket-form select {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: rgba(12, 21, 35, 0.8);
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.9rem;
}

.ticket-form textarea {
  resize: vertical;
}

.ticket-message {
  font-size: 0.82rem;
  min-height: 20px;
  color: var(--muted);
  margin: 0;
}

.ticket-message.is-error {
  color: #fda4af;
}

.ticket-message.is-ok {
  color: #86efac;
}

.ticket-submit-btn {
  align-self: flex-start;
}

.ticket-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.tickets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 760px;
  overflow-y: auto;
  padding-right: 2px;
}

.ticket-item {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: rgba(16, 28, 44, 0.75);
  padding: 12px;
}

.ticket-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.ticket-item-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.ticket-item-meta {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.ticket-description {
  margin: 10px 0;
  font-size: 0.84rem;
  color: rgba(234, 242, 255, 0.92);
  white-space: pre-wrap;
}

.ticket-pill {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.ticket-pill.status-open { background: rgba(34, 197, 94, 0.18); }
.ticket-pill.status-in_progress { background: rgba(59, 130, 246, 0.2); }
.ticket-pill.status-waiting { background: rgba(234, 179, 8, 0.24); }
.ticket-pill.status-done { background: rgba(107, 114, 128, 0.25); }

.ticket-pill.priority-low { border-color: rgba(74, 222, 128, 0.5); }
.ticket-pill.priority-medium { border-color: rgba(34, 211, 238, 0.5); }
.ticket-pill.priority-high { border-color: rgba(251, 146, 60, 0.6); }
.ticket-pill.priority-urgent { border-color: rgba(248, 113, 113, 0.7); }

.ticket-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.ticket-actions-row select,
.ticket-actions-row input {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: rgba(12, 21, 35, 0.8);
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.8rem;
}

.ticket-mini-btn {
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.78rem;
}

.ticket-attachments {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ticket-attachment-btn {
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 5px 10px;
  font-size: 0.72rem;
}

.ticket-comment-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}

.ticket-comment-row input {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: rgba(12, 21, 35, 0.8);
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.8rem;
}

.ticket-empty {
  text-align: center;
  color: var(--muted-2);
  font-size: 0.88rem;
  padding: 20px 8px;
}

@media (max-width: 1200px) {
  .ticketing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .ticket-form-grid { grid-template-columns: 1fr; }
  .ticket-actions-row { grid-template-columns: 1fr; }
}

/* Specific adjustments for drawer charts */
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}




