/* NexHub Console — design system
   Dark first, light theme via [data-theme="light"]. Works in both directions (RTL Persian / LTR English):
   spacing uses logical properties only. Fonts are self-hosted (the site must work without international internet). */

@font-face { font-family: "Vazirmatn"; src: url("/static/fonts/Vazirmatn-arabic.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EFD-10EFF, U+1EE00-1EEFF; }
@font-face { font-family: "Vazirmatn"; src: url("/static/fonts/Vazirmatn-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jakarta"; src: url("/static/fonts/PlusJakartaSans-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jakarta"; src: url("/static/fonts/PlusJakartaSans-latin-ext.woff2") format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --font-en: "Jakarta", "Vazirmatn", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-fa: "Vazirmatn", "Jakarta", Tahoma, ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;

  --brand: #5b8dee; --brand-2: #a78bfa; --brand-ink: #ffffff;
  --brand-grad: linear-gradient(135deg, #5b8dee 0%, #7c6cf0 55%, #a78bfa 100%);

  --bg: #080b14; --bg-2: #0b0f1a;
  --surface: #0f1421; --surface-2: #141a2a; --surface-3: #1a2134; --surface-hover: #182036;
  --border: rgba(148, 163, 205, .12); --border-strong: rgba(148, 163, 205, .22);
  --text: #e8ecf7; --text-2: #a3aec8; --text-3: #6b7695;
  --success: #2fd09a; --success-bg: rgba(47, 208, 154, .12);
  --warning: #f5b544; --warning-bg: rgba(245, 181, 68, .13);
  --danger: #f2616b; --danger-bg: rgba(242, 97, 107, .13);
  --info: #4fb6f5; --info-bg: rgba(79, 182, 245, .13);
  --brand-bg: rgba(91, 141, 238, .14);

  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 8px 24px -6px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .25);
  --shadow-lg: 0 28px 70px -14px rgba(0, 0, 0, .65), 0 6px 18px rgba(0, 0, 0, .35);
  --ring: 0 0 0 3px rgba(91, 141, 238, .35);
  --ease: cubic-bezier(.23, 1, .32, 1); --ease-out: cubic-bezier(.23, 1, .32, 1); --ease-in-out: cubic-bezier(.77, 0, .175, 1); --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --sidebar-w: 268px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f6fb; --bg-2: #eef1f8;
  --surface: #ffffff; --surface-2: #f7f8fc; --surface-3: #eef1f8; --surface-hover: #f1f4fb;
  --border: rgba(16, 24, 48, .09); --border-strong: rgba(16, 24, 48, .17);
  --text: #121a2e; --text-2: #4c5876; --text-3: #8a94ad;
  --success: #109868; --success-bg: rgba(16, 152, 104, .1);
  --warning: #b77905; --warning-bg: rgba(212, 140, 10, .12);
  --danger: #d23a45; --danger-bg: rgba(210, 58, 69, .09);
  --info: #1f7fc2; --info-bg: rgba(31, 127, 194, .09);
  --brand: #3d6fe0; --brand-bg: rgba(61, 111, 224, .1);
  --shadow-sm: 0 1px 2px rgba(16, 24, 48, .06);
  --shadow: 0 8px 24px -8px rgba(16, 24, 48, .14), 0 2px 6px rgba(16, 24, 48, .05);
  --shadow-lg: 0 30px 70px -16px rgba(16, 24, 48, .25), 0 6px 18px rgba(16, 24, 48, .08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain; interpolate-size: allow-keywords; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--font-fa); font-size: 14.5px; line-height: 1.65; -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:root[lang="en"] body { font-family: var(--font-en); font-size: 14px; letter-spacing: -.003em; }
body::before { /* soft brand glow behind everything */
  content: ""; position: fixed; inset: -20% -10% auto auto; width: 70vw; height: 70vh; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, rgba(91, 141, 238, .13), transparent 70%);
}
:root[dir="rtl"] body::before { inset: -20% auto auto -10%; }
:root[data-theme="light"] body::before { background: radial-gradient(closest-side, rgba(91, 141, 238, .09), transparent 70%); }

a { color: var(--brand); text-decoration: none; transition: color .15s; }
@media (hover: hover) and (pointer: fine) { a:hover { color: var(--brand-2); } }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: -.01em; color: var(--text); }
p { margin: 0 0 .75em; }
code, .mono, kbd, pre { font-family: var(--font-mono); font-size: .9em; }
.ltr { direction: ltr; unicode-bidi: isolate; }
:root[dir="rtl"] .ltr { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: rgba(91, 141, 238, .35); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ------------------------------------------------------------------ icons */
.i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3.5px; }
.i-sm { width: 15px; height: 15px; vertical-align: -2.5px; }
.i-lg { width: 22px; height: 22px; }
.i-xl { width: 28px; height: 28px; }
:root[dir="rtl"] .i-flip { transform: scaleX(-1); }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; position: relative; z-index: 1; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px);
  border-inline-end: 1px solid var(--border); z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 16px; color: var(--text); }
@media (hover: hover) and (pointer: fine) { .sidebar-brand:hover { color: var(--text); } }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-grad); display: grid; place-items: center; flex: none;
  box-shadow: 0 6px 18px -4px rgba(91, 141, 238, .55); }
