/* Elements marked hidden stay hidden even when a class sets display */
[hidden] { display: none !important; }

/* ============================================================
   Tech Connect UI — core stylesheet
   Flat, corporate, high-contrast. Token driven.

   Modes / palettes (set on <html>):
     data-theme="light" data-palette="indigo"   (default)
     data-theme="light" data-palette="emerald"
     data-theme="light" data-palette="graphite"
     data-theme="dark"                          (Midnight)
   ============================================================ */

:root {
  /* brand */
  --primary:        #4338ca;
  --primary-dark:   #3730a3;
  --primary-light:  #eef0ff;
  --on-primary:     #ffffff;
  --accent-2:       #0ea5e9;
  --grad:           linear-gradient(0deg, #4338ca, #4338ca);
  --header-bg:      #ffffff;
  --rail-bg:        #111827;
  --rail-text:      #9ca3af;
  --rail-active:    #ffffff;
  --rail-hover:     rgba(255,255,255,.06);

  /* status */
  --secondary:      #64748b;
  --success:        #15803d;
  --success-light:  #e8f5ec;
  --danger:         #b91c1c;
  --danger-light:   #fdecec;
  --warning:        #a16207;
  --warning-light:  #fdf6e3;
  --info:           #1d4ed8;
  --info-light:     #e8effd;
  --refund:         #7e22ce;
  --refund-light:   #f4ebfd;

  /* surfaces (flat) */
  --bg:             #f5f6fa;
  --surface:        #ffffff;
  --surface-solid:  #ffffff;
  --surface-2:      #f8f9fc;
  --glass-edge:     #e6e8f0;
  --border:         #e6e8f0;
  --border-dark:    #d3d7e2;
  --field:          #ffffff;

  /* text */
  --text:           #0f172a;
  --text-secondary: #475569;
  --text-muted:     #64748b;

  /* compatibility tokens used by some page views */
  --sidebar-bg:     #ffffff;
  --sidebar-text:   #4b5563;
  --sidebar-active: #111827;
  --sidebar-hover:  #f3f4f6;
  --sidebar-accent: #4338ca;
  --sidebar-w:      240px;
  --topbar-h:       60px;

  /* shape */
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      18px;
  --shadow:         0 1px 2px rgba(16,24,40,.04), 0 4px 12px rgba(16,24,40,.05);
  --shadow-md:      0 2px 6px rgba(16,24,40,.06), 0 16px 32px -8px rgba(16,24,40,.16);
  --ease:           cubic-bezier(.22,1,.36,1);
  --ring:           0 0 0 3px rgba(67,56,202,.18);
  --blur:           none;
  --transition:     .18s cubic-bezier(.22,1,.36,1);

  /* type */
  --font:           'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono:      'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* network colours */
  --mtn:            #ffcc00;
  --telecel:        #e30613;
  --airteltigo:     #0a4ea2;

  color-scheme: light;
}

/* ── Palettes (light) ───────────────────────────────────────── */
[data-palette="emerald"]:not([data-theme="dark"]) {
  --primary: #047857; --primary-dark: #065f46; --primary-light: #e7f6f0;
  --accent-2: #0891b2;
  --grad: linear-gradient(0deg, #047857, #047857);
  --sidebar-accent: #047857;
  --ring: 0 0 0 3px rgba(4,120,87,.18);
  --rail-bg: #0b2a22;
}
[data-palette="graphite"]:not([data-theme="dark"]) {
  --primary: #1f2937; --primary-dark: #111827; --primary-light: #eceef1;
  --accent-2: #ea580c;
  --grad: linear-gradient(0deg, #1f2937, #1f2937);
  --sidebar-accent: #1f2937;
  --ring: 0 0 0 3px rgba(31,41,55,.18);
  --rail-bg: #0f1115;
}

/* ── Midnight (dark) ────────────────────────────────────────── */
[data-theme="dark"] {
  --primary:        #818cf8;
  --primary-dark:   #6366f1;
  --primary-light:  rgba(129,140,248,.14);
  --on-primary:     #0b0f1a;
  --accent-2:       #38bdf8;
  --grad:           linear-gradient(0deg, #4f46e5, #4f46e5);
  --header-bg:      #12151c;
  --rail-bg:        #0b0d12;

  --secondary:      #94a3b8;
  --success:        #4ade80;
  --success-light:  rgba(74,222,128,.12);
  --danger:         #f87171;
  --danger-light:   rgba(248,113,113,.12);
  --warning:        #facc15;
  --warning-light:  rgba(250,204,21,.12);
  --info:           #60a5fa;
  --info-light:     rgba(96,165,250,.12);
  --refund:         #c084fc;
  --refund-light:   rgba(192,132,252,.12);

  --bg:             #0b0d12;
  --surface:        #12151c;
  --surface-solid:  #12151c;
  --surface-2:      #181c25;
  --glass-edge:     rgba(255,255,255,.07);
  --border:         rgba(255,255,255,.07);
  --border-dark:    rgba(255,255,255,.13);
  --field:          #0f1218;

  --text:           #e5e7eb;
  --text-secondary: #a3acbb;
  --text-muted:     #7a8597;

  --sidebar-bg:     #111827;
  --sidebar-text:   #a3acbb;
  --sidebar-active: #e5e7eb;
  --sidebar-hover:  #172033;
  --sidebar-accent: #818cf8;

  --shadow:         inset 0 1px 0 rgba(255,255,255,.04);
  --shadow-md:      inset 0 1px 0 rgba(255,255,255,.05), 0 20px 40px -12px rgba(0,0,0,.7);
  --ring:           0 0 0 3px rgba(129,140,248,.25);

  color-scheme: dark;
}

[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23a3acbb' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
}
[data-theme="dark"] select.form-control option { background: var(--surface-solid); color: var(--text); }

/* ── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--primary); color: var(--on-primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.ti { font-size: 1.1em; line-height: 1; vertical-align: -0.12em; }

/* ── Typography ─────────────────────────────────────────────── */
h1 { font-size: clamp(1.35rem, 3.4vw, 1.65rem); font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
h2 { font-size: clamp(1.15rem, 2.6vw, 1.35rem); font-weight: 700; letter-spacing: -.005em; }
h3 { font-size: 1.05rem; font-weight: 600; }
h4 { font-size: .98rem;  font-weight: 600; }

/* ── Panel helper (formerly frosted) ────────────────────────── */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px; border-radius: var(--radius);
  font-family: var(--font); font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap; text-decoration: none; line-height: 1.2;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--on-primary); }
.btn-gradient  { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-gradient:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--on-primary); }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { filter: brightness(.94); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover  { filter: brightness(.94); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-dark); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); color: var(--primary); }
.btn-sm { min-height: 30px; padding: 0 11px; font-size: .8rem; }
.btn-lg { min-height: 46px; padding: 0 22px; font-size: .98rem; }
.btn-block { width: 100%; }
.btn-icon { min-height: 36px; width: 36px; padding: 0; }

[data-theme="dark"] .btn-success,
[data-theme="dark"] .btn-danger { color: #0b0f1a; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem;
  color: var(--text);
}
.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  display: block; width: 100%;
  min-height: 42px; padding: 9px 12px; border-radius: var(--radius);
  border: 1px solid var(--border-dark);
  background: var(--field); color: var(--text);
  font-size: 16px; font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none; appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { opacity: .6; cursor: not-allowed; background: var(--surface-2); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%234b5563' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.55; }

.form-hint  { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: .3rem; }

.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type=checkbox],
.form-check input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }

