/* =====================================================================
   ZeroSMS design system
   One stylesheet, one visual language, used by both the customer and
   admin dashboards. Tokens first, then primitives, then components.
   ===================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -0.011em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------- tokens */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  /* Brand, taken from the ZeroSMS mark. */
  --brand:         #1d8fc4;
  --brand-strong:  #17739e;
  --brand-soft:    #e8f4fb;
  --brand-border:  #b9ddf1;
  --brand-text:    #145b7e;

  /* Neutrals */
  --bg:            #f5f7fa;
  --surface:       #ffffff;
  --surface-2:     #fafbfc;
  --surface-3:     #f1f4f8;
  --border:        #e3e8ef;
  --border-strong: #cfd7e3;

  --text:          #1a2230;
  --text-muted:    #5b6779;
  --text-subtle:   #8794a8;
  --text-inverse:  #ffffff;

  /* Status. Each has a solid, a soft background and a readable text tone,
     so a badge never relies on colour alone being legible. */
  --ok:            #17864b;
  --ok-soft:       #e6f6ed;
  --ok-border:     #b5e3c9;

  --warn:          #9a6200;
  --warn-soft:     #fdf3e2;
  --warn-border:   #f2d9a8;

  --danger:        #c02b2b;
  --danger-soft:   #fdeceb;
  --danger-border: #f5c2bf;

  --info:          #2159b8;
  --info-soft:     #ebf1fd;
  --info-border:   #c2d5f5;

  --neutral:       #5b6779;
  --neutral-soft:  #f1f4f8;
  --neutral-border:#dde4ed;

  /* Chart series - distinguishable in both themes and for common CVD. */
  --c1: #1d8fc4;
  --c2: #17864b;
  --c3: #b8860b;
  --c4: #9a4bb8;
  --c5: #c02b2b;
  --c6: #0f7b8a;

  --radius-sm: 5px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-xs: 0 1px 2px rgba(16, 26, 40, .06);
  --shadow-sm: 0 1px 3px rgba(16, 26, 40, .08), 0 1px 2px rgba(16, 26, 40, .04);
  --shadow:    0 4px 12px rgba(16, 26, 40, .08), 0 1px 3px rgba(16, 26, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 26, 40, .14), 0 4px 8px rgba(16, 26, 40, .06);

  --sidebar-w: 248px;
  --imp-h: 40px;
  --topbar-h: 60px;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px;
}

:root[data-theme="dark"],
html:not([data-theme="light"]) body.theme-dark {
  --bg:            #10151d;
  --surface:       #171d27;
  --surface-2:     #1c2330;
  --surface-3:     #222b3a;
  --border:        #2a3444;
  --border-strong: #3a4657;

  --text:          #e6ebf2;
  --text-muted:    #9aa7ba;
  --text-subtle:   #6e7c92;

  --brand:         #4bb3e8;
  --brand-strong:  #6cc4f0;
  --brand-soft:    #142c3b;
  --brand-border:  #1f4f6b;
  --brand-text:    #8ed0f2;

  --ok:            #4ecb87;  --ok-soft:     #112e1f;  --ok-border:     #1f5638;
  --warn:          #e0a94a;  --warn-soft:   #2e2413;  --warn-border:   #5c4620;
  --danger:        #f07b74;  --danger-soft: #331817;  --danger-border: #62302c;
  --info:          #7aa7f0;  --info-soft:   #161f33;  --info-border:   #2c3f66;
  --neutral:       #9aa7ba;  --neutral-soft:#1c2330;  --neutral-border:#2f3a4a;

  --c1: #4bb3e8; --c2: #4ecb87; --c3: #e0a94a;
  --c4: #b98ae0; --c5: #f07b74; --c6: #4bc0cf;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .36);
  --shadow:    0 4px 14px rgba(0, 0, 0, .42);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
}

/* ------------------------------------------------------------- utilities */
.u-muted   { color: var(--text-muted); }
.u-subtle  { color: var(--text-subtle); }
.u-mono    { font-family: var(--font-mono); font-size: .92em; }
.u-nowrap  { white-space: nowrap; }
.u-right   { text-align: right; }
.u-center  { text-align: center; }
.u-bold    { font-weight: 600; }
.u-small   { font-size: 12.5px; }
.u-xs      { font-size: 11.5px; }
.u-break   { word-break: break-word; overflow-wrap: anywhere; }
.u-tnum    { font-variant-numeric: tabular-nums; }
.u-hide    { display: none !important; }
.u-flex    { display: flex; }
.u-between { display: flex; align-items: center; justify-content: space-between; }
.u-gap-1 { gap: var(--space-1); } .u-gap-2 { gap: var(--space-2); }
.u-gap-3 { gap: var(--space-3); } .u-gap-4 { gap: var(--space-4); }
.u-mt-2 { margin-top: var(--space-2); } .u-mt-4 { margin-top: var(--space-4); }
.u-mt-6 { margin-top: var(--space-6); } .u-mb-4 { margin-bottom: var(--space-4); }
.u-mb-6 { margin-bottom: var(--space-6); }
.u-w-full { width: 100%; }
.u-items-center { align-items: center; }
.u-wrap { flex-wrap: wrap; }
.u-grow { flex: 1 1 auto; min-width: 0; }

.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;
}