.logo svg { width: 20px; height: 20px; }
.brand-name { font-family: var(--font-en); font-weight: 800; font-size: 16.5px; letter-spacing: -.02em; line-height: 1.1; }
.brand-name b { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 11.5px; color: var(--text-3); font-weight: 500; margin-top: 2px; }
.sidebar-search { margin: 4px 14px 10px; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav-section { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 16px 12px 6px; }
:root[lang="fa"] .nav-section { letter-spacing: 0; font-size: 11.5px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; margin: 1px 0; border-radius: 9px; color: var(--text-2);
  font-weight: 500; font-size: 13.8px; transition: background .15s, color .15s; position: relative; }
.nav a .i { opacity: .82; }
@media (hover: hover) and (pointer: fine) { .nav a:hover { background: var(--surface-hover); color: var(--text); } }
.nav a.active { background: var(--brand-bg); color: var(--text); }
.nav a.active .i { color: var(--brand); opacity: 1; }
.nav a.active::before { content: ""; position: absolute; inset-inline-start: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-grad); }
:root[dir="rtl"] .nav a.active::before { border-radius: 3px 0 0 3px; }
.nav .count { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; font-family: var(--font-en); }
.nav .count.soft { background: var(--surface-3); color: var(--text-2); }
.sidebar-foot { border-top: 1px solid var(--border); padding: 12px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.me-card .who { min-width: 0; flex: 1; }
.me-card .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .who span { font-size: 12px; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); min-height: 62px; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.content { padding: 28px 28px 70px; width: 100%; max-width: 1320px; margin: 0 auto; }
.menu-btn { display: none; }
.scrim { display: none; }

@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(86vw, 300px); transform: translateX(-102%); transition: transform .3s var(--ease-drawer);
    background: var(--surface); box-shadow: var(--shadow-lg); }
  :root[dir="rtl"] .sidebar { transform: translateX(102%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(4, 6, 12, .55); z-index: 35; animation: fade .2s; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 20px 16px 60px; }
}

/* ---------------------------------------------------------------- buttons */
.btn { --b-bg: var(--surface-2); --b-fg: var(--text); --b-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 10px;
  background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-bd); font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: transform .16s var(--ease-out), background .15s, border-color .15s, box-shadow .2s, color .15s, filter .15s;
  user-select: none; position: relative; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--surface-hover); color: var(--b-fg); border-color: var(--border-strong); } }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-primary { --b-bg: var(--brand-grad); --b-fg: #fff; --b-bd: transparent; background: var(--brand-grad); box-shadow: 0 6px 18px -6px rgba(91, 141, 238, .6); }
@media (hover: hover) and (pointer: fine) { .btn-primary:hover { background: var(--brand-grad); color: #fff; filter: brightness(1.08); box-shadow: 0 10px 26px -8px rgba(91, 141, 238, .7); } }
.btn-danger { --b-bg: var(--danger-bg); --b-fg: var(--danger); --b-bd: transparent; }
@media (hover: hover) and (pointer: fine) { .btn-danger:hover { background: var(--danger); color: #fff; } }
.btn-success { --b-bg: var(--success-bg); --b-fg: var(--success); --b-bd: transparent; }
@media (hover: hover) and (pointer: fine) { .btn-success:hover { background: var(--success); color: #fff; } }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--text-2); }
@media (hover: hover) and (pointer: fine) { .btn-ghost:hover { background: var(--surface-hover); color: var(--text); border-color: transparent; } }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.8px; border-radius: 8px; gap: 6px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor;
  border-color: rgba(255, 255, 255, .9) rgba(255, 255, 255, .9) transparent transparent; animation: spin .7s linear infinite; }
.btn:not(.btn-primary).loading::after { border-color: var(--text-2) var(--text-2) transparent transparent; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .link-btn:hover { color: var(--brand-2); } }

/* ----------------------------------------------------------------- layout */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; font-weight: 750; letter-spacing: -.025em; }
:root[lang="fa"] .page-head h1 { font-weight: 800; letter-spacing: 0; font-size: 24px; }
.page-head .sub { color: var(--text-2); margin-top: 6px; max-width: 760px; font-size: 14px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--brand); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: .07em; }
:root[lang="fa"] .eyebrow { letter-spacing: 0; text-transform: none; }
.stack { display: grid; gap: 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.grid-auto-sm { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } .page-head h1 { font-size: 22px; } }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 200px; margin: 0; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hstack { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 12px; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); } .small { font-size: 12.8px; } .tiny { font-size: 11.8px; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.nowrap { white-space: nowrap; } .grow { flex: 1; } .w-100 { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); position: relative; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-title { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-title .i { color: var(--brand); }
.card-sub { color: var(--text-2); font-size: 13px; margin-top: 4px; max-width: 760px; }
.card-body { padding: 18px 20px 20px; }
.card-body.flush { padding: 8px 0 4px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.card.hoverable { transition: transform .25s var(--ease), box-shadow .25s, border-color .2s; }
@media (hover: hover) and (pointer: fine) { .card.hoverable:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); } }
.card.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.card.warn { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }

/* stats */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; display: flex; gap: 14px;
  align-items: center; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-bg); color: var(--brand); flex: none; }
.stat .ico.success { background: var(--success-bg); color: var(--success); } .stat .ico.warning { background: var(--warning-bg); color: var(--warning); }
.stat .ico.danger { background: var(--danger-bg); color: var(--danger); } .stat .ico.info { background: var(--info-bg); color: var(--info); }
.stat .v { font-size: 24px; font-weight: 800; line-height: 1.1; font-family: var(--font-en); letter-spacing: -.02em; }
.stat .l { color: var(--text-2); font-size: 12.8px; margin-top: 3px; }
.stat .meter { margin-top: 8px; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.8px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; }
.badge .i { width: 13px; height: 13px; }
.badge-brand { background: var(--brand-bg); color: var(--brand); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-outline { background: transparent; border-color: var(--border-strong); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* status dots */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--text-3); flex: none; position: relative; }
.dot.up { background: var(--success); box-shadow: 0 0 0 0 rgba(47, 208, 154, .5); animation: pulse 2.4s infinite; }
.dot.down { background: var(--danger); }
.dot.warn { background: var(--warning); }
.dot.external { background: var(--info); }
.dot.pending, .dot.unknown { background: var(--text-3); }
.dot.stopped { background: transparent; box-shadow: inset 0 0 0 2px var(--text-3); }

/* ----------------------------------------------------------------- forms */
.field { margin-bottom: 14px; }
.field > label, .label { display: block; font-size: 12.8px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.help { font-size: 12.2px; color: var(--text-3); margin-top: 5px; }
.input, input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], input[type=url], input:not([type]), select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text);
  font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .2s, background .15s; outline: none; }
