/* ============================================================
   AME V2 Design System — ame-v2.css
   Visual language: affiliatemarketing-express-redesign.html
   Structural layout: legacy admin.html + clients/dashboard.html
   ============================================================ */

/* ── CSS VARIABLES (from redesign.html) ── */
:root {
  /* Backgrounds */
  --bg: #EDF2F8;
  --bg-white: #FFFFFF;
  --bg-dark: #0A1F2C;

  /* Text */
  --text-primary: #0D2B3E;
  --text-secondary: #4A6070;
  --text-accent: #7BA8C0;
  --text-on-dark: #FFFFFF;

  /* Brand Colors */
  --teal: #1B4F5A;
  --teal-light: #2ABFBF;
  --orange: #F5A623;
  --orange-dark: #E8820C;

  /* Status */
  --success: #22C55E;
  --warning: #FBBF24;
  --danger: #EF4444;
  --info: #2ABFBF;
  --inactive: #94A3B8;

  /* Borders & Shadows */
  --border: #D8E4EE;
  --card-shadow: 0 2px 16px rgba(13,43,62,0.08);
  --card-shadow-hover: 0 8px 32px rgba(13,43,62,0.12);

  /* Layout */
  --topbar-height: 52px;
  --sidebar-width: 190px;
  --sidebar-width-sm: 170px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Font */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100%;
  overflow: hidden;
}

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

img { max-width: 100%; display: block; }

/* ── TYPOGRAPHY ── */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--text-accent); }

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--teal);
  margin-bottom: 20px;
}

.section-h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.section-h2 em {
  font-style: italic;
  font-weight: 300;
  color: var(--text-accent);
}

