/* Theme of this dashboard: colours and logo card (a reseller copy overrides the colours in the page). */
:root {
  --ds-bg:#071519;
  --ds-surface:#0c2228;
  --ds-surface-2:#12303a;
  --ds-border:#1d4049;
  --ds-ink:#e6f0f1;
  --ds-ink-muted:#9bb5b9;
  --ds-ink-faint:#6f8c91;
  --ds-accent:#2a9d9a;
  --ds-accent-ink:#ffffff;
  --ds-accent-tint:rgba(42,157,154,.16);
  --nh-gold:#c9973f;
}
:root[data-theme="light"] {
  --ds-bg:#f4f8f8; --ds-surface:#ffffff; --ds-surface-2:#eaf2f2; --ds-border:#d3e2e3;
  --ds-ink:#0b2126; --ds-ink-muted:#4d6a6f; --ds-ink-faint:#80999c;
  --ds-accent:#155e6b; --ds-accent-ink:#ffffff; --ds-accent-tint:rgba(21,94,107,.10);
}

/* the logo always sits on a light card (its "node" text is dark teal) */
.nh-logo-card{ display:inline-flex; align-items:center; justify-content:center; background:#ffffff; border-radius:12px; padding:8px 14px;
  box-shadow:0 1px 2px rgba(0,0,0,.18); }
.nh-logo-card img{ display:block; height:34px; width:auto; }
.ds-login-logo .nh-logo-card{ margin:0 auto 16px; padding:12px 18px; }
.ds-login-logo .nh-logo-card img{ height:46px; }
.ds-login-logo h1 .nh-product{ color:var(--nh-gold); }

.ds-sidebar-brand{ flex-direction:column; align-items:flex-start; gap:6px; }
.ds-sidebar-brand .nh-logo-card{ padding:6px 10px; border-radius:10px; }
.ds-sidebar-brand .nh-logo-card img{ height:26px; }
.ds-sidebar-brand .nh-product{ font-size:.78rem; font-weight:700; letter-spacing:.06em; color:var(--nh-gold); padding-inline-start:2px; }


.ds-btn-primary{ background:var(--ds-accent); border-color:var(--ds-accent); color:var(--ds-accent-ink); }
.ds-btn-primary:hover{ filter:brightness(1.08); }
.btn-green{ background:var(--ds-accent) !important; }

