/* Jewellery Showroom CRM — Warm Ivory Light & Obsidian Dark Dual Theme */

:root {
  color-scheme: light dark;

  /* Default: Top-Notch Warm Alabaster & Champagne Gold Luxury Light Theme */
  --bg: #f6f3ee;
  --bg-grad:
    radial-gradient(1040px 600px at 84% -12%, rgba(212, 168, 95, 0.14), transparent 62%),
    radial-gradient(780px 540px at 6% 100%, rgba(184, 130, 46, 0.08), transparent 60%),
    #f6f3ee;
  --sidebar: #fdfbf8;
  --topbar-bg: rgba(253, 251, 248, 0.86);
  --surface: #ffffff;
  --surface-2: #f2ede5;
  --surface-hover: #ebe4da;
  --well: #f9f6f1;
  --line: rgba(132, 104, 72, 0.15);
  --line-strong: rgba(154, 115, 62, 0.34);

  --text: #171310;
  --text-2: #4e433a;
  --muted: #7f7165;
  --bronze: #9a713d;
  --gold: #b8822e;
  --gold-2: #8a5c16;
  --gold-soft: rgba(184, 130, 46, 0.11);

  --active-pill: #181412;
  --active-pill-fg: #fbf8f3;

  --green: #128c50;
  --green-bg: rgba(18, 140, 80, 0.09);
  --amber: #b86a14;
  --amber-bg: rgba(184, 106, 20, 0.10);
  --red: #c93b2e;
  --red-bg: rgba(201, 59, 46, 0.09);
  --whatsapp: #169c4d;

  --shadow: 0 6px 24px rgba(42, 30, 18, 0.048), 0 1px 2px rgba(42, 30, 18, 0.036);
  --shadow-lg: 0 22px 54px rgba(34, 24, 14, 0.14);
  --radius: 18px;
  --radius-sm: 13px;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]),
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b0a09;
  --bg-grad:
    radial-gradient(960px 580px at 80% -10%, rgba(193, 145, 77, 0.15), transparent 62%),
    radial-gradient(740px 520px at 10% 100%, rgba(145, 95, 50, 0.11), transparent 64%),
    #0b0a09;
  --sidebar: #12100f;
  --topbar-bg: rgba(18, 15, 13, 0.86);
  --surface: #181412;
  --surface-2: #211b18;
  --surface-hover: #2a221e;
  --well: #1f1a17;
  --line: rgba(222, 186, 142, 0.13);
  --line-strong: rgba(222, 186, 142, 0.28);

  --text: #f7f3ee;
  --text-2: #cbbeb3;
  --muted: #8f8278;
  --bronze: #dfbb96;
  --gold: #dfa955;
  --gold-2: #f3c87c;
  --gold-soft: rgba(223, 169, 85, 0.14);

  --active-pill: #f6efe9;
  --active-pill-fg: #181412;

  --green: #38d98b;
  --green-bg: rgba(56, 217, 139, 0.13);
  --amber: #f5aa42;
  --amber-bg: rgba(245, 170, 66, 0.14);
  --red: #f16f61;
  --red-bg: rgba(241, 111, 97, 0.14);
  --whatsapp: #25d366;

  --shadow: 0 14px 36px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-lg: 0 28px 68px rgba(0, 0, 0, 0.65);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg-grad);
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.24s ease, color 0.24s ease;
}