.section-sub {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── TOPBAR (shared: team + client) ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: linear-gradient(90deg, rgba(255,255,255,0.97), rgba(255,255,255,0.92));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(13,43,62,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  gap: 16px;
}

.topbar-logo {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-logo .logo-icon { margin-right: 2px; }

.topbar-logo .logo-accent { color: var(--orange); }

.topbar-logo span { color: var(--orange); }

.topbar-brand {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  font-size: 22px;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.status-pill {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  color: var(--text-on-dark);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timestamp {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ── SIDEBAR (team + client shared structure) ── */
.sidebar {
  position: fixed;
  left: 0;
  top: 52px;
  width: 190px;
  height: calc(100vh - 52px);
  background: linear-gradient(180deg, #1B4F5A 0%, #163F48 100%);
  color: rgba(255,255,255,0.85);
  border-right: none;
  padding: 4px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(13,43,62,0.08);
}

.sidebar-nav { flex: 1; }

.sidebar-section { margin-bottom: 4px; }

.sidebar-section.collapsible .sidebar-items {
  overflow: hidden;
  max-height: 300px;
  transition: max-height 0.3s ease;
}

.sidebar-section.collapsible.collapsed .sidebar-items {
  max-height: 0;
}

.sidebar-label {
  color: rgba(255,255,255,0.92);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 14px 2px;
  margin-bottom: 2px;
  letter-spacing: 1.2px;
}

.sidebar-label.toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.2s;
  user-select: none;
}

.sidebar-label.toggle:hover { color: rgba(255,255,255,1); }

.sidebar-label .chevron {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none; stroke-width: 2;
  transition: transform 0.3s ease;
  stroke-linecap: round; stroke-linejoin: round;
}

.sidebar-section.collapsed .sidebar-label .chevron {
  transform: rotate(-90deg);
}

.sidebar-item {
  color: rgba(255,255,255,0.85);
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-right: 8px;
}

.sidebar-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0.7;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.sidebar-item.active {
  background: rgba(42,191,191,0.12);
  border-left-color: var(--orange);
  color: #fff;
  font-weight: 600;
}

.sidebar-item.active svg { opacity: 1; }

.sidebar-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(245,166,35,0.15);
  color: var(--orange);
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 4px 0;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 0;
}

/* ── MAIN CONTENT AREA ── */
.main {
  margin-left: 190px;
  margin-top: 52px;
  padding: 36px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - 52px);
  min-width: 0;
}

/* ── PAGES (SPA) ── */
.page { display: none; max-width: 100%; overflow-x: hidden; }
.page.active { display: block; }

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

.page-date {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ── CARDS ── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

/* ── HEALTH CARD (client dashboard) ── */
.health-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
  border-top: 3px solid var(--teal);
  position: relative;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.health-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 70px;
  max-width: 55%;
}

.health-card-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.health-card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Health dots */
.health-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.health-dot.healthy { background-color: var(--success); box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.health-dot.warning { background-color: var(--warning); box-shadow: 0 0 8px rgba(251,191,36,0.5); }
.health-dot.critical { background-color: var(--danger); box-shadow: 0 0 8px rgba(239,68,68,0.6); animation: pulse-dot 1.8s infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Health score ring */
.health-score-ring {
  position: relative;
  width: 120px; height: 120px;
}

.health-score-ring svg { transform: rotate(-90deg); }
.health-score-ring .ring-bg { stroke: var(--border); fill: none; stroke-width: 6; }
.health-score-ring .ring-fg { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1.5s ease; }
.health-score-ring .ring-fg.good { stroke: var(--success); }
.health-score-ring .ring-fg.warn { stroke: var(--warning); }
.health-score-ring .ring-fg.bad { stroke: var(--danger); }

.health-score-value {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--text-primary);
}

/* Health grid (13 metrics) */
.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  position: relative;
  max-width: 100%;
  overflow: hidden;
}

.health-category { display: flex; flex-direction: column; gap: 10px; min-width: 0; overflow: hidden; }

.health-category-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; padding: 6px 12px; border-radius: var(--radius-sm);
  text-align: center;
}

.health-category-label.cat-performance { color: var(--teal); background: rgba(27,79,90,0.06); border: 1px solid rgba(27,79,90,0.12); }
.health-category-label.cat-operations { color: var(--warning); background: rgba(251,191,36,0.06); border: 1px solid rgba(251,191,36,0.12); }
.health-category-label.cat-risk { color: var(--danger); background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.12); }
.health-category-label.cat-pubquality { color: #7C3AED; background: rgba(124,58,237,0.06); border: 1px solid rgba(124,58,237,0.12); }

.health-item {
  text-align: center;
  padding: 18px 10px;
  border-radius: var(--radius-lg);
  position: relative;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  transition: all 0.25s ease;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
}

.health-item:hover {
  border-color: rgba(27,79,90,0.25);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.health-metric-label {
  font-size: 10px;
  color: var(--teal);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.health-value {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.metric-subbox {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  text-align: center;
}

.metric-subbox.up {
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  color: var(--success);
}

.metric-subbox.down {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--danger);
}

.metric-subbox .arrow {
  font-size: 9px;
  margin-right: 2px;
}

.metric-subbox .context {
  display: block;
  font-size: 10px;
  margin-top: 3px;
  opacity: 0.85;
}

/* ── DASHBOARD SECTIONS ── */
.dashboard-section { margin-top: 32px; }
.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.dashboard-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.dashboard-section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.summary-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.summary-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.summary-card-value {
  font-size: 13px;
  color: var(--text-secondary);
}
.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.status-row:last-child { border-bottom: none; }
.status-label {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}
.status-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── PERIOD SELECTOR (client dashboard) ── */
.time-range-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background-color: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  width: fit-content;
}

.time-range-btn {
  padding: 7px 18px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
  letter-spacing: 0.3px;
}

.time-range-btn:hover {
  color: var(--text-primary);
  background-color: rgba(27,79,90,0.06);
}

.time-range-btn.active {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  color: var(--text-on-dark);
  box-shadow: 0 2px 12px rgba(27,79,90,0.25);
}

/* ── BUTTONS ── */
.btn-primary {
  background: var(--orange);
  color: var(--text-on-dark);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover { background: var(--orange-dark); }

.btn-teal {
  background: var(--teal);
  color: var(--text-on-dark);
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-block;
}
.btn-teal:hover { background: #16404A; }

.btn-outline {
  border: 2px solid var(--border);
  color: var(--text-primary);
  background: var(--bg-white);
  padding: 12px 26px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

.btn-danger {
  background: var(--danger);
  color: var(--text-on-dark);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn-back {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-back:hover { background: rgba(27,79,90,0.04); border-color: var(--teal); }

/* ── FILTER BAR ── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }

/* ── DASHBOARD TOOLBAR — uniform height for all elements ── */
.dashboard-toolbar {
  display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; align-items: stretch;
}
.dashboard-toolbar .filter-btn,
.dashboard-toolbar .form-select,
.dashboard-toolbar .form-input,
.dashboard-toolbar .btn-primary,
.dashboard-toolbar .btn-secondary {
  height: 40px; box-sizing: border-box; padding-top: 0; padding-bottom: 0;
  display: inline-flex; align-items: center;
}

.filter-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--teal); color: var(--teal); }
.filter-btn.active { background: var(--teal); color: var(--text-on-dark); border-color: var(--teal); }

/* ── TABLES ── */
.table-container {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
}

table { width: 100%; border-collapse: collapse; }

thead {
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
}

tr:hover { background-color: rgba(27,79,90,0.03); }

/* ── TYPE FILTER BADGES ── */
.type-badge { transition: all 0.15s; cursor: pointer; }
.type-badge:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.10); transform: translateY(-1px); }
.type-badge.active { }
#publisher-type-filters.has-active .type-badge:not(.active) { opacity: 0.4; }
#publisher-type-filters.has-active .type-badge:not(.active):hover { opacity: 0.75; }

/* ── STATUS BADGES ── */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.status-active { background: rgba(34,197,94,0.1); color: var(--success); border: 1px solid rgba(34,197,94,0.2); }
.status-pending { background: rgba(251,191,36,0.1); color: var(--warning); border: 1px solid rgba(251,191,36,0.2); }
.status-critical { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.status-inactive { background: rgba(148,163,184,0.1); color: var(--inactive); border: 1px solid rgba(148,163,184,0.2); }

/* ── BRAND CARDS (team dashboard) ── */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.brand-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--card-shadow);
}

.brand-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(27,79,90,0.3);
  transform: translateY(-2px);
}

.brand-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--text-on-dark);
  flex-shrink: 0;
}