:root[data-theme="light"] input:not([type=checkbox]):not([type=radio]), :root[data-theme="light"] select, :root[data-theme="light"] textarea { background: #fff; }
textarea { height: auto; padding: 10px 12px; min-height: 90px; resize: vertical; line-height: 1.6; }
select { cursor: pointer; padding-inline-end: 30px; appearance: none; background-repeat: no-repeat; background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94ad' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 11px center; }
:root[dir="rtl"] select { background-position: left 11px center; }
@media (hover: hover) and (pointer: fine) { input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--border-strong)); } }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; cursor: pointer; flex: none; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; font-size: 13.8px; }
.input-group { display: flex; gap: 8px; }
.input-group > * { min-width: 0; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 42px; }
.pw-toggle { position: absolute; inset-inline-end: 4px; top: 4px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--text-3);
  border-radius: 7px; cursor: pointer; display: grid; place-items: center; }
@media (hover: hover) and (pointer: fine) { .pw-toggle:hover { color: var(--text); background: var(--surface-hover); } }
.strength { display: flex; gap: 4px; margin-top: 7px; }
.strength i { height: 4px; flex: 1; border-radius: 4px; background: var(--surface-3); transition: background .25s; }
.strength[data-s="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-s="2"] i:nth-child(-n+2) { background: var(--warning); }
.strength[data-s="3"] i:nth-child(-n+3) { background: #9ad04f; }
.strength[data-s="4"] i { background: var(--success); }
.strength-label { font-size: 11.5px; color: var(--text-3); margin-top: 4px; min-height: 16px; }
.choice-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer;
  transition: border-color .15s, background .15s; background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) { .choice:hover { border-color: var(--brand); } }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-bg); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); gap: 2px; }
.seg label { padding: 6px 13px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 12px; border: 1px solid transparent; font-size: 13.8px;
  background: var(--info-bg); color: var(--text); margin-bottom: 16px; }
.alert > .i { margin-top: 2px; color: var(--info); }
.alert b { font-weight: 700; }
.alert-success { background: var(--success-bg); } .alert-success > .i { color: var(--success); }
.alert-warning { background: var(--warning-bg); } .alert-warning > .i { color: var(--warning); }
.alert-danger { background: var(--danger-bg); } .alert-danger > .i { color: var(--danger); }
.alert-brand { background: var(--brand-bg); } .alert-brand > .i { color: var(--brand); }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.6px; }
.table th { text-align: start; font-weight: 600; font-size: 12px; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; background: var(--surface); position: sticky; top: 0; }
:root[lang="fa"] .table th { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
@media (hover: hover) and (pointer: fine) { .table tbody tr:hover { background: var(--surface-hover); } }
.table .actions { text-align: end; white-space: nowrap; }
.table.compact td { padding: 8px 14px; }
.card .table th:first-child, .card .table td:first-child { padding-inline-start: 20px; }
.card .table th:last-child, .card .table td:last-child { padding-inline-end: 20px; }

/* -------------------------------------------------------- lists / people */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none;
  background: var(--brand-grad); text-transform: uppercase; font-family: var(--font-en); }