.input-wrap { position: relative; }
.input-wrap .form-control { padding-right: 70px; }
.input-wrap .input-action {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--primary); font-family: var(--font);
  font-size: .8rem; font-weight: 600; cursor: pointer; padding: 6px 8px; border-radius: 4px;
}
.input-wrap .input-action:hover { background: var(--primary-light); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; background: var(--surface);
}
.card-title { font-size: .98rem; font-weight: 700; }
.card-body  { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }

.card:has(.modal-backdrop),
.stat-card:has(.modal-backdrop),
.glass:has(.modal-backdrop),
.alert:has(.modal-backdrop) { overflow: visible; }

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  border-top: 3px solid var(--primary);
  padding: 16px; display: flex; flex-direction: column; gap: 4px;
}
.stat-card .stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.stat-card .stat-value { font-size: 1.55rem; font-weight: 700; color: var(--text); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-card .stat-sub   { font-size: .78rem; color: var(--text-muted); }
.stat-card .stat-icon  { font-size: 1.25rem; margin-bottom: 2px; color: var(--primary); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%; border-collapse: collapse; font-size: .875rem;
  min-width: 540px; font-variant-numeric: tabular-nums;
}
.table th {
  background: var(--surface-2); color: var(--text-secondary);
  font-size: .78rem; font-weight: 600;
  padding: 10px 14px; border-bottom: 1px solid var(--border-dark);
  white-space: nowrap; text-align: left;
}
.table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--text);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table tbody tr:hover { background: var(--primary-light); }
.table-sm th, .table-sm td { padding: 7px 10px; }