h1, h2, h3, .font-display, .kpi-value, .clock-digit {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

svg {
  display: block;
}

.app-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   FULL EXPANDED SIDEBAR (DESKTOP DEFAULT)
   ========================================================= */

.app-shell {
  min-height: 100dvh;
  display: flex;
}

.sidebar {
  width: 260px;
  flex: 0 0 260px;
  height: 100dvh;
  position: sticky;
  top: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: background-color 0.24s ease;
}

.brand-lockup {
  height: 76px;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.brand-lockup:hover {
  background: var(--surface);
}

.brand-badge {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface);
  display: grid;
  place-items: center;
  flex: none;
}

.brand-octagon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.brand-initials {
  position: relative;
  z-index: 1;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--bronze);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.brand-copy strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn.sidebar-close {
  display: none;
  margin-left: auto;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 14px 18px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.sidebar-scroll:hover {
  scrollbar-color: var(--line-strong) transparent;
}

.nav-group {
  margin-bottom: 14px;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 4px 10px 6px;
}

.nav-item {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  margin-bottom: 3px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background-color 0.15s cubic-bezier(0.2, 0, 0, 1), color 0.15s ease, transform 0.12s ease;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item:active {
  transform: scale(0.985);
}

.nav-item.active {
  background: var(--active-pill);
  color: var(--active-pill-fg);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.nav-icon {
  display: grid;
  place-items: center;
  flex: none;
}

.nav-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item.active .whatsapp-icon {
  color: var(--active-pill-fg);
}

.whatsapp-icon {
  color: var(--whatsapp);
}

.nav-count {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  color: var(--gold-2);
}

.nav-item.active .nav-count {
  background: rgba(255, 255, 255, 0.2);
  color: var(--active-pill-fg);
}

.sidebar-footer {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.integration-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 11.5px;
  font-weight: 600;
}

.integration-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--whatsapp);
  box-shadow: 0 0 0 3px var(--green-bg);
  flex: none;
}

/* =========================================================
   MAIN SHELL & DOCKED FULL-WIDTH TOPBAR
   ========================================================= */

.main-shell {
  flex: 1;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.topbar {
  height: 76px;
  min-height: 76px;
  width: 100%;
  margin: 0;
  background: var(--sidebar);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 25;
  transition: background-color 0.24s ease, border-color 0.24s ease;
}

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

.topbar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.icon-btn.mobile-menu {
  display: none;
}

.global-search {
  position: relative;
  flex: 1;
  max-width: 390px;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 40px;
  border-radius: 999px;
  background: var(--well);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.global-search:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.global-search input {
  border: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  outline: none;
  font-size: 13px;
  color: var(--text);
}

.global-search input::placeholder {
  color: var(--muted);
}

.global-search kbd {
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text-2);
  display: grid;
  place-items: center;
  position: relative;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.theme-toggle {
  overflow: visible;
  isolation: isolate;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--gold-soft), 0 6px 16px rgba(184, 130, 46, 0.16);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-glyph {
  position: relative;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

.theme-icon {
  display: grid;
  place-items: center;
}

.theme-icon-sun {
  display: none;
  color: var(--gold-2);
}

.theme-icon-moon {
  display: grid;
  color: var(--bronze);
  transition: color 0.15s ease;
}

.theme-toggle:hover .theme-icon-moon {
  color: var(--text);
}

.theme-label-to-dark { display: inline; }
.theme-label-to-light { display: none; }

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-sun,
[data-theme="dark"] .theme-icon-sun {
  display: grid;
  filter: drop-shadow(0 0 6px rgba(243, 200, 124, 0.42));
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-moon,
[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-label-to-dark,
[data-theme="dark"] .theme-label-to-dark {
  display: none;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-label-to-light,
[data-theme="dark"] .theme-label-to-light {
  display: inline;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid var(--well);
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--well);
  transition: border-color 0.15s ease;
}

.profile-trigger:hover {
  border-color: var(--line-strong);
}

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--active-pill);
  color: var(--active-pill-fg);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.profile-copy {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.profile-copy strong {
  font-size: 12px;
  font-weight: 600;
}

.profile-copy small {
  font-size: 10px;
  color: var(--muted);
}

/* =========================================================
   CARDS & SNAPPY MICRO-ANIMATIONS
   ========================================================= */

.main-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 26px 28px;
}

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1), border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 30px rgba(42, 30, 18, 0.08), 0 2px 4px rgba(42, 30, 18, 0.04);
}

[data-theme="dark"] .card-interactive:hover {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card-interactive:active {
  transform: scale(0.99);
}

/* Snappy Staggered Entrance (dynamic-sibling-animations) */
@keyframes cardRiseIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.kpi-grid > .kpi-card,
.hero-strip > .card,
.dashboard-split > .card,
.operations-grid > .card,
.stat-strip > .mini-stat,
.report-kpis > .mini-stat,
.customer-grid > .customer-card,
.catalogue-grid > .catalogue-item,
.rate-grid > .rate-card {
  --stagger-step: 0.03s;
  animation: cardRiseIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@supports (animation-delay: calc(sibling-index() * 0.1s)) {
  .kpi-grid > .kpi-card,
  .hero-strip > .card,
  .dashboard-split > .card,
  .operations-grid > .card,
  .stat-strip > .mini-stat,
  .report-kpis > .mini-stat,
  .customer-grid > .customer-card,
  .catalogue-grid > .catalogue-item,
  .rate-grid > .rate-card {
    animation-delay: calc((sibling-index() - 1) * var(--stagger-step));
  }
}

@supports not (animation-delay: calc(sibling-index() * 0.1s)) {
  .kpi-grid > .kpi-card:nth-child(2),
  .hero-strip > .card:nth-child(2),
  .dashboard-split > .card:nth-child(2),
  .operations-grid > .card:nth-child(2),
  .report-kpis > .mini-stat:nth-child(2) {
    animation-delay: 0.03s;
  }
  .kpi-grid > .kpi-card:nth-child(3),
  .operations-grid > .card:nth-child(3),
  .report-kpis > .mini-stat:nth-child(3) {
    animation-delay: 0.06s;
  }
  .kpi-grid > .kpi-card:nth-child(4),
  .report-kpis > .mini-stat:nth-child(4) {
    animation-delay: 0.09s;
  }
}

/* Row 1: Greeting + Clock & Zero-Star Bullion Strip */
.hero-strip {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
}

.greeting-card {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.greeting-copy h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.greeting-date {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-2);
}

.greeting-date svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.clock-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.clock-digit {
  min-width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--well);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--bronze);
  font-variant-numeric: tabular-nums;
}

.clock-sep {
  font-weight: 700;
  font-size: 17px;
  color: var(--muted);
}

.highlight-card {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.highlight-pill {
  flex: 1;
  min-width: 220px;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.bullion-live-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bullion-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
  flex: none;
}

.purity-chip {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.highlight-rate-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.highlight-rate-wrap strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.highlight-rate-wrap small {
  font-size: 11px;
  color: var(--muted);
}

.purity-switch {
  display: inline-flex;
  gap: 4px;
}

.purity-switch button {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.14s ease;
}

.purity-switch button.active {
  background: var(--active-pill);
  color: var(--active-pill-fg);
  border-color: transparent;
}

.highlight-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Row 2: 4 KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--well);
  border: 1px solid var(--line);
  color: var(--text-2);
  display: grid;
  place-items: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.kpi-card:hover .kpi-icon {
  border-color: var(--gold);
  color: var(--gold-2);
}

.kpi-value {
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--bronze);
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kpi-sub strong {
  color: var(--text-2);
  font-weight: 600;
}

/* Row 3: Sales Chart */
.sales-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--well);
  border: 1px solid var(--line);
}

.chart-filter button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 9px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.chart-filter button.active {
  background: var(--active-pill);
  color: var(--active-pill-fg);
}

.sort-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.sort-pill:hover {
  border-color: var(--gold);
  color: var(--text);
}

.sales-chart-well {
  position: relative;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px 14px;
}

.sales-chart {
  width: 100%;
  height: 220px;
  overflow: visible;
}

.chart-gridline {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis-text {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.sales-area {
  opacity: 0;
  animation: areaFadeIn 0.36s ease 0.12s forwards;
}

.sales-path {
  fill: none;
  stroke: var(--bronze);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
  animation: chartStrokeDraw 0.52s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.enquiry-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-dasharray: 5 5;
  opacity: 0.7;
}

@keyframes chartStrokeDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes areaFadeIn {
  to { opacity: 1; }
}

.chart-node-dot {
  fill: var(--well);
  stroke: var(--bronze);
  stroke-width: 2.2;
  transition: r 0.14s ease, fill 0.14s ease, stroke-width 0.14s ease;
  cursor: pointer;
}

.chart-node-group:hover .chart-node-dot,
.chart-node-group.active .chart-node-dot {
  r: 5.5;
  fill: var(--gold);
  stroke: var(--well);
  stroke-width: 2.5;
}

.chart-crosshair {
  stroke: var(--gold);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.chart-crosshair.show {
  opacity: 0.7;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(255, 252, 249, 0.96);
  color: var(--text);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 11.5px;
  box-shadow: 0 12px 30px rgba(32, 22, 16, 0.16);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease, left 0.1s ease, top 0.1s ease;
  z-index: 12;
  min-width: 152px;
}

[data-theme="dark"] .chart-tooltip {
  background: rgba(24, 19, 16, 0.94);
  color: var(--text);
  border-color: rgba(223, 169, 85, 0.34);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  left: calc(50% + var(--arrow-shift, 0px));
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: inherit;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  transform: translateX(-50%) rotate(45deg);
}

[data-theme="dark"] .chart-tooltip::after {
  border-right-color: rgba(223, 169, 85, 0.34);
  border-bottom-color: rgba(223, 169, 85, 0.34);
}

.chart-tooltip.flipped::after {
  bottom: auto;
  top: -6px;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
}

[data-theme="dark"] .chart-tooltip.flipped::after {
  border-left-color: rgba(223, 169, 85, 0.34);
  border-top-color: rgba(223, 169, 85, 0.34);
}

.chart-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.chart-tip-head {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 5px;
}

.chart-tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 11.5px;
  line-height: 1.5;
}

.chart-tip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
}

.chart-tip-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}

.chart-tip-dot.sales { background: var(--bronze); }
.chart-tip-dot.enq { background: var(--gold); }

.chart-tip-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.chart-tip-val.gold {
  color: var(--gold-2);
}

.chart-progress-track {
  margin-top: 10px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.chart-progress-fill {
  height: 100%;
  width: 62%;
  border-radius: 999px;
  background: var(--bronze);
  transition: width 0.35s ease;
}

/* Row 4: Recent Orders & Top Products with Luxury Photo Frames */
.dashboard-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.view-all-pill {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.view-all-pill:hover {
  border-color: var(--gold);
  color: var(--text);
}

.ref-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--well);
  border: 1px solid var(--line);
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1), border-color 0.15s ease;
}

.ref-row:hover {
  transform: translateX(3px);
  border-color: var(--line-strong);
}

.ref-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1.4;
}

.jewel-thumb {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}

.jewel-thumb svg {
  width: 24px;
  height: 24px;
}

.jewel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.24s ease;
}