.avatar.lg { width: 52px; height: 52px; font-size: 19px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar.c1 { background: linear-gradient(135deg, #22c1c3, #3a7bd5); } .avatar.c2 { background: linear-gradient(135deg, #f7797d, #c471ed); }
.avatar.c3 { background: linear-gradient(135deg, #f2994a, #eb5757); } .avatar.c4 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.avatar.c5 { background: linear-gradient(135deg, #8e2de2, #4a00e0); } .avatar.c6 { background: linear-gradient(135deg, #f953c6, #b91d73); }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .hd { color: var(--text-3); font-size: 12.3px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }

/* expandable rows (<details>) */
details.xrow { border-bottom: 1px solid var(--border); }
details.xrow:last-of-type { border-bottom: 0; }
details.xrow > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 13px 20px; transition: background .12s; }
details.xrow > summary::-webkit-details-marker { display: none; }
@media (hover: hover) and (pointer: fine) { details.xrow > summary:hover { background: var(--surface-hover); } }
details.xrow > summary .chev { margin-inline-start: auto; color: var(--text-3); transition: transform .25s var(--ease); }
details.xrow[open] > summary .chev { transform: rotate(180deg); }
details.xrow[open] > summary { background: var(--surface-2); }
details.xrow > .xbody { padding: 18px 20px 22px; background: var(--surface-2); border-top: 1px solid var(--border); animation: slideDown .3s var(--ease); }
details.disclose { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); margin-top: 10px; }
details.disclose > summary { cursor: pointer; list-style: none; padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary .chev { margin-inline-start: auto; transition: transform .25s; }
details.disclose[open] > summary .chev { transform: rotate(180deg); }
details.disclose > .dbody { padding: 4px 12px 12px; animation: slideDown .25s var(--ease); }

/* ------------------------------------------------------ service tiles */
.svc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column;
  gap: 12px; transition: transform .25s var(--ease), box-shadow .25s, border-color .2s; position: relative; overflow: hidden; }
@media (hover: hover) and (pointer: fine) { .svc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); } }
.svc-card .top { display: flex; align-items: center; gap: 12px; }
.svc-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; background: var(--brand-grad); }
.svc-ico.t1 { background: linear-gradient(135deg, #3a7bd5, #00d2ff); } .svc-ico.t2 { background: linear-gradient(135deg, #f7797d, #c471ed); }
.svc-ico.t3 { background: linear-gradient(135deg, #f2994a, #eb5757); } .svc-ico.t4 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.svc-ico.t5 { background: linear-gradient(135deg, #8e2de2, #4a00e0); } .svc-ico.t6 { background: linear-gradient(135deg, #f953c6, #b91d73); }
.svc-ico.t7 { background: linear-gradient(135deg, #485563, #29323c); } .svc-ico.t8 { background: linear-gradient(135deg, #e0a526, #c76b10); }
.svc-card .title { font-weight: 700; font-size: 14.5px; line-height: 1.35; }
.svc-card .status { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.svc-card .note { font-size: 12.6px; color: var(--text-2); line-height: 1.6; }
.svc-card .foot { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.cred { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 6px 6px 6px 11px; min-width: 0; }
:root[dir="rtl"] .cred { padding: 6px 11px 6px 6px; }
.cred .k { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.cred .v { font-family: var(--font-mono); font-size: 12.8px; direction: ltr; unicode-bidi: isolate; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.cred .btn { height: 26px; padding: 0 8px; }

/* --------------------------------------------------------------- progress */
.meter { height: 7px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--brand-grad); transition: width .6s var(--ease); }
.meter.success > span { background: var(--success); } .meter.warning > span { background: var(--warning); } .meter.danger > span { background: var(--danger); }

/* ----------------------------------------------------------------- empty */
.empty { text-align: center; padding: 36px 20px; color: var(--text-2); }
.empty .ico { width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 12px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); }
.empty h4 { font-size: 15px; margin-bottom: 4px; }
.empty p { font-size: 13px; color: var(--text-3); margin: 0 auto; max-width: 380px; }

/* ------------------------------------------------------------ pre / code */
pre.log { direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-all; font-size: 12px; line-height: 1.6; max-height: 68vh; overflow: auto;
  background: #05070d; color: #c9d4ea; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); margin: 0; }
:root[data-theme="light"] pre.log { background: #0e1424; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--border-strong);
  border-bottom-width: 2px; font-size: 11px; color: var(--text-2); background: var(--surface-2); font-family: var(--font-en); }

/* ----------------------------------------------------------- dropdowns */
.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 230px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; transform-origin: top right; opacity: 0; transform: translateY(-6px) scale(.97);
  pointer-events: none; transition: opacity .12s ease-out, transform .12s ease-out; }
:root[dir="rtl"] .dd-menu { transform-origin: top left; }
.dd.open .dd-menu { opacity: 1; transform: none; pointer-events: auto; transition: opacity .16s var(--ease-out), transform .18s var(--ease-out); }
.dd-menu a, .dd-menu button.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; color: var(--text);
  background: none; border: 0; font: inherit; font-size: 13.5px; cursor: pointer; text-align: start; }
@media (hover: hover) and (pointer: fine) { .dd-menu a:hover, .dd-menu button.item:hover { background: var(--surface-hover); color: var(--text); } }
.dd-menu .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dd-menu .head { padding: 8px 10px 6px; font-size: 12px; color: var(--text-3); }
.notif-menu { width: min(380px, 92vw); padding: 0; }
.notif-menu .nh { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; }
.notif-list { max-height: 420px; overflow: auto; }
.notif-item { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13px; display: flex; gap: 10px; }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.notif-item .when { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.notif-item .dot { margin-top: 7px; }
.bell { position: relative; }
.bell .pip { position: absolute; top: 6px; inset-inline-end: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger);
  color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); font-family: var(--font-en); }

/* ------------------------------------------------------- command palette */
.modal-back { position: fixed; inset: 0; background: rgba(4, 6, 12, .6); backdrop-filter: blur(4px); z-index: 100; display: none; align-items: flex-start;
  justify-content: center; padding: 12vh 16px 16px; }
.modal-back.open { display: flex; animation: fade .15s ease-out; }
.modal { width: min(620px, 100%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow-lg);
  overflow: hidden; animation: modalIn .2s var(--ease-out); }
#cmdk.modal-back.open, #cmdk .modal { animation: none; }
.modal.small { width: min(440px, 100%); }
.modal .m-body { padding: 22px; }
.modal .m-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.cmdk-input input { border: 0; background: transparent; height: 32px; padding: 0; font-size: 15.5px; box-shadow: none !important; }
.cmdk-list { max-height: 52vh; overflow: auto; padding: 8px; }
.cmdk-group { font-size: 11.5px; color: var(--text-3); padding: 10px 10px 4px; font-weight: 700; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; color: var(--text); }
.cmdk-item .i { color: var(--text-3); }
.cmdk-item .hint { margin-inline-start: auto; font-size: 12px; color: var(--text-3); }
.cmdk-item.active { background: var(--brand-bg); }
.cmdk-item.active .i { color: var(--brand); }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.search-trigger { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg-2); color: var(--text-3); cursor: pointer; font: inherit; font-size: 13px; transition: border-color .15s; }
@media (hover: hover) and (pointer: fine) { .search-trigger:hover { border-color: var(--brand); color: var(--text-2); } }
.search-trigger kbd { margin-inline-start: auto; }

/* ----------------------------------------------------------------- toasts */
.toasts { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 11px; align-items: flex-start; padding: 13px 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg); font-size: 13.6px; opacity: 1; transform: none;
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out); }
@starting-style { .toast { opacity: 0; transform: translateY(14px) scale(.97); } }
.toast.out { opacity: 0; transform: translateY(8px) scale(.97); transition-duration: .18s; }
.toast .i { margin-top: 1px; }
.toast.success .i { color: var(--success); } .toast.error .i { color: var(--danger); } .toast.info .i { color: var(--brand); }
.toast .x { margin-inline-start: auto; background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 0; }

/* -------------------------------------------------------------- progress bar */
#navbar { position: fixed; top: 0; inset-inline-start: 0; height: 2.5px; width: 0; background: var(--brand-grad); z-index: 300; opacity: 0;
  transition: width .4s var(--ease), opacity .3s; box-shadow: 0 0 10px rgba(91, 141, 238, .7); }
#navbar.go { opacity: 1; width: 75%; transition: width 6s cubic-bezier(.1, .7, .2, 1), opacity .2s; }

/* ------------------------------------------------------------- auth pages */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); position: relative; z-index: 1; }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 20% 10%, rgba(91, 141, 238, .35), transparent 60%),
  radial-gradient(900px 500px at 90% 100%, rgba(167, 139, 250, .35), transparent 60%), #070a14; padding: 48px; display: flex; flex-direction: column; color: #e8ecf7; }
