@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800&display=swap');

/* Nexus Workspace - light analytics shell */

/* Global 90% zoom on desktop */
@media (min-width: 961px) {
  html { zoom: 0.9; }
}

:root {
  --accent: #bb1c05;
  --accent-hover: #bb1c05;
  --accent-rgb: 187, 28, 5;
  --accent-soft: rgba(var(--accent-rgb), 0.12);
  --accent-soft-2: rgba(var(--accent-rgb), 0.18);
  --mint: #10b981;
  --mint-soft: rgba(16, 185, 129, 0.12);
  --mint-soft-2: rgba(16, 185, 129, 0.18);
  --ink: #0f172a;
  --text-1: #111827;
  --text-2: #374151;
  --text-3: #6b7280;
  --muted: #9ca3af;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.12);
  --bg: #edf1f6;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-2: rgba(248, 250, 252, 0.92);
  --surface-3: rgba(241, 245, 249, 0.92);
  --shadow-sm: 0 1px 1px rgba(15, 23, 42, 0.03), 0 8px 20px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
  --sidebar-w: 220px;
  --header-h: 72px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --font-display: 'Archivo', sans-serif;
  --font-body: 'Archivo', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 13px;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-1);
  line-height: 1.45;
  font-size: 0.9rem;
  background:
    radial-gradient(circle at top left, rgba(187, 28, 5, 0.08), transparent 24%),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.08), transparent 22%),
    linear-gradient(180deg, #eef2f7 0%, #e9edf3 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  padding-top: var(--header-h);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.38), rgba(255,255,255,0.10)),
    radial-gradient(circle at 16% 8%, rgba(255,255,255,0.72), transparent 18%);
  z-index: -1;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-areas:
    "sidebar main";
  min-height: calc(100vh - var(--header-h));
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 500;
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset;
  isolation: isolate;
  transform: translateZ(0);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  max-width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.hamburger:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: var(--line-strong);
}

.header-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-brand-link.logo-only {
  gap: 0;
}

.header-brand-mark {
  width: auto;
  height: 34px;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.header-brand-image {
  display: block;
  width: auto;
  height: 100%;
  object-fit: contain;
  padding: 0;
}

.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-chip,
.profile-chip {
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.82);
  box-shadow: var(--shadow-sm);
}

.icon-chip {
  width: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.icon-chip:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: var(--line-strong);
}

.chip-badge {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 8px;
}

.profile-chip-link {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.profile-chip-link:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.95);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(187,28,5,0.2), rgba(16,185,129,0.2));
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--line);
  padding: 2px;
  transition: border-color .18s, box-shadow .18s, transform .18s;
  text-decoration: none;
}
.profile-chip-icon:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(187,28,5,.15);
  transform: translateY(-1px);
}

.profile-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.profile-chip-link {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.profile-chip-link:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.96);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.profile-name {
  font-size: 12px;
  font-weight: 700;
}

.profile-role {
  font-size: 10px;
  color: var(--text-3);
}

.icon-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.icon-link:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: var(--line-strong);
}

.sidebar {
  grid-area: sidebar;
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh / 0.9 - var(--header-h));
  overflow: hidden;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.sidebar-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 16px 14px 16px;
}

.workspace-switcher {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  margin: 0 0 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(248,250,252,0.98), rgba(241,245,249,0.98));
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.workspace-switcher-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.workspace-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.workspace-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-1);
}

.workspace-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.nav-section {
  margin-bottom: 18px;
}

.nav-label {
  display: block;
  padding: 8px 12px 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px;
  margin: 4px 0;
  border-radius: 14px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  transition: background .18s ease, transform .18s ease, color .18s ease;
}
.nav-item:hover {
  background: rgba(187,28,5,0.06);
  color: var(--text-1);
  transform: translateX(2px);
}
.nav-item.active {
  background: #fff;
  color: var(--text-1);
  box-shadow: 0 8px 18px rgba(15,23,42,0.06);
}

.nav-icon { font-size: 17px; color: var(--accent); }
.nav-item.active .nav-icon { color: var(--accent); }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15,23,42,0.08);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.sidebar-card {
  margin-top: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,247,251,0.96));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.sidebar-card-body {
  padding: 16px;
}

.help-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.help-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(15,23,42,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
}

.help-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}

.help-copy {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.help-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  margin-top: 14px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.help-action:hover { transform: translateY(-1px); background: #030712; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: rgba(248,250,252,0.94);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-user-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
}

.sidebar-user-email {
  font-size: 11px;
  color: var(--text-3);
}

.sidebar-user-chevron {
  margin-left: auto;
  color: var(--muted);
}

.main-content {
  grid-area: main;
  padding: 0 24px 24px;
  overflow-y: auto;
  min-width: 0;
}

.dashboard-page {
  max-width: 1540px;
  margin: 0 auto;
}

.dashboard-home-page > :first-child {
  margin-top: 0;
}

.page-hdr {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-hdr-left {
  min-width: 0;
}

.page-hdr-left h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--ink);
}

.page-hdr-left p {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-3);
  max-width: 760px;
}

.card-head,
.card-body {
  padding-left: 20px;
  padding-right: 20px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  padding-bottom: 14px;
}

.card-body {
  padding-top: 0;
  padding-bottom: 20px;
}

.card-head + .card-body {
  padding-top: 0;
}

.card > .table-wrap {
  padding: 0 20px 20px;
}

.card > .table-wrap table {
  margin-bottom: 0;
}

.hdr-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(187,28,5,0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.hero-card,
.card,
.metric-card,
.workspace-card,
.chart-card,
.table-card,
.insight-card,
.gallery-card,
.auth-card,
.setup-card,
.modal-box,
.consent-banner,
.settings-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.hero-card,
.card,
.metric-card,
.workspace-card,
.chart-card,
.table-card,
.insight-card {
  border-radius: var(--radius-lg);
}

.hero-card {
  padding: 16px;
  margin-bottom: 14px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);
}

.summary-card {
  position: relative;
  min-height: 118px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.summary-card:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 0;
  bottom: 22px;
  width: 1px;
  background: var(--line);
}

.summary-value {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 54px);
  line-height: 0.95;
  letter-spacing: -0.08em;
  color: var(--ink);
  font-weight: 700;
}

.summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--text-3);
  font-weight: 700;
}

.summary-note {
  font-size: 11px;
  color: var(--muted);
}

.hero-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.3vw, 38px);
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--ink);
}

.hero-copy {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  max-width: 640px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
  color: var(--text-2);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.pill-btn:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: var(--line-strong);
}