.ref-row:hover .jewel-img,
.catalogue-item:hover .jewel-img {
  transform: scale(1.05);
}

.inv-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: none;
}

.ref-item-copy {
  min-width: 0;
}

.ref-item-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ref-item-copy small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.ref-mid {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.ref-mid strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.ref-mid small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.ref-price {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ref-price strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.ref-price small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.medal-badge {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
}

/* Row 5: Operations Grid */
.operations-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr 0.9fr;
  gap: 16px;
}

.enquiry-list,
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.enquiry-row,
.task-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--well);
  border: 1px solid var(--line);
  transition: border-color 0.15s ease;
}

.enquiry-row:hover,
.task-row:hover {
  border-color: var(--line-strong);
}

.enquiry-info,
.task-info {
  flex: 1;
  min-width: 0;
}

.enquiry-info strong,
.task-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.enquiry-info small,
.task-info small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-row.completed .task-info strong {
  text-decoration: line-through;
  color: var(--muted);
}

.task-check {
  width: 17px;
  height: 17px;
  accent-color: var(--gold-2);
  cursor: pointer;
  flex: none;
}

.task-due {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--red-bg);
  color: var(--red);
  white-space: nowrap;
}

.task-due.tomorrow {
  background: var(--surface-2);
  color: var(--text-2);
}