.auth-art .grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
  linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.auth-art .orb { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .55; animation: float 14s ease-in-out infinite; }
.auth-art .content-art { position: relative; margin-top: auto; max-width: 480px; }
.auth-art h2 { font-size: 34px; line-height: 1.2; font-weight: 800; color: #fff; letter-spacing: -.02em; }
:root[lang="fa"] .auth-art h2 { letter-spacing: 0; line-height: 1.5; }
.auth-art p { color: #a9b4d0; font-size: 15px; margin-top: 12px; }
.auth-art .feats { display: grid; gap: 12px; margin-top: 28px; }
.auth-art .feat { display: flex; gap: 12px; align-items: center; color: #cfd7ea; font-size: 14px; }
.auth-art .feat .i { color: #8fb0ff; }
.auth-form { display: flex; flex-direction: column; padding: 32px; }
.auth-form .inner { width: min(400px, 100%); margin: auto; animation: rise .6s var(--ease); }
.auth-form h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
:root[lang="fa"] .auth-form h1 { letter-spacing: 0; }
.auth-form .sub { color: var(--text-2); margin: 8px 0 26px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.auth-foot { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 30px; }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-art { display: none; } }

/* ------------------------------------------------------------- welcome */
.hero-card { position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 28px; border: 1px solid var(--border);
  background: radial-gradient(700px 260px at 0% 0%, rgba(91, 141, 238, .22), transparent 70%), radial-gradient(500px 260px at 100% 100%, rgba(167, 139, 250, .18), transparent 70%), var(--surface); }
:root[dir="rtl"] .hero-card { background: radial-gradient(700px 260px at 100% 0%, rgba(91, 141, 238, .22), transparent 70%), radial-gradient(500px 260px at 0% 100%, rgba(167, 139, 250, .18), transparent 70%), var(--surface); }
.hero-card h1 { font-size: 26px; font-weight: 800; }
.hero-card .sub { color: var(--text-2); margin-top: 6px; }

/* timeline / activity */
.activity { display: grid; }
.activity .a { display: flex; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); font-size: 13px; }
.activity .a:last-child { border-bottom: 0; }
.activity .a .when { color: var(--text-3); font-size: 12px; white-space: nowrap; margin-inline-start: auto; font-family: var(--font-mono); }

/* qr */
.qr { width: 220px; height: 220px; background: #fff; padding: 10px; border-radius: 12px; display: block; margin: 10px auto; }

/* tooltips */
[data-tip] { position: relative; }
[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: #000d; color: #fff; padding: 5px 9px; border-radius: 7px; font-size: 12px; z-index: 80; pointer-events: none; animation: fade .15s; font-weight: 500; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-hover) 50%, var(--surface-3) 75%); background-size: 200% 100%;
  animation: shimmer 1.4s infinite; border-radius: 8px; height: 14px; }

/* ------------------------------------------------------------- motion */
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) } to { opacity: 1; transform: none } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px) } to { opacity: 1; transform: none } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 208, 154, .45) } 70% { box-shadow: 0 0 0 7px rgba(47, 208, 154, 0) } 100% { box-shadow: 0 0 0 0 rgba(47, 208, 154, 0) } }
@keyframes shimmer { to { background-position: -200% 0 } }
@keyframes float { 0%, 100% { transform: translate(0, 0) } 50% { transform: translate(30px, -24px) } }
.reveal > * { animation: rise .32s var(--ease-out) both; }
.reveal > *:nth-child(2) { animation-delay: .04s } .reveal > *:nth-child(3) { animation-delay: .08s } .reveal > *:nth-child(4) { animation-delay: .12s }
.reveal > *:nth-child(5) { animation-delay: .16s } .reveal > *:nth-child(6) { animation-delay: .2s }
.reveal > *:nth-child(n+7) { animation-delay: .24s }
@media (prefers-reduced-motion: reduce) {
  /* fewer and gentler, not none: keep fades and colour changes (they explain what happened), drop movement and looping */
  .reveal > *, .row-in, .modal, .dd-menu, .toast, details > .xbody, details > .dbody { animation-name: fade !important; transform: none !important; }
  .btn:active, .btn:active * { transform: none !important; }
  .dot.up, .auth-art .orb, .skel { animation: none !important; }
  .sidebar { transition-duration: .01ms !important; }
}