.pill-btn.primary {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.pill-btn.primary:hover { background: #030712; }

.pill-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.82;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(192px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  padding: 15px 15px 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(187,28,5,0.16);
  box-shadow: var(--shadow-md);
}

.metric-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: start;
  margin-bottom: 10px;
}

.metric-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.metric-label > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.metric-icon.indigo { background: var(--accent-soft); color: var(--accent); }
.metric-icon.mint { background: var(--mint-soft); color: var(--mint); }
.metric-icon.sky { background: rgba(59,130,246,0.10); color: #2563eb; }
.metric-icon.gray { background: rgba(15,23,42,0.06); color: var(--text-2); }
.metric-icon.teal { background: var(--mint-soft); color: var(--mint); }
.metric-icon.amber { background: rgba(245,158,11,0.12); color: #d97706; }
.metric-icon.purple { background: var(--accent-soft); color: var(--accent); }

.metric-name {
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  line-height: 1.1;
  margin-top: 1px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.06em;
  color: var(--ink);
  margin-top: 4px;
}

.metric-val {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.06em;
  color: var(--ink);
  margin-top: 4px;
}

.metric-lbl {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 800;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  justify-self: end;
  align-self: start;
}
.metric-badge.up {
  background: var(--mint-soft);
  color: var(--mint);
}
.metric-badge.down {
  background: rgba(239,68,68,0.10);
  color: #dc2626;
}

.sparkline {
  width: 100%;
  height: 34px;
  overflow: visible;
}

.sparkline path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-area {
  fill: rgba(187,28,5,0.08);
  stroke: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.dashboard-stack {
  display: grid;
  gap: 14px;
}

.chart-card,
.table-card,
.workspace-card,
.insight-card {
  padding: 18px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.card-subtitle {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 4px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15,23,42,0.04);
}

.mini-pill {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.mini-pill.active {
  background: #fff;
  color: var(--text-1);
  box-shadow: 0 4px 10px rgba(15,23,42,0.08);
}

.chart-frame {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(248,250,252,0.94));
  border: 1px solid var(--line);
  overflow: hidden;
}

.chart-frame.pad {
  padding: 16px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--text-3);
  font-size: 11px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.chart-art {
  width: 100%;
  display: block;
}

.chart-art text {
  font-family: var(--font-body);
}

.chart-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(187,28,5,0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.mini-overview {
  display: grid;
  gap: 16px;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}

.sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.sub-table th,
.sub-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.sub-table th {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.responsive-table th,
.responsive-table td {
  padding-right: 12px;
}

.responsive-table colgroup col:nth-child(1) { width: 28%; }
.responsive-table colgroup col:nth-child(2) { width: 18%; }
.responsive-table colgroup col:nth-child(3) { width: 18%; }
.responsive-table colgroup col:nth-child(4) { width: 18%; }
.responsive-table colgroup col:nth-child(5) { width: 18%; }

.customer-table .source-badge {
  max-width: 100%;
}

.customer-table .source-badge > div {
  min-width: 0;
}

.customer-table .source-badge > div > div:last-child {
  overflow-wrap: anywhere;
}

.workspace-item .workspace-meta {
  flex: 1;
  min-width: 0;
}

.workspace-item .workspace-name,
.workspace-item .workspace-desc {
  overflow-wrap: anywhere;
}

.workspace-item .workspace-desc {
  line-height: 1.35;
}

.workspace-item .sync-row {
  align-items: flex-start;
}

.workspace-item .sync-row > span:last-child {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: right;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-1);
  min-width: 0;
}

.source-badge .source-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(15,23,42,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.status-pill.active { background: var(--mint-soft); color: var(--mint); }
.status-pill.past-due { background: rgba(245,158,11,0.12); color: #d97706; }
.status-pill.cancelled { background: rgba(239,68,68,0.10); color: #dc2626; }

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pager-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.82);
  cursor: pointer;
}

.workspaces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.workspace-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workspace-item {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.workspace-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(187,28,5,0.12);
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
}
.workspace-logo.stripe { background: linear-gradient(135deg, #635bff, #bb1c05); }
.workspace-logo.slack { background: linear-gradient(135deg, #bb1c05, #db2777); }
.workspace-logo.hubspot { background: linear-gradient(135deg, #f97316, #ea580c); }

.workspace-name {
  font-size: 14px;
  font-weight: 800;
}

.workspace-desc {
  font-size: 12px;
  color: var(--text-3);
}

.toggle {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: rgba(15,23,42,0.10);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(15,23,42,0.18);
  transition: transform .18s ease;
}

.toggle.on {
  background: rgba(16,185,129,0.22);
}
.toggle.on::after {
  transform: translateX(18px);
}

.sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-3);
}

.workspace-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
}
.workspace-status.connected { color: var(--mint); }
.workspace-status.disconnected { color: #dc2626; }

.dot-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.insight-card {
  display: grid;
  gap: 12px;
}

.gauge-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 210px;
}

.gauge-center {
  position: absolute;
  display: grid;
  place-items: center;
  text-align: center;
}

.gauge-value {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.06em;
}

.gauge-copy {
  font-size: 12px;
  color: var(--text-3);
}

.usage-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.94));
  padding: 16px;
}

.usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.usage-bars {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 40px;
  margin-left: auto;
}

.usage-bars span {
  width: 4px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--mint), var(--accent));
}

.alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.alert-row:last-child { border-bottom: none; }

.alert-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.alert-info {
  flex: 1;
  min-width: 0;
}

.alert-name {
  font-size: 13px;
  font-weight: 700;
}

.alert-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.alert-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.88);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  color: var(--text-1);
}
.av-purple { background: rgba(187,28,5,0.12); }
.av-teal   { background: rgba(16,185,129,0.12); }
.av-amber  { background: rgba(245,158,11,0.12); }
.av-red    { background: rgba(239,68,68,0.12); }
.av-green  { background: rgba(16,185,129,0.12); }

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

.card,
.table-card,
.workspace-card,
.chart-card,
.insight-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover,
.table-card:hover,
.workspace-card:hover,
.chart-card:hover,
.insight-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(187,28,5,0.12);
}

.btn,
.btn-outline,
.btn-ghost,
.btn-primary,
.btn-danger,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.btn:hover,
.btn-outline:hover,
.btn-ghost:hover,
.btn-primary:hover,
.btn-danger:hover,
.btn-icon:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-ghost,
.btn-outline {
  background: rgba(255,255,255,0.82);
  border-color: var(--line);
  color: var(--text-2);
}

.btn-danger {
  background: rgba(239,68,68,0.10);
  color: #dc2626;
  border-color: rgba(239,68,68,0.14);
}

.btn-sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  color: var(--text-2);
}
.btn-icon.danger {
  background: rgba(239,68,68,0.10);
  color: #dc2626;
}