/* ---------------------------------------------------------------- layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar__brand {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar__brand img { width: 30px; height: 30px; border-radius: 7px; }
.sidebar__brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; color: var(--text); }
.sidebar__brand-sub { font-size: 11px; color: var(--text-subtle); margin-top: -2px; }

.sidebar__nav { padding: var(--space-3) var(--space-3) var(--space-6); flex: 1; }

.nav-group { margin-bottom: var(--space-5); }
.nav-group__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-subtle);
  padding: 0 var(--space-3); margin-bottom: var(--space-2);
}
.nav-group__ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand);
}
.nav-group__ico .icon { width: 12px; height: 12px; }
.nav-group--foot { margin-top: 6px; padding-top: var(--space-4); border-top: 1px solid var(--border); }
.nav-item--admin { color: var(--brand-text); font-weight: 600; }
.nav-item--admin .icon { color: var(--brand); }
.nav-item--admin:hover { background: var(--brand-soft); }

.nav-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 8px var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px; font-weight: 500;
  margin-bottom: 1px;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item.is-active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.nav-item.is-active .icon { color: var(--brand); }
.nav-item .icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-subtle); }
.nav-item__badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 650; padding: 1px 6px; border-radius: 10px;
  min-width: 18px; text-align: center;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--space-4);
  padding: 0 var(--space-6);
  position: sticky; top: 0; z-index: 30;
}
.topbar__title { font-size: 15px; font-weight: 600; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }

.content { padding: var(--space-6); flex: 1; max-width: 1560px; width: 100%; margin-inline: auto; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6);
}
.page-head__title { font-size: 21px; font-weight: 650; letter-spacing: -.02em; }
.page-head__sub { color: var(--text-muted); font-size: 13.5px; margin-top: 3px; }
.page-head__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card__head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  flex-wrap: wrap;
}
.card__title { font-size: 14.5px; font-weight: 620; }
.card__sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.card__body { padding: var(--space-5); }
.card__body--flush { padding: 0; }
.card__foot {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: 12.5px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  flex-wrap: wrap;
}

.grid { display: grid; gap: var(--space-4); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1fr) 340px; }
.grid--main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ------------------------------------------------------------ stat tiles */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.stat__label {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-subtle);
  display: flex; align-items: center; gap: 6px;
}
.stat__value {
  font-size: 25px; font-weight: 660; letter-spacing: -.02em;
  margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.15;
}
.stat__value--sm { font-size: 20px; }
.stat__meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.stat__delta { font-weight: 600; }
.stat__delta--up { color: var(--ok); }
.stat__delta--down { color: var(--danger); }
.stat--accent { border-left: 3px solid var(--brand); }
.stat--ok     { border-left: 3px solid var(--ok); }
.stat--warn   { border-left: 3px solid var(--warn); }
.stat--danger { border-left: 3px solid var(--danger); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px; font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn .icon { width: 15px; height: 15px; }

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

.btn--secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--secondary:hover { background: var(--surface-3); }

.btn--ghost { background: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }

.btn--danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--danger:hover { filter: brightness(.93); }

.btn--danger-soft { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.btn--danger-soft:hover { background: var(--danger); color: #fff; }

.btn--ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn--ok:hover { filter: brightness(.93); }

.btn--sm { padding: 4px 10px; font-size: 12.5px; }
.btn--lg { padding: 10px 20px; font-size: 14.5px; }
.btn--block { width: 100%; }
.btn--icon { padding: 6px; }
.btn--icon .icon { width: 16px; height: 16px; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.5;
}
.badge::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.badge--plain::before { display: none; }

.badge--ok      { background: var(--ok-soft);      color: var(--ok);      border-color: var(--ok-border); }
.badge--warn    { background: var(--warn-soft);    color: var(--warn);    border-color: var(--warn-border); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger);  border-color: var(--danger-border); }
.badge--info    { background: var(--info-soft);    color: var(--info);    border-color: var(--info-border); }
.badge--neutral { background: var(--neutral-soft); color: var(--neutral); border-color: var(--neutral-border); }
.badge--brand   { background: var(--brand-soft);   color: var(--brand-text); border-color: var(--brand-border); }

/* ---------------------------------------------------------------- tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 11.5px; font-weight: 640; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-subtle);
  padding: 10px var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.table td {
  padding: 11px var(--space-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table--clickable tbody tr { cursor: pointer; }
.table td.u-right, .table th.u-right { text-align: right; }
.table__actions { display: flex; gap: 4px; justify-content: flex-end; }

.table__primary { font-weight: 560; color: var(--text); }
.table__secondary { font-size: 12px; color: var(--text-subtle); margin-top: 1px; }

/* Card-style rows on narrow screens: admin tables stay usable on a phone
   instead of forcing a horizontal scroll across a dozen columns. */
@media (max-width: 720px) {
  .table--responsive thead { display: none; }
  .table--responsive, .table--responsive tbody, .table--responsive tr, .table--responsive td {
    display: block; width: 100%;
  }
  .table--responsive tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: var(--space-3);
    padding: var(--space-2);
    background: var(--surface);
  }
  .table--responsive td {
    border: 0;
    padding: 5px var(--space-2);
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
    text-align: right;
  }
  .table--responsive td::before {
    content: attr(data-label);
    font-size: 11.5px; font-weight: 640; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-subtle);
    text-align: left; flex-shrink: 0;
  }
  .table--responsive td:not([data-label]) { justify-content: flex-end; }
  .table--responsive .table__actions { justify-content: flex-end; width: 100%; }
}

/* ----------------------------------------------------------------- forms */
.form-grid { display: grid; gap: var(--space-4); }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field--span { grid-column: 1 / -1; }

.label { font-size: 12.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 5px; }
.label__required { color: var(--danger); }
.label__optional { color: var(--text-subtle); font-weight: 450; font-size: 11.5px; }

.input, .select, .textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--surface-3); color: var(--text-muted); cursor: not-allowed;
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.textarea { min-height: 96px; resize: vertical; font-family: inherit; }
.textarea--mono { font-family: var(--font-mono); font-size: 12.5px; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235b6779' d='M6 8.5 2 4.5h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.help { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.error-text { font-size: 12px; color: var(--danger); font-weight: 500; }

.checkbox, .radio {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13.5px; cursor: pointer; padding: 3px 0;
}
.checkbox input, .radio input {
  width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--brand);
  flex-shrink: 0; cursor: pointer;
}
.checkbox__text { min-width: 0; }
.checkbox__title { font-weight: 500; }
.checkbox__help { font-size: 12px; color: var(--text-muted); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 36px; height: 20px; border-radius: 20px;
  background: var(--border-strong); position: relative;
  transition: background .16s; flex-shrink: 0;
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-xs);
  transition: transform .16s;
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--brand); outline-offset: 2px; }

.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }

.input-prefix {
  display: flex; align-items: center; padding: 0 10px;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-muted); font-size: 13px; white-space: nowrap;
}
.input-prefix + .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* --------------------------------------------------------------- filters */
.filters {
  display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: flex-end;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.filters .field { min-width: 150px; }
.filters .field--search { flex: 1 1 220px; }

/* ---------------------------------------------------------------- alerts */
.alert {
  display: flex; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 13.5px;
  margin-bottom: var(--space-4);
  align-items: flex-start;
}
.alert .icon { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.alert__body { min-width: 0; flex: 1; }
.alert__title { font-weight: 620; margin-bottom: 2px; }
.alert--ok     { background: var(--ok-soft);     border-color: var(--ok-border);     color: var(--ok); }
.alert--warn   { background: var(--warn-soft);   border-color: var(--warn-border);   color: var(--warn); }
.alert--danger { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.alert--info   { background: var(--info-soft);   border-color: var(--info-border);   color: var(--info); }
.alert--brand  { background: var(--brand-soft);  border-color: var(--brand-border);  color: var(--brand-text); }
.alert a { color: inherit; text-decoration: underline; }

/* ---------------------------------------------------------------- toasts */
.toasts {
  position: fixed; bottom: var(--space-5); right: var(--space-5);
  z-index: 200; display: flex; flex-direction: column; gap: var(--space-2);
  max-width: 380px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3) var(--space-4);
  display: flex; gap: var(--space-3); align-items: flex-start;
  animation: toast-in .2s ease-out;
  font-size: 13.5px;
}
.toast--ok     { border-left-color: var(--ok); }
.toast--warn   { border-left-color: var(--warn); }
.toast--danger { border-left-color: var(--danger); }
.toast__close { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--text-subtle); padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- modals */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(12, 18, 28, .5);
  backdrop-filter: blur(2px);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
  animation: fade-in .14s ease-out;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  max-height: calc(100vh - 2 * var(--space-8));
  display: flex; flex-direction: column;
  animation: modal-in .18s cubic-bezier(.2, .8, .3, 1);
}
.modal--lg { max-width: 760px; }
.modal--sm { max-width: 400px; }
.modal__head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
}
.modal__title { font-size: 15.5px; font-weight: 620; }
.modal__sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.modal__body { padding: var(--space-5); overflow-y: auto; }
.modal__foot {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: var(--space-2);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-wrap: wrap;
}
.modal__close { background: none; border: 0; cursor: pointer; color: var(--text-subtle); padding: 2px; }
.modal__close:hover { color: var(--text); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- dropdowns */
.dropdown { position: relative; display: inline-block; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 5px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px; padding: 5px;
  z-index: 50; display: none;
}
.dropdown.is-open .dropdown__menu { display: block; }
.dropdown__item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text); width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left;
}
.dropdown__item:hover { background: var(--surface-3); text-decoration: none; }
.dropdown__item--danger { color: var(--danger); }
.dropdown__divider { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown__header {
  padding: 8px 10px; font-size: 11.5px; font-weight: 640;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-subtle);
}

/* ------------------------------------------------------------ pagination */
.pagination { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.pagination__item {
  min-width: 30px; height: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-muted); background: var(--surface);
}
.pagination__item:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.pagination__item.is-active {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
}
.pagination__item.is-disabled { opacity: .4; pointer-events: none; }
.pagination__gap { padding: 0 4px; color: var(--text-subtle); }

/* ----------------------------------------------------------------- empty */
.empty {
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--text-muted);
}
.empty__icon {
  width: 42px; height: 42px; margin: 0 auto var(--space-4);
  color: var(--text-subtle); opacity: .7;
}
.empty__title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.empty__text { font-size: 13.5px; max-width: 400px; margin: 0 auto var(--space-4); line-height: 1.55; }

/* --------------------------------------------------------------- loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn.is-loading { pointer-events: none; opacity: .75; }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart__legend {
  display: flex; gap: var(--space-4); flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-muted);
  margin-top: var(--space-3);
}
.chart__legend-item { display: flex; align-items: center; gap: 6px; }
.chart__swatch { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.chart__grid { stroke: var(--border); stroke-width: 1; }
.chart__axis { fill: var(--text-subtle); font-size: 10.5px; }
.chart__tooltip {
  position: absolute; pointer-events: none; z-index: 60;
  background: var(--text); color: var(--surface);
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 12px; box-shadow: var(--shadow); white-space: nowrap;
  opacity: 0; transition: opacity .1s;
}
.chart__tooltip.is-visible { opacity: 1; }

/* ------------------------------------------------------------ mini meter */
.meter { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.meter__fill { height: 100%; border-radius: 3px; transition: width .3s; }
.meter__fill--ok { background: var(--ok); }
.meter__fill--warn { background: var(--warn); }
.meter__fill--danger { background: var(--danger); }
.meter__fill--brand { background: var(--brand); }

/* ------------------------------------------------------------------ misc */
.divider { height: 1px; background: var(--border); margin: var(--space-5) 0; border: 0; }

.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px var(--space-4); font-size: 13.5px; }
.kv__key { color: var(--text-muted); }
.kv__val { min-width: 0; word-break: break-word; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  padding: 9px var(--space-4);
  font-size: 13.5px; font-weight: 550; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-text);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 650; flex-shrink: 0;
}
.avatar--sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar--lg { width: 46px; height: 46px; font-size: 16px; }

.code-block {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono); font-size: 12.5px;
  overflow-x: auto; white-space: pre;
  color: var(--text);
}

.copy-field {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 10px;
  font-family: var(--font-mono); font-size: 12.5px;
}
.copy-field__value { flex: 1; overflow-x: auto; white-space: nowrap; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px;
  width: 2px; background: var(--border);
}
.timeline__item { position: relative; padding-bottom: var(--space-4); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: -22px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.timeline__dot--ok { border-color: var(--ok); background: var(--ok); }
.timeline__dot--danger { border-color: var(--danger); background: var(--danger); }
.timeline__dot--brand { border-color: var(--brand); background: var(--brand); }
.timeline__title { font-size: 13.5px; font-weight: 560; }
.timeline__meta { font-size: 12px; color: var(--text-subtle); margin-top: 1px; }

/* ------------------------------------------------------------ auth pages */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth__panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--space-12) var(--space-8);
}
.auth__form { width: 100%; max-width: 380px; margin: 0 auto; }
.auth__brand { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-8); }
.auth__brand img { width: 38px; height: 38px; border-radius: 9px; }
.auth__brand-name { font-size: 18px; font-weight: 660; letter-spacing: -.02em; }
.auth__title { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin-bottom: 6px; }
.auth__sub { color: var(--text-muted); font-size: 13.5px; margin-bottom: var(--space-6); }
.auth__foot { margin-top: var(--space-6); font-size: 13px; color: var(--text-muted); text-align: center; }