/* --------------------------------------------------------- responsive table cards */
@media (max-width: 760px) {
  .table.stack-sm thead { display: none; }
  .table.stack-sm, .table.stack-sm tbody, .table.stack-sm tr, .table.stack-sm td { display: block; width: 100%; }
  .table.stack-sm tr { padding: 10px 16px; border-bottom: 1px solid var(--border); }
  .table.stack-sm td { border: 0; padding: 4px 0 !important; }
  .table.stack-sm td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
  .table.stack-sm .actions { text-align: start; }
  .topbar .hide-sm { display: none; }
}

hr.sep { border: 0; height: 1px; background: var(--border); margin: 16px 0; }
.svc-card.is-new { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring, rgba(91,141,238,.25)); animation: pop .5s var(--ease); }

/* ============================================================== polish layer
   Design-engineering pass (details that compound): sharper type, layered surfaces, press feedback on everything pressable,
   asymmetric motion (slow where the person decides, instant where the system answers), mobile-native behaviour. */

/* type: tidy wrapping and steady numbers */
h1, h2, h3, .card-title, .eyebrow { text-wrap: balance; }
.sub, .card-sub, .help, .empty p, .alert { text-wrap: pretty; }
.stat .v, .table td, .table th, .badge, .count, .meter, .mono, .tiny, .small, time { font-variant-numeric: tabular-nums; }
.stat .v { font-size: 25px; letter-spacing: -.025em; }
.page-head h1 { letter-spacing: -.03em; }

/* surfaces: a hairline of light on top, softer layered shadow (dark theme) */
:root:not([data-theme="light"]) .card, :root:not([data-theme="light"]) .stat, :root:not([data-theme="light"]) .svc-card {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -14px rgba(0, 0, 0, .55); }
:root:not([data-theme="light"]) .card-head + .card-body { padding-top: 14px; }
.card, .stat, .svc-card { transition: border-color .2s ease, box-shadow .25s ease; }

/* press feedback on every pressable thing, quick on press, slightly slower to release */
.seg label, .choice, .search-trigger, .link-btn, .nav a, .dd-menu a, .dd-menu button.item, .cmdk-item { touch-action: manipulation; }
.seg label { transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .16s var(--ease-out); }
.seg label:active, .choice:active, .search-trigger:active { transform: scale(.97); }
.nav a:active { transform: scale(.985); }
.nav a { transition: background .15s ease, color .15s ease, transform .16s var(--ease-out); }
.card.hoverable:active, a.svc-card:active { transform: scale(.985); }

/* controls never select their own text when held; stop the grey tap flash */
.btn, .nav a, .seg label, .choice, .search-trigger, .pw-toggle, .menu-btn, summary, .badge { -webkit-user-select: none; user-select: none; }
a, button, summary, label { -webkit-tap-highlight-color: transparent; }

/* disclosure panels open AND close smoothly where the browser can (Chromium 131+); others keep the existing open animation */
@supports (interpolate-size: allow-keywords) {
  details.disclose::details-content, details.xrow::details-content { block-size: 0; overflow: clip;
    transition: block-size .24s var(--ease-out), content-visibility .24s allow-discrete; }
  details.disclose[open]::details-content, details.xrow[open]::details-content { block-size: auto; }
  details.disclose > .dbody, details.xrow > .xbody { animation: none; }
}

/* status pills (YouTube page and anywhere a row of facts is shown) */
.pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12.4px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; max-width: 100%; }
.pill .dot { width: 7px; height: 7px; animation: none; box-shadow: none; }
.pill.ok { color: var(--text); } .pill.bad { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.pill.warn { color: var(--warning); background: var(--warning-bg); border-color: transparent; }
.pill .faint { font-weight: 500; }
.drive-line { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12.6px; color: var(--text-2); }
.drive-line .meter { flex: 1; max-width: 240px; height: 5px; }

/* new rows in a live list ease in; nothing else moves */
.row-in > td { animation: rise .26s var(--ease-out) both; }
.row-in > td:nth-child(2) { animation-delay: 30ms; } .row-in > td:nth-child(3) { animation-delay: 60ms; }

/* theme switch: colours cross-fade instead of snapping (class is added for a moment by app.js) */
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .28s ease, border-color .28s ease, color .28s ease, fill .28s ease, box-shadow .28s ease !important; }

/* a status dot only pulses where it is the one thing to look at */
.dot.up { animation: none; box-shadow: none; }
.badge .dot.up, .page-head .dot.up { animation: pulse 2.4s infinite; }