.btn-ghost:hover,
.btn-outline:hover,
.btn-icon:hover {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text-1);
}

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.9);
  color: var(--text-1);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(187,28,5,0.38);
  box-shadow: 0 0 0 4px rgba(187,28,5,0.10);
  background: #fff;
}
.form-hint { margin-top: 6px; font-size: 11px; color: var(--text-3); }
.form-error { margin-top: 6px; font-size: 11px; color: #dc2626; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }

/* ── Flash source element (hidden after JS picks it up) ────── */
.flash { display: none; }

/* ── Toast container ─────────────────────────────────────── */
.toast-shelf {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

/* ── Individual toast ────────────────────────────────────── */
.toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 370px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: 0 8px 32px rgba(15,23,42,.13), 0 2px 8px rgba(15,23,42,.06);
  position: relative;
  overflow: hidden;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform .38s cubic-bezier(.34,1.56,.64,1), opacity .28s ease;
  border-left: 4px solid transparent;
}
.toast.toast-in {
  transform: translateX(0);
  opacity: 1;
}
.toast.toast-out {
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform .28s ease, opacity .22s ease;
}

/* Type colours */
.toast-success { border-left-color: #10b981; }
.toast-error   { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }
.toast-info    { border-left-color: #bb1c05; }

/* Icon bubble */
.toast-icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; margin-top: 1px;
}
.toast-success .toast-icon { background: rgba(16,185,129,.12);  color: #059669; }
.toast-error   .toast-icon { background: rgba(239,68,68,.12);   color: #dc2626; }
.toast-warning .toast-icon { background: rgba(245,158,11,.12);  color: #d97706; }
.toast-info    .toast-icon { background: rgba(187,28,5,.12);  color: #bb1c05; }

/* Body */
.toast-body { flex: 1; min-width: 0; }
.toast-title {
  font-size: 13.5px; font-weight: 800; color: #0f172a;
  line-height: 1.2; margin-bottom: 3px;
}
.toast-msg {
  font-size: 12.5px; color: #64748b; line-height: 1.5;
  word-break: break-word;
}

/* Close button */
.toast-close {
  background: none; border: none; cursor: pointer;
  color: #94a3b8; padding: 2px; line-height: 1;
  font-size: 16px; flex-shrink: 0;
  border-radius: 6px;
  transition: color .15s, background .15s;
  margin-top: -2px;
}
.toast-close:hover { color: #475569; background: #f1f5f9; }

/* Progress bar */
.toast-progress {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(15,23,42,.06);
}
.toast-progress-bar {
  height: 100%; width: 100%;
  transition: width linear;
  border-radius: 0 2px 2px 0;
}
.toast-success .toast-progress-bar { background: #10b981; }
.toast-error   .toast-progress-bar { background: #ef4444; }
.toast-warning .toast-progress-bar { background: #f59e0b; }
.toast-info    .toast-progress-bar { background: #bb1c05; }

@media (max-width: 480px) {
  .toast-shelf { top: 12px; right: 12px; left: 12px; }
  .toast { width: 100%; }
}

.consent-banner {
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.consent-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f59e0b, #fb7185);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

.consent-title { font-size: 15px; font-weight: 800; color: var(--text-1); }
.consent-desc { font-size: 13px; color: var(--text-3); margin-top: 4px; line-height: 1.55; }
.consent-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text-1);
  vertical-align: middle;
}
tbody tr:hover { background: rgba(187,28,5,0.03); }
tbody tr:last-child td { border-bottom: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.pill-active   { background: var(--mint-soft); color: var(--mint); }
.pill-expiring { background: rgba(245,158,11,0.12); color: #d97706; }
.pill-expired  { background: rgba(239,68,68,0.10); color: #dc2626; }
.pill-daily       { background: var(--accent-soft); color: var(--accent); }
.pill-daily_day   { background: rgba(217,119,6,0.12); color: #b45309; }
.pill-daily_night { background: rgba(30,41,59,0.10); color: #334155; }
.pill-weekly      { background: rgba(59,130,246,0.10); color: #2563eb; }
.pill-biweekly    { background: rgba(8,145,178,0.10); color: #0e7490; }
.pill-monthly     { background: var(--mint-soft); color: var(--mint); }
.pill-biannual    { background: rgba(244,114,182,0.10); color: #db2777; }
.pill-annual      { background: rgba(187,28,5,0.10); color: #bb1c05; }
.pill-sa       { background: var(--accent-soft); color: var(--accent); }
.pill-admin    { background: var(--mint-soft); color: var(--mint); }
.pill-employee { background: rgba(59,130,246,0.10); color: #2563eb; }
.pill-pending  { background: rgba(245,158,11,0.12); color: #d97706; }
.pill-approved { background: var(--mint-soft); color: var(--mint); }
.pill-denied   { background: rgba(239,68,68,0.10); color: #dc2626; }

.settings-grid {
  display: grid;
  grid-template-columns: 220px minmax(0,1fr);
  gap: 20px;
}

.settings-page {
  display: grid;
  gap: 18px;
}

.settings-hero {
  padding: 22px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(230px, 260px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-shell {
  display: grid;
  gap: 18px;
}

.settings-content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.settings-nav-card {
  position: sticky;
  top: calc(var(--header-h) + 18px);
}

.settings-nav-card .card-body {
  padding-top: 16px;
}

.settings-panel .card-head {
  padding-bottom: 16px;
}

.settings-panel .card-body {
  padding-bottom: 22px;
}

.settings-panel .table-wrap {
  margin-top: 0;
}

.settings-panel .logo-preview {
  border-radius: 16px;
  background: rgba(255,255,255,0.8);
  padding: 8px;
  border: 1px solid var(--line);
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.settings-nav-item:hover { background: rgba(187,28,5,0.06); color: var(--text-1); }
.settings-nav-item.active { background: rgba(187,28,5,0.12); color: var(--text-1); }
.settings-panel { display: none; }

.auth-page,
.setup-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card,
.setup-card {
  width: 100%;
  max-width: 440px;
  border-radius: 28px;
  padding: 32px 30px;
}

.auth-logo,
.setup-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.auth-logo-img,
.setup-logo-img {
  height: 42px;
  width: auto;
}

.auth-logo-text,
.setup-logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.auth-title,
.setup-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.04em;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text-1);
}

.auth-sub,
.setup-copy {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  margin-bottom: 22px;
}

.setup-kicker {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 10px;
}

.setup-error {
  background: rgba(239,68,68,0.10);
  color: #b91c1c;
  border: 1px solid rgba(239,68,68,0.14);
  padding: 10px 13px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 13px;
}

.setup-form .form-group { margin-bottom: 12px; }
.setup-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}
.setup-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(255,255,255,0.9);
  color: var(--text-1);
}
.setup-form button {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  margin-top: 6px;
}
.setup-note { margin-top: 14px; font-size: 12px; color: var(--text-3); }

.site-footer {
  margin-top: 18px;
  padding: 0 24px 20px;
  margin-left: var(--sidebar-w);
}

.footer-inner {
  max-width: 1540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 4px 0;
  border-top: 1px solid var(--line);
}

.footer-copy {
  font-size: 10px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(15,23,42,0.42);
  backdrop-filter: blur(10px);
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-box {
  width: min(100%, 720px);
  margin: auto;
  flex-shrink: 0;
  border-radius: 28px;
  padding: 20px;
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.modal-sub {
  margin-top: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-3);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 18px;
}

.logo-upload-area {
  border: 1px dashed rgba(15,23,42,0.16);
  border-radius: 18px;
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.logo-upload-area:hover {
  border-color: rgba(187,28,5,0.40);
  background: rgba(187,28,5,0.05);
}
.logo-preview {
  max-height: 56px;
  max-width: 180px;
  margin: 0 auto 10px;
}

.customer-photo-upload {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px dashed rgba(15,23,42,0.16);
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  margin-bottom: 18px;
}

.customer-photo-preview {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.customer-photo-copy {
  min-width: 0;
}

.customer-photo-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.customer-photo-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.45;
}

.customer-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.customer-cell-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(15,23,42,0.08);
}

.customer-cell-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(187,28,5,0.12);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.customer-cell-copy {
  min-width: 0;
}

.customer-cell-copy strong {
  display: block;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-cell-copy span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(380px, 100%);
  padding: 0 14px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.88);
  box-shadow: var(--shadow-sm);
}

.page-search i {
  color: var(--muted);
  font-size: 18px;
  flex-shrink: 0;
}

.page-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  color: var(--text-1);
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-tab {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.78);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.filter-tab:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.filter-tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.customer-section {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 13px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.section-head p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-3);
}

.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(16,185,129,0.12);
  color: #047857;
  font-size: 12px;
  font-weight: 700;
}

.section-count.muted {
  background: rgba(15,23,42,0.06);
  color: var(--text-2);
}

.customer-link {
  display: flex;
  text-decoration: none;
  color: inherit;
}

.customer-link:hover .customer-cell-copy strong {
  color: var(--accent);
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 18px;
  margin-bottom: 18px;
}

.detail-card .card-body {
  padding: 22px;
}

.detail-profile {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.detail-avatar-wrap {
  flex-shrink: 0;
}

.detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: var(--shadow-md);
}

.detail-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(187,28,5,0.12);
  color: var(--accent);
  font-size: 40px;
  font-weight: 800;
}

.detail-copy {
  min-width: 0;
  flex: 1;
}

.detail-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.detail-meta {
  display: flex;
  gap: 12px 18px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
}

.detail-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.detail-metric {
  padding: 14px;
  border-radius: 18px;
  background: rgba(248,250,252,0.9);
  border: 1px solid var(--line);
}

.detail-metric span {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.detail-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}

.detail-side {
  display: grid;
  gap: 18px;
}

.mini-stack {
  display: grid;
  gap: 12px;
}

.mini-stack > div {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(248,250,252,0.9);
  border: 1px solid var(--line);
}

.mini-stack span {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mini-stack strong {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.detail-side .card-title,
.detail-card .card-title {
  font-weight: 600;
}

.detail-shell .pill {
  font-weight: 600;
}

.detail-shell .btn {
  font-weight: 600;
}

.bank-banner {
  background: rgba(187,28,5,0.08);
  border: 1px solid rgba(187,28,5,0.14);
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.bank-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--mint));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

.stack-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
}

.muted {
  color: var(--text-3);
}

.hidden-mobile { display: block; }

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.profile-card,
.profile-side-card {
  overflow: hidden;
}

.profile-hero {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.profile-avatar-xl {
  width: 118px;
  height: 118px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(187,28,5,0.14), rgba(16,185,129,0.14));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.profile-main-copy {
  min-width: 0;
  flex: 1;
}

.profile-main-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-main-top h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.5vw, 38px);
  font-weight: 600;
  line-height: 1.05;
}

.profile-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  color: var(--text-3);
  margin-top: 10px;
  font-size: 12px;
}

.profile-meta-line span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-summary-strip {
  margin-top: 20px;
}

.profile-panels {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.profile-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,0.70);
  padding: 18px;
}

.profile-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.profile-location-list,
.detail-stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.profile-location-row,
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(248,250,252,0.82);
  border: 1px solid var(--line);
}

.profile-location-row strong,
.detail-row strong {
  font-weight: 600;
}

.detail-row span {
  color: var(--text-3);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.mini-stat {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(248,250,252,0.88);
  padding: 14px;
  display: grid;
  gap: 5px;
}

.mini-stat-label {
  color: var(--text-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.mini-stat-value {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.activity-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(187,28,5,0.08);
  flex-shrink: 0;
}

.activity-action {
  color: var(--text-1);
  font-size: 12px;
  font-weight: 600;
}

.activity-meta,
.profile-note {
  color: var(--text-3);
  font-size: 12px;
}

.profile-note {
  margin: 0;
  line-height: 1.7;
}

@media (max-width: 1320px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main";
  }

  .sidebar {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    z-index: 180;
    width: min(320px, 92vw);
    height: calc(100vh - var(--header-h));
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open { display: block; }
  .hamburger { display: inline-flex; }
  .site-footer { margin-left: 0; }
  .footer-inner { padding-top: 10px; }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-nav-card {
    position: static;
  }
}

@media (max-width: 860px) {
  .main-content { padding: 0 16px 20px; }
  .site-footer { padding: 0 16px 18px; }
  .header-inner { padding: 0 16px; gap: 10px; }
  .profile-copy { display: none; }
  .header-inner { flex-wrap: nowrap; }
  .header-nav { margin-left: 0; }
  .footer-copy { font-size: 10px; }
  .grid2,
  .grid3,
  .profile-layout,
  .form-row,
  .settings-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }
  .card-head,
  .card-body,
  .card > .table-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
  .summary-strip {
    grid-template-columns: 1fr;
  }
  .profile-hero {
    flex-direction: column;
  }
  .profile-avatar-xl {
    width: 96px;
    height: 96px;
    font-size: 34px;
  }
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }
  .profile-location-row,
  .detail-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .summary-card {
    min-height: auto;
    padding: 16px 18px;
  }
  .summary-card:not(:last-child)::after {
    top: auto;
    right: 18px;
    left: 18px;
    bottom: 0;
    width: auto;
    height: 1px;
  }
  .modal-overlay {
    padding: 16px;
  }
  .modal-box {
    padding: 18px;
    border-radius: 24px;
  }

}

@media (max-width: 640px) {
  .header-brand-mark { width: auto; height: 28px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .split-grid { grid-template-columns: 1fr; }
  .customer-photo-upload {
    flex-direction: column;
    align-items: flex-start;
  }
  .detail-shell {
    grid-template-columns: 1fr;
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-card,
  .chart-card,
  .table-card,
  .workspace-card,
  .insight-card { padding: 16px; }
  .hero-title { font-size: 28px; }
  .card-header { align-items: flex-start; }
  .sub-table th,
  .sub-table td { padding: 10px 0; }
  .responsive-table colgroup col:nth-child(1),
  .responsive-table colgroup col:nth-child(2),
  .responsive-table colgroup col:nth-child(3),
  .responsive-table colgroup col:nth-child(4),
  .responsive-table colgroup col:nth-child(5) { width: auto; }
  .footer-inner {
    justify-content: flex-start;
    gap: 8px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-avatar {
    width: 100px;
    height: 100px;
  }
  .detail-name {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .header-inner {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
  }
  .header-brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }
  .header-nav {
    flex: 0 0 auto;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-end;
  }
  .header-actions {
    margin-left: 0;
    gap: 6px;
  }
  .notif-wrap {
    flex-shrink: 0;
  }
  .header-settings,
  .header-logout,
  .hamburger {
    display: none !important;
  }
  .profile-chip {
    height: 42px;
    padding: 0 10px 0 6px;
  }
  .profile-copy {
    display: none !important;
  }
  .icon-chip, .profile-chip {
    height: 42px;
  }
  .icon-chip {
    width: 42px;
  }
  .header-brand-mark {
    height: 36px;
  }
  .header-nav {
    gap: 8px;
  }
}

/* ═══════════════════════════════════════════════════════
   CONTENT DENSITY OVERRIDE
   Tightens tables, avatars, cards, text across all pages.
   Sidebar and header untouched. Mobile unaffected.
   Appended only — nothing above changed.
   ═══════════════════════════════════════════════════════ */

@media (min-width: 1025px) {

  /* ── Table rows ── */
  thead th {
    padding: 9px 12px;
    font-size: 9px;
  }
  tbody td {
    padding: 9px 12px;
    font-size: 12px;
  }

  /* ── Customer avatars in table cells ── */
  .customer-cell-avatar,
  .customer-cell-initial {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
  }

  .user-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 10px !important;
  }

  /* ── Page heading ── */
  .page-hdr-left h1 {
    font-size: clamp(14px, 1.4vw, 18px);
  }
  .page-hdr-left p {
    font-size: 11px;
  }

  /* ── Section headings (Active customers, Expired users…) ── */
  .section-head h2 { font-size: 14px; }
  .section-head p  { font-size: 11px; }

  /* ── Card head ── */
  .card-head {
    padding-top: 13px;
    padding-bottom: 11px;
  }
  .card-title  { font-size: 12.5px; }
  .card-subtitle { font-size: 10px; }

  /* ── Pills ── */
  .pill {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* ── Filter tabs (All customers / Active / Expired) ── */
  .filter-tab {
    min-height: 32px;
    padding: 0 12px;
    font-size: 11px;
  }

  /* ── Buttons ── */
  .btn, .btn-outline, .btn-ghost,
  .btn-primary, .btn-danger {
    min-height: 32px;
    padding: 0 13px;
    font-size: 11.5px;
  }
  .btn-sm {
    min-height: 26px;
    padding: 0 10px;
    font-size: 10.5px;
  }
  .pill-btn {
    min-height: 32px;
    padding: 0 12px;
    font-size: 9.5px;
  }

  /* ── Section count badges (3 active, 0 expired) ── */
  .section-count {
    min-height: 26px;
    padding: 0 10px;
    font-size: 11px;
  }

  /* ── Alert rows (notifications / whatsapp) ── */
  .alert-name { font-size: 12px; }
  .alert-meta { font-size: 10px; }
  .alert-chip { font-size: 10px; padding: 3px 8px; }
  .alert-row  { padding: 9px 0; }

  /* ── Settings nav ── */
  .settings-nav-item {
    min-height: 34px;
    font-size: 11.5px;
  }

  /* ── Form inputs ── */
  .form-input,
  .form-select,
  .form-textarea {
    min-height: 36px;
    font-size: 12px;
    padding: 8px 12px;
  }
  .form-label { font-size: 11px; }

  /* ── Modal ── */
  .modal-title { font-size: 15px; }
  .modal-sub   { font-size: 11.5px; }

  /* ── Metric cards ── */
  .metric-val,
  .metric-value {
    font-size: clamp(13px, 1.1vw, 16px);
  }
  .metric-name { font-size: 8.5px; }
  .metric-badge { font-size: 9.5px; padding: 3px 7px; }

  /* ── Summary strip ── */
  .summary-value { font-size: clamp(22px, 3vw, 36px); }
  .summary-card  { min-height: 90px; padding: 14px 18px; }

  /* ── Hero ── */
  .hero-title { font-size: clamp(16px, 1.7vw, 24px); }
  .hero-copy  { font-size: 11px; }
  .hero-kicker { font-size: 9px; }

  /* ── Page search bar ── */
  .page-search {
    height: 36px;
    font-size: 12px;
  }

  /* ── Consent banner ── */
  .consent-title { font-size: 13px; }
  .consent-desc  { font-size: 11px; }

  /* ── Detail page ── */
  .detail-name { font-size: 20px; }
  .detail-avatar {
    width: 80px !important;
    height: 80px !important;
    border-radius: 18px !important;
  }
  .detail-avatar-placeholder {
    width: 80px !important;
    height: 80px !important;
    font-size: 28px !important;
  }

}
/* ════════════════════════════════════════════════════════
   RESPONSIVE — redesigned page components
   ════════════════════════════════════════════════════════ */

/* ── Page header: stack on small screens ─────────────── */
@media (max-width: 860px) {
  .page-hdr { flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 16px; }
  .page-tools { width: 100%; }
  .page-tools .form-input { width: 100% !important; }

  .cust-stats, .notif-stats, .pay-stats,
  .wa-stats, .sub-stats { grid-template-columns: 1fr 1fr !important; gap: 10px; }

  .cs-card, .cs2-card, .ss-card, .wa-stat, .ns-card, .pay-stat { padding: 14px 16px; }
  .cs-val, .cs2-val, .ss-val, .wa-stat-val, .ns-val { font-size: 18px; }
  .cs-icon, .cs2-icon, .ss-icon, .wa-stat-icon, .ns-icon, .pay-stat-icon { width: 38px; height: 38px; font-size: 17px; }

  .ph-card { flex-direction: column; gap: 16px; }
  .ph-right { align-items: flex-start; flex-direction: row; gap: 12px; }

  .snap-cols { gap: 12px; }
  .snap-col { flex: 0 0 calc(50% - 6px); min-width: 0; border-right: none !important; margin-right: 0 !important; padding-right: 0 !important; }

  .wa-row { flex-wrap: wrap; gap: 10px; }
  .txn-row { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 640px) {
  .cust-stats, .notif-stats, .pay-stats,
  .wa-stats, .sub-stats { grid-template-columns: 1fr !important; }
  .snap-col { flex: 0 0 100%; }
  .page-hdr h1 { font-size: 20px; }
  .ph-avatar { width: 72px; height: 72px; font-size: 26px; }
  .ph-name   { font-size: 18px; }
  .notif-dropdown { width: calc(100vw - 32px); right: -8px; }
}

/* ── Sticky column headers ────────────────────────────── */
.cust-list-wrap { position: relative; }
.cr-col-hdr { position: sticky; top: 0; z-index: 2; }
.sub-list-wrap { position: relative; }
.sr-col-hdr { position: sticky; top: 0; z-index: 2; }

/* ── Customer list: card layout on mobile ─────────────── */
@media (max-width: 768px) {
  .cr-col-hdr { display: none !important; }
  .cr {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
  }
  .cr-loc, .cr-plan, .cr-exp { display: none; }
  .cr-info { flex: 1; min-width: 0; }
  .cr-pill { flex-shrink: 0; }
}

/* ── Subscription list: card layout on mobile ─────────── */
@media (max-width: 768px) {
  .sr-col-hdr { display: none !important; }
  .sr {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
  }
  .sr-avatar   { flex-shrink: 0; }
  .sr-customer { flex: 1; min-width: 140px; }
  .sr-plan     { order: 3; }
  .sr-status   { order: 4; margin-left: auto; }
  .sr-loc      { order: 5; flex: 0 0 100%; font-size: 11.5px; }
  .sr-dates    { order: 6; flex: 0 0 100%; font-size: 11.5px; }
  .sr-amount   { order: 7; font-size: 13px; }
  .sr-channel  { display: none; }
}

/* ── Notification page on mobile ──────────────────────── */
@media (max-width: 768px) {
  .notif-tabs { flex-wrap: wrap; width: 100%; }
  .notif-tab  { flex: 1; justify-content: center; }
  .nl-item, .al-item, .al-row { flex-wrap: wrap; }
}

/* ── WhatsApp alert queue on mobile ───────────────────── */
@media (max-width: 640px) {
  .wa-row { gap: 8px; padding: 14px 16px; }
  .wa-expire { display: none; }
  .wa-btn    { padding: 7px 11px; font-size: 11.5px; }
  .wa-actions { gap: 6px; }
}

/* ── History/payment rows on customer detail ──────────── */
@media (max-width: 640px) {
  .hi { flex-wrap: wrap; gap: 6px; padding: 12px 16px; }
  .hi-dates { flex: 0 0 100%; order: 5; }
  .hi-by    { display: none; }
  .pr { flex-wrap: wrap; gap: 6px; padding: 12px 16px; }
  .pr-ref { flex: 0 0 100%; order: 5; }
  .pr-by  { display: none; }
}

/* ── Sidebar mobile overlay backdrop ─────────────────── */
@media (max-width: 1024px) {
  .sidebar.open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.35);
    z-index: -1;
    backdrop-filter: blur(2px);
  }
}

/* ════════════════════════════════════════════════════════
   MOBILE COMPREHENSIVE FIX
   ════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* ── Remove min-width so flex works properly ─────── */
  .cust-list      { min-width: 0 !important; }
  .sub-list       { min-width: 0 !important; }
  .cust-list-wrap { overflow-x: visible; }
  .sub-list-wrap  { overflow-x: visible; }

  /* ── Customer rows: 3-column card grid ──────────── */
  /* grid: [avatar] [name+phone+plan+expiry] [status] */
  .cr {
    display: grid !important;
    grid-template-columns: 48px 1fr auto !important;
    grid-template-rows: auto auto !important;
    column-gap: 12px !important;
    row-gap: 0 !important;
    align-items: center !important;
    padding: 14px 16px !important;
  }
  .cr-avatar {
    grid-column: 1;
    grid-row: 1 / 4;
    align-self: center;
    width: 44px; height: 44px;
  }
  .cr-info {
    grid-column: 2; grid-row: 1;
  }
  .cr-loc  {
    display: none !important;
  }
  .cr-plan {
    display: inline-flex !important;
    grid-column: 2; grid-row: 2;
    margin-top: 4px;
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(187,28,5,.08);
    color: var(--accent);
    font-weight: 700;
    width: fit-content;
  }
  .cr-exp {
    display: none !important;
  }
  .cr-pill {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    font-size: 10.5px;
    padding: 4px 10px;
  }

  /* ── Subscription rows: stacked card ────────────── */
  .sr {
    display: grid !important;
    grid-template-columns: 48px 1fr auto !important;
    grid-template-rows: auto auto auto !important;
    column-gap: 12px !important;
    row-gap: 0 !important;
    padding: 14px 16px !important;
    align-items: start !important;
  }
  .sr-avatar   { grid-column: 1; grid-row: 1 / 4; align-self: center; }
  .sr-customer { grid-column: 2; grid-row: 1; }
  .sr-status   { grid-column: 3; grid-row: 1 / 4; align-self: center; margin-left: 0; font-size: 10.5px; padding: 4px 10px; }

  .sr-plan {
    grid-column: 2; grid-row: 2;
    margin-top: 5px;
    font-size: 10.5px;
    padding: 2px 8px;
  }
  .sr-loc {
    grid-column: 2; grid-row: 3;
    font-size: 11px;
    margin-top: 3px;
    order: unset; flex: unset;
  }
  .sr-dates   { display: none !important; }
  .sr-amount  { display: none !important; }
  .sr-channel { display: none !important; }
}

/* ── Dashboard metrics: 2 cols on mobile ────────────── */
@media (max-width: 860px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
  }
}
@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Main content padding on mobile ─────────────────── */
@media (max-width: 640px) {
  .main-content { padding: 0 12px 20px; }

  /* Page header */
  .page-hdr { padding-top: 14px; margin-bottom: 14px; }
  .page-hdr h1 { font-size: 20px !important; }

  /* Stats grids: stack on phones */
  .cust-stats,
  .notif-stats,
  .pay-stats,
  .wa-stats,
  .sub-stats  { grid-template-columns: 1fr !important; gap: 8px; }

  /* Stat card */
  .cs-card, .cs2-card, .ss-card,
  .wa-stat, .ns-card, .pay-stat { padding: 12px 14px; gap: 10px; }
  .cs-icon, .cs2-icon, .ss-icon,
  .wa-stat-icon, .ns-icon, .pay-stat-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
  .cs-val, .cs2-val, .ss-val,
  .wa-stat-val, .ns-val { font-size: 17px; }
  .cs-lbl, .cs2-lbl, .ss-lbl,
  .wa-stat-lbl, .ns-lbl { font-size: 10.5px; }

  /* Cards */
  .card, .sub-list, .cust-list,
  .wa-queue, .alert-log, .txn-card,
  .notif-list-card, .alert-log-card,
  .pay-list, .hist-list { border-radius: 16px; }

  /* Section headers */
  .sec-hdr { margin-bottom: 10px; }
  .sec-hdr h2 { font-size: 14px; }

  /* Profile hero */
  .ph-card { padding: 18px; border-radius: 18px; }
  .ph-avatar { width: 68px; height: 68px; font-size: 24px; }
  .ph-name   { font-size: 17px; }
  .ph-contact { gap: 10px; }
  .ph-contact span { font-size: 12px; }

  /* Snapshot cols */
  .snap-card { padding: 16px; }
  .snap-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .snap-col  { flex: unset !important; min-width: 0; border-right: none !important; margin-right: 0 !important; padding-right: 0 !important; }

  /* History and payment rows */
  .hi { padding: 12px 14px; gap: 8px; }
  .hi-plan   { min-width: 60px; }
  .hi-dates  { display: none; }
  .hi-amount { min-width: 80px; font-size: 12.5px; }
  .hi-loc    { display: none; }
  .hi-by     { display: none; }
  .hi-status { font-size: 10.5px; padding: 3px 8px; }

  .pr { padding: 12px 14px; }
  .pr-amount { font-size: 14px; min-width: 90px; }
  .pr-ref    { display: none; }
  .pr-date   { font-size: 11px; }
  .pr-by     { display: none; }

  /* WA alert queue */
  .wa-row { padding: 14px; gap: 8px; }
  .wa-avatar { width: 38px; height: 38px; font-size: 14px; }
  .wa-name { font-size: 13px; }
  .wa-actions { width: 100%; justify-content: flex-start; }
  .wa-btn { flex: 1; justify-content: center; }

  /* Bank tracker */
  .bank-banner { padding: 16px 18px; gap: 12px; border-radius: 16px; }
  .bank-banner-icon { width: 42px; height: 42px; font-size: 20px; }
  .bank-banner-name { font-size: 14px; }
  .bank-banner-total-val { font-size: 18px; }

  .txn-row { padding: 13px 14px; gap: 8px; }
  .txn-avatar { width: 36px; height: 36px; font-size: 13px; }
  .txn-name   { font-size: 13px; }
  .txn-amount { font-size: 13px; min-width: 90px; }
  .txn-ref, .txn-channel-chip, .txn-date { display: none; }

  /* Notification list */
  .nl-item { padding: 12px 14px; gap: 10px; }
  .nl-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 9px; }
  .nl-title { font-size: 12px; }
  .nl-text  { font-size: 11px; }
  .al-row   { padding: 12px 14px; }

  /* Tabs */
  .cust-tabs, .notif-tabs { width: 100%; }
  .cust-tab, .notif-tab   { flex: 1; text-align: center; justify-content: center; padding: 8px 10px; font-size: 12px; }

  /* Reg form card */
  .reg-card-body { padding: 16px; }
  .reg-card-hdr  { padding: 14px 16px; }

  /* Dashboard hero and cards */
  .hero-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .hero-actions {
    width: 100%;
  }
  .hero-actions .pill-btn {
    flex: 1 1 100%;
    justify-content: center;
    min-width: 0;
  }
  .summary-strip {
    grid-template-columns: 1fr;
  }
  .summary-card {
    min-height: auto;
    padding: 16px 16px;
  }
  .summary-card:not(:last-child)::after {
    top: auto;
    right: 16px;
    left: 16px;
    bottom: 0;
    width: auto;
    height: 1px;
  }
  .metrics-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .metric-card {
    padding: 14px;
  }
  .metric-top {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .metric-badge {
    justify-self: start;
  }
  .dashboard-grid,
  .split-grid {
    grid-template-columns: 1fr !important;
  }
  .chart-card,
  .table-card,
  .workspace-card,
  .insight-card {
    padding: 14px;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .card-actions,
  .mini-pills {
    width: 100%;
  }
  .mini-pills {
    overflow-x: auto;
    justify-content: flex-start;
  }
  .mini-pill {
    flex: 1 0 auto;
    min-width: 0;
  }
}

/* ── Very small phones ────────────────────────────── */
@media (max-width: 380px) {
  .main-content { padding: 0 10px 16px; }
  .cs-val, .cs2-val { font-size: 15px; }
  .wa-btn { font-size: 11px; padding: 6px 9px; }
  .ph-name { font-size: 15px; }
}

/* ── Mobile sub-line in customer rows ─────────────── */
.cr-mobile-sub {
  display: none;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 768px) {
  .cr-mobile-sub { display: block; }
}

/* -------------------------------------------------------------
   Mobile iPhone-style bottom navigation
   ------------------------------------------------------------- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: block;
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(94vw, 560px);
    z-index: 520;
    pointer-events: none;
  }

  .mobile-bottom-nav-inner {
    pointer-events: auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px 9px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  }

  .mobile-nav-item {
    appearance: none;
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 54px;
    padding: 6px 4px 5px;
    border-radius: 18px;
    color: var(--text-3);
    transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
  }

  .mobile-nav-item:hover {
    transform: translateY(-1px);
    background: rgba(187, 28, 5, 0.06);
    color: var(--text-1);
  }

  .mobile-nav-item.active {
    background: linear-gradient(180deg, rgba(187, 28, 5, 0.14), rgba(187, 28, 5, 0.08));
    color: var(--ink);
    box-shadow: inset 0 0 0 1px rgba(187, 28, 5, 0.12);
  }

  .mobile-nav-icon {
    font-size: 20px;
    line-height: 1;
    color: currentColor;
  }

  .mobile-nav-label {
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: currentColor;
    white-space: nowrap;
  }

  .main-content {
    padding-bottom: calc(98px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 480px) {
  .mobile-bottom-nav {
    width: calc(100vw - 18px);
    bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav-inner {
    padding: 7px 8px 8px;
    gap: 4px;
    border-radius: 22px;
  }

  .mobile-nav-item {
    min-height: 50px;
    border-radius: 16px;
    padding: 5px 2px 4px;
  }

  .mobile-nav-icon {
    font-size: 18px;
  }

  .mobile-nav-label {
    font-size: 8px;
    letter-spacing: .06em;
  }
}

@media (max-width: 768px) {
  .mobile-more-menu.modal-overlay {
    align-items: end;
    padding: 18px 10px calc(18px + env(safe-area-inset-bottom));
    background: rgba(15,23,42,0.32);
    z-index: 540;
  }

  .mobile-more-sheet {
    width: min(100%, 560px);
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    margin: 0 auto;
    padding: 14px 14px 16px;
    border-radius: 28px;
    background: rgba(255,255,255,0.94);
    border: 1px solid rgba(15,23,42,0.08);
    box-shadow: 0 26px 70px rgba(15,23,42,0.22);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .mobile-more-handle {
    width: 56px;
    height: 5px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: rgba(15,23,42,0.14);
  }

  .mobile-more-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }

  .mobile-more-kicker {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .mobile-more-title {
    margin: 6px 0 0;
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1;
    letter-spacing: -0.06em;
    color: var(--ink);
  }

  .mobile-more-close {
    appearance: none;
    border: 1px solid rgba(15,23,42,0.08);
    background: rgba(255,255,255,0.9);
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
  }

  .mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 52px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(248,250,252,0.95);
    border: 1px solid rgba(15,23,42,0.06);
    color: var(--text-2);
    box-shadow: 0 6px 18px rgba(15,23,42,0.04);
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  }

  .mobile-more-item:hover {
    transform: translateY(-1px);
    background: #fff;
    border-color: rgba(187,28,5,0.14);
    box-shadow: 0 12px 26px rgba(15,23,42,0.08);
  }

  .mobile-more-item.active {
    background: linear-gradient(180deg, rgba(187,28,5,0.12), rgba(187,28,5,0.06));
    border-color: rgba(187,28,5,0.18);
    color: var(--ink);
  }

  .mobile-more-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(187,28,5,0.10);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
  }

  .mobile-more-item-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
  }

  .mobile-more-item-label {
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.15;
    color: inherit;
  }

  .mobile-more-item-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(15,23,42,0.08);
    color: var(--text-2);
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-more-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(15,23,42,0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-more-footer .mobile-more-item {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .mobile-more-menu.modal-overlay {
    padding: 14px 8px calc(14px + env(safe-area-inset-bottom));
  }

  .mobile-more-sheet {
    border-radius: 26px;
    padding: 12px 12px 14px;
  }

  .mobile-more-grid {
    gap: 8px;
  }

  .mobile-more-item {
    min-height: 48px;
    padding: 9px 10px;
    border-radius: 14px;
    gap: 9px;
  }

  .mobile-more-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: 14px;
  }

  .mobile-more-item-label {
    font-size: 11px;
  }
}

/* ── Mobile-wide polish for iPhone / Android ───────────── */
@media (max-width: 768px) {
  :root {
    --header-h: 64px;
    --sidebar-w: 100vw;
    --radius: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
  }

  html, body {
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    padding-top: var(--header-h);
  }

  .site-header {
    height: var(--header-h);
  }

  .header-inner {
    padding: 0 12px;
    gap: 8px;
  }

  .header-brand-mark {
    height: 32px;
  }

  .app-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }

  .sidebar {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    width: 100vw;
    max-width: 100vw;
    height: calc(100vh - var(--header-h));
    transform: translateX(-100%);
    transition: transform .22s ease;
    border-right: none;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    z-index: 480;
  }

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

  .sidebar-scroll {
    padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .main-content {
    margin-left: 0;
    padding: 0 12px calc(24px + env(safe-area-inset-bottom));
  }

  .page-hdr {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 16px;
    padding-bottom: 12px;
  }

  .page-hdr-left h1,
  .page-title,
  .hero-title,
  .section-head h2,
  .card-title {
    text-wrap: balance;
  }

  .page-hdr-left h1 {
    font-size: clamp(20px, 5vw, 26px);
    line-height: 1.12;
  }

  .page-hdr-left p,
  .page-hdr-sub,
  .card-subtitle,
  .card-sub {
    font-size: 12px;
    line-height: 1.45;
  }

  .btn,
  .btn-primary,
  .btn-ghost,
  .btn-outline,
  .btn-danger,
  .icon-chip,
  .profile-chip,
  .filter-tab,
  .sub-tab,
  .pill-btn {
    min-height: 40px;
  }

  .btn,
  .btn-primary,
  .btn-ghost,
  .btn-outline,
  .btn-danger {
    padding: 0 14px;
  }

  .btn-sm {
    min-height: 34px;
    padding: 0 12px;
  }

  .grid2,
  .grid3,
  .db-grid2,
  .db-grid3,
  .metrics-grid,
  .split-grid,
  .detail-grid,
  .summary-strip,
  .profile-stats-grid,
  .cust-stats,
  .notif-stats,
  .pay-stats,
  .wa-stats,
  .sub-stats {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .card,
  .hero-card,
  .chart-card,
  .table-card,
  .workspace-card,
  .insight-card,
  .section-card,
  .summary-card,
  .ph-card,
  .snap-card,
  .cs2-card,
  .cs-card,
  .ss-card,
  .wa-stat,
  .ns-card,
  .pay-stat,
  .db-card {
    border-radius: 18px;
  }

  .card,
  .hero-card,
  .chart-card,
  .table-card,
  .workspace-card,
  .insight-card,
  .section-card,
  .db-card {
    padding: 16px;
  }

  .summary-strip,
  .profile-hero,
  .detail-shell,
  .ph-card,
  .snap-cols {
    display: grid;
    grid-template-columns: 1fr !important;
  }

  .profile-hero,
  .ph-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .summary-strip,
  .snap-cols,
  .detail-shell {
    gap: 12px;
  }

  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-box {
    width: min(100%, 100%);
    max-width: 100%;
    border-radius: 22px 22px 18px 18px;
    padding: 16px;
  }

  .modal-title {
    font-size: 16px;
  }

  .modal-sub {
    font-size: 12px;
  }

  .modal-footer {
    gap: 8px;
  }

  .modal-footer .btn,
  .modal-footer .btn-primary,
  .modal-footer .btn-danger,
  .modal-footer .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .table-wrap,
  .cust-list-wrap,
  .sub-list-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 720px;
  }

  .responsive-table {
    min-width: 760px;
  }

  input,
  select,
  textarea,
  .form-input,
  .form-select,
  .form-textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .form-row,
  .detail-shell,
  .profile-hero,
  .snap-cols {
    grid-template-columns: 1fr !important;
  }

  .form-row {
    gap: 12px;
  }

  .notif-dropdown {
    width: calc(100vw - 24px);
    right: 0;
    max-width: calc(100vw - 24px);
  }

  .site-footer {
    padding: 16px 0 calc(18px + env(safe-area-inset-bottom));
  }

  .footer-inner {
    padding: 0 12px;
  }
}

@media (max-width: 480px) {
  :root {
    --header-h: 62px;
  }

  .header-inner {
    padding: 0 10px;
  }

  .header-nav {
    gap: 6px;
  }

  .icon-chip,
  .profile-chip {
    height: 40px;
  }

  .icon-chip {
    width: 40px;
  }

  .profile-chip {
    padding: 0 10px 0 6px;
  }

  .page-hdr-left h1 {
    font-size: 22px;
  }

  .page-hdr-left p {
    font-size: 11.5px;
  }

  .main-content {
    padding-left: 10px;
    padding-right: 10px;
  }

  .card,
  .hero-card,
  .chart-card,
  .table-card,
  .workspace-card,
  .insight-card,
  .section-card,
  .db-card {
    padding: 14px;
  }
}

/* â”€â”€ Subscription rows: cleaner stacked cards on phones â”€â”€ */
@media (max-width: 640px) {
  .sub-list {
    overflow-x: hidden !important;
  }

  .sr-col-hdr {
    display: none !important;
  }

  .sr {
    position: relative;
    min-width: 0 !important;
    width: 100%;
    display: block !important;
    padding: 14px 14px 12px !important;
    padding-right: 92px !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    overflow: hidden;
  }

  .sr-avatar {
    float: left;
    width: 42px;
    height: 42px;
    margin: 2px 10px 0 0;
  }

  .sr-customer {
    display: block;
    min-width: 0;
    margin-left: 52px;
  }

  .sr-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .sr-phone {
    font-size: 11px;
    line-height: 1.35;
  }

  .sr-plan {
    display: inline-flex;
    clear: left;
    margin: 8px 0 0 52px;
    padding: 4px 9px;
    font-size: 10.5px;
    white-space: nowrap;
  }

  .sr-loc {
    display: flex !important;
    align-items: center;
    min-width: 0;
    white-space: normal;
    line-height: 1.35;
    font-size: 11px;
    overflow-wrap: anywhere;
    clear: left;
    margin: 6px 0 0 52px;
  }

  .sr-dates-wrap {
    display: flex !important;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    clear: left;
    margin: 6px 0 0 52px;
  }

  .sr-dates {
    display: block !important;
    font-size: 11px;
    line-height: 1.35;
  }

  .sr-days {
    font-size: 10.5px;
    line-height: 1.2;
    margin-top: 3px;
  }

  .sr-amount {
    display: block !important;
    clear: left;
    margin: 8px 0 0 52px;
    font-size: 14px;
    font-weight: 800;
    padding-top: 0;
  }

  .sr-status {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 10px;
    padding: 4px 9px;
  }

  .sr-actions {
    position: absolute;
    right: 14px;
    bottom: 12px;
    display: flex;
    gap: 6px;
  }

  .sr-actions form {
    display: inline-flex;
    margin: 0;
  }

  .sr-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 10px;
  }

  .sr-btn i {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .sr {
    padding: 13px 12px 12px !important;
    padding-right: 84px !important;
  }

  .sr-avatar {
    width: 38px;
    height: 38px;
    margin-top: 1px;
  }

  .sr-customer,
  .sr-plan,
  .sr-loc,
  .sr-dates-wrap,
  .sr-amount {
    margin-left: 46px;
  }

  .sr-name {
    font-size: 13.5px;
  }

  .sr-plan,
  .sr-status {
    font-size: 9.5px;
  }

  .sr-amount {
    font-size: 13px;
  }

  .sr-btn {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .sr-status {
    top: 12px;
    right: 12px;
  }

  .sr-actions {
    right: 12px;
    bottom: 11px;
  }
}