/* ── Badges / status ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px; font-size: .74rem;
  font-weight: 600; text-transform: capitalize;
  white-space: nowrap; line-height: 1.45; border: 1px solid transparent;
}
.badge-success  { background: var(--success-light); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.badge-danger   { background: var(--danger-light);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.badge-warning  { background: var(--warning-light); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.badge-info     { background: var(--info-light);    color: var(--info);    border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.badge-secondary{ background: var(--surface-2);     color: var(--secondary); border-color: var(--border-dark); }
.badge-primary  { background: var(--primary-light); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }

.status-accepted, .status-placed, .status-processing, .status-delivered,
.status-failed, .status-refunded, .status-skipped { }
.status-accepted   { background: var(--surface-2);     color: var(--secondary); border-color: var(--border-dark) !important; }
.status-placed     { background: var(--info-light);    color: var(--info); }
.status-processing { background: var(--warning-light); color: var(--warning); }
.status-delivered  { background: var(--success-light); color: var(--success); }
.status-failed     { background: var(--danger-light);  color: var(--danger); }
.status-refunded   { background: var(--refund-light);  color: var(--refund); }
.status-skipped    { background: var(--warning-light); color: var(--warning); }
.status-cancelled  { background: var(--surface-2); color: var(--text-muted); }

/* ── Network marks ──────────────────────────────────────────── */
.net-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex-shrink: 0; background: var(--text-muted); }
.net-dot.mtn { background: var(--mtn); }
.net-dot.telecel { background: var(--telecel); }
.net-dot.airteltigo { background: var(--airteltigo); }
.net-mark {
  width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center;
  font-size: .6rem; font-weight: 700; flex-shrink: 0;
  background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border);
}
.net-mark.mtn { background: var(--mtn); color: #2b2100; border-color: transparent; }
.net-mark.telecel { background: var(--telecel); color: #fff; border-color: transparent; }
.net-mark.airteltigo { background: var(--airteltigo); color: #fff; border-color: transparent; }
.net-mark.has-logo { background: #fff; border: 1px solid var(--border); padding: 0; overflow: hidden; color: transparent; }
.net-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.net-dot.has-logo { width: 18px; height: 18px; background: #fff; overflow: hidden; border: 1px solid var(--border); }
.net-dot.has-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 11px 40px 11px 14px; border-radius: var(--radius);
  border: 1px solid transparent; border-left-width: 4px; font-size: .88rem;
  display: flex; align-items: flex-start; gap: 9px; position: relative;
}
.alert-close { position: absolute; top: 7px; right: 8px; background: none; border: none; cursor: pointer; font-size: 1.15rem; color: inherit; opacity: .6; width: 26px; height: 26px; border-radius: 4px; line-height: 1; }
.alert-close:hover { opacity: 1; }
.alert-success { background: var(--success-light); border-color: var(--success); color: var(--success); }
.alert-danger  { background: var(--danger-light);  border-color: var(--danger);  color: var(--danger); }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: var(--warning); }
.alert-info    { background: var(--info-light);    border-color: var(--info);    color: var(--info); }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: inline-flex; align-items: center; flex-wrap: wrap; border: 1px solid var(--border-dark); border-radius: var(--radius); overflow: hidden; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 34px; padding: 0 10px;
  border-right: 1px solid var(--border-dark); background: var(--surface);
  font-size: .85rem; font-weight: 500; color: var(--text);
  text-decoration: none; font-variant-numeric: tabular-nums;
}
.page-link:last-child { border-right: 0; }
.page-link:hover { background: var(--surface-2); color: var(--primary); text-decoration: none; }
.page-link.active { background: var(--primary); color: var(--on-primary); }
.page-link.disabled { opacity: .45; pointer-events: none; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(17,24,39,.55);
  z-index: 1000; display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface-solid); border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md); width: 100%; max-width: 520px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  animation: modalIn .15s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-2); }