.wa-brand-icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

.wa-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.wa-mini {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(37, 211, 102, 0.25);
  background: var(--green-bg);
  color: var(--whatsapp);
  display: grid;
  place-items: center;
  flex: none;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.wa-mini:hover {
  transform: translateY(-1px) scale(1.05);
  border-color: rgba(37, 211, 102, 0.55);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.22);
}

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

.quick-action {
  padding: 13px 10px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.quick-action svg {
  color: var(--gold-2);
}

.quick-action:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: var(--surface-2);
}

/* =========================================================
   BUTTONS, BADGES, INNER PAGES & PRODUCT IMAGE UPLOAD
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.985); }

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 10px;
}

.btn-primary {
  background: var(--active-pill);
  color: var(--active-pill-fg);
}

.btn-secondary {
  background: var(--gold-soft);
  border-color: var(--line-strong);
  color: var(--gold-2);
}

.btn-ghost {
  background: var(--well);
  border-color: var(--line);
  color: var(--text-2);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-danger {
  background: var(--red-bg);
  border-color: rgba(207, 68, 54, 0.25);
  color: var(--red);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}

.avatar.a { background: rgba(193, 145, 77, 0.18); color: var(--gold-2); }
.avatar.b { background: rgba(22, 156, 91, 0.16); color: var(--green); }
.avatar.c { background: rgba(135, 108, 198, 0.18); color: #8c6ec9; }
.avatar.d { background: rgba(207, 68, 54, 0.16); color: var(--red); }
.avatar.e { background: rgba(45, 156, 175, 0.16); color: #2b8ea0; }

.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--green-bg);
  color: var(--green);
  white-space: nowrap;
}

.status.warning { background: var(--amber-bg); color: var(--amber); }
.status.danger { background: var(--red-bg); color: var(--red); }
.status.neutral { background: var(--surface-2); color: var(--text-2); }

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-heading h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.page-heading p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.heading-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  height: 38px;
  border-radius: 11px;
  background: var(--well);
  border: 1px solid var(--line);
  min-width: 260px;
  color: var(--muted);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-field:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.search-field input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 13px;
  color: var(--text);
}

.select-control,
.form-control,
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select-control:focus,
.form-control:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.select-control { width: auto; height: 38px; padding: 0 12px; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mini-stat {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  overflow: hidden;
}

.mini-stat small {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.mini-stat strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.mini-stat em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--well);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 0.14s ease; }
tbody tr:hover td { background: var(--well); }

.person-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.person-cell small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.row-action {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.row-action:hover {
  border-color: var(--gold);
  color: var(--text);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.row-action.convert-btn { color: var(--gold-2); background: var(--gold-soft); border-color: rgba(193, 145, 77, 0.25); }

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--well);
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(345px, 1fr));
  gap: 16px;
}

.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 16px;
}

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.customer-card,
.catalogue-item,
.info-card {
  padding: 18px;
}

.customer-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.customer-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.customer-card-top strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.customer-card-top small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.customer-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--well);
  border: 1px solid var(--line);
}

.customer-meta.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-meta small {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.customer-meta strong {
  display: block;
  margin-top: 3px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.customer-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: auto;
  flex-wrap: nowrap;
}

.customer-primary-btns {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.rate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.rate-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rate-card small {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.rate-card strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  color: var(--bronze);
  font-variant-numeric: tabular-nums;
}

.rate-card span {
  font-size: 11.5px;
  color: var(--muted);
}

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.quote-summary {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--well);
  border: 1px solid var(--line);
}

.quote-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

.quote-line strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.quote-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}

.quote-total strong {
  font-size: 19px;
  color: var(--bronze);
  font-variant-numeric: tabular-nums;
}

/* Luxury 4:3 Catalogue Photo Card */
.catalogue-art {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 164px;
  border-radius: 14px;
  background: var(--well);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  overflow: hidden;
  color: var(--gold-2);
}

.catalogue-art svg {
  width: 44px;
  height: 44px;
}