/* the login button and old logo heading used WhatsApp green gradients (style.css / design-system.css) */
#loginBtn, #loginBtn.ds-login-submit, .ds-login-submit{ background:linear-gradient(135deg,#2a9d9a,#155e6b); box-shadow:0 8px 20px rgba(21,94,107,.35); }
#loginBtn:hover, .ds-login-submit:hover{ background:linear-gradient(135deg,#31aeaa,#176a79); box-shadow:0 12px 26px rgba(21,94,107,.42); }
.login-logo h1{ background:linear-gradient(135deg,#2a9d9a,#c9973f); -webkit-background-clip:text; background-clip:text; }

/* buttons: the main colour (the old dashboard mixed blue and purple ones) */
.btn-blue, .btn-purple{ background:var(--ds-accent) !important; color:var(--ds-accent-ink) !important; border-color:var(--ds-accent) !important; }
.btn-blue:hover, .btn-purple:hover{ filter:brightness(1.08); }
/* the connection status in the top bar is a small readable pill */
#hdrDot{ font-size:.78rem !important; color:var(--ds-ink-muted); white-space:nowrap; }


/* phones: the four status cards in two rows of two */
@media (max-width:600px){ .stats{ display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; } }

/* ---------- statistics tab (2026-11-29): four headline numbers, one chart, light details, statuses as one bar ---------- */
.an-chips{ display:flex; flex-wrap:wrap; gap:6px; margin:12px 0 4px; }
.an-chip{ border:1px solid var(--ds-border); background:transparent; color:var(--ds-ink-muted); border-radius:999px; padding:6px 14px; font:600 .8rem var(--ds-font-body); cursor:pointer; }
.an-chip:hover{ color:var(--ds-ink); border-color:var(--ds-ink-faint); }
.an-chip.active{ background:var(--ds-accent); border-color:var(--ds-accent); color:var(--ds-accent-ink); }
.an-filters-bar{ margin:6px 0 !important; }
.an-more{ width:100%; }
.an-more summary{ cursor:pointer; color:var(--ds-ink-muted); font-size:.8rem; padding:4px 0; list-style:none; }
.an-more summary::-webkit-details-marker{ display:none; }
.an-more-body{ display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; padding-top:8px; }
.an-heads{ display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:12px; margin:10px 0 12px; }
.an-head{ padding:16px 18px !important; display:flex; flex-direction:column; gap:6px; }
.an-head-top{ display:flex; align-items:center; gap:8px; color:var(--ds-ink-muted); font-size:.82rem; font-weight:600; }
.an-head-ico{ font-size:1.1rem; }
.an-head-v{ font-size:1.9rem; font-weight:750; color:var(--ds-ink); line-height:1.1; font-variant-numeric:tabular-nums; }
.an-head-sub{ font-size:.76rem; color:var(--ds-ink-muted); display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.an-head-sub .ds-badge{ margin:0 !important; }
.an-head-alert{ border-color:var(--ds-warning) !important; background:linear-gradient(180deg, var(--ds-warning-tint), transparent) !important; }
.an-head-alert .an-head-v{ color:var(--ds-warning); }
.an-chart, .an-status{ padding:14px 16px !important; margin-bottom:12px; }
.an-chart-title{ display:flex; justify-content:space-between; align-items:center; gap:10px; font-weight:700; font-size:.88rem; color:var(--ds-ink); margin-bottom:10px; }
.an-legend{ display:flex; align-items:center; gap:6px; font-weight:500; font-size:.75rem; color:var(--ds-ink-muted); }
.an-dot{ display:inline-block; width:9px; height:9px; border-radius:3px; margin-inline-start:6px; vertical-align:middle; }
.an-dot-in{ background:var(--ds-accent); } .an-dot-out{ background:var(--ds-ink-faint); }
.an-chart-svg{ width:100%; height:180px; display:block; direction:ltr; }
.an-bar-in{ fill:var(--ds-accent); } .an-bar-out{ fill:var(--ds-ink-faint); opacity:.75; }
.an-axis{ fill:var(--ds-ink-faint); font-size:10px; }
.an-chart-empty{ color:var(--ds-ink-muted); font-size:.85rem; padding:24px 0; text-align:center; }
.an-details{ display:grid; grid-template-columns:repeat(auto-fit, minmax(170px,1fr)); gap:10px; margin-bottom:12px; }
.an-detail{ display:flex; gap:10px; align-items:flex-start; border:1px solid var(--ds-border); border-radius:var(--ds-r-md); padding:10px 12px; background:var(--ds-surface); }
.an-detail-ico{ font-size:1rem; }
.an-detail-k{ font-size:.72rem; color:var(--ds-ink-muted); }
.an-detail-v{ font-size:1.05rem; font-weight:700; color:var(--ds-ink); font-variant-numeric:tabular-nums; }
.an-detail-sub{ font-size:.7rem; color:var(--ds-ink-muted); }
.an-status-bar{ display:flex; height:12px; border-radius:999px; overflow:hidden; background:var(--ds-surface-2); }
.an-status-bar span{ display:block; height:100%; }
.an-status-legend{ display:flex; flex-wrap:wrap; gap:6px 16px; margin-top:10px; font-size:.78rem; color:var(--ds-ink-muted); }
.an-status-legend b{ color:var(--ds-ink); margin-inline-start:4px; }
.an-status-legend .an-dot{ margin-inline-start:0; margin-inline-end:6px; }
.an-period-label{ font-family:var(--ds-font-body) !important; }
/* the detailed send log: closed until asked for */
.an-log:not(.an-open) > :not(.ds-card-title){ display:none !important; }
#statsLogToggle{ white-space:nowrap; }
.an-log .an-log-only{ display:none; } .an-log.an-open .an-log-only{ display:inline-flex; }
.an-log > .ds-card-title{ margin-bottom:0; }
.an-log.an-open > .ds-card-title{ margin-bottom:12px; }
@media (max-width:900px){ .an-heads{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:420px){ .an-head-v{ font-size:1.5rem; } .an-head{ padding:12px 14px !important; } }

/* inbox on phones (2026-11-29): the list, or the open conversation full height with a back button (they used to share
   the screen and the open conversation had no room left for its messages) */
.ds-thread-back{ display:none; }
@media (max-width:820px){
  .ds-inbox{ height:calc(100vh - 120px) !important; }
  .ds-inbox .ds-conv-panel{ max-height:none !important; flex:1; border-bottom:none !important; }
  .ds-inbox.chat-open .ds-conv-panel{ display:none !important; }
  .ds-inbox:not(.chat-open) .ds-thread-panel{ display:none !important; }
  .ds-thread-head{ flex-wrap:wrap; }
  .ds-thread-back{ flex:0 0 100%; max-width:max-content; display:inline-flex; align-self:flex-start; border:1px solid var(--ds-border); background:var(--ds-surface-2); color:var(--ds-ink); border-radius:999px; padding:4px 12px; font:600 .78rem var(--ds-font-body); margin-bottom:8px; cursor:pointer; }
}

/* reply box on small phones: the text on top, then attach / emoji / send in one row (they were stacked one per line) */
@media (max-width:480px){
  .ds-composer{ display:grid !important; grid-template-columns:auto auto minmax(0,1fr); align-items:center; gap:8px; }
  .ds-composer > textarea, .ds-composer > :has(textarea){ grid-column:1 / -1; grid-row:1; }
  .ds-composer .ds-btn{ width:100%; }
}

/* WATS (2026-11-29): unread messages on the Inbox tab */
.nav-tab .nav-unread { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: auto;
    border-radius: 10px; background: #e5484d; color: #fff; font-size: .72rem; font-weight: 800; line-height: 1; }
.nav-tab:has(.nav-unread) { display: flex; align-items: center; gap: 6px; }

/* WATS (2026-11-29): campaign progress and report */
.camp-progress { height: 6px; border-radius: 3px; background: var(--ds-surface-2, rgba(255,255,255,.08)); overflow: hidden; margin: 4px 0 2px; }
.camp-progress > span { display: block; height: 100%; background: var(--ds-accent, #24918f); border-radius: 3px; transition: width .4s; }
.camp-funnel { display: grid; gap: 10px; margin: 6px 0 14px; }
.camp-funnel .row { display: grid; grid-template-columns: 130px 1fr 92px; align-items: center; gap: 10px; font-size: .86rem; }
.camp-funnel .bar { height: 10px; border-radius: 5px; background: var(--ds-surface-2, rgba(255,255,255,.08)); overflow: hidden; }
.camp-funnel .bar > span { display: block; height: 100%; border-radius: 5px; background: var(--ds-accent, #24918f); }
.camp-funnel .num { text-align: end; font-variant-numeric: tabular-nums; color: var(--ds-ink-muted, #9fb3b8); }
.camp-funnel .num b { color: var(--ds-ink, #e6f0f1); }