/* page changes: the sidebar and top bar stay put, only the content cross-fades (browsers without view transitions simply navigate) */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: hub-sidebar; }
.topbar { view-transition-name: hub-topbar; }
::view-transition-group(hub-sidebar), ::view-transition-group(hub-topbar) { animation-duration: 0s; }
::view-transition-old(root) { animation: fade-out .12s ease-in both; }
::view-transition-new(root) { animation: fade-in .18s ease-out both; }
@keyframes fade-out { to { opacity: 0 } }
@keyframes fade-in { from { opacity: 0 } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* phones: no zoom-on-focus, room for the notch and home bar, comfortable tap targets */
@media (max-width: 760px) {
  .input, input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], input[type=url], input:not([type]), select, textarea,
  .cmdk-input input { font-size: 16px; }          /* iOS zooms into anything smaller when it is focused */
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .content { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .toasts { bottom: max(14px, env(safe-area-inset-bottom)); inset-inline-end: 12px; }
  .btn-sm { height: 36px; } .btn-xs { height: 30px; }
  .pill { height: 28px; }
}
@media (max-width: 1024px) { .sidebar-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); } }


/* ── phones: nothing may push the page sideways; tab bar; compact health pill ───────────────────────────────── */
.bottom-nav { display: none; }
.health-pill { height: 28px; padding: 0 10px; text-decoration: none; white-space: nowrap; }
.health-pill span { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .main, .content, .card, .card-body { min-width: 0; }
  .content { overflow-x: clip; }
  details.xrow > summary { padding-inline: 14px; gap: 10px; }
  details.xrow > summary .person { min-width: 0 !important; flex: 1 1 auto !important; }
  .card-head [data-filter], .card-head input[type='search'] { width: 100% !important; }
  .health-pill span { display: none; }      /* just the coloured dot + icon on a phone */
  .health-pill { padding: 0 8px; }
  .content { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--surface, #0f1424) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 2px; border: 0;
    border-radius: 12px; background: transparent; color: var(--text-3); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer;
  }
  .bottom-nav .i { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--text); background: color-mix(in srgb, var(--brand) 20%, transparent); }
  .bottom-nav a:active, .bottom-nav button:active { transform: scale(.95); }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ════════════════════════════════════════════════════════════════════════════════════════════════════════════
   THEME v3 (2026-11-09): warm near-black / paper surfaces, one lime accent ("lit" = on), flat fills, display type
   (Lalezar for Persian, Syne for Latin) on the sign-in poster and the wordmark. No gradients, glows or blur.
   Everything here overrides the tokens/rules above, so removing this block restores the original look.
   ════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