.catalogue-overlay-pill {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(18, 15, 13, 0.78);
  color: #ffffff;
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 600;
}

.catalogue-stock-pill {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(18, 15, 13, 0.72);
  color: #f3c87c;
  border: 1px solid rgba(223, 169, 85, 0.35);
  backdrop-filter: blur(8px);
  font-size: 10.5px;
  font-weight: 700;
}

.catalogue-copy strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.catalogue-copy small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }

.catalogue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  flex-wrap: nowrap;
}

.catalogue-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--bronze);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Product Image Upload Box in Modal */
.img-upload-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: var(--well);
  border: 1px dashed var(--line-strong);
  flex-wrap: wrap;
}

.img-preview-box {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: none;
}

.img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-upload-controls {
  flex: 1;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.campaign-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.campaign-card h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.campaign-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--well);
  border: 1px solid var(--line);
}

.progress {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--bronze);
  border-radius: 999px;
}

.campaign-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.inline-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 14px;
  background: var(--well);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}

/* P&L & Expense Breakdown Rows */
.pnl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.pnl-row.total {
  border-top: 1.5px solid var(--line-strong);
  border-bottom: 0;
  padding-top: 12px;
  font-weight: 700;
  font-size: 15px;
}

.exp-bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 0;
}

.exp-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

/* WhatsApp Broadcast Studio Card */
.wa-bubble-preview {
  padding: 12px;
  border-radius: 14px;
  background: var(--green-bg);
  border: 1px solid rgba(24, 163, 80, 0.28);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.wa-bubble-img-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  max-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-bubble-img-wrap img {
  width: 100%;
  max-height: 210px;
  object-fit: cover;
  display: block;
}

.wa-bubble-img-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 13, 12, 0.78);
  color: #f7f3ee;
  font-size: 10.5px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.wa-bubble-img-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 13, 12, 0.76);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wa-bubble-img-clear:hover {
  background: var(--red);
}

.wa-bubble-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
}

.wa-photo-section {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--well);
  border: 1px solid var(--line);
}

.wa-photo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.wa-photo-head label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0;
}

.wa-photo-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.wa-photo-chip {
  flex: 0 0 98px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, transform 0.14s ease, background 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wa-photo-chip:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.wa-photo-chip.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: 0 0 0 1px var(--gold);
}

.wa-photo-chip-thumb {
  width: 100%;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-photo-chip-thumb img,
.wa-photo-chip-thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wa-photo-chip strong {
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.wa-photo-chip small {
  font-size: 9.5px;
  color: var(--muted);
  display: block;
}

.wa-photo-upload-tile {
  flex: 0 0 98px;
  padding: 6px;
  border-radius: 12px;
  border: 1.5px dashed var(--line-strong);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.wa-photo-upload-tile:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--text);
}

.wa-photo-upload-tile input {
  display: none;
}

.wa-queue-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: var(--well);
  border: 1px solid var(--line);
}

.wa-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.wa-queue-head strong {
  font-size: 12.5px;
}

.wa-queue-list {
  margin-top: 10px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.wa-queue-list::-webkit-scrollbar,
.wa-photo-strip::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.wa-queue-list::-webkit-scrollbar-track,
.wa-photo-strip::-webkit-scrollbar-track {
  background: transparent;
}

.wa-queue-list::-webkit-scrollbar-thumb,
.wa-photo-strip::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
}

.wa-queue-list::-webkit-scrollbar-thumb:hover,
.wa-photo-strip::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

.wa-row-send-btn {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(37, 211, 102, 0.28);
  padding: 6px 12px;
}

.wa-row-send-btn:hover {
  background: var(--whatsapp);
  color: #ffffff;
  border-color: var(--whatsapp);
}

.wa-queue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.wa-queue-row.sent {
  border-color: rgba(24, 163, 80, 0.32);
  background: var(--green-bg);
}

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

.wa-queue-info strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-queue-info small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
}

.wa-queue-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}

.wa-cost-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--well);
  border: 1px solid var(--line);
}

.wa-cost-box small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
}

.wa-cost-box strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  color: var(--bronze);
  font-variant-numeric: tabular-nums;
}

.row-action.danger-action:hover {
  color: var(--red);
  border-color: rgba(201, 59, 46, 0.35);
  background: var(--red-bg);
}

.empty-state {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

/* Helpers */
.grid { display: grid; gap: 16px; }
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-8 { gap: 8px; }
.mt-12 { margin-top: 12px; }
.mb-14 { margin-bottom: 14px; }
.muted { color: var(--muted); }
.subtle { font-size: 12px; color: var(--muted); }
.text-gold { color: var(--bronze); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

/* =========================================================
   POPOVERS, MODALS & TOASTS
   ========================================================= */

.popover-wrap { position: relative; }

.popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
  display: none;
  z-index: 40;
}

.popover.show { display: block; }
.profile-popover { width: 205px; }

.profile-popover button {
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
}

.profile-popover button:hover { background: var(--well); }

.popover-title {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 6px 8px;
}

.notification-row {
  display: flex;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 11px;
}

.notification-row:hover { background: var(--well); }
.notification-row strong { display: block; font-size: 12px; }
.notification-row small { color: var(--muted); font-size: 11px; }

.notif-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
}

