/* Falcon WA 3 — dashboard
   Dark navigation rail, calm work surface, Falcon gold reserved for primary actions.
   Light & dark themes share the same tokens. */
@font-face { font-family: Plex; font-weight: 400; font-display: swap; src: url(fonts/plex-arabic-400.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 500; font-display: swap; src: url(fonts/plex-arabic-500.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 600; font-display: swap; src: url(fonts/plex-arabic-600.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 700; font-display: swap; src: url(fonts/plex-arabic-700.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 400; font-display: swap; src: url(fonts/plex-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: Plex; font-weight: 500; font-display: swap; src: url(fonts/plex-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: Plex; font-weight: 600; font-display: swap; src: url(fonts/plex-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: Plex; font-weight: 700; font-display: swap; src: url(fonts/plex-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

:root {
  --bg: #f4f3ef; --surface: #ffffff; --surface-2: #faf9f6; --line: #e7e5df; --line-2: #d9d6ce;
  --text: #17181c; --text-2: #4a4d57; --muted: #7a7e89; --faint: #a7aab3;
  --rail: #0d0e11; --rail-2: #16181d; --rail-line: #23262d; --rail-text: #c9ccd4; --rail-muted: #7d818c;
  --gold: #c9a24a; --gold-2: #e8cb7f; --gold-ink: #6e5418; --gold-soft: #faf3e1; --gold-line: rgba(201,162,74,.38);
  --green: #18995a; --green-soft: #e6f6ec; --red: #d1453b; --red-soft: #fdeceb; --amber: #c7860e; --amber-soft: #fdf4e2; --blue: #2f6fd0; --blue-soft: #e9f1fc;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(17,19,24,.04), 0 6px 20px -10px rgba(17,19,24,.10);
  --shadow-lg: 0 24px 60px -20px rgba(10,11,14,.45);
  --font: Plex, system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1013; --surface: #17191e; --surface-2: #1c1e24; --line: #262930; --line-2: #31353d;
  --text: #eceae4; --text-2: #c2c4cb; --muted: #8b8f9a; --faint: #5f636d;
  --rail: #0a0b0d; --rail-2: #121317; --rail-line: #1e2026;
  --gold-soft: rgba(201,162,74,.12); --gold-ink: #e8cb7f;
  --green-soft: rgba(24,153,90,.14); --red-soft: rgba(209,69,59,.14); --amber-soft: rgba(199,134,14,.15); --blue-soft: rgba(47,111,208,.16);
  --shadow: 0 1px 0 rgba(255,255,255,.02), 0 8px 24px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
[x-cloak] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: .86em; direction: ltr; unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(201,162,74,.28); }
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }
.ic.xl { width: 28px; height: 28px; }

/* ================================================================ shell */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--rail); color: var(--rail-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-inline-end: 1px solid var(--rail-line);
  background-image: radial-gradient(420px 220px at 100% -40px, rgba(201,162,74,.16), transparent 70%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 0 0 1px rgba(201,162,74,.35), 0 6px 18px -6px rgba(201,162,74,.5); }
.brand b { display: block; color: #fff; font-size: 16px; letter-spacing: .01em; line-height: 1.2; }
.brand small { color: var(--rail-muted); font-size: 12px; }
.rail-sec { padding: 6px 12px; }
.rail-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 8px; font-size: 11.5px; font-weight: 600; color: var(--rail-muted); letter-spacing: .03em; }
.rail-h button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: var(--gold-2); font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.rail-h button:hover { background: rgba(201,162,74,.12); }
.nav { display: grid; gap: 2px; }
.nav button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--rail-text); font-size: 14px; min-height: 22px; }
.nav button:hover { background: rgba(255,255,255,.045); color: #fff; }
.nav button.on { background: linear-gradient(90deg, rgba(201,162,74,.10), rgba(201,162,74,.18)); color: #fff; box-shadow: inset 0 0 0 1px rgba(201,162,74,.28); }
.nav button.on .ic { color: var(--gold-2); }
.nav .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .meta { font-family: var(--mono); font-size: 11.5px; color: var(--rail-muted); direction: ltr; }
.nav .pill { font-size: 11px; padding: 0 7px; border-radius: 99px; background: rgba(209,69,59,.2); color: #f2a29b; }
.inst-ic { position: relative; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--rail-2); border: 1px solid var(--rail-line); color: var(--rail-text); flex: none; }
.inst-ic .dot { position: absolute; bottom: -2px; inset-inline-end: -2px; border: 2px solid var(--rail); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.dot.s-connected { background: #22c06e; }
.dot.s-qr, .dot.s-connecting, .dot.s-reconnecting, .dot.s-starting { background: #e3a52a; }
.dot.s-logged_out, .dot.s-stopped { background: #e0574c; }
.rail-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--rail-line); display: grid; gap: 2px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 8px; border-radius: 12px; background: var(--rail-2); border: 1px solid var(--rail-line); }
.me .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1b1407; font-weight: 700; font-size: 13px; flex: none; text-transform: uppercase; }
.me b { display: block; color: #fff; font-size: 13px; line-height: 1.3; }
.me small { color: var(--rail-muted); font-size: 11.5px; }
.me button { all: unset; cursor: pointer; margin-inline-start: auto; color: var(--rail-muted); padding: 6px; border-radius: 8px; display: grid; }
.me button:hover { color: #fff; background: rgba(255,255,255,.06); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); min-height: 68px; }
.topbar .burger { display: none; }
.crumb { min-width: 0; flex: 1; }
.crumb small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.crumb h1 { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 22px 28px 56px; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.content > *, .grid > *, .split > *, .card { min-width: 0; }

/* tabs */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-top: -4px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 10px 14px 12px; color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--gold); }
.tabs button.on .ic { color: var(--gold); }

/* ================================================================ surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-h { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h .t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.4; }
.card-h p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.card-b { padding: 20px; }
.card-f { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.ic-box { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold-line); flex: none; }
.ic-box.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.ic-box.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.ic-box.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.ic-box.gray { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }

/* hero / connection */
.hero { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 22px 24px; background: #101114; color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  background-image: radial-gradient(520px 260px at 0% 0%, rgba(201,162,74,.22), transparent 65%), radial-gradient(380px 200px at 100% 120%, rgba(34,192,110,.10), transparent 70%); border: 1px solid #22252b; }
.hero .who { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ring { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); flex: none; color: #c9ccd4; }
.ring.s-connected { background: rgba(34,192,110,.14); border-color: rgba(34,192,110,.35); color: #4ee093; }
.ring.s-qr, .ring.s-connecting, .ring.s-reconnecting, .ring.s-starting { background: rgba(227,165,42,.14); border-color: rgba(227,165,42,.35); color: #f0bf5a; }
.ring.s-logged_out, .ring.s-stopped { background: rgba(224,87,76,.14); border-color: rgba(224,87,76,.35); color: #f08a81; }
.hero small { color: #a4a8b2; font-size: 12.5px; }
.hero h3 { margin: 2px 0 0; font-size: 20px; line-height: 1.35; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.hero .num { font-family: var(--mono); font-size: 14px; color: #d8dae0; direction: ltr; unicode-bidi: isolate; font-weight: 500; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hero .facts span { font-size: 12px; padding: 2px 10px; border-radius: 99px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: #d0d3da; }

/* KPI */
.kpi { padding: 16px 18px; display: grid; gap: 10px; align-content: start; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .top .ic { color: var(--faint); }
.kpi b { font-size: 26px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.meter { height: 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.meter.green i { background: linear-gradient(90deg, #16a35d, #43cf86); }

/* chart */
.chart { position: relative; height: 220px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; }
.chart .y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--faint); font-family: var(--mono); text-align: end; padding-bottom: 24px; line-height: 1; }
.chart .plot { position: relative; display: flex; align-items: flex-end; gap: 6px; margin-bottom: 24px; border-bottom: 1px solid var(--line-2);
  background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 25%; }
.chart .col { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; position: relative; }
.chart .col span { width: min(14px, 42%); border-radius: 4px 4px 1px 1px; min-height: 2px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); transition: height .3s; }
.chart .col span.inc { background: var(--line-2); }
:root[data-theme="dark"] .chart .col span.inc { background: #4a4e57; }
.chart .col small { position: absolute; bottom: -22px; inset-inline: 0; text-align: center; font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.chart .col:hover span { filter: brightness(1.1); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }

/* ================================================================ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 15px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; font-weight: 600; font-size: 13.5px; text-decoration: none; white-space: nowrap; transition: border-color .15s, background .15s, box-shadow .15s; }
.btn:hover { border-color: var(--gold); }
.btn.gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); border-color: transparent; color: #1b1407; box-shadow: 0 6px 16px -8px rgba(201,162,74,.7); }
.btn.gold:hover { box-shadow: 0 8px 20px -8px rgba(201,162,74,.9); }
.btn.dark { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn.red:hover { border-color: var(--red); }
.btn.sm { min-height: 32px; padding: 4px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { padding: 0; width: 38px; }
.btn.sm.icon { width: 32px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.hero .btn:not(.gold) { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #fff; }

label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.in { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.in::placeholder { color: var(--faint); }
.in:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(201,162,74,.16); }
select.in { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7e89' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 32px; }
textarea.in { min-height: 120px; resize: vertical; line-height: 1.75; }
.in.code6 { text-align: center; font: 600 24px/1 var(--mono); letter-spacing: .45em; padding-inline-start: .45em; direction: ltr; }
.in.sm { min-height: 34px; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.55; }
.err { color: var(--red); font-size: 13px; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.search { position: relative; }
.search .ic { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .in { padding-inline-start: 34px; min-height: 34px; }

.sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); font-weight: 500; }
.sw:hover { border-color: var(--line-2); }
.sw .lbl { display: grid; gap: 1px; }
.sw .lbl small { color: var(--muted); font-size: 12px; font-weight: 400; }
.sw input { appearance: none; width: 38px; height: 22px; border-radius: 22px; background: var(--line-2); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.sw input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: inset-inline-start .15s; }
.sw input:checked { background: var(--green); }
.sw input:checked::after { inset-inline-start: 19px; }
.sw.bare { border: 0; padding: 0; background: none; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; line-height: 1.7; }
.chip.ok { background: var(--green-soft); color: var(--green); border-color: transparent; }
.chip.warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.chip.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.chip.info { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.chip.gold { background: var(--gold-soft); color: var(--gold-ink); border-color: var(--gold-line); }
.chip .dot { width: 7px; height: 7px; }
.chip button { all: unset; cursor: pointer; opacity: .55; display: grid; }
.chip button:hover { opacity: 1; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { all: unset; cursor: pointer; padding: 3px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }

/* ================================================================ lists & tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); padding: 10px 16px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
td .clip { max-width: 420px; white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 8px; font-size: 13.5px; }
.empty .ic { width: 28px; height: 28px; color: var(--faint); }
.list > * { border-top: 1px solid var(--line); }
.list > *:first-child { border-top: 0; }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 20px; }
.item.two { grid-template-columns: minmax(0, 1fr) auto; }
.item .kw { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.item b { font-weight: 600; }

/* ================================================================ misc */
.qr { width: 272px; max-width: 100%; aspect-ratio: 1; border-radius: 18px; border: 1px solid var(--line); display: grid; place-items: center; background: #fff; padding: 10px; box-shadow: var(--shadow); color: #7a7e89; }
.qr img { width: 100%; border-radius: 8px; display: block; }
.steps { display: grid; gap: 14px; counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 13.5px; color: var(--text-2); }
.steps li::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold-line); }
.steps li b { color: var(--text); }
.bubble { white-space: pre-wrap; background: #dcf8c6; color: #111; border-radius: 12px 12px 12px 4px; padding: 9px 12px; max-width: 440px; font-size: 13.5px; line-height: 1.75; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.chatbox { border-radius: 14px; padding: 16px; display: grid; gap: 8px; align-content: start; min-height: 260px; max-height: 440px; overflow-y: auto; border: 1px solid var(--line);
  background: #ece5dd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23d6cdc2'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .chatbox { background-color: #0b141a; background-image: none; }
.chatbox .me { justify-self: end; background: #fff; color: #111; border-radius: 12px 12px 4px 12px; padding: 8px 12px; max-width: 80%; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
:root[data-theme="dark"] .chatbox .me { background: #202c33; color: #e9edef; }
:root[data-theme="dark"] .bubble { background: #005c4b; color: #e9edef; }
.chatbox .bot { justify-self: start; }
.chatbox .muted { background: rgba(255,255,255,.85) !important; color: #6b6f78 !important; }
.chatbox .hint { text-align: center; color: #6b6f78; }
pre.code { background: #0d0e11; color: #e6e3da; border-radius: 12px; padding: 16px; overflow-x: auto; font: 12.5px/1.75 var(--mono); direction: ltr; text-align: left; margin: 0; border: 1px solid #23262d; }
.kv { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px 16px; align-items: center; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; min-width: 0; }
.field-copy { display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.field-copy code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; text-align: left; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.65; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.note .ic { margin-top: 2px; }
.note.warn { background: var(--amber-soft); border-color: transparent; color: var(--text); }
.note.warn .ic { color: var(--amber); }
.note.ok { background: var(--green-soft); border-color: transparent; color: var(--text); }
.note.ok .ic { color: var(--green); }
.note.bad { background: var(--red-soft); border-color: transparent; color: var(--text); }
.note.bad .ic { color: var(--red); }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.codes code { font-size: 15px; text-align: center; padding: 6px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); letter-spacing: .06em; }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength i { height: 4px; border-radius: 4px; background: var(--line); }
.strength.s1 i:nth-child(-n+1) { background: var(--red); }
.strength.s2 i:nth-child(-n+2) { background: var(--amber); }
.strength.s3 i:nth-child(-n+3) { background: #7cbf4a; }
.strength.s4 i { background: var(--green); }
.secrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 20px; }
.secrow h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.secrow p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.toast { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: #111216; color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 80; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13.5px; border: 1px solid #2a2d34; max-width: calc(100vw - 32px); }
.modal { position: fixed; inset: 0; background: rgba(8,9,11,.55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal > .card { width: min(680px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal > .card.narrow { width: min(460px, 100%); }

/* ================================================================ login */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); background: var(--bg); }
.auth-art { position: relative; overflow: hidden; background: #0b0c0e; color: #fff; padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background-image: radial-gradient(600px 420px at 85% 5%, rgba(201,162,74,.28), transparent 65%), radial-gradient(500px 360px at 0% 100%, rgba(201,162,74,.10), transparent 70%); }
.auth-art::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%); mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%); pointer-events: none; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .brand { padding: 0; }
.auth-art h2 { font-size: 34px; line-height: 1.35; margin: 0 0 12px; font-weight: 700; max-width: 15ch; }
.auth-art h2 em { font-style: normal; color: var(--gold-2); }
.auth-art p { color: #a8acb6; margin: 0; max-width: 44ch; }
.auth-art ul { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.auth-art li { display: flex; align-items: center; gap: 12px; color: #d6d8de; font-size: 14px; }
.auth-art li .ic-box { background: rgba(201,162,74,.12); color: var(--gold-2); border-color: rgba(201,162,74,.3); width: 34px; height: 34px; }
.auth-art .foot { color: #6f737d; font-size: 12px; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-form form { width: min(400px, 100%); display: grid; gap: 16px; }
.auth-form h1 { margin: 0; font-size: 24px; font-weight: 700; }
.auth-form .lead { margin: -8px 0 4px; color: var(--muted); font-size: 14px; }
.auth-form .btn { min-height: 44px; font-size: 14.5px; }
.pw { position: relative; }
.pw .in { padding-inline-end: 42px; }
.pw button { all: unset; cursor: pointer; position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); color: var(--faint); padding: 4px; display: grid; border-radius: 6px; }
.pw button:hover { color: var(--text); }
.linkish { all: unset; cursor: pointer; color: var(--gold-ink); font-weight: 600; font-size: 13px; }
.linkish:hover { text-decoration: underline; }


/* ================================================================ 3.2 — services, templates, send, team */
.sec-h { display: flex; align-items: baseline; gap: 10px; margin: 6px 2px -6px; }
.sec-h h2 { margin: 0; font-size: 15px; font-weight: 700; }

/* service cards */
.svc-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.svc { all: unset; box-sizing: border-box; cursor: pointer; position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px 16px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; overflow: hidden; --c: var(--gold); --cs: var(--gold-soft); }
.svc::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); opacity: .0; transition: opacity .18s; }
.svc:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--c) 60%, transparent), var(--shadow); }
.svc:hover::before { opacity: 1; }
.svc:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.svc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.svc-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--cs); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.svc-ic .ic { width: 20px; height: 20px; }
.svc-t { font-size: 15px; font-weight: 700; color: var(--text); }
.svc-d { font-size: 12.5px; color: var(--muted); line-height: 1.55; min-height: 2.9em; }
.svc-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.svc-m { font-size: 12.5px; font-weight: 600; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc .go { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); flex: none; transition: background .18s, color .18s; }
.svc:hover .go { background: var(--c); color: #fff; }
.svc.c-gold { --c: #c9a24a; --cs: var(--gold-soft); }
.svc.c-green { --c: #18995a; --cs: var(--green-soft); }
.svc.c-amber { --c: #c7860e; --cs: var(--amber-soft); }
.svc.c-blue { --c: #2f6fd0; --cs: var(--blue-soft); }
.svc.c-violet { --c: #7a52d1; --cs: rgba(122,82,209,.10); }
.svc.c-teal { --c: #0f9488; --cs: rgba(15,148,136,.10); }
.svc.c-slate { --c: #5d6474; --cs: var(--surface-2); }
:root[data-theme="dark"] .svc.c-slate { --c: #9aa0ad; }
:root[data-theme="dark"] .svc.c-violet { --c: #a585ef; --cs: rgba(165,133,239,.12); }
:root[data-theme="dark"] .svc.c-teal { --c: #2cc3b4; --cs: rgba(44,195,180,.12); }
:root[data-theme="dark"] .svc.c-blue { --c: #6c9cf0; }
:root[data-theme="dark"] .svc.c-green { --c: #3fca85; }

/* section header with quick switcher (replaces the old tab bar) */
.subnav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.subnav .back { flex: none; }
.sn-t { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.sn-t h2 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; }
.sn-t p { margin: 0; font-size: 12.5px; color: var(--muted); }
.sn-switch { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.sn-switch::-webkit-scrollbar { display: none; }
.sn-switch > * { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 9px; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.sn-switch > * span { display: none; }
.sn-switch > *:hover { color: var(--text); background: var(--surface); }
.sn-switch > .on { background: var(--surface); color: var(--gold-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--gold-line); }
.sn-switch > .on span { display: inline; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.toolbar .search .in { width: 280px; max-width: 100%; }

/* templates */
.tpl-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tpl { display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.tpl:hover { border-color: var(--gold-line); box-shadow: 0 14px 30px -20px rgba(201,162,74,.6), var(--shadow); }
.tpl header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px 12px; }
.tpl h3 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-prev { position: relative; flex: 1; cursor: pointer; padding: 14px 16px 18px; max-height: 230px; overflow: hidden; border-block: 1px solid var(--line);
  background: #ece5dd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23d6cdc2'/%3E%3C/svg%3E"); }
.tpl-prev::after { content: ""; position: absolute; inset: auto 0 0; height: 40px; background: linear-gradient(transparent, #ece5dd); pointer-events: none; }
:root[data-theme="dark"] .tpl-prev { background: #0b141a; }
:root[data-theme="dark"] .tpl-prev::after { background: linear-gradient(transparent, #0b141a); }
.tpl footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 8px 14px; background: var(--surface-2); }
.tpl.add { all: unset; box-sizing: border-box; cursor: pointer; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; min-height: 250px; border-radius: var(--r-lg); border: 1.5px dashed var(--line-2); color: var(--muted); padding: 20px; transition: border-color .15s, background .15s; }
.tpl.add:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--text); }
.tpl.add b { color: var(--text); font-size: 15px; }
.tpl.add small { font-size: 12.5px; max-width: 26ch; }

/* WhatsApp bubble (templates, preview) */
.wa-b { position: relative; display: grid; gap: 6px; width: fit-content; max-width: 100%; background: #fff; color: #111b21; border-radius: 4px 12px 12px 12px; padding: 8px 10px 20px; font-size: 13.5px; line-height: 1.7; box-shadow: 0 1px 1px rgba(11,20,26,.13); }
.wa-b.out { background: #d9fdd3; border-radius: 12px 4px 12px 12px; margin-inline-start: auto; }
.wa-b .tx { white-space: pre-wrap; word-break: break-word; }
.wa-b i { position: absolute; inset-inline-end: 8px; bottom: 3px; font-style: normal; font-size: 11px; color: #667781; direction: ltr; }
.wa-b .att { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 8px; background: rgba(11,20,26,.05); font-size: 12.5px; font-weight: 600; color: #3b4a54; }
:root[data-theme="dark"] .wa-b { background: #202c33; color: #e9edef; }
:root[data-theme="dark"] .wa-b.out { background: #005c4b; }
:root[data-theme="dark"] .wa-b i { color: #8696a0; }
:root[data-theme="dark"] .wa-b .att { background: rgba(255,255,255,.07); color: #d1d7db; }

/* send */
.send-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.compose { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 250px); align-items: start; }
.in-ic { position: relative; }
.in-ic .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.in-ic .in { padding-inline-start: 36px; }
.phone { border-radius: 22px; border: 1px solid var(--line-2); overflow: hidden; background: #ece5dd; box-shadow: 0 18px 40px -26px rgba(0,0,0,.45); display: flex; flex-direction: column; min-height: 330px; }
:root[data-theme="dark"] .phone { background: #0b141a; border-color: #2a2e35; }
.ph-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #075e54; color: #fff; }
:root[data-theme="dark"] .ph-h { background: #202c33; }
.ph-h .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); font-size: 15px; flex: none; }
.ph-h b { display: block; font-size: 13px; }
.ph-h small { font-size: 11px; opacity: .75; }
.ph-b { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; max-height: 420px; overflow-y: auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23d6cdc2'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .ph-b { background-image: none; }
.ph-empty { margin: auto; text-align: center; font-size: 12.5px; color: #667781; background: rgba(255,255,255,.75); padding: 6px 12px; border-radius: 8px; }
:root[data-theme="dark"] .ph-empty { background: #182229; color: #8696a0; }

.rc-list { display: grid; }
.rc { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); align-items: start; }
.rc:first-child { border-top: 0; }
.rc-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.rc-ic.out { background: var(--green-soft); color: var(--green); }
.rc-ic.in { background: var(--gold-soft); color: var(--gold-ink); }
.rc-b { min-width: 0; display: grid; gap: 3px; }
.rc-1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rc-1 b { font-size: 13px; font-weight: 600; }
.rc-1 .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-1 time { margin-inline-start: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.rc-2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rc-2 .tx { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal > .card.wide { width: min(1120px, 100%); }

/* team */
.team-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding: 22px 24px; border-radius: var(--r-lg); color: #fff; border: 1px solid #22252b;
  background: #101114 radial-gradient(520px 260px at 0% 0%, rgba(201,162,74,.22), transparent 65%); }
.team-hero h2 { margin: 0 0 4px; font-size: 20px; }
.team-hero p { margin: 0; color: #b4b8c1; font-size: 13.5px; max-width: 70ch; }
.team-hero b { color: var(--gold-2); }
.team-hero .btn:not(.gold) { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #fff; }
.ag-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; color: #1b1407; background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.how { padding: 18px 20px; display: grid; gap: 4px; }
.how .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold-line); margin-bottom: 6px; }
.how p { margin: 0; color: var(--muted); font-size: 13px; }
.opt { position: relative; display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; background: var(--surface); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt small { color: var(--muted); font-weight: 400; font-size: 12px; }
.opt.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,74,.14); background: var(--gold-soft); }

@media (max-width: 1100px) {
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .send-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .sn-switch { width: 100%; }
  .sn-switch > * span { display: inline; }
  .subnav .back span { display: none; }
}
@media (max-width: 640px) {
  .compose { grid-template-columns: minmax(0, 1fr); }
  .phone { min-height: 0; }
  .svc-grid { gap: 10px; }
  .svc { padding: 14px 13px 12px; }
  .svc-d { display: none; }
  .tpl-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar .search { flex: 1; }
  .toolbar .search .in { width: 100%; }
}

/* ================================================================ responsive */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; position: fixed; inset-block: 0; inset-inline-start: 0; width: min(296px, 86vw); height: 100%; z-index: 50; box-shadow: var(--shadow-lg); }
  .rail.open { display: flex; }
  .scrim { position: fixed; inset: 0; background: rgba(8,9,11,.5); z-index: 45; }
  .topbar { padding: 10px 16px; min-height: 60px; }
  .topbar .burger { display: inline-flex; }
  .content { padding: 18px 16px 48px; }
  .g3, .g2 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 4px 0; }
  .kv dd { margin-bottom: 10px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { padding: 24px; gap: 18px; }
  .auth-art h2 { font-size: 22px; margin-bottom: 6px; }
  .auth-art ul, .auth-art .foot { display: none; }
  .hide-m { display: none !important; }
}
@media (max-width: 560px) {
  .kpi b { font-size: 22px; }
  .item { grid-template-columns: minmax(0, 1fr) auto; }
  .item > .sw.bare { display: none; }
  .secrow { grid-template-columns: minmax(0, 1fr); }
  .secrow > .ic-box { display: none; }
  .chart .col:nth-child(even) small { visibility: hidden; }
  .card-h, .card-b { padding-inline: 16px; }
  .hero { padding: 18px; }
  .crumb h1 { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