@font-face { font-family: "Lalezar"; src: url("/static/fonts/Lalezar-arabic.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Lalezar"; src: url("/static/fonts/Lalezar-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Syne"; src: url("/static/fonts/Syne-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Geist Mono"; src: url("/static/fonts/GeistMono-latin.woff2") format("woff2"); font-weight: 300 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
:root {
  --brand: #c6f24e; --brand-2: #dcfb86; --brand-fill: #c6f24e; --brand-ink: #12140a; --brand-grad: var(--brand-fill); --lamp: #c6f24e;
  --bg: #0e0e0c; --bg-2: #121210;
  --surface: #161613; --surface-2: #1b1b17; --surface-3: #23231e; --surface-hover: #1f1f1a;
  --border: rgba(255, 255, 255, .09); --border-strong: rgba(255, 255, 255, .19);
  --text: #f2efe6; --text-2: #aba89c; --text-3: #7c796e;
  --brand-bg: rgba(198, 242, 78, .11);
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 22px;
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 18px 44px -14px rgba(0, 0, 0, .7);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand);
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
:root[data-theme="light"] {
  --brand: #456f00; --brand-2: #2f4d00; --brand-fill: #bdec3f; --brand-ink: #14150f; --lamp: #72ad10;
  --bg: #f2efe6; --bg-2: #ebe7dc;
  --surface: #fbf9f3; --surface-2: #f5f2ea; --surface-3: #e9e5d9; --surface-hover: #f0ede3;
  --border: rgba(18, 20, 10, .11); --border-strong: rgba(18, 20, 10, .24);
  --text: #14150f; --text-2: #55564b; --text-3: #84847a;
  --brand-bg: rgba(110, 165, 16, .14);
  --shadow: none; --shadow-lg: 0 18px 44px -16px rgba(18, 20, 10, .25);
}
::selection { background: var(--brand-fill); color: var(--brand-ink); }
body::before, :root[data-theme="light"] body::before { display: none; }
.logo { background: var(--brand-fill); box-shadow: none; border-radius: 9px; }
.logo svg path { fill: var(--brand-ink); }
.brand-name { font-family: "Syne", var(--font-en); font-weight: 800; letter-spacing: -.03em; }
.brand-name b { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--text-3); font-weight: 800; }
/* primary button: a solid lime pill with dark text, in both themes */
.btn-primary { --b-bg: var(--brand-fill); --b-fg: var(--brand-ink); background: var(--brand-fill); color: var(--brand-ink); box-shadow: none; font-weight: 700; }
@media (hover: hover) and (pointer: fine) { .btn-primary:hover { background: var(--brand-fill); color: var(--brand-ink); filter: brightness(1.06); box-shadow: none; } }
.btn-primary:active { transform: scale(.97); }
.seg-btn.active { color: var(--brand-ink) !important; background: var(--brand-fill) !important; border-color: var(--brand-fill) !important; }
#navbar { box-shadow: none; background: var(--brand-fill); }
.meter > span { background: var(--lamp); }
/* avatars and service icons: one quiet tile each instead of eight gradients */
.avatar, .avatar.c1, .avatar.c2, .avatar.c3, .avatar.c4, .avatar.c5, .avatar.c6 { background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); }
.svc-ico, .svc-ico.t1, .svc-ico.t2, .svc-ico.t3, .svc-ico.t4, .svc-ico.t5, .svc-ico.t6, .svc-ico.t7, .svc-ico.t8 {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 12px; }
.hero-card, :root[dir="rtl"] .hero-card { background: var(--surface); }
.svc-card.is-new { box-shadow: 0 0 0 2px var(--brand); }
.sidebar, .topbar, .bottom-nav { backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar { background: var(--bg); } .bottom-nav { background: var(--surface); }
.nav a.active::before { background: var(--lamp); }
.bottom-nav a.active { background: var(--brand-bg); }
.card, .stat { box-shadow: none; }

/* ── sign-in pages: form on one side, a live poster on the other ─────────────────────────────────────────── */
.auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
.auth-form { padding: 20px 24px 28px; }
.auth-form .inner { width: min(380px, 100%); animation: none; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 34px; color: var(--text); }
.auth-form h1 { font-family: "Lalezar", var(--font-fa); font-weight: 400; font-size: 54px; line-height: 1.2; letter-spacing: 0; }
:root[lang="en"] .auth-form h1 { font-family: "Syne", var(--font-en); font-weight: 800; font-size: 40px; letter-spacing: -.035em; line-height: 1.05; }
.auth-form .sub { margin: 6px 0 26px; }
.auth-form .btn-primary.btn-lg { height: 52px; border-radius: 999px; font-size: 16px; }
.auth-form input { border-radius: 12px; height: 48px; }
.auth-foot { margin-top: 24px; }
.poster { position: relative; margin: 14px; border-radius: 28px; background: var(--surface); border: 1px solid var(--border); padding: clamp(26px, 3.4vw, 48px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px; overflow: hidden; min-height: calc(100dvh - 28px); }
.poster .kick { display: inline-flex; align-self: flex-start; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 14px; }
.lampdot { width: 11px; height: 11px; border-radius: 3px; background: var(--text-3); flex: none; }
.lampdot.up { background: var(--lamp); animation: lamp-breathe 2.6s ease-in-out infinite; }
.lampdot.down { background: var(--danger); animation: lamp-blink 1s steps(2, jump-none) infinite; }
@keyframes lamp-breathe { 50% { opacity: .45; } }
@keyframes lamp-blink { 50% { opacity: .25; } }
.poster h2 { font-family: "Lalezar", var(--font-fa); font-weight: 400; font-size: clamp(52px, 6.6vw, 104px); line-height: 1.16; letter-spacing: 0; margin: 0; color: var(--text); }
:root[lang="en"] .poster h2 { font-family: "Syne", var(--font-en); font-weight: 800; font-size: clamp(36px, 4.6vw, 70px); line-height: 1.03; letter-spacing: -.035em; }
.poster h2 span { display: block; white-space: nowrap; }
.poster h2 mark { display: inline-block; background: var(--brand-fill); color: var(--brand-ink); padding: 0 .16em .03em; border-radius: .14em; transform: rotate(-2.2deg); margin-inline: .04em; }
.pboard-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--text-2); font-size: 13.5px; }
.pboard-top b { font-family: "Lalezar", var(--font-fa); font-weight: 400; font-size: 44px; line-height: 1; color: var(--text); direction: ltr; unicode-bidi: isolate; }
:root[lang="en"] .pboard-top b { font-family: "Syne", var(--font-en); font-weight: 800; font-size: 32px; letter-spacing: -.03em; }
.pcells { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 7px; direction: ltr; margin-top: 14px; }
.pcell { position: relative; aspect-ratio: 1; display: grid; place-items: center; padding-bottom: 7px; border: 1px solid var(--border-strong); border-radius: 11px;
  font: 500 clamp(10px, .95vw, 12.5px) var(--font-mono); color: var(--text); opacity: 0; transform: translateY(6px) scale(.96);
  animation: pcell-in .42s var(--ease-out) forwards; animation-delay: calc(var(--i) * 26ms + 100ms); }
@keyframes pcell-in { to { opacity: 1; transform: none; } }
.pcell::after { content: ""; position: absolute; inset-inline: 22%; bottom: 16%; height: 3.5px; border-radius: 2px; background: var(--text-3); opacity: .5; }
.pcell.up::after { background: var(--lamp); opacity: 1; }
.pcell.off { border-style: dashed; color: var(--text-3); }
.pcell.off::after { background: none; border: 1px solid var(--text-3); opacity: .7; }
.pcell.down { border-color: var(--danger); color: var(--danger); }
.pcell.down::after { background: var(--danger); opacity: 1; animation: lamp-blink 1s steps(2, jump-none) infinite; }
.pcap { min-height: 22px; margin: 12px 0 0; font-size: 13.5px; color: var(--text-2); }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .poster { display: none; } }
@media (prefers-reduced-motion: reduce) { .pcell { animation: none; opacity: 1; transform: none; } .lampdot.up, .lampdot.down, .pcell.down::after { animation: none; } }

/* access requests on the dashboard: the "Request access" summary looks like a button, the form opens below it */
.req-ask > summary { list-style: none; cursor: pointer; }
.req-ask > summary::-webkit-details-marker { display: none; }
.req-ask[open] { flex-basis: 100%; }
.req-ask[open] > summary { display: none; }

/* WireGuard setup guide: step numbers */
.wg-step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent, #c8f04a); color: #111; font-size: 13px; font-weight: 700; margin-inline-end: 6px; }

/* Users page: compact list of a person's services */
.ulist { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.urow { display: flex; align-items: center; gap: 10px; padding: 6px 10px; flex-wrap: wrap; }
.urow + .urow { border-top: 1px solid var(--border); }
.urow details.disclose { margin-top: 0 !important; }