.notif-icon.gold { background: var(--gold-soft); color: var(--gold-2); }
.notif-icon.green { background: var(--green-bg); color: var(--green); }
.notif-icon.amber { background: var(--amber-bg); color: var(--amber); }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  z-index: 40;
}

.search-results.show { display: block; }

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.search-result:hover { background: var(--well); }
.search-result strong { display: block; font-size: 13px; }
.search-result small { color: var(--muted); font-size: 11px; }

.modal-root:empty { display: none; }

.modal-root {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 11, 8, 0.56);
  backdrop-filter: blur(8px);
  z-index: 100;
}

.modal {
  width: min(580px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  animation: cardRiseIn 0.17s ease both;
}

.modal.modal-wide { width: min(740px, 100%); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--well);
  font-size: 18px;
  line-height: 1;
}

.modal-body { padding: 18px 22px; }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}

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

.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field-help { font-size: 11px; color: var(--muted); }

.message-preview {
  padding: 14px;
  border-radius: 14px;
  background: var(--green-bg);
  border: 1px solid rgba(24, 163, 80, 0.25);
  margin-bottom: 12px;
}

.message-preview small { font-size: 10px; font-weight: 700; color: var(--green); }

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--active-pill);
  color: var(--active-pill-fg);
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  animation: cardRiseIn 0.2s ease;
}

.toast i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.toast.error i { background: var(--red); }
.toast strong { display: block; font-size: 13px; }
.toast small { display: block; font-size: 11px; opacity: 0.8; }

.app-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  padding: 16px 26px 22px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.mobile-backdrop { display: none; }
.print-only { display: none; }

/* =========================================================
   THEME TRANSITION ANIMATION (VIEW TRANSITIONS + GOLDEN DAWN HALO)
   ========================================================= */

html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: none !important;
}

::view-transition-group(root) {
  z-index: 1;
  animation: none;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
  height: 100%;
}

:root[data-theme-transition="to-light"]::view-transition-old(root) { z-index: 1; }
:root[data-theme-transition="to-light"]::view-transition-new(root) { z-index: 2; }
:root[data-theme-transition="to-dark"]::view-transition-new(root) { z-index: 1; }
:root[data-theme-transition="to-dark"]::view-transition-old(root) { z-index: 2; }

.theme-wave-halo {
  display: none;
}

.theme-wave-halo.active {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  contain: layout paint;
}

.theme-wave-halo[data-direction="to-light"] {
  background: radial-gradient(
    circle at center,
    transparent 0%,
    transparent 56%,
    rgba(255, 248, 232, 0.14) 68%,
    rgba(243, 200, 124, 0.36) 79%,
    rgba(255, 250, 238, 0.64) 85%,
    rgba(212, 162, 78, 0.28) 91%,
    rgba(184, 130, 46, 0.08) 96%,
    transparent 100%
  );
}

.theme-wave-halo[data-direction="to-dark"] {
  background: radial-gradient(
    circle at center,
    transparent 0%,
    transparent 60%,
    rgba(24, 18, 14, 0.12) 72%,
    rgba(223, 169, 85, 0.34) 82%,
    rgba(243, 200, 124, 0.48) 85%,
    rgba(184, 130, 46, 0.16) 93%,
    transparent 100%
  );
}

::view-transition-group(theme-halo) {
  z-index: 4;
  animation: none;
  overflow: visible;
  pointer-events: none;
}

::view-transition-image-pair(theme-halo) {
  isolation: auto;
  overflow: visible;
}

::view-transition-old(theme-halo) {
  animation: none;
  opacity: 0;
}