/* ── TASK CARDS ── */
.task-badge { padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.task-badge.critical { background: rgba(239,68,68,0.08); color: var(--danger); }
.task-badge.urgent { background: rgba(245,158,11,0.08); color: #F59E0B; }
.task-badge.high { background: rgba(234,179,8,0.08); color: #EAB308; }
.task-badge.medium { background: rgba(27,79,90,0.08); color: var(--teal); }
.task-badge.low { background: rgba(107,114,128,0.08); color: #6B7280; }

/* ── QUICK STATS (team dashboard) ── */
.quick-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.quick-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.quick-stat-value { font-size: 22px; font-weight: 800; color: var(--teal); }
.quick-stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* ── GOAL BAR ── */
.goal-bar-outer { height: 20px; background: var(--bg); border-radius: 100px; overflow: hidden; position: relative; border: 1px solid var(--border); }
.goal-bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--teal-light)); border-radius: 100px; transition: width 0.8s ease; }
.goal-label { font-size: 13px; color: var(--text-secondary); margin-top: 8px; text-align: center; }

/* ── MODALS ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(13,43,62,0.5);
  backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(13,43,62,0.2);
}

.modal-box h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.modal-box p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }

.modal-box input,
.modal-box select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
  font-family: var(--font-family);
}

.modal-box input:focus,
.modal-box select:focus { border-color: var(--teal); }

.modal-buttons { display: flex; gap: 12px; }
.modal-btn { flex: 1; padding: 10px; border: none; border-radius: var(--radius-md); font-weight: 600; font-size: 14px; cursor: pointer; }
.modal-btn-cancel { background: var(--bg); color: var(--text-secondary); }
.modal-btn-primary { background: linear-gradient(135deg, var(--teal), var(--teal-light)); color: var(--text-on-dark); }
.modal-btn-danger { background: var(--danger); color: var(--text-on-dark); }

/* ── KPI CARDS (client pages) ── */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 24px; }

.kpi-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--card-shadow);
  border-top: 3px solid var(--border);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.kpi-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(27,79,90,0.3);
  transform: translateY(-2px);
}

.kpi-label {
  font-size: 10px; color: var(--teal); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 10px; text-align: center;
}

.kpi-value {
  font-size: 32px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px; text-align: center;
}

/* ── CONTENT GRIDS ── */
.content-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ── ALERT BOX ── */
.alert-box {
  background: rgba(245,158,11,0.04);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
}

.alert-icon { font-size: 18px; flex-shrink: 0; }
.alert-title { font-weight: 700; color: var(--danger); font-size: 13px; margin-bottom: 4px; }
.alert-text { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

.alert-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.alert-item:last-child { border-bottom: none; }

/* ── CHART CONTAINERS ── */
.chart-container {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.chart-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

/* ── FORM ELEMENTS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-family);
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(27,79,90,0.1);
}

.form-input.error {
  border-color: var(--danger);
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  font-family: var(--font-family);
}

/* ── SEARCH INPUT ── */
.search-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  font-family: var(--font-family);
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--teal); }

/* ── PAGINATION ── */
.page-btn {
  min-width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg-white);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  transition: all 0.2s;
}
.page-btn:hover { border-color: var(--teal); color: var(--teal); }
.page-btn.active { background: var(--teal); color: var(--text-on-dark); border-color: var(--teal); }

/* ── TAB NAVIGATION ── */
.tab-container { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab-button {
  padding: 12px 16px; background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  border-bottom: 2px solid transparent; transition: all 0.2s;
}
.tab-button.active { color: var(--teal); border-bottom-color: var(--teal); }

/* ── PROGRESS BAR (new-client wizard) ── */
.progress-section { margin-bottom: 32px; }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--teal-light)); border-radius: 3px; transition: width 0.4s ease; }

