/* ==========================================================================
   SmsHorizon panel — app.css
   Polish layer on top of Bootstrap 5.3.x. Design tokens + base + auth screen.
   Self-hosted fonts (no CDN). Brand tokens shared with the marketing site.
   NOTE: the login design is LOCKED (Classic Ocean, motion). Its motion +
   gradient now live in this file (see the .auth-aside block + AUTH MOTION at
   the foot of the file), gated behind prefers-reduced-motion.
   ========================================================================== */

/* ---- Self-hosted fonts (latin subset) ---------------------------------- */
@font-face { font-family:'Figtree'; font-style:normal; font-weight:400; font-display:swap; src:url('lib/fonts/figtree-400.woff2') format('woff2'); }
@font-face { font-family:'Figtree'; font-style:normal; font-weight:500; font-display:swap; src:url('lib/fonts/figtree-500.woff2') format('woff2'); }
@font-face { font-family:'Figtree'; font-style:normal; font-weight:600; font-display:swap; src:url('lib/fonts/figtree-600.woff2') format('woff2'); }
@font-face { font-family:'Figtree'; font-style:normal; font-weight:700; font-display:swap; src:url('lib/fonts/figtree-700.woff2') format('woff2'); }
@font-face { font-family:'Figtree'; font-style:normal; font-weight:800; font-display:swap; src:url('lib/fonts/figtree-800.woff2') format('woff2'); }
@font-face { font-family:'Fraunces'; font-style:normal; font-weight:500; font-display:swap; src:url('lib/fonts/fraunces-500.woff2') format('woff2'); }
@font-face { font-family:'Fraunces'; font-style:normal; font-weight:700; font-display:swap; src:url('lib/fonts/fraunces-700.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:400; font-display:swap; src:url('lib/fonts/jetbrains-mono-400.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('lib/fonts/jetbrains-mono-500.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:600; font-display:swap; src:url('lib/fonts/jetbrains-mono-600.woff2') format('woff2'); }

/* ---- Design tokens ----------------------------------------------------- */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-muted: #eef2f7;
  --text: #102a43;
  --text-muted: #486581;
  --text-faint: #829ab1;
  --border: #d2dcea;
  --border-soft: #e6ebf1;
  --brand: #1d4ed8;
  --brand-hover: #1e40af;
  --brand-soft: #eef4ff;
  --brand-dark: #1e3a8a;
  --cyan: #22d3ee;
  /* Ocean accent tokens (de-azured 2026-06-16: legacy azure #139dd7/#42b1df
     dropped per "full ocean/navy"). These carry the Classic Ocean family across
     the dashboard content (cards, boxes, quick-actions). The chrome's two
     confirmed azure-family survivors — the teal-green navbar and the #1f7fd4
     single-blue sidebar — are set directly in the shell rules below, not here. */
  --sky: #1d4ed8;
  --sky-soft: #2563eb;
  --sky-ink: #1e3a8a;
  --sky-bg: rgba(29,78,216,.10);
  --sky-line: rgba(29,78,216,.26);
  --green: #00a867;
  --green-hover: #04996a;
  --ink: #0f2440;
  --ink-2: #33475c;
  --ink-3: #5b6b7d;
  --line: #e4ebf2;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --accent: #f59e0b;
  --success: #059669;
  --danger: #dc2626;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(16,42,67,.06), 0 1px 3px rgba(16,42,67,.05);
  --shadow-md: 0 4px 12px rgba(16,42,67,.08), 0 2px 4px rgba(16,42,67,.05);
  --shadow-lg: 0 28px 70px -22px rgba(16,42,67,.34), 0 10px 28px -14px rgba(16,42,67,.20);

  /* Bootstrap overrides so its components inherit the brand */
  --bs-primary: #1d4ed8;
  --bs-primary-rgb: 29,78,216;
  --bs-body-color: #102a43;
  --bs-body-font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bs-border-radius: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Panel pages use the system font stack — matches the compose mockup the design
   was approved against. The login screen keeps Figtree/Fraunces (locked design). */
.panel-body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  /* Density: match the mock, which has NO body line-height (renders `normal`).
     Bootstrap sets body line-height:1.5, which inflated every padding-based row
     (navbar items, sidebar links, dropdown toggles, radios) ~4-6px taller than
     the mock — the "everything feels a little bigger" report. Prose surfaces
     (textarea) re-assert 1.5 themselves where readability needs it. */
  line-height: normal;
}

/* ==========================================================================
   AUTH SCREEN (login / forgot password)
   ========================================================================== */

.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 520px at 100% -10%, #e7efff 0%, rgba(231,239,255,0) 60%),
    radial-gradient(900px 480px at -10% 110%, #eef4ff 0%, rgba(238,244,255,0) 55%),
    var(--bg-soft);
}

/* the split card: brand aside + form main */
.auth-card {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* ---- brand aside (gradient + decorative glows) ---- */
.auth-aside {
  position: relative;
  overflow: hidden;
  padding: 52px 46px;
  color: #eaf1ff;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(152deg, #2563eb 0%, #1d4ed8 44%, #15307e 100%);
}
/* cyan glow top-right — echoes the logo's cyan */
.auth-aside::before {
  content: ""; position: absolute; width: 440px; height: 440px; right: -150px; top: -170px;
  background: radial-gradient(circle, rgba(34,211,238,.48), rgba(34,211,238,0) 68%);
  pointer-events: none;
}
/* sky-blue glow bottom-left */
.auth-aside::after {
  content: ""; position: absolute; width: 400px; height: 400px; left: -160px; bottom: -170px;
  background: radial-gradient(circle, rgba(96,165,250,.40), rgba(96,165,250,0) 70%);
  pointer-events: none;
}
.auth-aside > * { position: relative; z-index: 1; }

.auth-aside h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 2rem;
  line-height: 1.18;
  margin: 0 0 12px;
  color: #fff;
  letter-spacing: -0.01em;
}
.auth-aside p.lede { color: rgba(234,241,255,.84); margin: 0 0 26px; max-width: 34ch; }

.auth-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-feats li { display: flex; align-items: center; gap: 10px; color: rgba(234,241,255,.94); font-size: .95rem; }
.auth-feats .bi { color: #a5f3fc; font-size: 1.05rem; }

.aside-stats { display: flex; gap: 10px; margin-top: auto; padding-top: 28px; }
.aside-stats > div {
  flex: 1; text-align: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px; padding: 12px 8px;
  backdrop-filter: blur(2px);
}
.aside-stats b { display: block; font-size: 1.25rem; font-weight: 700; color: #fff; line-height: 1.1; }
.aside-stats span { font-size: .76rem; color: rgba(234,241,255,.72); }

.auth-aside .aside-foot { margin-top: 18px; font-size: .82rem; color: rgba(234,241,255,.6); }

/* ---- form main ---- */
.auth-main { padding: 48px 46px; display: flex; flex-direction: column; justify-content: center; }
.auth-logo { display: block; height: 44px; width: auto; margin: 0 auto 22px; }
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-head h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
.auth-head .sub { color: var(--text-muted); margin: 0; font-size: .98rem; }

/* ---- notched floating-label fields (Material / Google "notch") ---------
   The label rests inside the field, then floats up to sit ON the top border;
   its white background cuts a notch in the outline. Applied in BOTH variants
   (a base feature). Only the float's smoothness differs per variant. */
.fl { position: relative; margin-bottom: 20px; }
.fl .bi-lead {
  position: absolute; left: 16px; top: 28px; transform: translateY(-50%);
  color: var(--text-faint); font-size: 1.05rem; pointer-events: none; z-index: 2;
}
.fl .form-control {
  height: 56px;
  padding: 14px 46px 0 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 1rem;
  box-shadow: none;
}
.fl .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.fl label {
  position: absolute; left: 40px; top: 28px; transform: translateY(-50%);
  color: var(--text-faint); font-size: 1rem; font-weight: 500;
  padding: 0 6px; background: transparent; pointer-events: none;
  white-space: nowrap;
}
/* floated state: focused OR has a value */
.fl .form-control:focus ~ label,
.fl .form-control:not(:placeholder-shown) ~ label {
  top: 0; transform: translateY(-50%) scale(.84);
  color: var(--brand); background: #fff;
}
.fl .form-control:not(:focus):not(:placeholder-shown) ~ label { color: var(--text-muted); }
.fl:focus-within .bi-lead { color: var(--brand); }

.toggle-pw {
  position: absolute; right: 8px; top: 28px; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--text-faint);
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer; z-index: 3;
}
.toggle-pw:hover { color: var(--text-muted); background: var(--bg-muted); }

.auth-row { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 22px; }
.auth-row .form-check-label { color: var(--text-muted); font-size: .9rem; }
.auth-row a { color: var(--brand); font-weight: 600; font-size: .9rem; text-decoration: none; }
.auth-row a:hover { text-decoration: underline; }

.btn-brand {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-brand:hover { background: var(--brand-hover); color: #fff; }
.btn-brand:disabled { opacity: .7; }

.auth-foot { margin-top: 26px; color: var(--text-faint); font-size: .88rem; text-align: center; }
.auth-foot a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

.auth-alert {
  border: 1px solid #f3c2c2;
  background: #fdecec;
  color: #8a1f1f;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: .92rem;
  margin-bottom: 20px;
  display: flex; gap: 10px; align-items: flex-start;
}

/* ---- responsive: stack, hide brand aside on small screens ---- */
@media (max-width: 767.98px) {
  .auth-card { grid-template-columns: 1fr; max-width: 460px; }
  .auth-aside { display: none; }
  .auth-main { padding: 38px 26px; }
}

/* ==========================================================================
   AUTH MOTION (Emil Kowalski principles, ported to CSS) + shared toast/spinner.
   The login is LOCKED to Classic Ocean (motion). All of the animation below
   self-disables under prefers-reduced-motion; the spinner/toast base styles
   stay (they are layout, not motion).
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* card mounts with a soft scale + lift */
  .auth-card { animation: ek-cardIn .55s cubic-bezier(.22,1,.36,1) both; }
  @keyframes ek-cardIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }

  /* staggered reveal of each element (delay driven by the inline --i) */
  .auth-wrap .reveal { opacity: 0; animation: ek-revealUp .6s cubic-bezier(.22,1,.36,1) forwards; animation-delay: calc(var(--i, 0) * 70ms + 150ms); }
  @keyframes ek-revealUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

  /* smooth notch float + field focus + lead-icon tint */
  .fl label { transition: top .2s cubic-bezier(.22,1,.36,1), transform .2s cubic-bezier(.22,1,.36,1), color .18s ease, background .18s ease; }
  .fl .form-control { transition: border-color .18s ease, box-shadow .2s cubic-bezier(.22,1,.36,1); }
  .fl .bi-lead { transition: color .18s ease; }

  /* button hover-lift / press */
  .btn-brand { transition: background .18s ease, transform .12s cubic-bezier(.22,1,.36,1), box-shadow .2s ease; }
  .btn-brand:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(0,0,0,.28); }
  .btn-brand:active { transform: translateY(0) scale(.985); }

  /* ambient glow drift on the brand aside */
  .auth-aside::before { animation: ek-drift1 16s ease-in-out infinite alternate; }
  .auth-aside::after  { animation: ek-drift2 19s ease-in-out infinite alternate; }
  @keyframes ek-drift1 { from { transform: translate(0, 0); } to { transform: translate(-26px, 22px); } }
  @keyframes ek-drift2 { from { transform: translate(0, 0); } to { transform: translate(22px, -20px); } }

  /* toast entrance */
  .toastx { animation: ek-toastIn .42s cubic-bezier(.22,1,.36,1) both; }
  @keyframes ek-toastIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
}

/* spinner inside the brand button (shown while a form submits) */
.btn-brand .spin { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: ek-spin .7s linear infinite; display: none; }
.btn-brand.is-loading .spin { display: inline-block; }
.btn-brand.is-loading .lbl { opacity: .85; }
@keyframes ek-spin { to { transform: rotate(360deg); } }

/* Sonner-style toast stack (reused by the panel shell) */
.toast-host { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1080; }
.toastx { display: flex; gap: 10px; align-items: center; background: #0b1f3a; color: #e0f2fe; padding: 12px 15px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: .92rem; min-width: 250px; }
.toastx .bi { color: #67e8f9; font-size: 1.1rem; }

/* ==========================================================================
   PANEL SHELL — locked "classic single-blue sidebar" chrome
   (topbar -> teal navbar -> single-blue sidebar + content card -> footer card).
   Mirror of public_html/_preview-compose-sidebar-blue.html. Two azure-family
   colours survive the de-azure by explicit decision: the teal-green navbar
   (#21a7d8 -> #27c08f) and the #1f7fd4 sidebar. Everything else is ocean/navy.
   ========================================================================== */
.panel-body { background: #fff; color: var(--text); text-rendering: optimizeLegibility; }
.panel-body a { text-decoration: none; color: inherit; }
.panel-body, .panel-body * { text-shadow: none; }      /* crisp, never shadowed */
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 32px; }

/* ---- topbar (logo + balance + add credits + account) ---- */
.topbar { background: #fff; padding-top: 14px; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 48px; width: auto; display: block; }
.header-right { display: flex; align-items: center; gap: 24px; }
.hcenter { display: flex; align-items: center; gap: 16px; }
.bal { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; text-align: right; white-space: nowrap; }
.bal .ey { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-faint); }
.bal .big { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.btn-credits { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 600;
  color: #fff; background: linear-gradient(180deg,#2bbf6a,#0f9d58); border: 0; border-radius: 999px;
  padding: 11px 14px; cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: filter .15s ease, transform .15s ease; }
.btn-credits:hover { filter: brightness(1.05); color: #fff; }
.btn-credits:active { transform: scale(.97); }
.btn-credits .bi { font-size: 16px; line-height: 0; flex: none; }

/* account pill */
.user-wrap { position: relative; }
.user { display: flex; align-items: center; gap: 11px; border: 1px solid var(--border-soft); border-radius: 999px;
  padding: 5px 17px 5px 14px; cursor: pointer; background: #fff; font-family: inherit;
  transition: background .15s ease, border-color .15s ease; }
.user:hover { background: #f6f9fc; border-color: var(--border); }
.user .av { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg,#8b5cf6,#6d28d9);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex: none; }
.user .ui { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.user .name { font-weight: 600; font-size: 15px; }
.user .uname { font-size: 12.5px; color: var(--text-faint); }
.user .cv { color: var(--brand); font-size: 14px; margin-left: 6px; transition: transform .2s ease; }
.user[aria-expanded="true"] .cv { transform: rotate(180deg); }

/* account dropdown (light vibrancy) */
.menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: 266px; padding: 8px;
  overflow: hidden; border-radius: 16px; display: none; transform-origin: top right;
  background: rgba(255,255,255,.97); backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%); border: 1px solid var(--border); }
.menu.open { display: block; }
@media (prefers-reduced-motion: no-preference) { .menu.open { animation: ek-pop .18s cubic-bezier(.22,1,.36,1); } }
@keyframes ek-pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
.m-head { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; }
.m-av { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg,#8b5cf6,#6d28d9);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; flex: none; }
.m-name { font-weight: 700; font-size: 15px; line-height: 1.2; color: var(--text); }
.m-sub { font-size: 12px; margin-top: 2px; color: var(--text-faint); }
.m-sep { height: 1px; margin: 4px 6px; background: rgba(20,30,60,.10); }
.m-item { display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 9px;
  font-size: 15.5px; font-weight: 500; color: #28303d; transition: background .13s ease, color .13s ease; }
.m-item i { font-size: 17px; width: 20px; text-align: center; color: #5a6678; }
.m-item:hover { background: #eef1f6; color: var(--text); }
.m-item:hover i { color: #3a4254; }
.m-item.danger { color: #d6353b; } .m-item.danger i { color: #d6353b; }
.m-item.danger:hover { background: #d6353b; color: #fff; } .m-item.danger:hover i { color: #fff; }

/* ---- full-width navbar (teal-green, kept by decision) ---- */
.navwrap { padding: 14px 0 10px; }
.nbar { display: flex; align-items: stretch; background: linear-gradient(90deg,#21a7d8,#27c08f);
  border-radius: 10px; overflow: hidden; }
.nb-main { display: flex; flex: 1; }
.nb-item { display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff;
  font-weight: 600; font-size: 16.5px; padding: 11px 14px; white-space: nowrap; position: relative;
  transition: background .15s ease; }
.nb-main .nb-item { flex: 1; }
.nb-main .nb-spacer { flex: 1; }
.nb-item i { font-size: 19px; }
.nb-item:hover { background: rgba(0,0,0,.10); color: #fff; }
.nb-item.active { background: rgba(0,0,0,.16); }
.nb-support { margin-left: auto; padding: 11px 25px; }
.nb-api { padding: 11px 25px; }

/* ---- layout: sidebar + content ---- */
.layout { display: grid; grid-template-columns: 256px 1fr; gap: 24px; margin-top: 16px; margin-bottom: 44px; align-items: start; }

/* single-blue sidebar (#1f7fd4 — the locked survivor) */
.sidebar { background: #fff; border: 1px solid var(--border-soft); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.side-group { padding: 0 0 6px; }
.side-group + .side-group { border-top: 1px solid #eef1f6; }
.side-head { height: 46px; font-size: 13.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  padding: 0 20px; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; background: #1f7fd4; color: #fff; }
.side-head i { font-size: 16px; }
.side-link { display: flex; align-items: center; padding: 12px 20px; font-size: 15px; font-weight: 600;
  color: #1f4ea8; transition: background .14s ease, color .14s ease; }
.side-link::after { content: ""; width: 7px; height: 7px; border-right: 2px solid #c3cad6; border-top: 2px solid #c3cad6;
  transform: rotate(45deg); margin-left: auto; transition: border-color .14s ease; }
.side-link:hover { background: #f4f8fc; color: #1f7fd4; }
.side-link:hover::after { border-color: #1f7fd4; }
.side-link.active { background: #eef6fd; color: #1257bd; }
.side-link.active::after { border-color: #1257bd; }

/* Component link colours must outrank `.panel-body a { color: inherit }` (0,1,1).
   The mockup used a bare `a { color: inherit }` (0,0,1), so the (0,1,0) .nb-item /
   .side-link colours won; the port scoped it to `.panel-body a`, which then
   clobbered them and the nav/sidebar links inherited the dark body text. Restore. */
.nbar .nb-item { color: #fff; }
.sidebar .side-link { color: #1f4ea8; }
.sidebar .side-link:hover { color: #1f7fd4; }
.sidebar .side-link.active { color: #1257bd; }

/* Left column wrapper: the sidebar card with the "Back to dashboard" button as a
   distinct card BELOW it (the account area has no active channel tab, so the logo
   used to be the only way back — this keeps the way back clearly visible). */
.side-col { display: flex; flex-direction: column; gap: 12px; }
.side-back { display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 14px; border: 1px solid var(--border-soft); border-radius: 12px;
  font-size: 14.5px; font-weight: 600; color: #1f4ea8; background: #fff; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.side-back:hover { background: #f4f8fc; color: #1f7fd4; border-color: #cfe0f3; box-shadow: var(--shadow-md); }
.side-back i { font-size: 16px; }
/* Add-credits is an <a> in the shell (a <button> in the mock, so the mock's bare
   `a{color:inherit}` never touched it). `.panel-body a{color:inherit}` (0,1,1)
   outranks `.btn-credits{color:#fff}` (0,1,0) and turned the label dark — restore
   white at higher specificity (its .plus svg uses currentColor, so it follows). */
.topbar .btn-credits, .topbar .btn-credits:hover { color: #fff; }

/* content card + gray-gradient head with breadcrumb */
.content { background: #fff; border: 1px solid var(--border-soft); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.content-head { height: 46px; padding: 0 26px; font-size: 18px; font-weight: 700; color: #fff;
  background: linear-gradient(to right,#656f7f,#828fa1); border-bottom: 1px solid rgba(0,0,0,.12);
  display: flex; align-items: center; gap: 11px; }
.content-head .breadcrumb { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; font-size: 16px; }
.content-head .breadcrumb li { display: flex; align-items: center; }
.content-head .breadcrumb li + li::before { content: '\203A'; color: rgba(255,255,255,.5); padding: 0 .6rem; }
.content-head .breadcrumb a { color: rgba(255,255,255,.82); font-weight: 600; transition: color .14s ease; }
.content-head .breadcrumb a:hover { color: #fff; }
.content-head .breadcrumb .cur { color: #fff; font-weight: 700; }
.content-body { padding: 24px 26px 30px; }

.welcome h2 { font-size: 1.45rem; font-weight: 700; margin: 0 0 3px; letter-spacing: -.01em; }
.welcome p { color: var(--ink-2); margin: 0 0 18px; font-size: .98rem; }

/* stat cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.card2 { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card2 .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem;
  background: var(--sky-bg); color: var(--sky); margin-bottom: 12px; }
.card2 .lbl { color: var(--ink-2); font-size: .95rem; font-weight: 600; }
.card2 .num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; color: var(--ink); }
.card2 .delta { font-size: .85rem; font-weight: 600; margin-top: 5px; color: var(--ink-3); }
.card2 .delta.up { color: var(--success); }

.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.box-h { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.box-h h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.box-h a { font-size: .9rem; font-weight: 600; color: var(--sky-ink); text-decoration: none; }
.box-h a:hover { text-decoration: underline; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .96rem; }
table.tbl th { text-align: left; padding: 11px 18px; color: var(--ink-3); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-soft); }
table.tbl td { padding: 13px 18px; border-top: 1px solid var(--line); color: var(--ink); }
.badge2 { font-size: .8rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.badge2.ok { background: #e6f6ef; color: var(--success); }
.badge2.pend { background: #fff3e0; color: #b26a00; }

.qa { padding: 18px; }
.qa h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 14px; }
.btn-compose { width: 100%; background: var(--sky); color: #fff; border: 0; border-radius: 12px; height: 48px;
  font-weight: 700; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: 9px; text-decoration: none; }
.btn-compose:hover { background: var(--sky-ink); color: #fff; }
.qa-link { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; margin-top: 10px; }
.qa-link .bi { color: var(--sky); font-size: 1.15rem; }
.qa-link:hover { border-color: var(--sky-line); background: var(--sky-bg); }

/* ==========================================================================
   PANEL CONTENT — list/table pages (Scheduled, Outbox, Contacts, Templates).
   Shared furniture so every SMS list page matches: page toolbar, action
   buttons, data table, status badges, tag pills, empty state, and the native
   <dialog> sheet used for add/edit modals. Same tokens as the shell/dashboard;
   inherits the panel system font + line-height:normal.
   ========================================================================== */

/* page toolbar: title/intro on the left, primary actions on the right */
.page-tools { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-tools .pt-l h2 { font-size: 1.15rem; font-weight: 700; margin: 0; letter-spacing: -.01em; color: var(--ink); }
.page-tools .pt-l p { margin: 3px 0 0; font-size: .92rem; color: var(--ink-3); }
.page-tools .pt-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* action buttons */
.btn-a { display: inline-flex; align-items: center; gap: 8px; font-family: inherit; font-size: 14px; font-weight: 600;
  border-radius: 9px; padding: 9px 15px; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s var(--ease-out); }
.btn-a i { font-size: 15px; }
.btn-a:active { transform: scale(.97); }
.btn-a.pri { background: var(--sky); color: #fff; }
.btn-a.pri:hover { background: var(--sky-ink); color: #fff; }
.btn-a.ghost { background: #fff; color: var(--ink-2); border-color: var(--border); }
.btn-a.ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn-a.danger { background: #fff; color: var(--danger); border-color: #f3c2c2; }
.btn-a.danger:hover { background: #fdecec; color: var(--danger); }
.btn-a.sm { padding: 6px 11px; font-size: 13px; }

/* data table on a list page (extends the dashboard table.tbl) */
.tbl-wrap { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tbl-wrap.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-wrap table.tbl { font-size: .94rem; }
table.tbl tbody tr { transition: background .12s ease; }
table.tbl tbody tr:hover { background: var(--bg-soft); }
table.tbl td.num { color: var(--ink-3); font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
table.tbl td.right, table.tbl th.right { text-align: right; }
.msg-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .86rem; color: var(--ink-2); }
table.tbl td.dt { white-space: nowrap; color: var(--ink-2); }

/* row actions (icon buttons) */
.t-actions { display: inline-flex; gap: 6px; }
.t-act { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px;
  border: 1px solid var(--border-soft); background: #fff; color: var(--ink-3); cursor: pointer; font-size: 14px;
  transition: background .13s ease, color .13s ease, border-color .13s ease; }
.t-act:hover { background: var(--bg-soft); color: var(--sky); border-color: var(--sky-line); }
.t-act.danger:hover { background: #fdecec; color: var(--danger); border-color: #f3c2c2; }

/* status badges — extend the dashboard .badge2 family */
.badge2.info { background: var(--sky-bg); color: var(--sky-ink); }
.badge2.muted { background: #eef1f6; color: #5b6b7d; }
.badge2.reject { background: #fdecec; color: #b42318; }

/* tag pills (Contacts) */
.tags-cell { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: var(--sky-bg); color: var(--sky-ink); }
.tag-none { color: var(--text-faint); font-size: .85rem; }

/* empty state */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty .ei { width: 56px; height: 56px; border-radius: 16px; display: inline-grid; place-items: center; font-size: 1.7rem;
  background: var(--sky-bg); color: var(--sky); margin-bottom: 14px; }
.empty h3 { font-size: 1.02rem; font-weight: 700; color: var(--ink-2); margin: 0 0 4px; }
.empty p { margin: 0 0 16px; font-size: .92rem; }

/* a section block on multi-section pages (Templates) */
.sec + .sec { margin-top: 22px; }

/* an inline note (deferred-action / info banner) */
.pnote { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 16px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.pnote.info { background: #eef4ff; color: #1e3a8a; border: 1px solid #cdddfb; }
.pnote.ok { background: #e6f6ef; color: #0f7a4d; border: 1px solid #bce6d2; }
.pnote.err { background: #fdecec; color: #b42318; border: 1px solid #f6cdcd; }
.pnote i { font-size: 16px; margin-top: 1px; }

/* ===== Delivery Reports: summary (total sent + delivery rate) ===== */
.rsum { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.rsum-card { background: var(--bg-muted); border-radius: 14px; padding: 11px 18px; display: flex; align-items: center; gap: 13px; }
.rsum-rate { flex-direction: column; align-items: stretch; gap: 7px; }
.rsum-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.rsum-lbl { font-size: .9rem; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.rsum-num { font-size: 1.5rem; font-weight: 800; color: var(--ink); line-height: 1.15; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.rsum-rate-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rsum-rate-l { display: flex; align-items: center; gap: 13px; min-width: 0; }
.rsum-of { font-size: .8rem; font-weight: 600; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rsum-bar { height: 6px; border-radius: 999px; background: #d7dee8; overflow: hidden; }
.rsum-bar-fill { height: 100%; border-radius: 999px; background: #12ad1c; }

/* ===== Analytics: status donut + legend (Delivery Reports) ===== */
.report-chart { position: relative; overflow: visible; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 44px; padding: 30px 26px; margin-bottom: 18px; flex-wrap: wrap; }
.rc-donut { flex: 0 0 auto; }
.report-apex { width: 300px; max-width: 100%; min-height: 300px; }
.rc-empty { width: 216px; height: 216px; display: flex; align-items: center; justify-content: center; background: #eef1f6; border-radius: 50%; color: var(--ink-3); font-size: 13px; font-weight: 600; text-align: center; padding: 0 18px; }
.rc-tip { position: absolute; z-index: 6; background: #fff; color: var(--ink); border: 1px solid #e2e6ee; border-radius: 9px; box-shadow: 0 8px 24px rgba(15,23,42,.16); padding: 8px 13px; font-size: 13px; line-height: 1.4; white-space: nowrap; display: flex; flex-direction: column; gap: 1px; opacity: 0; pointer-events: none; transition: opacity .12s ease; transform: translate(-50%, 13px); }
.rc-tip.down { transform: translate(-50%, calc(-100% - 13px)); }
.rc-tip.show { opacity: 1; }
.rc-tip-name { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-weight: 600; }
.rc-tip-val { font-size: 13.5px; color: var(--ink); }
.rc-tip-val b { font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-tip-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.rc-tip::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); border: 7px solid transparent; }
.rc-tip:not(.down)::after { top: -13px; border-bottom-color: #fff; }
.rc-tip.down::after { bottom: -13px; border-top-color: #fff; }
.rc-legend { flex: 0 0 auto; width: 300px; max-width: 100%; }
.rc-legend h3 { margin: 0 0 10px; font-size: 1rem; font-weight: 700; color: var(--ink); text-align: center; }
.legend { list-style: none; margin: 0; padding: 0; }
.legend li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.legend li:last-child { border-bottom: 0; }
.legend .swatch { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.legend .lg-label { flex: 1; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.legend .lg-count { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.legend .lg-pct { color: var(--ink-3); font-size: .85rem; width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .report-chart { gap: 18px; justify-content: center; } }

/* ===== Campaigns: per-campaign delivery progress ===== */
.cprog { min-width: 220px; }
.cprog-bar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: #eef1f6; }
.cprog-bar > span { display: block; height: 100%; }
.cprog-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: .82rem; }
.cprog-top .cm-del { color: var(--success); font-weight: 700; }
.cprog-top .cm-pct { color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.cprog-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 7px; font-size: .76rem; color: var(--ink-3); }
.cprog-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cprog-legend .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.cprog-legend b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cstatus { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; }
.cstatus.done { color: var(--success); }
.cstatus.run { color: #1a56db; }
.cstatus .dotp { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* native <dialog> sheet (add/edit modals; opened via app.js data-open) */
dialog.sheet { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--border-soft); border-radius: 16px;
  padding: 0; box-shadow: var(--shadow-lg); color: var(--text); background: #fff; overflow: visible; position: relative; }
dialog.sheet::backdrop { background: rgba(15,23,42,.42); }
dialog.sheet .sh-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
dialog.sheet .sh-head h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
/* Close button straddles the top-right corner (half outside the sheet). */
dialog.sheet .sh-close { position: absolute; top: -14px; right: -14px; z-index: 5;
  width: 34px; height: 34px; border: 1px solid var(--border); background: #fff; border-radius: 50%; color: var(--ink-2);
  box-shadow: 0 4px 14px rgba(15,23,42,.18); cursor: pointer; font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease, transform .15s ease, border-color .15s ease; }
dialog.sheet .sh-close:hover { background: #fdecec; color: var(--danger); border-color: #f3c2c2; transform: scale(1.08); }
dialog.sheet .sh-body { padding: 20px; display: grid; gap: 14px; }
dialog.sheet .sh-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 15px 20px;
  border-top: 1px solid var(--line); background: var(--bg-soft); border-radius: 0 0 16px 16px; }
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: sheetIn .22s var(--ease-out); }
  @keyframes sheetIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
}

/* form fields inside a sheet */
.fld { display: grid; gap: 6px; }
.fld label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.fld .req { color: var(--danger); }
.fld input[type=text], .fld input[type=tel], .fld input[type=email], .fld input[type=url], .fld input[type=password], .fld input[type=number], .fld input[type=date], .fld textarea, .fld select {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--text); background: #fff;
  border: 1.5px solid var(--border); border-radius: 9px; padding: 10px 12px; transition: border-color .15s ease, box-shadow .15s ease; }
.fld textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.fld input:focus, .fld textarea:focus, .fld select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.fld .hint { font-size: 12px; color: var(--text-faint); }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .fld-row { grid-template-columns: 1fr; } }

/* ---- footer card (brand + status + links) ---- */
.site-foot { }
.foot-inner { background: #fff; border: 1px solid var(--border-soft); border-radius: 12px; display: flex;
  align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; margin-bottom: 32px; flex-wrap: wrap; }
.foot-l { display: flex; align-items: center; gap: 10px; font-size: 14px; white-space: nowrap; }
.foot-brand { font-weight: 600; color: #1f7fd4; letter-spacing: -.01em; }   /* the SMS single-blue */
.foot-sep { color: #c2cad6; }
.foot-copy { color: var(--text-faint); }
.foot-r { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.foot-r a { color: var(--text-muted); transition: color .15s ease; }
.foot-r a:hover { color: var(--text); }
.foot-status { display: inline-flex; align-items: center; gap: 7px; color: #0f9d58; white-space: nowrap; }
.foot-led { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; flex: none; }

/* hamburger (mobile only) + drawer backdrop */
.icon-btn { width: 42px; height: 42px; flex: none; border: 1px solid var(--border-soft); border-radius: 9px;
  background: #fff; color: var(--text-muted); font-size: 19px; cursor: pointer; display: none;
  align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--bg-muted); }
.backdrop { display: none; }

/* horizontal-scroll wrapper so wide tables never force the page sideways */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* motion (Emil): press feedback + card hover-lift, gated behind reduced-motion */
.btn-compose, .qa-link, .side-link {
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s var(--ease-out);
}
@media (prefers-reduced-motion: no-preference) {
  .btn-compose:active, .qa-link:active { transform: scale(.985); }
  .card2 { transition: transform .16s var(--ease-out), box-shadow .2s ease; }
  @media (hover: hover) and (pointer: fine) {
    .card2:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
  }
}

/* ---- tablet / phone (≤1000): nav becomes an off-canvas drawer ---- */
@media (max-width: 1000px) {
  .wrap { padding: 0 16px; }
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .content-body { padding: 20px 18px 26px; }
  .nb-main .nb-spacer { display: none; }
  .icon-btn { display: inline-flex; }
  .topbar-inner { height: 64px; }
  .hcenter { display: none; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }

  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 284px; max-width: 86vw; z-index: 80;
    border-radius: 0; transform: translateX(-100%); transition: transform .3s cubic-bezier(.32,.72,0,1); overflow: auto; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: none; }
  .backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 70;
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease; }
  body.nav-open .backdrop { opacity: 1; visibility: visible; }
}
@media (max-width: 920px) { .nb-item span.lbl { display: none; } .nb-api, .nb-support { padding: 11px 22px; } }
@media (max-width: 620px) {
  .topbar-inner { gap: 12px; }
  .brand img { height: 40px; }
  .user .name, .user .uname, .user .cv { display: none; }
  .user { padding: 5px 12px; gap: 10px; }
  .cards { grid-template-columns: 1fr; }
  .foot-inner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 18px; }
  .foot-r { flex-wrap: wrap; gap: 12px 18px; }
}

/* coarse pointers (touch): roomier targets */
@media (pointer: coarse) {
  .side-link { padding: 14px 20px; }
  .toggle-pw { width: 44px; height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
}

/* reduced motion: no drawer slide */
@media (prefers-reduced-motion: reduce) {
  .sidebar, .backdrop { transition: none; }
}

/* ============================================================
   Developers + Virtual Number pages
   (api / apikeys / webhook / inwebhook / keywords / inbox)
   ============================================================ */

/* --- API overview: the essentials (one row per line, easy to scan/read) --- */
.api-ess { margin: 0; }
.ess-row { display: flex; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ess-row:last-child { border-bottom: 0; }
.ess-row dt { flex: 0 0 150px; display: flex; align-items: center; gap: 7px; font-size: .9rem; font-weight: 700; color: var(--ink-2); margin: 0; }
.ess-row dt i { font-size: 15px; color: var(--brand); }
.ess-row dd { flex: 1; min-width: 0; margin: 0; font-size: .94rem; color: var(--ink); line-height: 1.5; }
.ess-url { display: inline-block; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .9rem; color: var(--brand-dark); background: var(--brand-soft); padding: 3px 9px; border-radius: 7px; word-break: break-all; }
.ess-note { display: block; margin-top: 5px; font-size: .85rem; color: var(--ink-3); }
.ess-note a { color: var(--brand); font-weight: 600; text-decoration: none; }
.ess-note a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .ess-row { flex-direction: column; gap: 5px; }
  .ess-row dt { flex-basis: auto; }
}

/* --- Try-it console --- */
.con-body { padding: 18px; }
.con-seg { display: inline-flex; max-width: 100%; background: var(--bg-muted); border-radius: 10px; padding: 4px; gap: 2px; margin-bottom: 18px; }
.cs-tab { border: 0; background: transparent; font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding: 7px 16px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.cs-tab:hover { color: var(--ink); }
.cs-tab.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
.con-fields .fld, .con-fields .fld-row { margin-bottom: 14px; }
.con-help { font-size: .9rem; color: var(--ink-3); line-height: 1.55; margin: 0 0 14px; }
.con-check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.con-run { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 4px; }
.con-method { color: var(--ink-3); font-size: .85rem; }
.con-hint { display: flex; align-items: flex-start; gap: 7px; margin: 10px 0 2px; font-size: .82rem; color: var(--ink-3); line-height: 1.5; }
.con-hint i { color: var(--brand); margin-top: 1px; }
.con-hint b { color: var(--ink-2); font-weight: 700; }
.con-out { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 14px; }
.con-out-h { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; background: var(--bg-soft); border-bottom: 1px solid var(--line); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); }
.con-copy { border: 0; background: transparent; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--brand); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; }
.con-pre { margin: 0; padding: 14px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .82rem; line-height: 1.6; color: var(--ink); white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; background: #fff; }
.con-status { font-weight: 700; }
.con-status.ok { color: var(--success); }
.con-status.bad { color: var(--danger); }

/* key field with eye toggle (shared: console + API Keys) */
.key-wrap { position: relative; display: flex; align-items: center; }
.key-wrap input { flex: 1; width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .86rem; color: var(--ink); background: #fff; }
.key-wrap input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.key-eye { border: 0; background: transparent; color: var(--ink-3); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; margin-left: 4px; flex: none; }
.key-eye:hover { color: var(--ink); background: var(--bg-muted); }

/* --- API Keys page (table) --- */
.key-cell { max-width: 230px; }
.key-cell input { font-size: .8rem; padding: 6px 9px; }
.btn-a.is-disabled, .btn-a:disabled { opacity: .5; pointer-events: none; }

/* --- Webhook pages (Developers > Webhook, VMN > Inbound Webhook) --- */
.wh-body { padding: 16px 18px 18px; }
.wh-intro { margin: 0 0 16px; font-size: .95rem; color: var(--ink-2); line-height: 1.6; max-width: 72ch; }
.wh-body .fld { max-width: 560px; }
.wh-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.wh-now { font-size: .85rem; color: var(--ink-3); word-break: break-all; }

/* --- SMS Inbox: client-side filter --- */
.in-search { position: relative; display: flex; align-items: center; width: 100%; max-width: 320px; }
.in-search i { position: absolute; left: 11px; color: var(--ink-3); font-size: 14px; pointer-events: none; }
.in-search input { width: 100%; padding: 8px 11px 8px 33px; border: 1.5px solid var(--border); border-radius: 9px; font-size: .92rem; font-family: inherit; }
.in-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.in-search input[type=search] { -webkit-appearance: none; appearance: none; }
.in-search input[type=search]::-webkit-search-cancel-button,
.in-search input[type=search]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* ==========================================================================
   ACCOUNT AREA — wallet / profile / support (its own sidebar)
   ========================================================================== */

/* shared helpers */
.muted-note { font-size: .82rem; color: var(--text-faint); font-weight: 600; }
.link-strong { font-weight: 600; color: var(--sky-ink); text-decoration: none; }
.link-strong:hover { text-decoration: underline; }
.t-empty { color: var(--text-faint); padding: 22px 18px; text-align: center; }
.amt-cr { color: var(--success); }
.amt-dr { color: var(--danger); }
.card2 .num.sm { font-size: 1.15rem; }
.bh-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bh-tools .in-search { max-width: 220px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--ink-3); text-decoration: none; margin-bottom: 8px; }
.back-link:hover { color: var(--sky-ink); }

/* status pill (tickets, transaction type, account status) */
.tk-badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; vertical-align: middle; }
.tk-badge.open { background: #fff3e0; color: #b26a00; }
.tk-badge.answered { background: #e6f6ef; color: var(--success); }
.tk-badge.closed { background: #eef1f6; color: #5b6b7d; }

/* --- Wallet overview --- */
.wal-grid { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 16px; margin-bottom: 18px; }
.wal-hero { background: linear-gradient(150deg, #1e3a8a 0%, #1d4ed8 100%); color: #fff; border-radius: 16px; padding: 22px 22px 20px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; }
.wal-hero .wh-ey { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: rgba(255,255,255,.78); }
.wal-hero .wh-bal { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.wal-hero .wh-sub { font-size: .92rem; color: rgba(255,255,255,.88); }
.wal-hero .wh-low { margin-top: 12px; font-size: .85rem; font-weight: 600; background: rgba(255,255,255,.15); border-radius: 9px; padding: 8px 11px; display: flex; align-items: flex-start; gap: 7px; }
.wal-hero .wh-cta { margin-top: 18px; align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; background: #fff; color: var(--brand-dark); font-weight: 700; font-size: .9rem; padding: 9px 16px; border-radius: 10px; text-decoration: none; transition: transform .15s var(--ease-out), box-shadow .15s ease; }
.wal-hero .wh-cta:hover { box-shadow: 0 6px 18px rgba(0,0,0,.18); transform: translateY(-1px); }
.cards.wal-stats { grid-template-columns: repeat(2, 1fr); margin-bottom: 0; }
.cards.tx-stats { grid-template-columns: repeat(3, 1fr); }
/* wallet stat cards: icon on the left, label/number/sub stacked to its right, so
   the cards read compactly and stay short. */
.cards.wal-stats .card2, .cards.tx-stats .card2 {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center;
  grid-template-areas: "ic lbl" "ic num" "ic delta"; padding: 14px 16px;
}
.cards.wal-stats .card2 .ic, .cards.tx-stats .card2 .ic { grid-area: ic; }
.cards.wal-stats .card2 .lbl, .cards.tx-stats .card2 .lbl { grid-area: lbl; }
.cards.wal-stats .card2 .num, .cards.tx-stats .card2 .num { grid-area: num; margin-top: 0; }
.cards.wal-stats .card2 .delta, .cards.tx-stats .card2 .delta { grid-area: delta; margin-top: 0; }

/* --- Recharge --- */
.rc-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; align-items: start; }
.rc-bank-body, .rc-form-body { padding: 18px; }
.kv { margin: 0; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv-row:last-child { border-bottom: 0; }
.kv-row dt { color: var(--ink-3); font-size: .9rem; font-weight: 600; margin: 0; }
.kv-row dd { margin: 0; font-size: .95rem; font-weight: 600; color: var(--ink); text-align: right; }
.rc-tip { margin: 14px 0 0; font-size: .85rem; color: var(--ink-3); display: flex; gap: 7px; align-items: flex-start; line-height: 1.5; }
.rc-tip i { color: var(--success); margin-top: 1px; }
.rc-form-body .fld { margin-bottom: 14px; }

/* --- Profile / billing forms --- */
.acct-form { padding: 18px; }
.acct-form .fld { margin-bottom: 14px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.fgrid .fld { margin-bottom: 14px; }
.acct-foot { margin-top: 4px; }
.pw-form { max-width: 560px; }   /* room for the Generate + Copy buttons on the new-password row */
.acct-col { max-width: 520px; }   /* stacked single-column form (GST & billing): inputs + textarea share one width */
.acct-flush { padding: 0; }       /* form sits directly in the content card (no inner .box wrapper) */
.acct-form .field-body { max-width: 240px; }   /* account forms use a tighter input width than compose (~30% smaller) */
.acct-form.bill-form .field-body { max-width: 264px; }   /* GST & billing inputs run ~10% wider */
.acct-form.wh-form .field-body { max-width: 460px; }     /* webhook URL inputs need room for long URLs */
.acct-form.pw-form .field-body { max-width: 380px; }     /* change-password rows: room for the inline Generate / Copy buttons */

/* Password input + Generate / Copy buttons (add-customer, impersonation,
   change-password). Shared here so non-partner pages (which load only app.css)
   get it too. */
.pw-row { display: flex; gap: 10px; align-items: center; max-width: 420px; }
.pw-row .input { flex: 1; }
.pw-row .btn-a { flex: none; }
.pw-copy { padding-left: 10px; padding-right: 10px; }   /* icon-only copy button: square-ish */

/* iOS-style segmented control (filled white pill) — used to switch webhook service */
.seg-r { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.seg { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 18px; background: #eceef2; border-radius: 11px; }
.seg-lab { padding: 7px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; white-space: nowrap; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.seg-lab:hover { color: var(--ink); }
#seg-sms:checked ~ .seg .seg-lab[for="seg-sms"],
#seg-vn:checked  ~ .seg .seg-lab[for="seg-vn"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,30,60,.16), 0 1px 1px rgba(20,30,60,.06); }
.seg-r:focus-visible ~ .seg { box-shadow: 0 0 0 3px rgba(31,127,212,.3); }
.seg-panel { display: none; }
#seg-sms:checked ~ .seg-panel[data-seg="sms"],
#seg-vn:checked  ~ .seg-panel[data-seg="vn"] { display: block; }
@media (prefers-reduced-motion: reduce) { .seg-lab { transition: none; } }

/* Security > Login Activity table */
.la-wrap { overflow-x: auto; }
.la-tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.la-tbl th { text-align: left; font-size: .82rem; font-weight: 600; color: var(--ink-3); padding: 11px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.la-tbl td { padding: 13px 18px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; }
.la-tbl tbody tr:last-child td { border-bottom: none; }
.la-dim { color: var(--text-faint); }
.la-empty { display: flex; align-items: center; gap: 9px; padding: 22px 18px; color: var(--ink-3); }
.la-loc1 { color: var(--ink); }
.la-loc2 { font-size: .82rem; color: var(--ink-3); margin-top: 1px; }
.la-dev { display: inline-flex; align-items: center; gap: 9px; }
.la-dev .bi { font-size: 1.1rem; color: var(--ink-2); line-height: 1; }
.la-dev-t { font-size: .9rem; color: var(--ink); }
/* brand colours for OS + browser icons (device-type icon stays neutral) */
.la-dev .bi-browser-chrome  { color: #4285f4; }
.la-dev .bi-browser-safari  { color: #1e88e5; }
.la-dev .bi-browser-firefox { color: #ff7139; }
.la-dev .bi-browser-edge    { color: #1295d8; }
.la-dev .bi-windows         { color: #00a4ef; }
.la-dev .bi-apple           { color: #555a64; }
.la-dev .bi-android2        { color: #3ddc84; }
.la-dev .bi-ubuntu          { color: #e95420; }
/* day-group sub-header rows: Today / Yesterday / Earlier, colour-coded by recency */
.la-grp td { background: var(--bg-soft); padding: 8px 18px; }
.la-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; background: var(--ink-3); }
.la-grp-lab { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); vertical-align: middle; }
.la-grp-cnt { margin-left: 9px; font-size: .8rem; color: var(--ink-3); vertical-align: middle; font-variant-numeric: tabular-nums; }
.la-grp-today   .la-dot     { background: var(--green); }
.la-grp-today   .la-grp-lab { color: #047857; }
.la-grp-yest    .la-dot     { background: #d97706; }
.la-grp-yest    .la-grp-lab { color: #a05f00; }
.la-grp-earlier .la-dot     { background: var(--ink-3); }
.la-grp-earlier .la-grp-lab { color: var(--ink-3); }

/* form sub-section divider (e.g. Notifications) */
.acct-subhead { margin: 20px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .98rem; font-weight: 700; color: var(--ink); }

/* Apple-style toggle switch (medium, green when on) */
.switch { position: relative; display: inline-flex; width: 48px; height: 28px; flex: none; cursor: pointer; vertical-align: middle; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; background: #c9ced6; border-radius: 999px; transition: background .2s ease; }
.switch-track::before { content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(16,32,64,.25); transition: transform .2s ease; }
.switch input:checked + .switch-track { background: #34c759; }
.switch input:checked + .switch-track::before { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(52,199,89,.4); }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-track::before { transition: none; } }
.ro-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; padding: 6px 18px 4px; }
.ro { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ro-l { color: var(--ink-3); font-size: .9rem; font-weight: 600; }
.ro-v { font-size: .94rem; font-weight: 600; color: var(--ink); text-align: right; }
.ro-foot { margin: 0; padding: 12px 18px 16px; font-size: .86rem; color: var(--ink-3); display: flex; gap: 7px; align-items: center; }
.ro-foot a { color: var(--sky-ink); font-weight: 600; }

/* Profile: editable form on the left, small read-only account card on the right */
.profile-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.profile-main { min-width: 0; }
.ro-card { border: 1px solid var(--line); border-radius: 12px; padding: 4px 20px 8px; background: #fff; }
.ro-card-h { font-size: 1.05rem; font-weight: 700; color: var(--ink); padding: 14px 0 11px; border-bottom: 1px solid var(--line); }
.ro-card .roc { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ro-card .roc:last-of-type { border-bottom: none; }
.ro-card .roc-l { display: block; font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.ro-card .roc-v { display: block; font-size: 1rem; font-weight: 600; color: var(--ink); word-break: break-word; }
.ro-card .roc-v.mono { font-size: .95rem; }
@media (max-width: 900px) {
  .profile-wrap { grid-template-columns: 1fr; gap: 22px; }
}

/* --- Support: ticket conversation --- */
.tk-thread { padding: 18px; }
.tk-closed { background: #eef1f6; color: #5b6b7d; font-size: .88rem; font-weight: 600; border-radius: 9px; padding: 9px 13px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.tk-reply { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 20px; }
.tk-reply .fld textarea { background: #fff; }
.tk-reply-foot { margin-top: 12px; display: flex; justify-content: flex-end; }
.tk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tk-msg { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tk-msg.me { background: var(--brand-soft); border-color: #d4e2fb; }
.tk-msg.staff { background: #fff; }
.tk-msg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.tk-who { font-size: .85rem; font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.tk-msg.me .tk-who { color: var(--brand-dark); }
.tk-when { font-size: .78rem; color: var(--text-faint); }
.tk-body { font-size: .94rem; color: var(--ink); line-height: 1.6; }

/* --- account-area responsive --- */
@media (max-width: 860px) {
  .wal-grid, .rc-grid { grid-template-columns: 1fr; }
  .fgrid, .ro-grid { grid-template-columns: 1fr; }
  .cards.wal-stats, .cards.tx-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .cards.wal-stats, .cards.tx-stats { grid-template-columns: 1fr; }
  .bh-tools .in-search { max-width: 100%; }
}

/* ==========================================================================
   DASHBOARD — Aurora KPI layout (full-width, no sidebar; shell layout='full')
   ========================================================================== */
.dash { margin-top: 18px; margin-bottom: 44px; }
.dash .d-welcome { margin-bottom: 18px; }
.dash .d-welcome h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin: 0; color: var(--ink); }
.dash .d-welcome p { margin: 3px 0 0; color: var(--ink-3); font-size: .95rem; }

/* hero balance band */
.dash-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 26px; flex-wrap: wrap;
  background: linear-gradient(125deg, #1e3a8a, #2563eb 58%, #3b82f6); color: #fff; border-radius: 18px; padding: 26px 30px; box-shadow: var(--shadow-md); }
.dash-hero::after { content: ""; position: absolute; right: -60px; top: -70px; width: 250px; height: 250px; border-radius: 50%; background: rgba(255,255,255,.08); }
.dash-hero .e { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.82); font-weight: 700; }
.dash-hero .big { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; margin: 5px 0 2px; }
.dash-hero .sub { color: rgba(255,255,255,.9); font-size: .95rem; }
.dash-hero .cta { display: flex; gap: 10px; margin-top: 18px; position: relative; z-index: 1; flex-wrap: wrap; }
.dash-hero .cta a { font-weight: 700; font-size: .86rem; padding: 10px 16px; border-radius: 11px; }
.dash-hero .cta .a { background: #fff; color: var(--brand-dark); }
.dash-hero .cta .b { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.28); }
.dash-hero .hstat { position: relative; z-index: 1; display: flex; gap: 28px; }
.dash-hero .hstat .n { font-size: 1.5rem; font-weight: 800; }
.dash-hero .hstat .k { font-size: .78rem; color: rgba(255,255,255,.82); font-weight: 600; }

/* kpi grid */
.dash .kgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
.dash .kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 17px 18px; box-shadow: var(--shadow-sm); }
.dash .kpi .ktop { display: flex; align-items: center; justify-content: space-between; }
.dash .kpi .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.12rem; background: var(--brand-soft); color: var(--brand); }
.dash .kpi .l { font-size: .84rem; color: var(--ink-3); font-weight: 600; margin-top: 12px; }
.dash .kpi .v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin-top: 1px; color: var(--ink); }
.dash .kpi .spark { margin-top: 10px; height: 34px; }
.dash .kpi .spark svg { width: 100%; height: 34px; display: block; }
.dash .trend { display: inline-flex; align-items: center; gap: 2px; font-size: .76rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.dash .trend.up { background: #e6f6ef; color: var(--success); }
.dash .trend.dn { background: #fdecec; color: var(--danger); }
.dash .trend.flat { background: #eef1f6; color: var(--ink-3); }

/* panels */
.dash .panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.dash .p-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dash .p-h h3 { font-size: 1rem; font-weight: 750; margin: 0; }
.dash .p-h .lk { font-size: .84rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.dash .p-h .lk:hover { text-decoration: underline; }
.dash .p-b { padding: 20px; }
.dash .col-side { display: grid; grid-template-columns: 1fr 340px; gap: 16px; margin-top: 16px; }
.dash .col-2 { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin-top: 16px; }

/* chart + legend */
.dash .ch svg { width: 100%; height: auto; display: block; }
.dash .legend { display: flex; flex-direction: column; gap: 7px; font-size: .86rem; color: var(--ink-2); font-weight: 600; }
.dash .legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 7px; vertical-align: middle; }

/* delivery ring */
.dash .ring { position: relative; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; }
.dash .ring::before { content: ""; position: absolute; width: 104px; height: 104px; border-radius: 50%; background: #fff; }
.dash .ring .rv { position: relative; text-align: center; }
.dash .ring .rv b { font-size: 1.5rem; font-weight: 800; }
.dash .ring .rv span { display: block; font-size: .72rem; color: var(--ink-3); font-weight: 600; }

/* quick links */
.dash .qlinks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash .ql { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; font-weight: 600; font-size: .88rem; color: var(--ink); text-decoration: none; transition: border-color .15s var(--ease-out), background .15s var(--ease-out), transform .15s var(--ease-out); }
.dash .ql:hover { border-color: #bcd2f7; background: var(--brand-soft); transform: translateY(-1px); }
.dash .ql .qi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1.02rem; flex: none; }
.dash .ql small { display: block; font-weight: 500; color: var(--ink-3); font-size: .74rem; }

/* empty states */
.dash .d-empty { text-align: center; padding: 30px 16px; color: var(--ink-3); }
.dash .d-empty .ei { font-size: 1.8rem; color: var(--text-faint); }
.dash .d-empty p { margin: 8px 0 0; font-size: .9rem; }
.dash .amt-cr { color: var(--success); } .dash .amt-dr { color: var(--danger); }

.dash-full .hamb { display: none; }   /* no sidebar to toggle on the dashboard */

@media (max-width: 1040px) {
  .dash .kgrid { grid-template-columns: repeat(2, 1fr); }
  .dash .col-side, .dash .col-2 { grid-template-columns: 1fr; }
  .dash-hero .hstat { display: none; }
}
@media (max-width: 560px) { .dash .kgrid { grid-template-columns: 1fr; } .dash .qlinks { grid-template-columns: 1fr; } }

/* ==========================================================================
   ALL-SERVICES OVERVIEW — per-channel status tiles on the landing dashboard
   (user/dashboard.php). Channel colour is set per-tile via inline custom props:
   --ac (accent), --acs (soft bg), --aci (ink = darker accent for tinted text).
   ========================================================================== */
.dash .svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
.dash .svc { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; overflow: hidden; }
/* split panel: tinted top zone (big icon + name + status) */
.dash .svc-top { background: var(--acs); padding: 20px 16px 15px; display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; }
.dash .svc-ic { width: 54px; height: 54px; border-radius: 15px; background: #fff; color: var(--ac); display: grid; place-items: center; font-size: 1.55rem; box-shadow: 0 2px 7px rgba(15, 36, 64, .09); }
.dash .svc-top .nm { font-size: 1.06rem; font-weight: 750; color: var(--aci); letter-spacing: -.01em; }
.dash .svc-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.dash .svc-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dash .svc-pill.ok { background: #e6f6ef; color: var(--success); }
.dash .svc-pill.warn { background: #fff3e0; color: #b26a00; }
.dash .svc-pill.off { background: #eef1f6; color: #5b6b7d; }
/* white body zone */
.dash .svc-bot { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.dash .svc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dash .svc-stats .s .n { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.dash .svc-stats .s .k { font-size: .72rem; color: var(--ink-3); font-weight: 600; margin-top: 3px; }
/* 7-day column chart: today highlighted, prior days faded */
.dash .svc-bars { display: flex; align-items: flex-end; gap: 5px; height: 40px; margin-top: 15px; }
.dash .svc-bars span { flex: 1; background: var(--ac); opacity: .3; border-radius: 4px 4px 0 0; min-height: 4px; }
.dash .svc-bars span.today { opacity: 1; }
.dash .svc-cap { font-size: .72rem; color: var(--ink-3); margin-top: 8px; }
.dash .svc-sub { font-size: .8rem; color: var(--ink-3); font-weight: 600; margin-top: 12px; }
.dash .svc-empty { margin-top: 14px; padding: 13px 14px; border-radius: 12px; background: var(--bg-soft); color: var(--ink-3); font-size: .84rem; line-height: 1.55; }
/* activate / renew call-to-action (inactive services) */
.dash .svc-cta { display: flex; flex-direction: column; flex: 1; }
.dash .svc-cta .msg { font-size: .87rem; color: var(--ink-3); line-height: 1.55; margin: 0 0 14px; }
.dash .svc-activate { margin-top: auto; width: 100%; border: 0; border-radius: 12px; background: var(--ac); color: #fff; font-size: .95rem; font-weight: 700; padding: 13px 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: filter .15s var(--ease-out); }
.dash .svc-activate:hover { filter: brightness(.93); }
.dash .svc-activate i { font-size: 1.05rem; }
.dash .svc-foot { display: flex; gap: 9px; margin-top: auto; padding-top: 16px; }
.dash .svc-foot a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: .84rem; font-weight: 650;
  text-decoration: none; padding: 9px 10px; border: 1px solid transparent; border-radius: 10px;
  transition: filter .15s var(--ease-out), background .15s var(--ease-out), color .15s var(--ease-out), border-color .15s var(--ease-out); }
.dash .svc-foot a i { font-size: .95rem; }
.dash .svc-foot a.pri { background: var(--ac); color: #fff; }
.dash .svc-foot a.pri:hover { filter: brightness(.93); }
.dash .svc-foot a.soft { background: var(--acs); color: var(--aci); }
.dash .svc-foot a.soft:hover { filter: brightness(.96); }
.dash .svc-foot a.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.dash .svc-foot a.ghost:hover { border-color: #cdd7e3; background: var(--bg-soft); color: var(--ink); }

/* ==========================================================================
   SHARED FORM LAYOUT (label left, box right) + CUSTOM DROPDOWN (.dd)
   The panel standard for form rows and dropdowns (lifted from compose so every
   form uses the same controls). JS for .dd lives in app.js.
   ========================================================================== */
.field { display: grid; grid-template-columns: 180px 16px 1fr; gap: 14px; align-items: start; margin-bottom: 20px; }
.field > label { font-size: 15px; font-weight: 600; color: #4b5563; padding-top: 11px; text-align: right; white-space: nowrap; }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .colon { padding-top: 11px; color: var(--text-muted); }
.field-body { max-width: 340px; }
.field-body .input, .field-body .textarea, .field-body select, .dd-toggle {
  width: 100%; font-family: inherit; font-size: 15px; color: #1f2430; background: #fff;
  border: 1.5px solid #c6cfdc; border-radius: 9px; padding: 11px 14px; transition: border-color .15s ease, box-shadow .15s ease; }
.field-body .textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.field-body .input:focus, .field-body .textarea:focus, .field-body select:focus, .dd-toggle:focus-visible, .dd.open .dd-toggle { outline: none; border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.field .hint { display: block; font-size: 12px; color: var(--text-faint); margin-top: 6px; }

/* custom dropdown (.dd) — replaces native <select> across forms */
.dd { position: relative; max-width: 300px; }
.dd-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.dd-toggle .dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-label.dd-placeholder { color: #4b5563; }
.dd-toggle .dd-caret { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--text-muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease, stroke .15s ease; }
.dd-toggle:hover .dd-caret, .dd.open .dd-toggle .dd-caret { stroke: #4b5563; }
.dd.open .dd-toggle .dd-caret { transform: rotate(180deg); }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 100%; max-height: 280px; overflow-y: auto;
  margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 11px;
  box-shadow: 0 12px 30px rgba(20,30,60,.14), 0 2px 6px rgba(20,30,60,.07);
  opacity: 0; transform: translateY(-6px) scale(.985); transform-origin: top; pointer-events: none;
  transition: opacity .15s ease, transform .16s cubic-bezier(.22,1,.36,1); }
.dd.open .dd-menu { opacity: 1; transform: none; pointer-events: auto; }
.dd-item { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 7px; font-size: 15px; color: #1f2430; cursor: pointer; white-space: nowrap; transition: background .12s ease, color .12s ease; }
.dd-item .dd-text { flex: 1; }
.dd-item .dd-check { flex: none; font-size: 14px; color: #4b5563; opacity: 0; }
.dd-item:hover, .dd-item.focus { background: #f1f4f9; }
.dd-item.sel { font-weight: 600; }
.dd-item.sel .dd-check { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .dd-menu { transition: opacity .12s ease; } .dd.open .dd-menu { transform: none; } .dd-toggle .dd-caret { transition: none; } }
@media (max-width: 640px) {
  .field { grid-template-columns: 1fr; gap: 6px; }
  .field > label { padding-top: 0; text-align: left; font-weight: 700; color: #1f2430; }
  .field .colon { display: none; }
  .field-body { max-width: none; }
  .dd { max-width: none; }
}

/* "Acting as" banner — shown in the customer panel while a partner is
   impersonating one of its customers (rendered by shell.php). */
.imp-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 9px 16px; background: #fff4e5; color: #9a5b00;
  border-bottom: 1px solid #f3d9ad; font-size: .88rem; font-weight: 600;
}
.imp-banner .imp-x {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  border-radius: 999px; background: #9a5b00; color: #fff; font-weight: 700;
  text-decoration: none;
}
.imp-banner .imp-x:hover { background: #7c4900; }

/* ============================================================
 * Support tickets v2 — prominent back button, solid-red close,
 * two-column conversation + detail/attachment rail, attachments,
 * internal-note bubble, priority + service tags.
 * Shared by the user / partner / control ticket pages.
 * ========================================================== */

/* Prominent "Back to all tickets" button (replaces the faint text link). */
.tk-back { margin-bottom: 14px; }

/* Close-ticket button: red by default, SOLID red on hover (matches the
   logout item .m-item.danger). Overrides .btn-a.ghost on this button. */
.btn-a.btn-close-tkt { background: #fff; color: var(--danger); border-color: #f3c2c2; }
.btn-a.btn-close-tkt:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-a.btn-close-tkt:hover i { color: #fff; }

/* Two-column ticket body: conversation (left) + detail/attachment rail (right).
   Collapses to one column when the available width is tight (works inside the
   sidebar'd user/partner content card and the wide control layout alike). */
.tk-wrap { container-type: inline-size; }
.tk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 304px; gap: 22px; align-items: start; }
.tk-main { min-width: 0; }
.tk-rail { display: flex; flex-direction: column; gap: 16px; }
.tk-grid .tk-thread { padding: 0; }            /* thread now sits on the page, no "Conversation" box */
@container (max-width: 780px) { .tk-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px)    { .tk-grid { grid-template-columns: 1fr; } }

/* Rail panels reuse .box; .box-b is the padded body for non-table boxes. */
.box-b { padding: 14px 16px; }
.tk-rail .box-h h3 { font-size: .96rem; }

/* Detail key/value list. */
.tk-meta { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; font-size: .86rem; margin: 0; }
.tk-meta dt { color: var(--ink-3); font-weight: 600; }
.tk-meta dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }

/* Attachment groups + chips (right rail and message bubbles). */
.tk-att-group + .tk-att-group { margin-top: 15px; }
.tk-att-lbl { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.tk-att { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; color: var(--ink); margin-bottom: 7px;
  transition: border-color .15s ease, background .15s ease; }
.tk-att:last-child { margin-bottom: 0; }
.tk-att:hover { border-color: #cdd7e3; background: var(--bg-soft); }
.tk-att-ic { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 1.1rem; }
.tk-att-ic.pdf { background: #fdecec; color: #c0392b; }
.tk-att-ic.img { background: #eaf3ff; color: #1f6fd6; }
.tk-att-ic.doc { background: #eaf0fb; color: #2a5bd7; }
.tk-att-ic.xls { background: #e7f6ec; color: #1d8a4e; }
.tk-att-ic.gen { background: #eef1f6; color: #5b6b7d; }
.tk-att-meta { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.tk-att-name { display: block; max-width: 100%; font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-att-sub { font-size: .73rem; color: var(--text-faint); }
.tk-att-empty { font-size: .84rem; color: var(--text-faint); margin: 0; }
.tk-att-dl { margin-left: auto; flex: none; color: var(--ink-3); font-size: 1rem; }

/* File input on the reply / new-ticket forms. */
.tk-file { margin-top: 8px; }
.tk-file-lab { font-size: .82rem; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.tk-file input[type=file] { font-size: .84rem; font-family: inherit; color: var(--ink-2); max-width: 100%; }
.tk-file input[type=file]::file-selector-button { font-family: inherit; font-weight: 600; font-size: .82rem;
  color: var(--ink-2); background: #fff; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 6px 12px; margin-right: 10px; cursor: pointer; transition: background .15s ease; }
.tk-file input[type=file]::file-selector-button:hover { background: var(--bg-soft); }
.tk-file-hint { font-size: .74rem; color: var(--text-faint); margin-top: 6px; }
/* Custom attach-files button: label-as-button so its own text replaces the native "Choose files". */
.tk-file-btn { display: inline-flex; align-items: center; gap: 7px; font-family: inherit; font-weight: 600;
  font-size: .82rem; color: var(--ink-2); background: #fff; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; transition: background .15s ease; }
.tk-file-btn:hover { background: var(--bg-soft); }
.tk-file-btn .hint { font-weight: 400; color: var(--text-muted); }
.tk-file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tk-file-names { font-size: .82rem; color: var(--text-faint); margin-left: 10px; }

/* Internal staff note (control / partner only) — clearly not customer-visible. */
.tk-msg.note { background: #fffbeb; border-color: #f4e3b0; border-style: dashed; }
.tk-msg.note .tk-who { color: #b45309; }
.tk-note-flag { font-size: .72rem; font-weight: 700; color: #b45309; background: #fef3c7;
  border-radius: 6px; padding: 1px 7px; margin-left: 6px; }

/* Canned-reply picker: shared .dd dropdown, own right-aligned row under the reply textarea. */
.tk-canned-row { display: flex; justify-content: flex-end; margin: 8px 0 0; }
.tk-canned-row .dd { width: 260px; max-width: 100%; }
/* Native-select fallback (partner staff page still uses <select class="tk-canned">). */
.tk-canned { font-family: inherit; font-size: .82rem; padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--ink-2); background: #fff; width: 100%; max-width: 260px; }

/* Reply form footer: internal-note toggle on the left, send on the right. */
.tk-reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.tk-reply-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tk-reply-tools .dd { width: 220px; }
.tk-note-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: .83rem; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; }
.tk-note-toggle input { width: 15px; height: 15px; accent-color: var(--danger); }

/* Priority pill + small neutral service/type tag. */
.pri-pill { display: inline-block; font-size: .73rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; vertical-align: middle; }
.pri-pill.low { background: #eef1f6; color: #5b6b7d; }
.pri-pill.normal { background: #eaf3ff; color: #1f6fd6; }
.pri-pill.high { background: #fff3e0; color: #b26a00; }
.pri-pill.urgent { background: #fdecec; color: var(--danger); }
.mini-tag { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #eef1f6; color: #5b6b7d; }