.auth__aside {
  background: linear-gradient(150deg, var(--brand-strong), var(--brand) 55%, #0f6f9c);
  color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--space-12);
  position: relative; overflow: hidden;
}
.auth__aside::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 78% 18%, rgba(255,255,255,.16), transparent 52%);
}
.auth__aside-inner { position: relative; z-index: 1; max-width: 420px; }
.auth__tagline { font-size: 25px; font-weight: 640; line-height: 1.3; letter-spacing: -.02em; margin-bottom: var(--space-4); }
.auth__points { list-style: none; display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-6); }
.auth__point { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; opacity: .95; }
.auth__point .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* ------------------------------------------------------- composer widget */
.composer__preview {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.composer__bubble {
  background: var(--brand); color: #fff;
  padding: 9px 13px; border-radius: 16px 16px 4px 16px;
  font-size: 13.5px; line-height: 1.45;
  max-width: 280px; margin-left: auto;
  word-break: break-word; white-space: pre-wrap;
}
.composer__counter {
  display: flex; gap: var(--space-4); font-size: 12px;
  color: var(--text-muted); margin-top: var(--space-2); flex-wrap: wrap;
}
.composer__counter strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------- impersonation */
.impersonation-bar {
  background: var(--warn); color: #23190a;
  padding: 0 var(--space-6);
  font-size: 13px; font-weight: 550;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  /* Pinned above the fixed sidebar/topbar so its message is never hidden. */
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--imp-h, 40px); box-sizing: border-box;
}
.impersonation-bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.impersonation-bar a { color: inherit; text-decoration: underline; font-weight: 650; }

/* When impersonating, offset the fixed sidebar, sticky topbar and content so
   nothing sits under the pinned bar. */
.has-impersonation .sidebar { top: var(--imp-h, 40px); }
.has-impersonation .main { padding-top: var(--imp-h, 40px); }
.has-impersonation .topbar { top: var(--imp-h, 40px); }

/* ------------------------------------------------------------ responsive */
.sidebar__toggle { display: inline-flex; }
.sidebar__backdrop { display: none; }

/* Desktop collapsible sidebar (slides left; main reclaims the space). */
.sidebar { transition: transform .22s ease-out; }
.main { transition: margin-left .22s ease-out; }
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main { margin-left: 0; }

@media (max-width: 1200px) {
  .grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--sidebar, .grid--main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .grid--4, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease-out;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .sidebar__backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(12, 18, 28, .45); z-index: 39;
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .sidebar__backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .sidebar__toggle { display: inline-flex; }
  .main { margin-left: 0; }
  .content { padding: var(--space-4); }
  .topbar { padding: 0 var(--space-4); }
  .grid--5, .grid--4, .grid--3, .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid--2, .form-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px var(--space-4); }
  .kv__key { margin-top: var(--space-2); }
  .page-head__title { font-size: 19px; }
  .toasts { left: var(--space-3); right: var(--space-3); bottom: var(--space-3); max-width: none; }
}

@media (max-width: 520px) {
  .grid--5, .grid--4, .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .stat__value { font-size: 22px; }
  .filters { padding: var(--space-3); }
  .filters .field { min-width: 100%; }
}