.step-indicators {
  display: flex; justify-content: space-between; margin-top: 12px;
}

.step-indicator {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.step-indicator.active { color: var(--teal); }
.step-indicator.completed { color: var(--success); }

/* ── CHECKBOX GRID (new-client) ── */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.cb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer;
  transition: all 0.2s; background: var(--bg-white);
}
.cb-item:hover { border-color: var(--teal); }
.cb-item.selected { border-color: var(--teal); background: rgba(27,79,90,0.04); }

/* ── FORM ROW (2-column grid) ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── SECTION DIVIDER ── */
.section-divider { margin-top: 32px; }
.section-title {
  font-size: 22px; font-weight: 800; color: var(--text-primary);
  margin-bottom: 20px; margin-top: 28px; letter-spacing: -0.3px;
}

/* ── LOGOUT BUTTON ── */
.logout-btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(239,68,68,0.04);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
}
.logout-btn:hover {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.3);
}

/* ── LAST UPDATE INDICATOR ── */
.last-update-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.last-update-label {
  font-size: 9px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.last-update-value {
  font-size: 11px; color: var(--text-primary);
  font-weight: 600;
}

/* ── DATA STATUS GRID ── */
.data-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── ADMIN RETURN BUTTON (client topbar) ── */
.admin-return-btn {
  display: none;
  background: rgba(27,79,90,0.06);
  border: 1px solid rgba(27,79,90,0.2);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.2s;
}
.admin-return-btn:hover {
  background: rgba(27,79,90,0.1);
  border-color: rgba(27,79,90,0.35);
}

/* ── RESPONSIVE ── */
@media (max-width: 1400px) {
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { width: var(--sidebar-width-sm); }
  .main { margin-left: var(--sidebar-width-sm); }
  .main-container { margin-left: var(--sidebar-width-sm); width: calc(100vw - var(--sidebar-width-sm)); max-width: calc(100vw - var(--sidebar-width-sm)); }
}

@media (max-width: 600px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px; }
  .main-container { margin-left: 0; width: 100vw; max-width: 100vw; }
}

/* ── SCROLLBAR ── */
.main::-webkit-scrollbar { width: 5px; height: 5px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.main::-webkit-scrollbar-thumb:hover { background: var(--teal); }
.main { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.sidebar { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ── PARTNER CARDS ── */
.partner-card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 18px; margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center;
  transition: all 0.2s ease;
}
.partner-card:hover { border-color: rgba(27,79,90,0.2); }

/* ── OFFER ROWS ── */
.offer-row {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 18px; margin-bottom: 12px;
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px;
  align-items: center; transition: all 0.2s ease;
}
.offer-row:hover { border-color: rgba(27,79,90,0.2); }

/* ── COMPARISON LABEL ── */
.comparison-label {
  font-size: 13px; color: var(--text-secondary); padding: 10px 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; letter-spacing: 0.3px;
}
.comparison-label .comp-month { color: var(--teal); font-weight: 700; }
.comparison-label .comp-vs { color: var(--text-secondary); font-size: 11px; text-transform: uppercase; }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--card-shadow);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--teal);
  margin-bottom: 8px;
}

.login-logo .accent { color: var(--orange); }

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.login-error {
  display: none;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--danger);
}

.login-error.visible { display: block; }

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.login-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.login-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.login-footer a {
  color: var(--teal);
  font-weight: 600;
}

.login-page-footer {
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── NEW CLIENT WIZARD ── */
.wizard-page {
  min-height: 100vh;
  padding: 40px 20px;
}

.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 700px;
  margin: 0 auto 32px;
}

.wizard-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--teal);
}

.wizard-logo .accent { color: var(--orange); }

.wizard-back {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.wizard-back:hover { color: var(--teal); }

.wizard-container {
  max-width: 700px;
  margin: 0 auto;
}

.wizard-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--card-shadow);
}

.wizard-step { display: none; }
.wizard-step.active { display: block; }

.wizard-step-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.wizard-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── UTILITY CLASSES ── */
.accent { color: var(--orange); }
.active { color: var(--teal); }

/* Icon sizing for SVGs outside sidebar context */
.icon-sm { width: 14px; height: 14px; }

/* Spacing utilities */
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-32 { margin-top: 32px; }
.text-center { text-align: center; }