.modal-title  { font-size: 1rem; font-weight: 700; }
.modal-close  { background: none; border: 0; cursor: pointer; font-size: 1.25rem; color: var(--text-secondary); line-height: 1; width: 30px; height: 30px; border-radius: 4px; }
.modal-close:hover { color: var(--text); background: var(--border); }
.modal-body   { padding: 18px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ── Older admin page classes (still referenced by some views) ── */
.admin-wrap { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--rail-bg); color: var(--rail-text);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 200; transition: transform var(--transition); overflow-y: auto;
}
.sidebar-brand { padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.sidebar-brand img { width: 30px; height: 30px; border-radius: 4px; object-fit: contain; }
.sidebar-brand .brand-name { font-size: .98rem; font-weight: 700; color: #fff; }
.sidebar-nav { padding: 10px 0; flex: 1; }
.nav-section-label { padding: 12px 18px 4px; font-size: .72rem; font-weight: 600; color: #6b7280; }
.sidebar a.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px; color: var(--rail-text);
  font-size: .88rem; text-decoration: none; border-left: 3px solid transparent;
}
.sidebar a.nav-link:hover { background: var(--rail-hover); color: #fff; }
.sidebar a.nav-link.active { border-left-color: var(--primary); background: rgba(255,255,255,.05); color: #fff; }
.sidebar a.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); background: var(--header-bg);
  border-bottom: 1px solid var(--border); padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 6px; border-radius: 4px; color: var(--text); }
.hamburger:hover { background: var(--surface-2); }
.hamburger svg { width: 22px; height: 22px; display: block; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user  { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.avatar { width: 32px; height: 32px; border-radius: 6px; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; flex-shrink: 0; }

.page-content { padding: 24px; flex: 1; }
.page-header  { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-title   { font-size: clamp(1.25rem, 3vw, 1.5rem); font-weight: 700; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(17,24,39,.5); z-index: 199; }

/* ── Older client top-nav classes ───────────────────────────── */
.client-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.client-nav { background: var(--header-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.client-nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.client-nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; color: var(--text); text-decoration: none; }
.client-nav .brand img { height: 30px; width: auto; object-fit: contain; }
.client-nav .brand:hover { text-decoration: none; }
.client-nav-links { display: flex; align-items: center; gap: 2px; }
.client-nav-links a { padding: 8px 12px; border-radius: 4px; font-size: .9rem; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.client-nav-links a:hover  { background: var(--surface-2); color: var(--text); text-decoration: none; }
.client-nav-links a.active { color: var(--primary); font-weight: 600; box-shadow: inset 0 -2px 0 var(--primary); border-radius: 0; }
.client-main  { flex: 1; max-width: 1200px; margin: 0 auto; padding: 24px 20px; width: 100%; }
.client-footer { background: transparent; border-top: 1px solid var(--border); padding: 16px 20px; text-align: center; font-size: .78rem; color: var(--text-muted); }
.balance-chip { background: var(--primary-light); color: var(--primary); padding: 6px 12px; border-radius: 4px; font-size: .84rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.client-hamburger { display: none; }
.client-nav-mobile { display: none; flex-direction: column; background: var(--surface-solid); border-top: 1px solid var(--border); padding: 6px 0; }
.client-nav-mobile.open { display: flex; }
.client-nav-mobile a { padding: 12px 20px; font-size: .95rem; color: var(--text-secondary); text-decoration: none; }
.client-nav-mobile a:hover  { background: var(--surface-2); color: var(--text); }
.client-nav-mobile a.active { color: var(--primary); background: var(--primary-light); }

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 110px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch; max-width: 1080px; margin: 0 auto; width: 100%;
  padding: 32px 20px; gap: 0;
}
.auth-pitch {
  order: 2;
  padding: clamp(28px, 4vw, 48px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  background: var(--primary); color: #fff;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; color: inherit; }
.auth-brand img { height: 34px; width: auto; border-radius: 4px; background: #fff; padding: 2px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 6px; background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; font-weight: 800; flex-shrink: 0; font-size: .95rem;
}
.auth-pitch .brand-mark { background: #fff; color: var(--primary); }
.auth-pitch h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; font-weight: 700; max-width: 18ch; color: #fff; }
.auth-pitch p { color: rgba(255,255,255,.82); font-size: .98rem; max-width: 40ch; margin-top: 12px; }
.auth-points { list-style: none; display: grid; gap: 10px; margin-top: 22px; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: rgba(255,255,255,.92); }
.auth-points li .ti { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 4px; background: rgba(255,255,255,.14); font-size: .95rem; }
.auth-nets { display: flex; gap: 8px; flex-wrap: wrap; }
.auth-nets span {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 4px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); font-weight: 600; font-size: .82rem; color: #fff;
}
.auth-side {
  order: 1; display: flex; align-items: center; justify-content: center;
  padding: clamp(24px, 4vw, 48px); background: var(--surface);
  border: 1px solid var(--border); border-right: 0;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}
.auth-card { width: 100%; max-width: 380px; background: transparent; border: 0; box-shadow: none; padding: 0; }
.auth-logo  { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.auth-logo img { height: 38px; width: auto; border-radius: 4px; }
.auth-logo .site-name { font-size: 1.02rem; font-weight: 700; }
.auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; text-align: left; }
.auth-sub { color: var(--text-secondary); font-size: .92rem; margin-bottom: 22px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: .8rem; margin: 20px 0 14px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ── Grid helpers ───────────────────────────────────────────── */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ── Utilities ──────────────────────────────────────────────── */
.d-flex    { display: flex; }
.d-block   { display: block; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-small   { font-size: .84rem; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.fw-600 { font-weight: 600; }
.w-100  { width: 100%; }
.mono   { font-family: var(--font-mono); font-size: .82rem; }
.num    { font-variant-numeric: tabular-nums; }

/* ── Shared page components ─────────────────────────────────── */
/* Balance summary panel */
.bal-hero {
  position: relative; border-radius: var(--radius-lg); padding: 20px 22px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); box-shadow: var(--shadow);
}
.bal-hero small { display: block; font-size: .8rem; font-weight: 500; color: var(--text-muted); }
.bal-hero .bal-amt { font-size: clamp(1.8rem, 5vw, 2.3rem); font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.bal-hero .bal-amt span { font-size: .5em; font-weight: 600; color: var(--text-muted); margin-right: 6px; }
.bal-hero .bal-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.bal-hero .btn-light { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.bal-hero .btn-light:hover { background: var(--primary-dark); color: var(--on-primary); }
.bal-hero .btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-dark); }
.bal-hero .btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* Key / value list */
.kv { display: flex; flex-direction: column; }
.kv-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px dashed var(--border-dark); align-items: baseline; }
.kv-row:first-child { border-top: 0; }
.kv-row > span:first-child { font-size: .82rem; font-weight: 500; color: var(--text-muted); }
.kv-row > span:last-child { font-size: .92rem; word-break: break-word; }
.kv-row.total { font-weight: 700; }
.kv-row .neg { color: var(--danger); font-weight: 600; }
.kv-row .pos { color: var(--success); font-weight: 600; }

/* Status timeline */
.tl { list-style: none; position: relative; margin: 0; padding: 0; }
.tl li { position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 0 7px 24px; }
.tl li::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--border-dark); }
.tl li:first-child::before { top: 50%; }
.tl li:last-child::before { bottom: 50%; }
.tl li:only-child::before { display: none; }
.tl li::after { content: ""; position: absolute; left: 0; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 2px; background: var(--surface-solid); border: 2px solid var(--primary); }
.tl li:last-child::after { background: var(--primary); }
.tl time { font-size: .82rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* Filter tabs */
.chip-row { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; -webkit-overflow-scrolling: touch; border-bottom: 1px solid var(--border); }
.chip-row::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-secondary); font-size: .87rem; font-weight: 500; white-space: nowrap; text-decoration: none; flex-shrink: 0; margin-bottom: -1px; }
.chip:hover { text-decoration: none; color: var(--text); }
.chip.on { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }

/* Empty state */
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.empty-state .empty-ico { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); font-size: 1.5rem; }
.empty-state b { display: block; color: var(--text); font-size: 1rem; margin-bottom: 10px; }

@media (max-width: 700px) {
  .table.table-stack { min-width: 0; }
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr { display: block; }
  .table-stack tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0 !important; border: 0 !important; white-space: normal !important; max-width: none !important; text-align: right; font-size: .88rem !important; }
  .table-stack td[data-label]::before { content: attr(data-label); font-size: .78rem; font-weight: 500; color: var(--text-muted); text-align: left; flex-shrink: 0; }
  .table-stack td[colspan] { display: block; text-align: center; }
  .table-stack td.ts-main { font-size: .98rem !important; font-weight: 700; }
  .table-stack td.ts-action { justify-content: flex-end; padding-top: 8px !important; }
}

/* ── Appearance menu (shared by layouts) ────────────────────── */
.theme-pick { position: relative; }
.theme-pick-btn {
  width: 36px; height: 36px; border-radius: var(--radius); display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border-dark); color: var(--text-secondary);
  cursor: pointer; font-size: 1.05rem; -webkit-tap-highlight-color: transparent;
}
.theme-pick-btn:hover { color: var(--primary); }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 600; min-width: 190px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 4px; display: none;
}
.theme-menu.open { display: block; animation: modalIn .12s ease-out; }
.theme-menu button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px;
  background: none; border: 0; color: var(--text); font-family: var(--font); font-size: .88rem; font-weight: 500;
  cursor: pointer; text-align: left;
}
.theme-menu button:hover { background: var(--surface-2); }
.theme-menu button.on { color: var(--primary); font-weight: 700; }
.sw { width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0; display: inline-block; border: 1px solid rgba(0,0,0,.12); }
.sw-indigo   { background: #4338ca; }
.sw-emerald  { background: #047857; }
.sw-graphite { background: #1f2937; }
.sw-midnight { background: linear-gradient(135deg, #0b0f1a 50%, #818cf8 50%); }

/* ── Phone bottom bar ───────────────────────────────────────── */
.tabbar { display: none; }
@media (max-width: 900px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 180;
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
    background: var(--header-bg); border-top: 1px solid var(--border);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: .68rem; font-weight: 600; color: var(--text-muted); text-decoration: none;
    min-height: 50px; justify-content: center; -webkit-tap-highlight-color: transparent;
    border-top: 2px solid transparent; margin-top: -5px;
  }
  .tabbar a .ti { font-size: 1.3rem; }
  .tabbar a.active { color: var(--primary); border-top-color: var(--primary); }
  .tabbar a.tab-main .tab-main-icon { display: grid; place-items: center; }
  .tabbar a.tab-main .tab-main-icon .ti { font-size: 1.3rem; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 16px; }
  .auth-pitch { order: 1; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 22px 20px; gap: 12px; }
  .auth-pitch h2 { font-size: 1.35rem; }
  .auth-pitch p, .auth-pitch .auth-points, .auth-pitch .auth-nets { display: none; }
  .auth-side { order: 2; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius-xl) var(--radius-xl); padding: 24px 20px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .admin-main { margin-left: 0; }
  .hamburger  { display: flex; }
  .page-content { padding: 16px; }
  .topbar       { padding: 0 16px; }
  .client-nav-links { display: none; }
  .client-hamburger { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .modal { max-width: 100%; }
  .table th, .table td { padding: 9px 10px; font-size: .84rem; }
  .page-header { align-items: flex-start; }
}

@media (max-width: 480px) {
  .card-body  { padding: 14px; }
  .card-header{ padding: 12px 14px; }
  .stat-card  { padding: 13px; }
  .stat-card .stat-value { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Rows-per-page picker */
.pp-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .82rem; color: var(--text-muted); white-space: nowrap; }
.pp-form label { margin: 0; font-weight: 500; }
.pp-form .pp-select { width: auto; min-width: 80px; min-height: 32px; height: 32px; padding-top: 0; padding-bottom: 0; font-size: .85rem; }
.pp-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pp-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .pp-form .pp-select { font-size: 16px; } }

/* ============================================================
   Polish layer — depth, motion, states, data, phone finish
   ============================================================ */
html { scroll-behavior: smooth; }
body { -webkit-tap-highlight-color: transparent; text-rendering: optimizeLegibility; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--text); }
* { scrollbar-width: thin; scrollbar-color: var(--border-dark) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
h1, h2, h3 { letter-spacing: -.02em; text-wrap: balance; }

/* Buttons: tactile, focus ring, loading */
.btn { min-height: 42px; border-radius: var(--radius); transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform .12s var(--ease); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px color-mix(in srgb, var(--primary) 50%, transparent); }
.btn-primary, .btn-gradient {
  background-image: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(16,24,40,.12), 0 4px 10px -4px color-mix(in srgb, var(--primary) 55%, transparent);
}
.btn-secondary { box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.btn-sm { min-height: 32px; border-radius: 8px; }
.btn-lg { min-height: 48px; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: rgba(255,255,255,.95) rgba(255,255,255,.95) rgba(255,255,255,.3) rgba(255,255,255,.3);
  animation: tcSpin .7s linear infinite;
}
.btn-secondary.is-loading::after, .btn-outline.is-loading::after { border-color: var(--primary) var(--primary) var(--border) var(--border); }
@keyframes tcSpin { to { transform: rotate(360deg); } }

/* Inputs */
.form-control { min-height: 46px; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.form-control:hover:not(:focus):not(:disabled) { border-color: color-mix(in srgb, var(--border-dark) 60%, var(--text-muted)); }
.form-control:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.form-control.is-invalid, .form-control:user-invalid { border-color: var(--danger); }

/* Cards & stat cards */
.card, .stat-card, .glass { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-header { padding: 16px 20px; }
.card-body { padding: 20px; }
.stat-card { border-top: 1px solid var(--border); position: relative; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: .85; }
.stat-card .stat-value { letter-spacing: -.02em; }

/* Tables: calm rows, sticky header */
.table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-size: .76rem; letter-spacing: .01em; }
.table td { padding: 14px 16px; }
.table th { padding: 11px 16px; }
.table tbody tr:nth-child(even) { background: transparent; }
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.table-sm th, .table-sm td { padding: 8px 12px; }

/* Badges: dot + label pills */
.badge { border-radius: 999px; padding: 3px 10px; gap: 6px; }
.badge[class*="status-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-processing::before { animation: tcPulse 1.6s ease-in-out infinite; }
@keyframes tcPulse { 50% { opacity: .35; } }

/* Alerts & modals */
.alert { border-radius: var(--radius); }
.modal { border-radius: var(--radius-xl); animation: tcSheet .28s var(--ease); }
.modal-header { background: transparent; }
@keyframes tcSheet { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-backdrop { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* Pagination & chips */
.pagination { border-radius: var(--radius); }
.chip { transition: color var(--transition), border-color var(--transition); }

/* Empty states */
.empty-state .empty-ico { border-radius: 50%; border: 0; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }

/* Skeleton loader (use class="skeleton") */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; color: transparent !important; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface-solid) 70%, transparent), transparent);
  animation: tcShimmer 1.4s infinite; }
@keyframes tcShimmer { to { transform: translateX(100%); } }

/* Page entrance: gentle stagger */
.tc-page > *, .cx-body > * { animation: tcRise .42s var(--ease) both; }
.tc-page > *:nth-child(2), .cx-body > *:nth-child(2) { animation-delay: .04s; }
.tc-page > *:nth-child(3), .cx-body > *:nth-child(3) { animation-delay: .08s; }
.tc-page > *:nth-child(n+4), .cx-body > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes tcRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Money figures: big confident numbers, muted currency */
.money { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.money small, .money .cur { font-size: .5em; font-weight: 600; color: var(--text-muted); margin-right: 4px; letter-spacing: 0; vertical-align: .35em; }

/* Phone: compact list rows instead of tall stacked cards */
@media (max-width: 700px) {
  .table-stack tr { padding: 14px 16px; }
  .table-stack td { font-size: .86rem !important; }
  .table.table-compact-phone tbody tr { display: grid !important; grid-template-columns: minmax(0,1fr) auto; gap: 2px 12px; align-items: center; }
  .table.table-compact-phone td { padding: 0 !important; justify-content: flex-start; text-align: left; }
  .table.table-compact-phone td::before { display: none !important; }
  .table.table-compact-phone td.cp-end { justify-content: flex-end; text-align: right; grid-column: 2; }
  .table.table-compact-phone td.cp-sub { grid-column: 1; color: var(--text-muted); font-size: .78rem !important; }
  .table.table-compact-phone td.cp-hide { display: none !important; }
}

/* Tab bar: frosted, safe-area aware */
@media (max-width: 900px) {
  .tabbar { background: color-mix(in srgb, var(--header-bg) 88%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); box-shadow: 0 -1px 0 var(--border), 0 -8px 24px -12px rgba(16,24,40,.12); border-top: 0; }
  .tabbar a { transition: color .15s var(--ease); }
  .tabbar a.tab-main .tab-main-icon { width: 44px; height: 30px; border-radius: 10px; background: var(--primary); color: var(--on-primary); margin-bottom: 1px; }
  .tabbar a.tab-main { color: var(--text); }
  .tabbar a.active { border-top-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .tc-page > *, .cx-body > *, .modal { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Auth: richer side panel, lifted form card */
.auth-pitch { position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(150deg, color-mix(in srgb, var(--primary) 88%, #000) 0%, var(--primary) 60%, color-mix(in srgb, var(--primary) 78%, #7c8cff) 100%); }
.auth-pitch::before { content: ""; position: absolute; z-index: -1; width: 420px; height: 420px; right: -160px; top: -160px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.18), transparent); }
.auth-pitch::after { content: ""; position: absolute; z-index: -1; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(to bottom, #000, transparent 70%); -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%); }
.auth-points li .ti { border-radius: 8px; background: rgba(255,255,255,.16); }
.auth-nets span { border-radius: 999px; }
.auth-wrap { filter: drop-shadow(0 24px 40px rgba(16,24,40,.10)); }

/* Numbered steps (shared) */
.how { list-style:none; display:grid; gap:12px; counter-reset:how; }
.how li { display:grid; grid-template-columns:30px minmax(0,1fr); gap:10px; align-items:start; font-size:.9rem; color:var(--text-secondary); }
.how li::before { counter-increment:how; content:counter(how); width:30px; height:30px; border-radius:50%; display:grid; place-items:center; background:var(--primary-light); color:var(--primary); font-weight:600; font-size:.8rem; }

/* ── Console pop-ups and list pages ─────────────────────────── */
.modal-wide { max-width: 760px; }
.modal .form-group:last-child { margin-bottom: 0; }
.ac-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ac-head h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.ac-head p { margin: 0; color: var(--text-muted); font-size: .88rem; max-width: 720px; }
.ac-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.ac-msg { max-width: 520px; white-space: normal; line-height: 1.45; }
.dl-grid { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 14px; margin: 0; font-size: .9rem; }
.dl-grid dt { color: var(--text-muted); }
.dl-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dl-pre { white-space: pre-wrap; font-family: var(--mono, monospace); font-size: .78rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; max-height: 220px; overflow: auto; margin: 0; }
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.bulk-bar[hidden] { display: none; }

/* Selected (highlighted) text stays readable in light and dark themes */
::selection { background: color-mix(in srgb, var(--primary) 38%, transparent); color: var(--text); }

/* ── Sign-in page (1.6) ─────────────────────────────────────── */
.auth-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.auth-sub { margin-bottom: 20px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: -2px 0 16px; font-size: .88rem; }
.auth-row .form-check { display: flex; gap: 8px; align-items: center; margin: 0; }
.auth-note { margin: 8px 0 0; text-align: center; font-size: .8rem; color: var(--text-muted); }
.auth-help { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-secondary); line-height: 1.5; }
.auth-help .ti { margin-right: 4px; vertical-align: -2px; }
.ap-eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #fff; margin-bottom: 16px; }
.ap-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ap-steps li { display: flex; gap: 12px; align-items: flex-start; }
.ap-steps b { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: .82rem; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); color: #fff; }
.ap-steps span { font-size: .86rem; color: rgba(255,255,255,.78); line-height: 1.45; }
.ap-steps strong { display: block; font-size: .95rem; color: #fff; font-weight: 600; }
.ap-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ap-feats span { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font-size: .84rem; font-weight: 500; color: #fff; }
.ap-feats .ti { font-size: 1rem; opacity: .9; }
[data-design="obsidian"] .ap-eyebrow, [data-design="obsidian"] .ap-feats .ti { color: var(--rail-accent); }
[data-design="obsidian"] .ap-steps b { background: color-mix(in srgb, var(--rail-accent) 20%, transparent); border-color: color-mix(in srgb, var(--rail-accent) 45%, transparent); color: var(--rail-accent); }
@media (max-width: 900px) {
  .ap-steps, .ap-feats { display: none; }
  .auth-pitch .ap-eyebrow { margin-bottom: 8px; }
}

/* Network name with its logo, anywhere */
.net-inline { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; }
.net-inline .net-mark { width: 24px; height: 24px; border-radius: 5px; font-size: .55rem; flex-shrink: 0; }

/* Developer page */
.dev-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.dev-base { padding: 0 18px 12px; overflow-wrap: anywhere; }
.dev-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.dev-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dev-row > .form-control, .dev-row > div { flex: 1 1 240px; min-width: 0; }
.dev-url { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
@media (max-width: 640px) { .dev-url { max-width: 60vw; } }
.ac-sub { display: block; font-size: .78rem; color: var(--text-muted); font-weight: 400; }
@media (max-width: 760px) {
  .table-stack td[data-label]::before { font-family: var(--font); letter-spacing: 0; text-transform: none; }
  .table-stack td > .ac-sub { display: inline; margin-left: 6px; }
  .table-stack td .ac-acts, .table-stack td .dev-acts { justify-content: flex-end; width: 100%; }
}

/* Complaints */
.cmp-list { display: grid; gap: 18px; }
.cmp-card { border: 1px solid var(--border); border-radius: var(--radius-lg, 12px); padding: 14px 16px; background: var(--surface-2); display: grid; gap: 8px; }
.cmp-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.cmp-msg { margin: 0; font-size: .9rem; white-space: pre-line; overflow-wrap: anywhere; }
.cmp-reply { border-left: 3px solid var(--primary); padding: 6px 0 6px 12px; display: grid; gap: 6px; }
.cmp-reply small { color: var(--text-muted); font-size: .76rem; }
.cmp-reply p { margin: 0; font-size: .9rem; white-space: pre-line; overflow-wrap: anywhere; }
.cmp-ev img { max-width: 220px; max-height: 180px; border-radius: 8px; border: 1px solid var(--border); display: block; }

.cmp-sts { display:grid; grid-template-columns:repeat(auto-fill, minmax(130px, 1fr)); gap:6px 12px; margin-bottom:6px; }
.switch-check { display:inline-flex; align-items:center; gap:6px; font-size:.86rem; cursor:pointer; }

/* Date filter chips */
.df-bar { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; align-items:center; padding:12px 18px; border-bottom:1px solid var(--border); }
.df-chips { display:flex; gap:6px; flex-wrap:wrap; }
.df-chip { padding:5px 12px; border-radius:999px; border:1px solid var(--border); font-size:.8rem; color:var(--text-secondary); white-space:nowrap; }
.df-chip.on { background:var(--primary); border-color:var(--primary); color:var(--on-primary); font-weight:600; }
.df-custom { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.df-custom .form-control { width:auto; padding:5px 8px; font-size:.82rem; }
.dev-credit { color: var(--text-muted) !important; font-size: .78rem; white-space: nowrap; }
.dev-credit b { color: var(--primary); font-weight: 600; }
.dev-credit:hover b { text-decoration: underline; }
.auth-single { grid-template-columns: minmax(0, 1fr); max-width: 520px; } .auth-single .auth-side { border-right: 1px solid var(--border); border-radius: var(--radius-xl); }
.auth-form .ac-form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:0 12px; }