@media print {
  .sidebar, .topbar, .page-head__actions, .filters, .pagination { display: none !important; }
  .main { margin-left: 0; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ----- searchable flag select (progressive enhancement for data-flag-select) ----- */
.flag-select { position: relative; }
.flag-select__native {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.flag-select__button {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 8px 30px 8px 11px; text-align: left;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13.5px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235b6779' d='M6 8.5 2 4.5h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color .12s, box-shadow .12s;
}
.flag-select.is-open .flag-select__button,
.flag-select__button:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.flag-select__button.is-invalid { border-color: var(--danger); }
.flag-select__flag { font-size: 17px; line-height: 1; flex-shrink: 0; }
.flag-select__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag-select__value.is-placeholder { color: var(--text-subtle); }
.flag-select__panel {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md, 0 10px 30px rgba(16,26,40,.14));
  overflow: hidden;
}
.flag-select__search-wrap { padding: 8px; border-bottom: 1px solid var(--border); }
.flag-select__search {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px;
}
.flag-select__search:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.flag-select__list { list-style: none; margin: 0; padding: 4px; max-height: 244px; overflow-y: auto; }
.flag-select__option {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; color: var(--text);
}
.flag-select__option:hover, .flag-select__option.is-active { background: var(--surface-3); }
.flag-select__option[aria-selected="true"] { font-weight: 600; }
.flag-select__empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Base icon size so any icon() used without a contextual size rule (e.g. inside
   dropdown menu items) renders at a sane size instead of expanding to fill.
   More specific rules (.nav-item .icon, .btn .icon, …) still override this. */
.icon { width: 16px; height: 16px; flex-shrink: 0; }
.dropdown__item .icon { width: 16px; height: 16px; flex-shrink: 0; }

/* Clickable rows (data-href) — replaces CSP-blocked inline onclick. */
[data-href] { cursor: pointer; }
[data-href]:hover { background: var(--surface-3); }

/* ---- iPhone-style SMS preview (device mockup around [data-sms-preview]) ---- */
.phone { width: 258px; max-width: 100%; margin: 4px auto 0; background: #0b0b0c;
  border-radius: 44px; padding: 11px; box-shadow: 0 12px 38px rgba(16,26,40,.28); }
.phone__screen { position: relative; background: #f2f2f7; border-radius: 34px; overflow: hidden;
  min-height: 430px; display: flex; flex-direction: column; }
.phone__island { width: 86px; height: 22px; background: #0b0b0c; border-radius: 0 0 16px 16px; margin: 0 auto; }
.phone__bar { display: flex; justify-content: space-between; align-items: center;
  padding: 8px 20px 2px; font-size: 12px; font-weight: 600; color: #1a1a1c; }
.phone__head { text-align: center; padding: 6px 12px 12px; border-bottom: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.65); }
.phone__avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 17px; margin: 0 auto 5px; }
.phone__sender { font-size: 12.5px; font-weight: 600; color: #1a1a1c; }
.phone__msgs { padding: 16px 13px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.phone__bubble { align-self: flex-start; max-width: 82%; background: #e9e9eb; color: #111;
  padding: 9px 13px; border-radius: 18px 18px 18px 4px; font-size: 13.5px; line-height: 1.42;
  word-break: break-word; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.phone__bubble.is-empty { color: #9a9aa0; font-style: italic; }
.phone__time { align-self: flex-start; font-size: 10.5px; color: #8a8a8e; margin: 3px 0 0 8px; }

/* ---- Notification bell dropdown ---- */
.notif-dot { position:absolute; top:6px; right:6px; width:8px; height:8px; border-radius:50%;
  background:var(--danger); border:2px solid var(--surface); }
.dropdown__menu--notif { right:0; left:auto; width:330px; max-width:calc(100vw - 32px); padding-bottom:4px; }
.notif-empty { display:flex; flex-direction:column; align-items:center; gap:6px; padding:22px 16px;
  color:var(--text-subtle); font-size:12.5px; }
.notif-empty .icon { width:22px; height:22px; opacity:.5; }
.notif-item { display:flex; gap:10px; padding:10px 14px; border-top:1px solid var(--border); }
.notif-item:hover { background:var(--surface-3); text-decoration:none; }
.notif-item.is-unread { background:var(--brand-soft); }
.notif-item__icon { flex-shrink:0; display:flex; margin-top:1px; }
.notif-item__body { display:flex; flex-direction:column; min-width:0; }
.notif-item__title { font-size:13px; font-weight:600; color:var(--text); line-height:1.35;
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.notif-item__time { font-size:11px; color:var(--text-subtle); margin-top:2px; }
.dropdown__item--center { justify-content:center; font-weight:600; color:var(--brand-text); }

/* ---- Active-session device icon chip ---- */
.session-icon { flex-shrink:0; display:flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:9px; background:var(--surface-3); color:var(--text-muted); }
.session-icon .icon { width:18px; height:18px; }

/* ---- Disabled buttons ---- */
.btn:disabled, .btn[disabled] { opacity:.5; cursor:not-allowed; pointer-events:none; }

/* ---- Dashboard hero banner ---- */
.hero { display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap;
  padding:20px 24px; margin-bottom:24px; border-radius:var(--radius);
  background:linear-gradient(120deg, var(--brand) 0%, #6d5efc 55%, #8b5cf6 100%); color:#fff;
  box-shadow:0 10px 30px rgba(79,70,229,.25); }
.hero__title { font-size:19px; font-weight:700; letter-spacing:-.01em; color:#fff; }
.hero__sub { font-size:13px; opacity:.88; margin-top:3px; }
.hero__actions { display:flex; gap:10px; flex-wrap:wrap; }
.hero .btn { border-color:transparent; }
.hero .btn--glass { background:rgba(255,255,255,.16); color:#fff; }
.hero .btn--glass:hover { background:rgba(255,255,255,.26); }
.hero .btn--light { background:#fff; color:var(--brand-text); }
.hero .btn--light:hover { background:rgba(255,255,255,.9); }

/* ---- Colourful stat icon chips ---- */
.stat__ico { display:flex; align-items:center; justify-content:center; width:34px; height:34px;
  border-radius:9px; margin-bottom:10px; }
.stat__ico .icon { width:17px; height:17px; }
.stat__ico--brand { background:var(--brand-soft); color:var(--brand); }
.stat__ico--ok { background:rgba(16,185,129,.14); color:var(--ok); }
.stat__ico--warn { background:rgba(245,158,11,.15); color:var(--warn); }
.stat__ico--info { background:rgba(59,130,246,.14); color:var(--info); }

/* ---- Available countries list (Test SMS) ---- */
.country-list { display:flex; flex-direction:column; }
.country-row { display:flex; align-items:center; gap:12px; padding:11px 20px;
  border-bottom:1px solid var(--border); }
.country-row:last-child { border-bottom:0; }
.country-row:hover { background:var(--surface-3); }
.country-row__flag { font-size:22px; line-height:1; flex-shrink:0;
  width:30px; text-align:center; }
.country-row__name { font-size:13.5px; font-weight:600; color:var(--text);
  display:flex; align-items:center; gap:8px; flex:1; min-width:0; }
.country-row__iso { font-size:10.5px; font-weight:650; letter-spacing:.04em;
  color:var(--text-subtle); background:var(--surface-3); padding:1px 6px; border-radius:6px; }
.country-row__dial { font-size:12.5px; font-weight:600; color:var(--text-muted);
  font-variant-numeric:tabular-nums; }

/* ============================================================ live polish
   Global entrance + hover motion so every page feels alive. All motion is
   gated behind prefers-reduced-motion and settles at a fully visible state. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes zsRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes zsFade { from { opacity: 0; } to { opacity: 1; } }

  .content .page-head,
  .content > .alert,
  .content .hero,
  .content .card,
  .content .stat { animation: zsRise .36s cubic-bezier(.22,.7,.3,1) both; }

  /* Gentle stagger across tiled rows so they cascade in, not all at once. */
  .grid--4 > *:nth-child(2), .grid--3 > *:nth-child(2) { animation-delay: .05s; }
  .grid--4 > *:nth-child(3), .grid--3 > *:nth-child(3) { animation-delay: .10s; }
  .grid--4 > *:nth-child(4) { animation-delay: .15s; }
  .grid--main > *:nth-child(2) { animation-delay: .08s; }

  .nav-item { animation: zsFade .4s ease both; }
}

/* Hover life (works with or without motion preference — these are instant-ish). */
.stat { transition: transform .18s ease, box-shadow .18s ease; }
.stat:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -16px rgba(20,30,50,.4); }
.card { transition: box-shadow .18s ease, border-color .18s ease; }
[data-href] { transition: background .14s ease, transform .14s ease; }
[data-href]:hover { transform: translateX(2px); }
.table tbody tr { transition: background .14s ease; }
.btn { transition: transform .12s ease, box-shadow .16s ease, background .16s ease, filter .16s ease; }
.btn--primary:hover { box-shadow: 0 8px 20px -8px var(--brand); }
.btn:active { transform: translateY(1px); }
.nav-item:hover { transform: translateX(2px); }
.stat__ico, .nav-group__ico { transition: transform .18s ease; }
.stat:hover .stat__ico { transform: scale(1.08) rotate(-3deg); }

/* ---- Route progress loader (top bar shown while the next page loads) ---- */
.route-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999;
  pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.route-progress.is-active { opacity: 1; }
.route-progress__bar { height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand), #8b5cf6);
  box-shadow: 0 0 10px color-mix(in srgb, var(--brand) 70%, transparent);
  border-radius: 0 2px 2px 0; transition: width .3s ease; }
/* subtle first-paint veil so a page feels like it "arrives" */
@media (prefers-reduced-motion: no-preference) {
  .content { animation: zsFade .25s ease both; }
}

/* =====================================================================
   VISUAL REFRESH v2 — modern UI system (appended last, restyles every
   page that uses the shared classes).
   ===================================================================== */
:root {
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(20,30,50,.05);
  --shadow-sm: 0 2px 8px rgba(20,30,50,.07);
  --shadow:    0 10px 28px -10px rgba(20,30,50,.18), 0 2px 6px rgba(20,30,50,.05);
  --shadow-lg: 0 28px 64px -24px rgba(20,30,50,.32);
  --bg: #eceff5;
}
:root[data-theme="dark"], html:not([data-theme="light"]) body.theme-dark { --bg: #0b0f16; }

/* Cards — rounder, lifted, hover depth */
.card { border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.card__head { padding: 15px 20px; }
.card__title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }

/* Headings with more presence */
.page-head__title { font-size: 26px; font-weight: 760; letter-spacing: -.025em; }

/* Buttons — gradient primary, lift, rounder */
.btn { border-radius: var(--radius); font-weight: 600; }
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  border-color: transparent; box-shadow: 0 8px 18px -8px var(--brand); }
.btn--primary:hover { filter: brightness(1.06); box-shadow: 0 10px 22px -8px var(--brand); }

/* Inputs — rounder, clear focus ring */
.input, .select, .textarea { border-radius: var(--radius); border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }

/* Sidebar — pill-style active item */
.nav-item { border-radius: 10px; margin-bottom: 2px; font-weight: 550; }
.nav-item.is-active { background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff; box-shadow: 0 8px 18px -10px var(--brand); }
.nav-item.is-active .icon { color: #fff; }

/* Topbar — subtle depth + blur */
.topbar { box-shadow: 0 1px 0 var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.1) blur(6px); }

/* Stat tiles — bigger numbers, accent gradient */
.stat { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.stat__value { font-size: 27px; font-weight: 760; letter-spacing: -.02em; }
.stat--accent { background: linear-gradient(140deg, var(--brand-soft), var(--surface)); border-color: var(--brand-border); }

/* Tables — airier, uppercase heads */
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); font-weight: 650; }
.table td, .table th { padding: 13px 16px; }

/* Badges fully rounded */
.badge { border-radius: 999px; font-weight: 600; }

/* ---- Form field icons + liveliness ---- */
.label .icon { color: var(--brand); flex-shrink: 0; }
.input, .select, .textarea { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.input:focus, .select:focus, .textarea:focus { transform: translateY(-1px); }
@media (prefers-reduced-motion: no-preference) {
  .card__body > .field,
  .card__body > .form-grid > .field { animation: zsRise .34s cubic-bezier(.22,.7,.3,1) both; }
  .card__body > .field:nth-child(2) { animation-delay: .05s; }
  .card__body > .field:nth-child(3) { animation-delay: .10s; }
  .card__body > .field:nth-child(4) { animation-delay: .15s; }
}

/* ---- Merge-tag chips (Send / composer) ---- */
.tag-chips { display:inline-flex; flex-wrap:wrap; gap:6px; margin:0 2px; vertical-align:middle; }
.tag-chip { font-family: var(--font-mono); font-size: 11.5px; line-height:1.6; color: var(--brand-text);
  background: var(--brand-soft); border: 1px solid var(--brand-border); border-radius: 999px;
  padding: 1px 9px; cursor: pointer; transition: background .14s ease, transform .1s ease; }
.tag-chip:hover { background: var(--brand-border); }
.tag-chip:active { transform: translateY(1px); }

/* ---- Fix: searchable country dropdown clipped behind following fields ---- */
.flag-select__panel { z-index: 200; }
.flag-select.is-open { z-index: 200; }
/* Lift the whole field (and neutralise the entrance-animation stacking context
   on later fields) while a flag dropdown is open, so its panel overlays them. */
.field:has(.flag-select.is-open) { position: relative; z-index: 200; }

/* ---- Crypto top-up: coin chips, amount display, slider, presets ---- */
.coins { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.coin { width:30px; height:30px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center;
  color:#fff; font-weight:700; font-size:15px; flex-shrink:0; box-shadow:0 2px 6px rgba(0,0,0,.18); }
.coin--btc{background:#f7931a} .coin--eth{background:#627eea} .coin--usdt{background:#26a17b}
.coin--ltc{background:#345d9d} .coin--trx{background:#eb0029} .coin--bnb{background:#f3ba2f;color:#1e2026}

.amount-display { font-size:clamp(34px,8vw,46px); font-weight:800; letter-spacing:-.03em; color:var(--text);
  display:flex; align-items:baseline; gap:2px; margin:4px 0 16px; justify-content:center; font-variant-numeric:tabular-nums; }
.amount-display__cur { font-size:.6em; font-weight:700; color:var(--text-muted); }

.amount-slider { -webkit-appearance:none; appearance:none; width:100%; height:8px; border-radius:999px;
  background:linear-gradient(90deg,var(--brand),#8b5cf6) no-repeat; background-color:var(--surface-3); outline:none; cursor:pointer; }
.amount-slider::-webkit-slider-thumb { -webkit-appearance:none; appearance:none; width:26px; height:26px; border-radius:50%;
  background:var(--brand); border:3px solid var(--surface); box-shadow:0 3px 10px color-mix(in srgb,var(--brand) 55%,transparent); cursor:pointer; transition:transform .1s; }
.amount-slider::-webkit-slider-thumb:active { transform:scale(1.15); }
.amount-slider::-moz-range-thumb { width:22px; height:22px; border-radius:50%; background:var(--brand);
  border:3px solid var(--surface); box-shadow:0 3px 10px rgba(0,0,0,.25); cursor:pointer; }

.presets { display:flex; flex-wrap:wrap; gap:8px; }
.preset-chip { font:inherit; font-size:13px; font-weight:600; color:var(--text-muted); background:var(--surface-2);
  border:1px solid var(--border); border-radius:999px; padding:7px 15px; cursor:pointer; transition:all .14s ease; font-variant-numeric:tabular-nums; }
.preset-chip:hover { border-color:var(--brand); color:var(--brand-text); }
.preset-chip.is-active { background:var(--brand); border-color:var(--brand); color:#fff; }

/* ---- Crypto top-up card: larger, centered contents ---- */
.topup .card__body { padding: 28px 34px; }
.topup .coins, .topup .presets { justify-content: center; }
.topup .amount-slider { height: 10px; }
@media (max-width: 560px) { .topup .card__body { padding: 20px 18px; } }

/* ---- Amount stepper (replaces the slider) ---- */
.amount-stepper { display:flex; align-items:center; justify-content:center; gap:20px; margin:6px 0 18px; }
.amount-stepper .amount-display { margin:0; }
.stepper-btn { width:48px; height:48px; border-radius:50%; border:1px solid var(--border);
  background:var(--surface-2); color:var(--text); font-size:26px; line-height:1; font-weight:600; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; transition:all .14s ease; flex-shrink:0; }
.stepper-btn:hover { border-color:var(--brand); color:var(--brand); background:var(--brand-soft); }
.stepper-btn:active { transform:scale(.93); }

/* ---- Spinner (dashboard chart / loading states) ---- */
.spinner { width:34px; height:34px; border-radius:50%; border:3px solid var(--border);
  border-top-color:var(--brand); animation:zsSpin .7s linear infinite; }
@keyframes zsSpin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration:1.6s; } }

/* ---- Active sessions list (redesigned) ---- */
.session-list { display:flex; flex-direction:column; }
.session-row { display:flex; align-items:center; gap:14px; padding:14px 20px; border-bottom:1px solid var(--border); transition:background .14s ease; }
.session-row:last-child { border-bottom:0; }
.session-row--current { background:var(--brand-soft); }
.session-icon--current { background:var(--brand); color:#fff; }
.session-row__info { flex:1; min-width:0; }
.session-row__device { font-size:13.5px; font-weight:650; color:var(--text); display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.session-row__meta { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-top:4px; font-size:12px; color:var(--text-subtle); }
.session-row__meta span { display:inline-flex; align-items:center; gap:4px; }
.session-row__meta .icon { width:12px; height:12px; }
.session-row__live { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; color:var(--ok); flex-shrink:0; }
.live-dot { width:8px; height:8px; border-radius:50%; background:var(--ok); box-shadow:0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }

/* ---- Page header as a soft banner (every page, cohesive with the dashboard) ---- */
.page-head {
  background: linear-gradient(120deg, var(--brand-soft) 0%, var(--surface) 68%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-xs);
}
.page-head__title { margin: 0; }
.page-head__sub { color: var(--text-muted); margin-top: 4px; }
@media (max-width: 560px) { .page-head { padding: 16px 16px; } }

/* ---- Cap line/area chart rendered height on wide screens ---- */
.chart[data-chart="line"] svg, .chart[data-chart="area"] svg { max-height: 200px; }

/* The [hidden] attribute must win over components that set display. */
.btn[hidden]{display:none !important;}

/* Send/Test: "Available SMS" badge — how many messages the balance covers */
.allowance[hidden]{display:none !important;}
.allowance{
  display:flex;align-items:center;gap:12px;flex-wrap:wrap;
  margin-top:12px;padding:11px 15px;border-radius:14px;
  background:linear-gradient(135deg, rgba(41,163,220,.11), rgba(124,92,255,.08));
  border:1px solid rgba(41,163,220,.22);
  animation:allowanceIn .28s cubic-bezier(.2,.8,.2,1);
}
.allowance__icon{
  width:36px;height:36px;border-radius:10px;flex:none;
  display:inline-flex;align-items:center;justify-content:center;
  color:#fff;background:var(--brand, #29a3dc);
  background-image:linear-gradient(135deg, #2bb0e8, #1b86bd);
  box-shadow:0 4px 12px rgba(41,163,220,.35);
}
.allowance__text{display:flex;flex-direction:column;line-height:1.15;}
.allowance__label{
  font-size:10px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;
  color:var(--text-3, #8a93a6);
}
.allowance__value{font-size:19px;font-weight:800;color:var(--brand, #29a3dc);letter-spacing:-.01em;}
.allowance__meta{
  margin-left:auto;font-size:12px;font-weight:600;
  color:var(--text-2, #64748b);white-space:nowrap;
}
.allowance__meta a{color:var(--brand, #29a3dc);font-weight:700;text-decoration:none;}
.allowance--empty .allowance__icon{background-image:linear-gradient(135deg,#f59e0b,#f97316);box-shadow:0 4px 12px rgba(245,158,11,.3);}
.allowance--empty .allowance__value{color:#b45309;}
@keyframes allowanceIn{from{opacity:0;transform:translateY(-4px) scale(.98);}to{opacity:1;transform:none;}}

/* ---- Custom checkboxes: a clean brand box instead of the native grey one ---- */
input[type="checkbox"]{
  -webkit-appearance:none; appearance:none; box-sizing:border-box;
  width:18px; height:18px; margin:0; flex:none; vertical-align:middle;
  border:1.5px solid var(--border-strong); border-radius:5px;
  background:var(--surface); cursor:pointer;
  transition:background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
input[type="checkbox"]:hover{ border-color:var(--brand); }
input[type="checkbox"]:checked{
  background:var(--brand); border-color:var(--brand);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size:12px 12px; background-position:center; background-repeat:no-repeat;
}
input[type="checkbox"]:indeterminate{
  background:var(--brand); border-color:var(--brand);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round'%3E%3Cline x1='6' y1='12' x2='18' y2='12'/%3E%3C/svg%3E");
  background-size:12px 12px; background-position:center; background-repeat:no-repeat;
}
input[type="checkbox"]:focus-visible{ outline:none; box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
input[type="checkbox"]:disabled{ opacity:.5; cursor:not-allowed; }

/* Toggle-switch input stays invisible (higher specificity than the rules above). */
.switch input[type="checkbox"]{
  -webkit-appearance:none; appearance:none;
  position:absolute; opacity:0; width:0; height:0; margin:0; border:0; background:none; box-shadow:none;
}
/* Keep wrapper checkboxes aligned with the first line of their label. */
.checkbox input[type="checkbox"], .radio input[type="checkbox"]{ margin-top:1px; }

/* First-visit Send intro modal */
.intro__bar{height:5px;background:var(--brand);background-image:linear-gradient(90deg,var(--brand),#7c5cff);}
.intro__body{padding:30px 28px 22px;text-align:center;}
.intro__icon{width:62px;height:62px;margin:0 auto 16px;border-radius:18px;display:flex;align-items:center;justify-content:center;color:#fff;background:linear-gradient(135deg,#2bb0e8,#1b86bd);box-shadow:0 10px 24px rgba(41,163,220,.34);}
.intro__title{margin:0 0 6px;font-size:20px;font-weight:800;letter-spacing:-.01em;color:var(--text);}
.intro__sub{margin:0 0 18px;font-size:13px;color:var(--text-muted);}
.intro__tip{text-align:left;background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:14px 16px;font-size:14px;line-height:1.55;color:var(--text);}
.intro__tip strong{color:var(--brand);}
.intro__note{display:block;margin-top:8px;color:var(--text-muted);font-size:12.5px;}
.intro__foot{display:flex;justify-content:center;gap:10px;padding:2px 28px 26px;}

/* Prominent wallet balance chip (page headers) */
.balance-chip{
  display:inline-flex;align-items:center;gap:9px;
  padding:7px 8px 7px 13px;border-radius:12px;
  background:linear-gradient(135deg, rgba(41,163,220,.12), rgba(124,92,255,.10));
  border:1px solid rgba(41,163,220,.26);
}
.balance-chip__icon{display:inline-flex;color:var(--brand, #29a3dc);}
.balance-chip__text{display:flex;flex-direction:column;line-height:1.1;}
.balance-chip__amount{font-size:15px;font-weight:700;letter-spacing:-.01em;color:var(--text);}
.balance-chip__label{font-size:9px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);}
.balance-chip__add{
  display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:9px;
  color:#fff;background:var(--brand, #29a3dc);background-image:linear-gradient(135deg,#2bb0e8,#1b86bd);
  box-shadow:0 3px 9px rgba(41,163,220,.32);text-decoration:none;flex:none;
}
.balance-chip__add:hover{filter:brightness(1.05);}

/* Phone input with a fixed, non-editable country dial-code prefix (Test page) */
.phone-group{display:flex;align-items:stretch;}
.phone-group__dial{
  display:inline-flex;align-items:center;padding:0 13px;
  background:var(--surface-3);border:1px solid var(--border-strong);border-right:0;
  border-radius:var(--radius-sm) 0 0 var(--radius-sm);
  font-weight:700;color:var(--text);font-size:13.5px;white-space:nowrap;letter-spacing:.01em;
}
.phone-group__input{border-top-left-radius:0 !important;border-bottom-left-radius:0 !important;}
.phone-group:focus-within .phone-group__dial{border-color:var(--brand);}
.phone-group .input.is-invalid, .input.is-invalid{border-color:var(--danger) !important;}

/* ===== Landing page animations ===== */
/* Hero entrance on load (staggered) */
.site-hero__eyebrow,.site-hero__title,.site-hero__subtitle,.site-hero__actions,.site-hero__note,.site-stats{
  animation:heroIn .8s cubic-bezier(.2,.7,.2,1) both;
}
.site-hero__title{animation-delay:.06s}
.site-hero__subtitle{animation-delay:.15s}
.site-hero__actions{animation-delay:.24s}
.site-hero__note{animation-delay:.32s}
.site-stats{animation-delay:.40s}
@keyframes heroIn{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}

/* Scroll-reveal for sections (class added by JS → no-JS users see content) */
.site-section.reveal{opacity:0;transform:translateY(26px);
  transition:opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);}
.site-section.reveal.is-visible{opacity:1;transform:none;}

/* Gentle lift on cards */
.site-feature,.site-price-card,.site-stat{transition:transform .25s ease, box-shadow .25s ease;}
.site-feature:hover,.site-price-card:hover{transform:translateY(-4px);}

@media (prefers-reduced-motion: reduce){
  .site-hero__eyebrow,.site-hero__title,.site-hero__subtitle,.site-hero__actions,.site-hero__note,.site-stats{animation:none}
  .site-section.reveal{opacity:1 !important;transform:none !important;transition:none}
  .site-feature:hover,.site-price-card:hover{transform:none}
}

/* ===== Landing hero: split layout (text left, globe right) ===== */
.site-hero__grid.has-globe{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:56px;align-items:start;text-align:left;
}
.site-hero__grid.has-globe .site-hero__content{max-width:540px;}
.site-hero__grid.has-globe .site-hero__visual{justify-self:end;align-self:center;width:100%;}
.site-hero__grid.has-globe .site-hero__eyebrow{justify-content:flex-start;}
.site-hero__grid.has-globe .site-hero__actions{justify-content:flex-start;}
.site-hero__grid.has-globe .site-stats{justify-content:flex-start;}
@media (max-width:980px){
  .site-hero__grid.has-globe{grid-template-columns:1fr;text-align:center;gap:26px;}
  .site-hero__grid.has-globe .site-hero__content{max-width:none;}
  .site-hero__grid.has-globe .site-hero__eyebrow,
  .site-hero__grid.has-globe .site-hero__actions,
  .site-hero__grid.has-globe .site-stats{justify-content:center;}
  .site-globe{max-width:420px;margin:0 auto;}
}

/* ===== Landing hero globe (globe.gl) ===== */
.site-hero__visual{
  position:relative;min-width:0;
  animation:heroIn 1s cubic-bezier(.2,.7,.2,1) both;animation-delay:.3s;
}
.site-globe{
  width:100%;max-width:560px;aspect-ratio:1 / 1;margin:0 0 0 auto;position:relative;cursor:grab;
}
.site-globe:active{cursor:grabbing;}
.site-globe canvas{display:block;outline:none;}
.site-globe__caption{
  text-align:center;margin-top:4px;display:inline-flex;align-items:center;gap:7px;
  width:100%;justify-content:center;color:var(--text-muted);font-size:12.5px;font-weight:600;
}
.site-globe__caption .icon{color:var(--brand);}
@media (prefers-reduced-motion: reduce){ .site-hero__visual{animation:none;} }

/* Stat cards: staggered entrance + hover lift (reports, dashboard) */
.stat { transition: transform .2s ease, box-shadow .2s ease; animation: statIn .5s cubic-bezier(.2,.7,.2,1) backwards; }
.stat:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(16,26,40,.10); }
.grid--5 > .stat:nth-child(2), .grid--4 > .stat:nth-child(2), .grid--3 > .stat:nth-child(2) { animation-delay: .06s; }
.grid--5 > .stat:nth-child(3), .grid--4 > .stat:nth-child(3), .grid--3 > .stat:nth-child(3) { animation-delay: .12s; }
.grid--5 > .stat:nth-child(4), .grid--4 > .stat:nth-child(4) { animation-delay: .18s; }
.grid--5 > .stat:nth-child(5) { animation-delay: .24s; }
.stat__ico { transition: transform .2s ease; }
.stat:hover .stat__ico { transform: scale(1.08) rotate(-4deg); }
@keyframes statIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .stat { animation: none; }
  .stat:hover { transform: none; }
  .stat:hover .stat__ico { transform: none; }
}