/* Flex utilities */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center-gap {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.flex-row-gap {
  display: flex;
  gap: 12px;
}

/* Staff detail styles (team admin) */
.staff-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.staff-role {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.detail-heading {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.detail-heading-spaced {
  font-size: 14px;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 12px;
}

.list-plain {
  list-style: none;
  padding: 0;
}

/* Search input wrapper */
.search-wrapper { margin-bottom: 20px; }
.search-input-spaced { margin-bottom: 12px; }

/* Reports filter layout */
.reports-filter {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.reports-filter .search-input { flex: 1; }
.reports-filter .form-select-fixed { flex: 0 0 auto; width: 150px; }
.reports-filter .form-select-narrow { flex: 0 0 auto; width: 100px; }

/* Chart placeholder */
.chart-placeholder {
  height: 300px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

/* Content placeholder card */
.placeholder-card {
  max-width: 600px;
}

.placeholder-content {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* Sync status indicator */
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── FULL-WIDTH MAIN (no sidebar) ── */
.main-full {
  margin-left: 0;
  margin-top: var(--topbar-height);
  padding: 36px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   CLIENT BRAND PAGE — Missing class definitions
   Translated from legacy dashboard.html dark theme to V2 light theme
   ============================================================ */

/* ── MAIN CONTAINER WRAPPER ── */
.main-container {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
  min-width: 0;
  width: calc(100vw - var(--sidebar-width));
  max-width: calc(100vw - var(--sidebar-width));
  box-sizing: border-box;
}

/* When .main is inside .main-container, don't double the offset */
.main-container .main {
  margin-left: 0;
  margin-top: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ── HEALTH HEADER LEFT ── */
.health-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── HEALTH HERO (score ring positioned top-right of health card) ── */
.health-hero {
  position: absolute;
  top: 24px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.health-hero-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.health-hero-detail {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-secondary);
}

.health-hero-detail .detail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.health-hero-detail .detail-dot.good { background: var(--success); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.health-hero-detail .detail-dot.warn { background: var(--warning); box-shadow: 0 0 6px rgba(251,191,36,0.5); }
.health-hero-detail .detail-dot.bad { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,0.5); }

/* ── HEALTH SCORE HERO (large ring) ── */
.health-score-hero {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.health-score-hero svg {
  transform: rotate(-90deg);
  width: 110px;
  height: 110px;
}

.health-score-hero .ring-bg { stroke: var(--border); fill: none; stroke-width: 7; }
.health-score-hero .ring-fg { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1.5s ease; }
.health-score-hero .ring-fg.good { stroke: var(--success); filter: drop-shadow(0 0 12px rgba(34,197,94,0.4)); }
.health-score-hero .ring-fg.warn { stroke: var(--warning); filter: drop-shadow(0 0 12px rgba(251,191,36,0.4)); }
.health-score-hero .ring-fg.bad { stroke: var(--danger); filter: drop-shadow(0 0 12px rgba(239,68,68,0.4)); }

.health-score-hero-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.health-score-hero-value .score-number {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.health-score-hero-value .score-label {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── HEALTH CONTROLS ROW ── */
.health-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ── HEALTH SCORE LABEL ── */
.health-score-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.4;
}

.health-score-label strong {
  color: var(--danger);
  font-weight: 700;
}

.health-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── HEALTH GRID OVERLAY ── */
.health-grid-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(237,242,248,0.88);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.health-grid-overlay.visible { display: flex; }
.health-grid-overlay .overlay-icon { font-size: 32px; }
.health-grid-overlay .overlay-title { font-size: 15px; font-weight: 700; color: var(--danger); }
.health-grid-overlay .overlay-msg { font-size: 12px; color: var(--text-secondary); text-align: center; max-width: 300px; }
.health-grid-overlay .overlay-retry {
  margin-top: 8px;
  padding: 8px 20px;
  background: var(--teal);
  color: var(--text-on-dark);
  border: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-family);
}
.health-grid-overlay .overlay-retry:hover { background: var(--teal-light); }

/* ── HEALTH ITEM HELP BUTTON ── */
.health-item .hi-help {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--teal);
  color: var(--text-on-dark);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(13,43,62,0.15);
}

.health-item:hover .hi-help { opacity: 1; }
.health-item .hi-help:hover { background: var(--teal-light); }

/* ── HEALTH POPUP ── */
.hi-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  z-index: 1000;
  box-shadow: 0 24px 64px rgba(13,43,62,0.2);
}

.hi-popup.visible { display: block; }

.hi-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,43,62,0.3);
  z-index: 999;
  backdrop-filter: blur(4px);
}

.hi-popup-overlay.visible { display: block; }

.hi-popup-title { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.hi-popup-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }

.hi-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.hi-popup-close:hover { background: var(--danger); color: var(--text-on-dark); border-color: var(--danger); }

.hi-popup-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.hi-popup-bar-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); width: 60px; text-align: right; }
.hi-popup-bar-track { flex: 1; height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; position: relative; }
.hi-popup-bar-fill { height: 100%; border-radius: 5px; transition: width 0.6s ease; }
.hi-popup-bar-value { font-size: 12px; font-weight: 700; color: var(--text-primary); width: 55px; }

/* ── METRIC COMPARISON ── */
.metric-comparison { display: none; }

/* ── ACTIVITY BOX / GRID ── */
.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.activity-box {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.activity-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

.activity-item { padding: 8px 0; font-size: 13px; color: var(--text-primary); line-height: 1.5; }
.activity-item strong { font-weight: 600; }

/* ── VIEW TASKS LINK ── */
.view-tasks-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 16px;
  transition: color 0.2s;
}

.view-tasks-link:hover { color: var(--teal-light); }

/* ── KPI GRID VARIANTS ── */
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── STAT CARDS GRID ── */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-cards-4 { grid-template-columns: repeat(4, 1fr); }
.stat-cards-5 { grid-template-columns: repeat(5, 1fr); }

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}

.stat-card:hover { box-shadow: var(--card-shadow-hover); }

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── STATUS CARDS GRID (tracking, payment) ── */
.status-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.status-cards-5 .status-cards-grid,
.status-cards-grid.status-cards-5 { grid-template-columns: repeat(5, 1fr); }

.status-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}

.status-card:hover { box-shadow: var(--card-shadow-hover); }
.status-card.danger { border-top: 3px solid var(--danger); }
.status-card.warning { border-top: 3px solid var(--warning); }

.status-card .status-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.status-card .status-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.status-desc { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.status-kpi { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.status-amount { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ── STATUS BANNER (profile page) ── */
.status-banner {
  margin-bottom: 24px;
}

.status-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.status-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.plan-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(27,79,90,0.08);
  color: var(--teal);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: auto;
}

/* ── ALERT BANNER (payment page) ── */
.alert-banner {
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

/* ── SPEED BAR (payment page) ── */
.speed-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.speed-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 100px;
  flex-shrink: 0;
}

.speed-bar {
  flex: 1;
  height: 12px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.speed-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  width: 60px;
  text-align: right;
}

.speed-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ── GAIN / LOSS / NET CARDS (revenue page) ── */
.gain-loss-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.gain-card {
  border-top: 3px solid var(--success);
}

.loss-card {
  border-top: 3px solid var(--danger);
}

.net-card {
  border-top: 3px solid var(--teal);
}

.card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── RISK CARDS (revenue page) ── */
.risk-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.risk-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.risk-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.risk-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.pagination-btn {
  padding: 8px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
}

.pagination-btn:hover { border-color: var(--teal); color: var(--teal); }
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pagination-numbers {
  display: flex;
  gap: 4px;
}

/* ── SEARCH CONTAINER ── */
.search-container {
  margin-bottom: 20px;
}

.search-container .search-input {
  width: 100%;
}

/* ── FILTER TABS ── */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-count {
  font-size: 11px;
  color: inherit;
  opacity: 0.7;
}

/* ── EXPLANATION CARD ── */
.explanation-card {
  margin-bottom: 24px;
}

.explanation-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ── INFO GRID (profile, payment pages) ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

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

.info-field {
  padding: 12px 0;
}

.info-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.info-field div {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.info-date {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── DOCUMENT CARD (profile page) ── */
.document-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.document-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.document-info {
  flex: 1;
}

.document-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.document-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.document-link {
  padding: 6px 14px;
  background: var(--teal);
  color: var(--text-on-dark);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s;
}

.document-link:hover { background: var(--teal-light); }

/* ── CONTACT FIELD ── */
.contact-field {
  padding: 12px 0;
}

.contact-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.contact-field div {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── TAG PILLS ── */
.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── ACCOUNT SECTION ── */
.account-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.membership-info {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── CAMPAIGN PAGES GRID ── */
.campaign-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ── CAMPAIGN FOOTER ── */
.campaign-footer {
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 16px;
}

/* ── PROGRESS RING (tasks page) ── */
.progress-card {
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring-wrapper {
  position: relative;
  width: 70px;
  height: 70px;
}

.progress-ring-svg {
  width: 70px;
  height: 70px;
  transform: rotate(-90deg);
}

.progress-ring-bg {
  stroke: var(--border);
  fill: none;
  stroke-width: 6;
}

.progress-ring-fg {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke: var(--teal);
  transition: stroke-dashoffset 1s ease;
}

.progress-percent {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── ADD TASK FORM ── */
.add-task-form {
  margin-bottom: 24px;
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-family);
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(27,79,90,0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

/* ── SIDEBAR UPDATE INDICATOR ── */
.sidebar-update-indicator {
  margin-top: auto;
  padding: 12px 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.sidebar-update-label {
  font-size: 9px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.sidebar-update-value {
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 600;
}

.sidebar-update-sub {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── TABLE LOADING ── */
.table-loading {
  text-align: center;
  color: var(--text-secondary);
  padding: 24px;
  font-size: 13px;
}

/* ── PAGE SUBTITLE ── */
.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── PAGE ACTIONS ── */
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── SECONDARY BUTTON ── */
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
}

.btn-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* ── STEPS LIST (payment page) ── */
.steps-list {
  padding-left: 20px;
  margin: 0;
}

.steps-list li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
  border-bottom: 1px solid var(--border);
}

.steps-list li:last-child { border-bottom: none; }

/* ── SIZE OVERVIEW GRID (creatives page) ── */
.size-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.size-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}

.size-card:hover { box-shadow: var(--card-shadow-hover); }

.size-name {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.size-count {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── GRID LAYOUTS (2col, 3col) ── */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

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

/* ── TASK CARDS (client tasks page) ── */
.task-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
}

.task-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(27,79,90,0.2);
  transform: translateY(-1px);
}

.task-card.expanded { background: var(--bg-white); }

.task-header {
  display: grid;
  grid-template-columns: 32px 1fr 150px 90px;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
}

.task-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.3;
  padding-right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-time-cell {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  padding: 5px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-priority {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 0;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.priority-critical { background: rgba(239,68,68,0.08); color: var(--danger); }
.priority-urgent { background: rgba(239,68,68,0.08); color: var(--danger); }
.priority-high { background: rgba(245,158,11,0.08); color: #F59E0B; }
.priority-medium { background: rgba(251,191,36,0.08); color: var(--warning); }
.priority-low { background: rgba(27,79,90,0.08); color: var(--teal); }

.task-details {
  display: none;
  padding: 0 18px 18px 18px;
  border-top: 1px solid var(--border);
}

.task-details.show { display: block; padding-top: 14px; }

.task-why {
  background: var(--bg);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.task-steps { font-size: 12px; }
.task-step { padding: 6px 0; color: var(--text-secondary); line-height: 1.5; }
.task-step strong { color: var(--text-primary); font-weight: 600; }

.task-url {
  background: var(--bg);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-primary);
  word-break: break-all;
}

/* Task checkbox */
.task-checkbox-label { display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.task-checkbox { display: none; }
.task-checkmark {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  background: var(--bg);
}
.task-checkmark:hover { border-color: var(--teal); }
.task-checkbox:checked + .task-checkmark { background: var(--success); border-color: var(--success); }
.task-checkbox:checked + .task-checkmark::after { content: '\2713'; color: var(--text-on-dark); font-size: 13px; font-weight: 700; }
.task-completed { opacity: 0.5; }
.task-completed .task-title { text-decoration: line-through; color: var(--inactive); }

/* Manual task icon (pencil) */
.manual-task-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--teal);
  background: rgba(27,79,90,0.08);
  border-radius: 4px;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  flex-shrink: 0;
  cursor: default;
  vertical-align: middle;
}

/* Re-open badge (shows how many times a task was re-opened) */
.reopen-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--danger);
  background: rgba(239,68,68,0.08);
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 4px;
  flex-shrink: 0;
  cursor: default;
  vertical-align: middle;
}

/* (task-delete-btn removed — replaced by delete-mode bulk delete) */

/* Delete mode: red selection checkbox — 8th column, right outside row */
.task-delete-cb {
  width: 20px;
  height: 20px;
  accent-color: var(--danger);
  cursor: pointer;
  display: none;       /* hidden by default, shown via .delete-mode-active */
  align-self: center;
  justify-self: center;
}
.task-delete-cb:hover { transform: scale(1.1); }

/* When delete mode is active: show red checkboxes in the always-present 8th column */
.delete-mode-active .task-delete-cb {
  display: block;
}

/* Delete mode: "Delete Task" button in column header */
.bulk-delete-btn {
  background: rgba(239,68,68,0.08);
  border: 1px solid var(--danger);
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.bulk-delete-btn:hover {
  background: var(--danger);
  color: #fff;
}
.bulk-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Confirm-done button (Pending → Done) */
.task-confirm-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--success);
  background: rgba(34,197,94,0.06);
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  margin-left: auto;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.task-confirm-btn:hover {
  background: var(--success);
  color: #fff;
}

/* ── PUBLISHERS BOX (dashboard) ── */
.publishers-box {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.publishers-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }

.publisher-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.publisher-item:last-child { border-bottom: none; }
.publisher-name { font-weight: 600; color: var(--text-primary); }
.publisher-revenue { color: var(--teal); font-weight: 700; }
.publisher-share { color: var(--text-secondary); font-size: 12px; }

/* ── PERIOD SELECTOR ── */
.period-selector { display: flex; gap: 8px; margin-bottom: 24px; }
.period-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.period-btn.active { background: var(--teal); color: var(--text-on-dark); border-color: var(--teal); }
.period-btn:hover { border-color: var(--teal); }

/* ── COLOR UTILITIES ── */
.color-positive { color: var(--teal); }
.color-negative { color: var(--danger); }

/* ── PARTNER & OFFER ELEMENT TEXT ── */
.partner-info { flex: 1; }
.partner-name { font-weight: 600; color: var(--text-primary); font-size: 13px; }
.partner-desc { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.partner-action { background: var(--teal); color: var(--text-on-dark); padding: 6px 12px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; cursor: pointer; border: none; transition: background 0.2s; }
.partner-action:hover { background: var(--teal-light); }

.offer-code { font-weight: 700; color: var(--text-primary); font-size: 14px; font-family: monospace; }
.offer-desc { color: var(--text-secondary); font-size: 12px; }

/* ── MODAL ACTIONS ── */
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.modal-btn { padding: 10px 20px; border: none; border-radius: var(--radius-md); font-weight: 600; font-size: 14px; cursor: pointer; }
.modal-btn-primary { background: linear-gradient(135deg, var(--teal), var(--teal-light)); color: var(--text-on-dark); }

/* ── CHART BARS ── */
.chart-bars { display: flex; align-items: flex-end; justify-content: space-between; height: 200px; gap: 4px; }
.bar { flex: 1; background: var(--teal); border-radius: 4px 4px 0 0; position: relative; transition: all 0.3s ease; opacity: 0.7; }
.bar.current { background: var(--teal); opacity: 1; }
.bar:hover { background: var(--teal-light); opacity: 1; }

/* ── ANIMATION ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVE OVERRIDES FOR CLIENT ── */
@media (max-width: 1200px) {
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-cards-5, .stat-cards-grid.stat-cards-5 { grid-template-columns: repeat(3, 1fr); }
  .status-cards-grid.status-cards-5 { grid-template-columns: repeat(3, 1fr); }
  .size-overview-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-2col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .stat-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .status-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gain-loss-grid { grid-template-columns: 1fr; }
  .risk-cards-grid { grid-template-columns: 1fr; }
  .health-hero { position: static; margin-bottom: 20px; }
  .grid-3col { grid-template-columns: 1fr; }
}

/* ============================================================
   SURGICAL UI FIX — Additional CSS
   ============================================================ */

/* ── FIX G1: Sidebar bottom push-to-bottom + logout spacing ── */
.sidebar-bottom {
  margin-top: auto;
  padding: 8px 16px 16px;
}

.sidebar-bottom .logout-btn {
  margin-top: 8px;
}

.sidebar-bottom .last-update-box {
  margin-bottom: 8px;
}

/* ── FIX D1: Health hero title styling ── */
.health-hero-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* ── FIX D4: Top 5 Combined Share bar ── */
.top5-combined-share {
  margin-bottom: 20px;
}

.combined-share-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.combined-share-label strong {
  color: var(--teal);
  font-weight: 700;
}

.combined-share-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.share-segment {
  height: 100%;
  transition: width 0.6s ease;
  min-width: 0;
}

.share-segment[data-publisher="1"] { background: var(--teal); }
.share-segment[data-publisher="2"] { background: var(--teal-light); }
.share-segment[data-publisher="3"] { background: var(--orange); }
.share-segment[data-publisher="4"] { background: #7C3AED; }
.share-segment[data-publisher="5"] { background: var(--inactive); }

.combined-share-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-color-1 { background: var(--teal); }
.legend-color-2 { background: var(--teal-light); }
.legend-color-3 { background: var(--orange); }
.legend-color-4 { background: #7C3AED; }
.legend-color-5 { background: var(--inactive); }

.legend-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* ── FIX D5: Critical Issues header with title + link side by side ── */
.critical-issues-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.critical-issues-header .chart-title {
  margin-bottom: 0;
}

.critical-issues-header .view-tasks-link {
  margin-bottom: 0;
}

/* ── FIX G3: Tighten sidebar section spacing ── */
.sidebar-section {
  margin-bottom: 4px;
}

.sidebar-label {
  padding: 6px 16px 3px;
  margin-bottom: 1px;
}