::view-transition-new(theme-halo) {
  animation: none;
  mix-blend-mode: normal;
  transform-origin: center center;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes themeToggleBreath {
    0% { transform: scale(1); }
    45% { transform: scale(1.08); }
    100% { transform: scale(1); }
  }

  @keyframes themeToggleOpacityOut {
    from { opacity: 1; }
    to { opacity: 0; }
  }

  @keyframes themeToggleOpacityIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes themeGlyphExit {
    from {
      opacity: 1;
      transform: rotate(0deg) scale(1);
    }
    to {
      opacity: 0;
      transform: rotate(110deg) scale(0.32);
    }
  }

  @keyframes themeGlyphEnter {
    from {
      opacity: 0;
      transform: rotate(-110deg) scale(0.32);
    }
    to {
      opacity: 1;
      transform: rotate(0deg) scale(1);
    }
  }

  @keyframes themeRingPulse {
    0% {
      opacity: 0.72;
      transform: scale(0.92);
    }
    100% {
      opacity: 0;
      transform: scale(1.58);
    }
  }

  .theme-toggle.is-pulsing::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    border: 1.5px solid var(--gold);
    pointer-events: none;
    animation: themeRingPulse 520ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  ::view-transition-group(theme-toggle) {
    z-index: 6;
    animation: none;
    overflow: visible;
    pointer-events: none;
  }

  ::view-transition-image-pair(theme-toggle) {
    isolation: auto;
    overflow: visible;
  }

  ::view-transition-old(theme-toggle),
  ::view-transition-new(theme-toggle) {
    mix-blend-mode: normal;
    height: 100%;
    transform-origin: center center;
  }

  ::view-transition-old(theme-toggle) {
    animation:
      themeToggleOpacityOut 320ms ease both,
      themeToggleBreath 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  ::view-transition-new(theme-toggle) {
    animation:
      themeToggleOpacityIn 320ms ease both,
      themeToggleBreath 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  ::view-transition-group(theme-glyph) {
    z-index: 7;
    animation: none;
    overflow: visible;
    pointer-events: none;
  }

  ::view-transition-image-pair(theme-glyph) {
    isolation: auto;
    overflow: visible;
  }

  ::view-transition-old(theme-glyph) {
    mix-blend-mode: normal;
    transform-origin: center center;
    animation: themeGlyphExit 320ms cubic-bezier(0.4, 0, 1, 1) both;
  }

  ::view-transition-new(theme-glyph) {
    mix-blend-mode: normal;
    transform-origin: center center;
    animation: themeGlyphEnter 480ms cubic-bezier(0.34, 1.48, 0.64, 1) 70ms both;
  }
}

html.theme-fallback-fade,
html.theme-fallback-fade body,
html.theme-fallback-fade .sidebar,
html.theme-fallback-fade .topbar,
html.theme-fallback-fade .card,
html.theme-fallback-fade .mini-stat,
html.theme-fallback-fade .icon-btn,
html.theme-fallback-fade .nav-item,
html.theme-fallback-fade .global-search,
html.theme-fallback-fade .profile-trigger,
html.theme-fallback-fade .popover,
html.theme-fallback-fade .app-footer {
  transition:
    background-color 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.42s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* =========================================================
   PRINTABLE OWNER & CA REPORT STYLES
   ========================================================= */

@media print {
  body {
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 12px;
  }
  #sidebar,
  .topbar,
  .heading-actions,
  .toolbar,
  .app-footer,
  #modalRoot,
  #toastRegion,
  .row-actions,
  .wa-mini {
    display: none !important;
  }
  .main-shell {
    padding: 0 !important;
  }
  .print-only {
    display: block !important;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 2px solid #222;
  }
  .card {
    box-shadow: none !important;
    background: #ffffff !important;
    border: 1px solid #d4d4d4 !important;
    break-inside: avoid;
  }
  tr {
    break-inside: avoid;
  }
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */

@media (max-width: 1160px) {
  .kpi-grid,
  .rate-grid,
  .report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-strip,
  .dashboard-split,
  .split-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .operations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 268px;
    flex: none;
    visibility: hidden;
    transform: translateX(-110%);
    transition: transform 0.22s ease, visibility 0.22s ease;
  }
  .sidebar.open {
    visibility: visible;
    transform: translateX(0);
  }
  .icon-btn.sidebar-close,
  .icon-btn.mobile-menu {
    display: grid;
  }
  .mobile-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 28;
  }
  .main-shell { padding: 0; }
  .topbar { flex-wrap: wrap; padding: 12px 16px; height: auto; min-height: 64px; }
  .main-content { padding: 14px 16px 22px; }
  .app-footer { padding: 14px 16px 18px; }
  .global-search {
    order: 3;
    max-width: none;
    width: 100%;
    flex: 1 1 100%;
  }
  .operations-grid,
  .stat-strip {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .kpi-grid,
  .rate-grid,
  .report-kpis,
  .field-grid,
  .quote-grid,
  .wa-cost-box,
  .customer-grid,
  .catalogue-grid,
  .campaign-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .highlight-pill { min-width: 0; }
  .profile-copy { display: none; }
  .ref-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-property: color, background-color, border-color, opacity, box-shadow !important;
    transition-duration: 0.18s !important;
    transition-timing-function: ease !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* =========================================================
   WHATSAPP MESSAGE TRACKING & ANALYTICS
   ========================================================= */

.wa-tracker-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 18px;
}

.wa-tracker-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.wa-kpi-card {
  position: relative;
  overflow: hidden;
}

.wa-kpi-seen {
  border-color: rgba(52, 183, 241, 0.34);
}

.wa-kpi-replied {
  border-color: rgba(37, 211, 102, 0.34);
}

.wa-kpi-failed {
  border-color: rgba(239, 68, 68, 0.24);
}

.wa-ticks {
  font-weight: 800;
  letter-spacing: -2.2px;
  margin-right: 3px;
  font-size: 12px;
}

.wa-ticks.blue,
.wa-blue-txt {
  color: #34b7f1;
}

.wa-ticks.green {
  color: var(--whatsapp, #25d366);
}

.wa-funnel-bar {
  display: flex;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--well);
  border: 1px solid var(--line);
  gap: 2px;
}

.wa-seg {
  height: 100%;
  transition: width 0.35s ease;
}

.wa-seg.replied { background: #22c55e; }
.wa-seg.seen { background: #34b7f1; }
.wa-seg.delivered { background: var(--gold, #c1914d); }
.wa-seg.sent { background: #94a3b8; }
.wa-seg.failed { background: #ef4444; }

.wa-funnel-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-2);
}

.wa-funnel-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.wa-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.wa-dot.replied { background: #22c55e; }
.wa-dot.seen { background: #34b7f1; }
.wa-dot.delivered { background: var(--gold, #c1914d); }
.wa-dot.sent { background: #94a3b8; }
.wa-dot.failed { background: #ef4444; }

.wa-tracker-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(270px, 1fr);
  gap: 16px;
  align-items: start;
}

.wa-log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.wa-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wa-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.wa-filter-pill b {
  font-size: 10.5px;
  opacity: 0.78;
}

.wa-filter-pill:hover {
  border-color: var(--gold);
  color: var(--text);
}

.wa-filter-pill.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

.wa-log-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--well);
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 300px;
}

.wa-log-search svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.wa-log-search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  width: 100%;
}

.wa-log-table-wrap {
  container-type: inline-size;
  max-height: 440px;
  overflow: auto;
}

.wa-log-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: var(--surface);
}

.wa-log-cust {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 165px;
}

.wa-log-cust strong {
  display: block;
  font-size: 12.5px;
}

.wa-log-cust small {
  display: block;
  font-size: 11px;
}

.wa-cat-tag {
  font-weight: 600;
  color: var(--text-2);
}

.wa-log-msg-cell {
  max-width: 300px;
}

.wa-log-msg-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wa-photo-pill {
  display: inline-block;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold);
}

.wa-reply-note {
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.35;
  background: var(--green-bg);
  color: var(--green);
  border-left: 2px solid #22c55e;
}

.wa-tick-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text-2);
}

.wa-tick-badge.seen {
  background: rgba(52, 183, 241, 0.14);
  border-color: rgba(52, 183, 241, 0.35);
  color: #0284c7;
}

[data-theme="dark"] .wa-tick-badge.seen {
  color: #53bdeb;
}

.wa-tick-badge.replied {
  background: var(--green-bg);
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--green);
}

.wa-tick-badge.delivered {
  background: var(--gold-soft);
  border-color: rgba(193, 145, 77, 0.32);
  color: var(--gold);
}

.wa-tick-badge.failed {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.32);
  color: #ef4444;
}

.wa-time-col strong {
  display: block;
  font-size: 11.5px;
  white-space: nowrap;
}

.wa-time-col small {
  display: block;
  font-size: 10.5px;
  white-space: nowrap;
}

.wa-quick-track {
  display: flex;
  align-items: center;
  gap: 5px;
}

.wa-step-btn {
  height: 28px;
  min-width: 30px;
  padding: 0 7px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -1.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wa-step-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.wa-step-btn.seen {
  color: #34b7f1;
}

.wa-step-btn.seen:hover,
.wa-step-btn.seen.active {
  background: rgba(52, 183, 241, 0.16);
  border-color: #34b7f1;
  color: #34b7f1;
}

.wa-step-btn.replied {
  letter-spacing: 0;
  color: var(--green);
}

.wa-step-btn.replied:hover,
.wa-step-btn.replied.active {
  background: var(--green-bg);
  border-color: #22c55e;
}

.wa-step-btn.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

.wa-engagement-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.wa-eng-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--well);
  border: 1px solid var(--line);
}

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

.wa-eng-info strong {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-eng-info small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.wa-eng-pct {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
}

.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }

.wa-timeline-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.wa-tl-step {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--well);
  opacity: 0.55;
}

.wa-tl-step.done {
  opacity: 1;
  border-color: var(--gold);
}

.wa-tl-step.done.blue {
  border-color: #34b7f1;
  background: rgba(52, 183, 241, 0.1);
}

.wa-tl-step.done.green {
  border-color: #22c55e;
  background: var(--green-bg);
}

.wa-tl-step strong {
  display: block;
  font-size: 11.5px;
}

.wa-tl-step small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}

.wa-camp-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 11px;
  background: var(--well);
  border: 1px solid var(--line);
}

.wa-camp-metrics small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.wa-camp-metrics strong {
  display: block;
  font-size: 12.5px;
  margin-top: 2px;
}

@media (max-width: 1180px) {
  .wa-tracker-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .wa-tracker-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .wa-tracker-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wa-timeline-strip,
  .wa-camp-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.wa-bubble-file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.wa-file-icon {
  font-size: 20px;
  line-height: 1;
}

.wa-file-meta {
  min-width: 0;
  flex: 1;
}

.wa-file-meta strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-file-meta small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
}

.wa-bubble-file-clear {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.wa-bubble-file-clear:hover {
  border-color: #ef4444;
  color: #ef4444;
}
