/* Sahara Bank DMS: the WorkSuite Suite layout (58px top bar, icon rail,
   grouped sidebar, 16px cards, soft shadows) in the Bank's navy and gold.
   Logical properties throughout so Arabic (RTL) mirrors cleanly. */

:root {
  --navy: #1d3a5c; --navy-2: #12273f; --gold: #c39a3e; --gold-2: #e0bd68; --gold-soft: #fbf4e4;
  --accent: #1f5f99; --accent-h: #164b7c; --accent-soft: #eaf2fa;
  --grad: linear-gradient(135deg, #2a6aa8 0%, #183f6b 100%);
  --page: #f3f5f8; --sheet: #ffffff; --panel: #f8fafc; --hover: #f0f3f8; --line: #e3e8ef; --line-2: #cdd5e0;
  --text: #17233a; --text-2: #56637a; --text-3: #8a94a6;
  --good: #047857; --good-bg: #e9f9f1; --warn: #b45309; --warn-bg: #fff8e6; --bad: #b91c1c; --bad-bg: #fdeeee;
  --info: #1d4ed8; --info-bg: #edf3ff; --orange: #c2410c; --orange-bg: #fff3e8; --violet: #6d28d9; --violet-bg: #f3f0ff; --slate: #475569; --slate-bg: #eef2f6;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --r: 10px; --r-lg: 16px;
  --sh: 0 1px 2px rgba(15, 30, 55, .04), 0 2px 10px rgba(15, 30, 55, .05);
  --sh-pop: 0 20px 48px rgba(12, 26, 48, .18), 0 4px 12px rgba(12, 26, 48, .08);
  --font: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --top-h: 60px; --rail-w: 78px; --side-w: 256px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #6aa8eb; --accent-h: #93c2f3; --accent-soft: #15263c; --gold-soft: #2a2312;
    --page: #0d131c; --sheet: #151c27; --panel: #111823; --hover: #1b2432; --line: #243043; --line-2: #33415a;
    --text: #e6ebf2; --text-2: #a6b1c3; --text-3: #6f7b90;
    --good: #34d399; --good-bg: #0c2a20; --warn: #f5b74a; --warn-bg: #2b200b; --bad: #f87171; --bad-bg: #2f1414;
    --info: #7aa7ff; --info-bg: #142242; --orange: #fb923c; --orange-bg: #2c1a0d; --violet: #a78bfa; --violet-bg: #211a3b; --slate: #94a3b8; --slate-bg: #1c2532;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --sh: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #6aa8eb; --accent-h: #93c2f3; --accent-soft: #15263c; --gold-soft: #2a2312;
  --page: #0d131c; --sheet: #151c27; --panel: #111823; --hover: #1b2432; --line: #243043; --line-2: #33415a;
  --text: #e6ebf2; --text-2: #a6b1c3; --text-3: #6f7b90;
  --good: #34d399; --good-bg: #0c2a20; --warn: #f5b74a; --warn-bg: #2b200b; --bad: #f87171; --bad-bg: #2f1414;
  --info: #7aa7ff; --info-bg: #142242; --orange: #fb923c; --orange-bg: #2c1a0d; --violet: #a78bfa; --violet-bg: #211a3b; --slate: #94a3b8; --slate-bg: #1c2532;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --sh: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--page); -webkit-font-smoothing: antialiased; overflow: hidden; }
[dir="rtl"] body { --font: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif; font-size: 14.5px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
.ic { flex-shrink: 0; vertical-align: middle; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--text-3); } .faint { color: var(--text-3); opacity: .6; } .good { color: var(--good); }
.sm { font-size: 12.5px; } .nowrap { white-space: nowrap; } .r { text-align: end; } .c { text-align: center; } .n { text-align: end; font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.row { display: flex; align-items: center; } .g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; } .g12 { gap: 12px; } .center { justify-content: center; } .end { justify-content: flex-end; } .wrap { flex-wrap: wrap; }
.pad { padding: 14px 18px; }

/* --------------------------------------------------------------- frame */
#app { height: 100vh; display: flex; flex-direction: column; }
.s-top { height: var(--top-h); flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding-inline: 14px 16px; background: color-mix(in srgb, var(--sheet) 90%, transparent); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); position: relative; z-index: 40; }
.s-top::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--navy), var(--gold) 60%, transparent); opacity: .85; }
.s-ibtn { width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); display: grid; place-items: center; position: relative; }
.s-ibtn:hover { background: var(--hover); color: var(--accent-h); }
.s-lang { font-weight: 800; font-size: 15px; color: var(--navy); border: 1px solid var(--line); }
[data-theme="dark"] .s-lang { color: var(--gold-2); }
.s-mob { display: none; }
.s-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.s-brand img { width: 36px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(18, 39, 63, .25)); }
.s-bw { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.s-bw b { font-size: 15.5px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; white-space: nowrap; }
[data-theme="dark"] .s-bw b { color: #fff; }
.s-bw small { font-size: 11px; color: var(--gold); font-weight: 600; white-space: nowrap; }
.s-div { width: 1px; height: 26px; background: var(--line); }
.s-chip { display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 8px; border: 0; background: transparent; border-radius: 10px; text-align: start; }
.s-chip:hover { background: var(--hover); }
.s-chip-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-h); display: grid; place-items: center; }
.s-chip .lbl { display: block; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--text-3); text-transform: uppercase; line-height: 1.3; }
.s-chip .val { display: block; font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.s-app { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--ac) 12%, transparent); color: var(--ac); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
[data-theme="dark"] .s-app { color: color-mix(in srgb, var(--ac) 60%, white); }
.s-search { display: flex; align-items: center; gap: 9px; width: min(430px, 32vw); height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text-3); margin: 0; }
.s-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); background: var(--sheet); }
.s-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 13px; color: var(--text); }
.kbd { font-size: 10px; font-weight: 700; border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; background: var(--sheet); color: var(--gold); }
.s-tools { display: flex; align-items: center; gap: 4px; }
.s-count { position: absolute; top: 2px; inset-inline-end: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; border: 1.5px solid var(--sheet); background: #e11d48; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.s-persona { display: flex; align-items: center; gap: 9px; height: 44px; padding-inline: 4px 10px; margin-inline-start: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--sheet); text-align: start; }
.s-persona:hover, .s-persona.open { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.s-pt { display: flex; flex-direction: column; line-height: 1.2; }
.s-pt small { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--gold); font-weight: 700; }
.s-pt b { font-size: 13px; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

.s-body { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); transition: grid-template-columns .2s ease; }
.s-body.collapsed { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr); }
.s-body.collapsed .s-side { visibility: hidden; border: 0; }
.s-rail { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; overflow-y: auto; scrollbar-width: none; }
.s-rail-i { width: 64px; padding: 7px 0 6px; border: 0; border-radius: 12px; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; color: rgba(255, 255, 255, .68); font-size: 10.5px; font-weight: 600; text-align: center; position: relative; }
.s-rail-i span { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-rail-i:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.s-rail-i.on { background: rgba(255, 255, 255, .13); color: #fff; }
.s-rail-i.on::before { content: ""; position: absolute; inset-inline-start: -7px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--gold-2); }
.s-rail-i.on .ic { color: var(--gold-2); }
.s-toggle { margin-top: auto; }
.s-side { background: var(--sheet); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; min-width: 0; }
.s-side-h { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.s-side-h h3 { font-size: 16px; font-weight: 750; }
.s-side-h .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.s-grp { padding: 10px 10px 2px; }
.s-grp-l { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 6px 10px; }
[dir="rtl"] .s-grp-l { letter-spacing: 0; font-size: 11.5px; }
.s-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: 13.5px; font-weight: 550; position: relative; }
.s-item:hover { background: var(--hover); color: var(--text); }
.s-item.on { background: var(--accent-soft); color: var(--accent-h); font-weight: 650; }
.s-il { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.s-badge.bad { background: var(--bad); }
.s-step { font-size: 10px; font-weight: 800; color: #6b4f12; background: linear-gradient(135deg, #f5dc9a, var(--gold-2)); border-radius: 999px; padding: 1px 7px; white-space: nowrap; box-shadow: 0 1px 2px rgba(120, 90, 20, .25); }
.s-side-f { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.s-hints { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.s-hints input, .swl input { display: none; }
.sw { width: 30px; height: 18px; border-radius: 9px; background: var(--line-2); position: relative; flex-shrink: 0; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
input:checked + .sw { background: var(--gold); }
input:checked + .sw::after { inset-inline-start: 14px; }
.s-new { height: 40px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-shadow: 0 4px 12px rgba(24, 63, 107, .25); }
.s-main { overflow-y: auto; min-width: 0; background: var(--page); display: flex; flex-direction: column; }
.foot { margin-top: auto; position: sticky; bottom: 0; z-index: 6; padding: 9px 28px; font-size: 11.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(8px); }
.foot .foot-by { font-weight: 600; color: var(--navy, #1d3a5c); }
[data-theme=dark] .foot .foot-by { color: var(--gold, #c39a3e); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .foot .foot-by { color: var(--gold, #c39a3e); } }

/* ------------------------------------------------------------- page */
.page { padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 1560px; width: 100%; margin-inline: auto; }
.ph { display: flex; flex-direction: column; gap: 6px; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }
.crumbs a:hover { color: var(--accent); }
.ph-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ph-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: var(--ac); background: color-mix(in srgb, var(--ac) 12%, var(--sheet)); border: 1px solid color-mix(in srgb, var(--ac) 22%, transparent); flex-shrink: 0; }
.ph-t { flex: 1; min-width: 240px; }
.ph-t h1 { font-size: 23px; font-weight: 760; letter-spacing: -.02em; }
.ph-t p { color: var(--text-2); margin-top: 3px; font-size: 13.5px; max-width: 820px; }
.ph-a { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sec-h { font-size: 16px; margin-top: 6px; }
.empty { padding: 36px 20px; text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty p { max-width: 420px; }

/* ---------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--sheet); color: var(--text); font-weight: 600; font-size: 13.5px; white-space: nowrap; box-shadow: 0 1px 2px rgba(15, 30, 55, .04); transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { border-color: var(--line-2); background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 1px 3px rgba(24, 63, 107, .3), 0 4px 12px rgba(24, 63, 107, .18); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.gold { background: linear-gradient(135deg, #e3c374, #c39a3e); border-color: transparent; color: #2b1f05; box-shadow: 0 4px 14px rgba(195, 154, 62, .35); }
.btn.glass { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; box-shadow: none; }
.btn.glass:hover { background: rgba(255, 255, 255, .2); }
.btn.warn { background: var(--orange-bg); border-color: color-mix(in srgb, var(--orange) 30%, transparent); color: var(--orange); }
.btn.danger { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.on { background: var(--accent-soft); color: var(--accent-h); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* ----------------------------------------------------- pills, people */
.st { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; background: var(--slate-bg); color: var(--slate); }
.st.info { background: var(--info-bg); color: var(--info); } .st.warn { background: var(--warn-bg); color: var(--warn); } .st.orange { background: var(--orange-bg); color: var(--orange); }
.st.good { background: var(--good-bg); color: var(--good); } .st.bad { background: var(--bad-bg); color: var(--bad); } .st.violet { background: var(--violet-bg); color: var(--violet); } .st.neutral { background: var(--slate-bg); color: var(--text-2); }
.cf { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; white-space: nowrap; background: var(--sheet); }
.cf.info { color: var(--info); } .cf.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); } .cf.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-bg); }
.pr { font-size: 11.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.pr.warn { color: var(--warn); font-weight: 650; } .pr.bad { color: var(--bad); font-weight: 700; }
.av { border-radius: 50%; background: var(--c); color: #fff !important; display: inline-grid; place-items: center; font-weight: 700; flex-shrink: 0; letter-spacing: .02em; box-shadow: 0 0 0 2px var(--sheet); }
.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.who > span:not(.av) { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; font-weight: 550; }
.due.warn { color: var(--warn); } .due.bad { color: var(--bad); font-weight: 700; }
.cnt { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--slate-bg); color: var(--text-2); font-size: 11px; font-weight: 700; margin-inline-start: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--sheet); font-size: 12.5px; font-weight: 550; color: var(--text-2); white-space: nowrap; }
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent-h); }
.chip.gold { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 45%, transparent); color: #7a5a14; }
[data-theme="dark"] .chip.gold { color: var(--gold-2); }
.chip small { color: var(--text-3); font-size: 11px; }
.note { display: flex; align-items: flex-start; gap: 9px; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; line-height: 1.5; }
.note .ic { margin-top: 2px; }
.note.info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
.note.warn { background: var(--orange-bg); border-color: color-mix(in srgb, var(--orange) 22%, transparent); color: var(--orange); }
.note.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--bad); }
.note.good { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); }
.note.sm { font-size: 12px; padding: 8px 10px; }
.lk { display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); font-size: 12px; }
.vb { font-size: 10.5px; font-weight: 700; background: var(--violet-bg); color: var(--violet); border-radius: 5px; padding: 1px 5px; }

/* ------------------------------------------------------------- cards */
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); padding: 16px 18px; min-width: 0; }
.card.flush { padding: 0; overflow-x: auto; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h.pad { padding: 14px 18px 0; }
.card-h h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.card-h h3 .muted { font-weight: 500; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g-1-2 { grid-template-columns: minmax(240px, 1fr) minmax(0, 2.2fr); }
.g-cv { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); align-items: start; }
.g-dv { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.kv li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv li:last-child { border-bottom: 0; }
.kv li > span:first-child { color: var(--text-3); flex-shrink: 0; }
.kv li > b, .kv li > a { text-align: end; font-weight: 600; }
.kv.sm li { padding: 6px 0; font-size: 12.5px; }

/* ------------------------------------------------------------ tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: start; background: var(--panel); color: var(--text-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
[dir="rtl"] .tbl th { letter-spacing: 0; font-size: 12px; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl tr[data-href] { cursor: pointer; }
.tbl.sm td, .tbl.sm th { padding: 7px 10px; }
.tbl th.c, .tbl td.c { text-align: center; } .tbl th.n { text-align: end; }
.tbl .warnrow td { background: color-mix(in srgb, var(--orange-bg) 70%, transparent); }
.tbl .badrow td { background: var(--bad-bg); color: var(--bad); }
.tbl small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.scrollx { overflow-x: auto; }
.bar { height: 6px; border-radius: 3px; background: var(--slate-bg); overflow: hidden; min-width: 70px; }
.bar span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
td .bar { display: inline-block; width: 90px; vertical-align: middle; margin-inline-end: 8px; }

/* ------------------------------------------------- tabs, seg, filters */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: 9px 14px; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; font-size: 13.5px; }
.tabs a.on { color: var(--accent-h); border-color: var(--gold); }
.tabs.sm { margin: -4px -6px 12px; } .tabs.sm a { padding: 7px 10px; font-size: 12.5px; }
.seg { display: inline-flex; background: var(--sheet); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.seg a.on { background: var(--grad); color: #fff; box-shadow: 0 1px 3px rgba(24, 63, 107, .3); }
.seg.big a { padding: 9px 18px; font-size: 14px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fsearch { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; background: var(--sheet); border: 1px solid var(--line); border-radius: 11px; color: var(--text-3); min-width: 260px; flex: 1; max-width: 420px; margin: 0; }
.fsearch input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; color: var(--text); }
.views { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--sheet); }
.views a { width: 36px; height: 34px; display: grid; place-items: center; color: var(--text-3); }
.views a.on { background: var(--accent-soft); color: var(--accent-h); }
.sel { height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--sheet); max-width: 340px; }

/* ------------------------------------------------------------- forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.fsec { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.fsec h4 { font-size: 14px; }
.fsec-n { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: var(--gold-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.fld input, .fld select, .fld textarea, .ta, .cif input { border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; height: 38px; background: var(--sheet); outline: none; width: 100%; }
.fld textarea, .ta { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .ta:focus, .cif input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.fld input[readonly] { background: var(--panel); }
.frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.frow3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-f { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick button, .ppl button { height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--sheet); font-size: 12.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.pick button.on, .ppl button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-h); box-shadow: inset 0 0 0 1px var(--accent); }
.ppl { display: flex; flex-wrap: wrap; gap: 6px; }
.ppl.single button { height: auto; padding: 7px 12px 7px 8px; text-align: start; }
.ppl.single button span:not(.av) { display: flex; flex-direction: column; line-height: 1.25; }
.ppl.single small { font-weight: 500; color: var(--text-3); font-size: 11.5px; }
.chk { display: flex; flex-direction: column; gap: 6px; }
.chk label { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 13px; }
.chk.big label { padding: 11px 12px; font-size: 14px; }
.chk input { width: 17px; height: 17px; accent-color: var(--accent); }
.qchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.qchips .chip { cursor: pointer; height: auto; min-height: 28px; padding: 4px 11px; white-space: normal; text-align: start; }
.swl { display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; }

/* -------------------------------------------------- dialogs, toasts */
.scrim { position: fixed; inset: 0; background: rgba(9, 18, 32, .45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.dialog { width: min(540px, 100%); max-height: calc(100vh - 32px); background: var(--sheet); border-radius: 18px; box-shadow: var(--sh-pop); display: flex; flex-direction: column; overflow: hidden; animation: pop .18s ease-out; }
.dialog.wide { width: min(820px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.dialog-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.dialog-h h3 { font-size: 16px; flex: 1; }
.dh-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-h); display: grid; place-items: center; }
.dialog-b { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.toast { position: fixed; bottom: 58px; inset-inline-start: 50%; transform: translateX(-50%); background: #14223a; color: #fff; padding: 12px 18px; border-radius: 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--sh-pop); z-index: 200; font-size: 13.5px; max-width: min(620px, 92vw); transition: opacity .3s, transform .3s; }
[dir="rtl"] .toast { transform: translateX(50%); }
.toast.good .ic { color: #34d399; } .toast.bad .ic { color: #f87171; } .toast.info .ic { color: var(--gold-2); }
.toast.hide { opacity: 0; pointer-events: none; }
.tip { position: fixed; z-index: 300; background: #14223a; color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 8px; pointer-events: none; opacity: 0; transition: opacity .1s; max-width: 320px; box-shadow: var(--sh-pop); }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; display: inline-block; }
.spin.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.prog { height: 8px; border-radius: 4px; background: var(--slate-bg); overflow: hidden; }
.prog span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .35s; border-radius: 4px; }
.prog.sm { height: 5px; margin-top: 8px; opacity: 0; } .prog.sm.on { opacity: 1; }

/* -------------------------------------------------------------- dd */
.dd { position: fixed; z-index: 90; min-width: 240px; max-width: 360px; background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-pop); padding: 6px; display: flex; flex-direction: column; max-height: 80vh; overflow-y: auto; animation: pop .12s; }
.dd.dd-wide { width: 340px; }
.dd .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 8px 10px 4px; }
.dd-note { font-size: 12px; color: var(--text-2); padding: 2px 10px 8px; line-height: 1.5; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dd a, .dd button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 0; background: transparent; text-align: start; font-size: 13px; width: 100%; }
.dd a:hover, .dd button:hover { background: var(--hover); }
.dd-p span:not(.av):not(.s-badge) { display: flex; flex-direction: column; flex: 1; line-height: 1.25; min-width: 0; }
.dd-p small { color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-p.on { background: var(--gold-soft); }
.dd-n span { display: flex; flex-direction: column; line-height: 1.35; }
.dd-n small { color: var(--text-3); font-size: 11px; }
.dd-n.unread { font-weight: 600; } .dd-n.unread .ic { color: var(--accent); }
.dd-empty { padding: 16px; text-align: center; color: var(--text-3); }

/* ------------------------------------------------------------ coach */
.coach { position: fixed; bottom: 56px; inset-inline-end: 18px; width: min(400px, calc(100vw - 32px)); background: var(--sheet); border-radius: 18px; box-shadow: var(--sh-pop), 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent); padding: 14px 16px 0; z-index: 80; overflow: hidden; animation: pop .2s; }
.co-h { display: flex; align-items: center; gap: 8px; }
.co-n { font-size: 20px; font-weight: 800; color: var(--navy); }
[data-theme="dark"] .co-n { color: var(--gold-2); }
.co-n small { font-size: 12px; color: var(--text-3); font-weight: 600; }
.co-sc { font-size: 11px; font-weight: 800; color: #6b4f12; background: linear-gradient(135deg, #f5dc9a, var(--gold-2)); padding: 2px 9px; border-radius: 999px; }
.coach h4 { font-size: 15px; margin: 8px 0 4px; }
.coach p { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.co-who { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin-top: 10px; color: var(--text-2); }
.co-f { display: flex; align-items: center; gap: 8px; padding: 12px 0; }
.co-here { font-size: 12px; font-weight: 700; color: var(--good); display: inline-flex; align-items: center; gap: 5px; }
.co-bar { height: 4px; background: var(--slate-bg); margin: 0 -16px; }
.co-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--gold)); }
.pulse { position: relative; z-index: 2; animation: pulse 1.6s infinite; border-radius: 12px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(195, 154, 62, .75); } 70% { box-shadow: 0 0 0 12px rgba(195, 154, 62, 0); } 100% { box-shadow: 0 0 0 0 rgba(195, 154, 62, 0); } }

/* -------------------------------------------------------------- home */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 28px 30px; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; color: #fff;
  background: radial-gradient(700px 300px at 85% -20%, rgba(224, 189, 104, .35), transparent 60%), radial-gradient(500px 300px at 0% 120%, rgba(42, 106, 168, .55), transparent 60%), linear-gradient(135deg, #1d3a5c 0%, #12273f 100%); box-shadow: 0 10px 30px rgba(18, 39, 63, .25); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 18px 18px; pointer-events: none; }
.hero-l { position: relative; display: flex; flex-direction: column; gap: 8px; }
.hero-k { font-size: 12.5px; color: var(--gold-2); font-weight: 650; letter-spacing: .02em; }
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.hero p { color: rgba(255, 255, 255, .78); max-width: 560px; }
.hero-a { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hero-r { position: relative; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 6px; backdrop-filter: blur(6px); transition: background .15s; }
.hero-r:hover { background: rgba(255, 255, 255, .13); }
.hero-r b { font-size: 16px; } .hero-r > span:not(.hero-badge):not(.ring) { font-size: 12.5px; color: rgba(255, 255, 255, .75); line-height: 1.5; padding-inline-end: 70px; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #2b1f05; background: linear-gradient(135deg, #f5dc9a, var(--gold-2)); padding: 4px 10px; border-radius: 999px; width: fit-content; }
.ring { position: absolute; inset-inline-end: 18px; bottom: 18px; width: 62px; height: 62px; border-radius: 50%; background: conic-gradient(var(--gold-2) calc(var(--p) * 1%), rgba(255, 255, 255, .15) 0); display: grid; place-items: center; }
.ring i { width: 48px; height: 48px; border-radius: 50%; background: #17304d; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 13px; }
.hero-logo { position: absolute; inset-inline-end: 360px; top: -30px; width: 190px; opacity: .06; pointer-events: none; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile2 { position: relative; background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; box-shadow: var(--sh); transition: transform .12s, box-shadow .12s; overflow: hidden; }
.tile2:hover { transform: translateY(-2px); box-shadow: var(--sh-pop); }
.t2-ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, transparent); }
.t2-v { font-size: 26px; font-weight: 800; line-height: 1.1; }
.t2-l { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.t2-go { position: absolute; inset-inline-end: 14px; top: 50%; translate: 0 -50%; color: var(--text-3); }
.t-blue { --tc: #2563eb; } .t-gold { --tc: #b8862a; } .t-violet { --tc: #7c3aed; } .t-red { --tc: #dc2626; }
.journey { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.jr { flex: 1; min-width: 120px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; padding: 14px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); position: relative; transition: border-color .12s, background .12s; }
.jr:hover { border-color: var(--gold); background: var(--gold-soft); }
.jr-n { position: absolute; top: 8px; inset-inline-start: 10px; font-size: 11px; font-weight: 800; color: var(--gold); }
.jr-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(24, 63, 107, .25); }
.jr b { font-size: 13.5px; } .jr small { font-size: 11.5px; color: var(--text-3); }
.jr-ar { display: grid; place-items: center; color: var(--gold); }
.clist { display: flex; flex-direction: column; }
.crow { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(150px, 220px) auto; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); transition: background .1s; }
.card:not(.flush) .crow { padding-inline: 4px; }
.crow:last-child { border-bottom: 0; }
.crow:hover { background: var(--hover); }
.crow.late { box-shadow: inset 3px 0 0 var(--bad); }
[dir="rtl"] .crow.late { box-shadow: inset -3px 0 0 var(--bad); }
.crow-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.k-incoming { background: #e7f0ff; color: #1d4ed8; } .k-outgoing { background: #e8f7f0; color: #047857; } .k-internal { background: #f1ecff; color: #6d28d9; } .k-request { background: #fff4e0; color: #b45309; }
[data-theme="dark"] .crow-ic { background: var(--slate-bg); }
.crow-m { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.crow-t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow-s { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; }
.crow-stage { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crow-stage small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.card:not(.flush) .crow { grid-template-columns: auto minmax(0, 1fr) auto; }
.feed { display: flex; flex-direction: column; gap: 2px; }
.fd { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; align-items: flex-start; }
.fd:last-child { border: 0; }
.fd > div { min-width: 0; line-height: 1.45; }
.fd span { color: var(--text-2); }
.fd small { display: block; color: var(--text-3); font-size: 11.5px; }
.launch { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ln { background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--sh); transition: transform .12s, border-color .12s; }
.ln:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--ac) 45%, transparent); }
.ln-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--ac) 12%, transparent); color: var(--ac); margin-bottom: 4px; }
[data-theme="dark"] .ln-ic { color: color-mix(in srgb, var(--ac) 55%, white); }
.ln small { color: var(--text-3); font-size: 12.5px; line-height: 1.45; }

/* --------------------------------------------------------- dashboard */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 6px; min-width: 0; transition: border-color .12s; }
a.kpi:hover { border-color: var(--gold); }
.kpi-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kpi-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-h); flex-shrink: 0; }
.kpi-ic.bad { background: var(--bad-bg); color: var(--bad); }
.kpi-l { overflow-wrap: anywhere; min-width: 0; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); line-height: 1.3; }
[dir="rtl"] .kpi-l { letter-spacing: 0; font-size: 12.5px; }
.kpi-v { font-size: 26px; font-weight: 780; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi.sm .kpi-v { font-size: 22px; }
.kpi-b { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.delta.good { color: var(--good); } .delta.bad { color: var(--bad); }
.ch { direction: ltr; }
.ch svg { width: 100%; height: auto; display: block; overflow: visible; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
[dir="rtl"] .ch-legend { direction: rtl; }
.ch-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-ax { fill: var(--text-3); font-size: 10.5px; font-family: var(--font); }
.ch-mark { transition: opacity .1s; } .ch-mark:hover { opacity: .8; }
.ch-hit { fill: transparent; } .ch-hit:hover { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.d-v { font-size: 22px; font-weight: 800; fill: var(--text); font-family: var(--font); }
.d-l { font-size: 10px; fill: var(--text-3); font-family: var(--font); }
.d-leg { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 150px; }
.d-leg div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.d-leg i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.d-leg span { flex: 1; color: var(--text-2); }
.d-leg b { font-variant-numeric: tabular-nums; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hb { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; align-items: center; gap: 10px; font-size: 12.5px; }
.hb-l { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 12px; background: var(--slate-bg); border-radius: 4px; overflow: hidden; }
.hb-b { display: block; height: 100%; border-radius: 4px; }
.hb-v { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 40px; text-align: end; }
.gauge { width: 100%; max-width: 230px; display: block; margin: 0 auto; }
.g-v { font-size: 26px; font-weight: 800; fill: var(--text); font-family: var(--font); }
.gwrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.g-note { font-size: 12px; color: var(--good); display: flex; gap: 6px; align-items: center; text-align: center; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mn { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 3px; }
.mn .ic { color: var(--accent); } .mn.bad .ic, .mn.bad b { color: var(--bad); }
.mn b { font-size: 20px; } .mn small { font-size: 11.5px; color: var(--text-3); }
.stor { display: flex; flex-direction: column; gap: 10px; }
.spark { flex-shrink: 1; min-width: 0; max-width: 55%; height: auto; }

/* ------------------------------------------------ correspondence screen */
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; background: linear-gradient(135deg, var(--gold-soft), var(--sheet)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); flex-wrap: wrap; }
.banner > div { display: flex; flex-direction: column; gap: 3px; }
.banner > div > span { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actbar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.ab-l { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 6px; }
.stepper { display: flex; align-items: flex-start; overflow-x: auto; padding: 4px 2px 6px; }
.stp { flex: 1; min-width: 132px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; position: relative; padding: 0 4px; }
.stp-line { flex: 0 0 18px; height: 2px; background: var(--line-2); margin-top: 16px; }
.stp-dot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--sheet); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--text-3); }
.stp.done .stp-dot { background: var(--good); border-color: var(--good); color: #fff; }
.stp.cur .stp-dot { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); animation: pulse2 2s infinite; }
@keyframes pulse2 { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--accent) 8%, transparent); } }
.stp.back .stp-dot { background: var(--orange); border-color: var(--orange); color: #fff; }
.stp.rej .stp-dot { background: var(--bad); border-color: var(--bad); color: #fff; }
.stp-t { font-size: 12.5px; font-weight: 650; line-height: 1.3; }
.stp.cur .stp-t { color: var(--accent-h); }
.stp-w { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); }
.stp-s { font-size: 11px; color: var(--text-3); }
.stp-sig { position: absolute; top: -2px; inset-inline-end: calc(50% - 26px); width: 18px; height: 18px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }

.letter { background: #fffefb; color: #1b2433; border: 1px solid #e8e2d4; border-radius: 6px; padding: 26px 30px 18px; font-family: "Amiri", "IBM Plex Sans Arabic", serif; font-size: 16px; line-height: 1.9; box-shadow: 0 2px 12px rgba(40, 30, 10, .06); position: relative; }
.letter .lh, .certdoc .lh, .ed-page .lh { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid #c39a3e; margin-bottom: 14px; }
.lh img { width: 46px; }
.lh > div:nth-child(2) { display: flex; flex-direction: column; line-height: 1.2; }
.lh b { font-size: 19px; color: #1d3a5c; } .lh span { font-family: "Inter", sans-serif; font-size: 10px; letter-spacing: .25em; color: #c39a3e; font-weight: 700; }
.lh-r { margin-inline-start: auto; display: flex; flex-direction: column; gap: 2px; font-size: 13px; font-family: "IBM Plex Sans Arabic", sans-serif; }
.lh-r div { display: flex; gap: 8px; justify-content: space-between; } .lh-r span { color: #7d7466; letter-spacing: 0; font-size: 12px; font-weight: 500; font-family: inherit; }
.lt-meta { font-size: 15px; margin-bottom: 6px; } .lt-meta span, .lt-subj span { color: #7d7466; }
.lt-subj { font-weight: 700; font-size: 16.5px; padding: 6px 0 10px; border-bottom: 1px dashed #e0d8c6; margin-bottom: 10px; }
.lt-body p { margin: 0 0 6px; }
.lt-sigs { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-top: 16px; padding-top: 10px; position: relative; min-height: 70px; }
.lsig { display: flex; flex-direction: column; align-items: center; font-size: 13px; line-height: 1.3; min-width: 150px; }
.lsig img { height: 46px; }
.lsig small { color: #7d7466; font-size: 11px; font-family: "Inter", "IBM Plex Sans Arabic", sans-serif; }
.lsig.empty { color: #a39a8a; font-style: italic; font-family: "Inter", sans-serif; font-size: 12px; }
.lsig-t { margin-top: 4px; font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 8px; display: inline-flex; gap: 4px; align-items: center; }
.lsig-t.digital { background: #e7f6ef; color: #047857; } .lsig-t.electronic { background: #e9f0fb; color: #1d4ed8; }
.stamp { margin-inline-start: auto; width: 96px; height: 96px; border-radius: 50%; border: 3px double #b4232a; color: #b4232a; display: grid; place-items: center; text-align: center; font-size: 11px; font-weight: 700; line-height: 1.4; transform: rotate(-12deg); opacity: .85; font-family: "IBM Plex Sans Arabic", sans-serif; }
.stamp .ic { display: none; }
.lt-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 8px; border-top: 1px solid #eee6d6; font-family: "Inter", sans-serif; font-size: 11px; color: #8a8273; direction: ltr; }
.sig-svg { display: block; }
.qr { border-radius: 4px; flex-shrink: 0; }
.hist { display: flex; flex-direction: column; position: relative; }
.hi { display: flex; gap: 10px; position: relative; padding-bottom: 14px; }
.hi:not(:last-child)::before { content: ""; position: absolute; top: 28px; bottom: 0; inset-inline-start: 13px; width: 2px; background: var(--line); }
.hi-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--slate-bg); color: var(--text-2); flex-shrink: 0; }
.hi.good .hi-ic { background: var(--good-bg); color: var(--good); } .hi.warn .hi-ic { background: var(--orange-bg); color: var(--orange); } .hi.bad .hi-ic { background: var(--bad-bg); color: var(--bad); }
.hi-b { min-width: 0; flex: 1; padding-top: 3px; }
.hi-t { font-size: 13px; } .hi-m { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); margin-top: 3px; flex-wrap: wrap; }
.hi-n { margin-top: 6px; padding: 7px 10px; background: var(--panel); border-radius: 8px; border-inline-start: 3px solid var(--gold); font-size: 12.5px; color: var(--text-2); }
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg-b { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 10px 12px; }
[dir="rtl"] .msg-b { border-radius: 14px 4px 14px 14px; }
.msg.ask .msg-b, .msg.return .msg-b { background: var(--orange-bg); border-color: color-mix(in srgb, var(--orange) 25%, transparent); }
.msg.answer .msg-b { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.msg-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap; }
.msg-h small { color: var(--text-3); margin-inline-start: auto; font-size: 11px; }
.msg-k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.msg.ask .msg-k, .msg.return .msg-k { color: var(--orange); } .msg.answer .msg-k { color: var(--info); }
.msg-t { margin-top: 5px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.att { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; margin: 6px 6px 0 0; }
.att button { border: 0; background: none; color: var(--text-3); padding: 0; display: grid; }
.att-list { display: flex; flex-wrap: wrap; gap: 4px; }
.attach-row { display: flex; gap: 8px; flex-wrap: wrap; }
.docs-mini { display: flex; flex-direction: column; gap: 6px; }
.dmini { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .12s, background .12s; }
.dmini:hover { border-color: var(--accent); background: var(--accent-soft); }
.dmini > .ic { color: var(--violet); }
.dmini span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dmini b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmini small { color: var(--text-3); font-size: 11.5px; }
.ccs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.cc { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: var(--panel); border-radius: 999px; padding: 2px 8px 2px 2px; }
.tmini { width: 100%; text-align: start; display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--sheet); margin-bottom: 8px; transition: border-color .12s; }
.tmini:hover { border-color: var(--accent); }
.tmini b { font-size: 13.5px; } .tmini small { color: var(--text-3); font-size: 11.5px; }
.tm-f { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.tmini .bar span { background: linear-gradient(90deg, var(--accent), var(--good)); }
.reqsum { display: flex; gap: 12px; padding: 12px 14px; background: var(--warn-bg); border-radius: 12px; margin-bottom: 12px; align-items: flex-start; }
.reqsum > div:last-child { display: flex; flex-direction: column; gap: 3px; }
.rs-ic { width: 40px; height: 40px; border-radius: 11px; background: #fff; color: #b45309; display: grid; place-items: center; flex-shrink: 0; }
.rs-f { font-size: 12.5px; } .rs-f small { color: var(--text-3); }
.reqsum span { font-size: 12.5px; color: var(--text-2); }
.compose { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.preview { position: sticky; top: 0; }
.pv-h { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.route { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.route.card { padding: 12px 14px; }
.rt { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.rt > span:not(.av) { display: flex; flex-direction: column; line-height: 1.2; }
.rt b { font-size: 12px; } .rt small { font-size: 11px; color: var(--text-3); }
.reg-ok { text-align: center; padding: 8px 0; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.reg-n { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; }
.reg-ref { font-size: 24px; font-weight: 800; color: var(--navy); background: linear-gradient(135deg, var(--gold-soft), #fff); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); border-radius: 14px; padding: 12px 20px; animation: pop .35s; }
[data-theme="dark"] .reg-ref { color: var(--gold-2); background: var(--gold-soft); }
.reg-l { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.plist { display: flex; flex-direction: column; gap: 6px; }
.pi { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--sheet); text-align: start; }
.pi:hover { border-color: var(--accent); background: var(--accent-soft); }
.pi span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pi small { color: var(--text-3); font-size: 11.5px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.dopt { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--sheet); text-align: start; }
.dopt small { color: var(--text-3); font-size: 11.5px; }
.dopt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.sugg { position: absolute; top: 8px; inset-inline-end: 8px; font-size: 10px; font-weight: 800; color: #7a5a14; background: var(--gold-soft); padding: 1px 6px; border-radius: 999px; display: inline-flex; gap: 3px; align-items: center; }
.q-ask { display: flex; gap: 8px; padding: 10px 12px; background: var(--orange-bg); color: var(--orange); border-radius: 10px; font-size: 13px; }
.sign { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(220px, 1fr); gap: 16px; }
.sg-l { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sgtype { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sgtype button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--sheet); text-align: start; }
.sgtype button .ic { color: var(--accent); }
.sgtype button small { color: var(--text-3); font-size: 11.5px; line-height: 1.4; }
.sgtype button.on { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.pad-w { border: 1px dashed var(--line-2); border-radius: 12px; background: #fffefb; position: relative; overflow: hidden; }
.sigpad { width: 100%; height: 130px; display: block; touch-action: none; cursor: crosshair; }
.pad-saved { position: absolute; inset: 0 0 38px; display: none; place-items: center; background: #fffefb; }
.pad-w.saved .pad-saved { display: grid; }
.pad-a { display: flex; gap: 6px; padding: 6px; border-top: 1px solid #eee6d6; background: var(--panel); }
.otp { display: flex; gap: 6px; direction: ltr; }
.otp input { width: 42px; height: 46px; text-align: center; font-size: 20px; font-weight: 700; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); }
.cert { background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.cert > .ic { color: var(--gold-2); }
.cert .kv li { border-color: rgba(255, 255, 255, .15); } .cert .kv li > span:first-child { color: rgba(255, 255, 255, .6); }
.cert .note { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .8); }
.doc-h { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 12px; }
.doc-h span { color: var(--text-3); } .doc-h small { font-family: var(--mono); color: var(--text-3); font-size: 10px; word-break: break-all; }
.signing { display: flex; gap: 20px; align-items: center; padding: 20px 8px; }
.signing ol, .or-s { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-3); }
.signing li.on, .or-s li.on { color: var(--accent-h); font-weight: 650; }
.or-s li.ok { color: var(--good); }
.or-s li.ok::marker { content: "✓  "; }
.certdoc { background: #fffefb; color: #1b2433; border: 6px double #c39a3e; border-radius: 6px; padding: 24px 28px; font-family: "Amiri", serif; font-size: 16px; line-height: 1.9; text-align: center; }
.certdoc .lh { justify-content: center; }
.certdoc h2 { font-size: 26px; color: #1d3a5c; margin-top: 6px; }
.certdoc h3 { font-family: "Inter", sans-serif; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: #c39a3e; margin-bottom: 12px; }
.certdoc .en { font-family: "Inter", sans-serif; font-size: 13px; color: #56637a; line-height: 1.6; margin-top: 8px; }
.cd-f { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 12px; }
.cd-f > div:nth-child(2) { display: flex; flex-direction: column; align-items: center; font-size: 13px; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.cmp > div { padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.cmp h4 { display: flex; align-items: center; gap: 7px; font-size: 14px; margin-bottom: 8px; }
.cmp h4 .ic { color: var(--accent); }
.cmp ul { margin: 0; padding-inline-start: 18px; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.mysig { display: flex; flex-direction: column; align-items: center; padding: 10px; background: #fffefb; border-radius: 12px; border: 1px dashed #e0d8c6; margin-bottom: 10px; color: #1b2433; }
.mysig small { color: #7d7466; }
.srow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.srow .ic { color: var(--good); }
.srow span { display: flex; flex-direction: column; min-width: 0; }
.srow b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow small { font-size: 11px; color: var(--text-3); }

.board { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board.three { grid-template-columns: repeat(3, minmax(240px, 1fr)); }
.bcol { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.bcol-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; }
.bcard { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; box-shadow: var(--sh); transition: transform .1s; }
.bcard:hover { transform: translateY(-1px); border-color: var(--accent); }
.bcard.late { border-inline-start: 3px solid var(--bad); }
.bcard b { font-size: 13px; line-height: 1.35; }
.bc-f { display: flex; align-items: center; gap: 6px; }

.rtypes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.rtype { background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--sh); }
.rtype.on, .rtype:hover { border-color: #d29b3b; }
.rt-ic { width: 38px; height: 38px; border-radius: 11px; background: #fff4e0; color: #b45309; display: grid; place-items: center; }
[data-theme="dark"] .rt-ic { background: var(--warn-bg); }
.rtype b { font-size: 13px; line-height: 1.35; } .rt-n { font-size: 11.5px; color: var(--text-3); }
.bigpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.bp { background: var(--sheet); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--sh); transition: transform .12s, border-color .12s; }
.bp:hover { transform: translateY(-2px); border-color: #d29b3b; }
.bp-ic { width: 52px; height: 52px; border-radius: 15px; background: linear-gradient(135deg, #fff1d6, #fde3b0); color: #a55d07; display: grid; place-items: center; }
.bp b { font-size: 15.5px; } .bp small { color: var(--text-3); }
.bp-docs { font-size: 12px; color: var(--text-2); padding-top: 8px; border-top: 1px dashed var(--line); }
.t24 { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: #0e7490; background: #e6f6fa; padding: 3px 9px; border-radius: 999px; }
[data-theme="dark"] .t24 { background: #0f2b33; color: #67e8f9; }
.cif { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.cif input { width: 220px; font-family: var(--mono); font-size: 15px; }
.cif a { color: var(--accent); }
.cust { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cu-h { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cu-h > .ic { color: var(--accent); }
.cu-h > div { display: flex; flex-direction: column; flex: 1; min-width: 200px; }
.cu-h span { font-size: 12.5px; color: var(--text-3); }
.cu-g { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.cu-g > div { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.cu-g > div + div { border-inline-start: 1px solid var(--line); }
.cu-g small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.cu-r { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; font-size: 12.5px; align-items: center; }
.cu-r span:nth-child(2) { color: var(--text-3); } .cu-r b { font-variant-numeric: tabular-nums; }
.reqdocs { display: flex; flex-direction: column; gap: 6px; }
.rd { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 12px; }
.rd-ic { color: var(--text-3); }
.rd-st { font-size: 12px; color: var(--bad); font-weight: 600; }
.rd.ok { border-style: solid; border-color: color-mix(in srgb, var(--good) 40%, transparent); background: var(--good-bg); }
.rd.ok .rd-st, .rd.ok .rd-ic { color: var(--good); }
.denied { max-width: 680px; margin: 30px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dn-ic { width: 92px; height: 92px; border-radius: 50%; background: var(--bad-bg); color: var(--bad); display: grid; place-items: center; box-shadow: 0 0 0 10px color-mix(in srgb, var(--bad-bg) 60%, transparent); }
.denied h1 { font-size: 24px; } .denied > p { color: var(--text-2); }
.dn-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.dn-box > div { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 3px; text-align: start; }
.dn-box small { font-size: 11px; color: var(--text-3); text-transform: uppercase; font-weight: 700; letter-spacing: .05em; } .dn-box span { font-size: 12px; color: var(--text-3); }
.arc-c { display: flex; flex-direction: column; gap: 10px; }

/* -------------------------------------------------------- documents */
mark { background: #fde68a; color: #1b2433; border-radius: 3px; padding: 0 2px; box-shadow: 0 0 0 1px #f5c542; }
.paper { --z: 1; --r: 0deg; background: #fdfcf7; color: #1d2433; width: min(640px, 100%); margin: 0 auto; aspect-ratio: 1 / 1.3; padding: 32px 36px; border-radius: 3px; position: relative; font-family: "Amiri", "IBM Plex Sans Arabic", serif; font-size: 16px; line-height: 2; box-shadow: 0 4px 22px rgba(30, 30, 20, .14); transform: scale(var(--z)) rotate(calc(var(--r) - .35deg)); transform-origin: top center; transition: transform .2s;
  background-image: radial-gradient(rgba(120, 110, 80, .05) 1px, transparent 1px), linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(230, 220, 190, .25)); background-size: 3px 3px, 100% 100%; overflow: hidden; }
.paper[dir="ltr"] { font-family: "Inter", sans-serif; font-size: 14px; line-height: 2.1; }
.pp-h { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 2px solid #c39a3e; margin-bottom: 18px; }
.pp-h img { width: 38px; }
.pp-h > div { display: flex; flex-direction: column; line-height: 1.25; }
.pp-h b { color: #1d3a5c; font-size: 17px; } .pp-h span { font-size: 12px; color: #7d7466; }
.pp-ref { margin-inline-start: auto; font-size: 11px; color: #7d7466; }
.pp-b p { margin: 0; }
.pp-t { font-weight: 700; font-size: 1.12em; text-align: center; margin-bottom: 8px !important; }
.pp-fill { height: 10px; background: rgba(60, 60, 60, .09); border-radius: 3px; margin: 14px 0 !important; width: 92%; }
.pp-fill.s { width: 64%; }
.pp-f { position: absolute; bottom: 30px; inset-inline: 36px; display: flex; justify-content: space-between; align-items: flex-end; }
.pp-st { width: 86px; height: 86px; border-radius: 50%; border: 3px double rgba(29, 58, 92, .7); color: rgba(29, 58, 92, .8); display: grid; place-items: center; text-align: center; font-size: 10px; font-weight: 700; transform: rotate(14deg); font-family: "IBM Plex Sans Arabic", sans-serif; }
.pp-st .ic { display: none; }
.pp-type { position: absolute; top: 10px; inset-inline-end: 12px; font-family: "Inter", sans-serif; font-size: 10px; color: #a69f90; text-transform: uppercase; letter-spacing: .1em; }
.paper.ocr .ocl { outline: 1.5px solid rgba(37, 99, 235, .55); background: rgba(37, 99, 235, .07); border-radius: 2px; }
.ocr-badge { position: absolute; top: 10px; inset-inline-start: 12px; font-family: "Inter", sans-serif; font-size: 10.5px; font-weight: 700; color: #fff; background: #2563eb; padding: 2px 8px; border-radius: 999px; }
.paper.img { aspect-ratio: auto; padding: 0; background: #fff; }
.paper.img img { display: block; width: 100%; }
.ocr-over { position: absolute; inset: auto 0 0 0; background: rgba(255, 255, 255, .92); padding: 10px 14px; font-size: 13px; line-height: 1.6; display: flex; flex-direction: column; direction: rtl; }
.thumb { aspect-ratio: 1 / 1.25; background: #fdfcf7; border-radius: 4px; padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 5px; position: relative; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); overflow: hidden; }
.thumb.img { padding: 0; } .thumb.img img { width: 100%; height: 100%; object-fit: cover; }
.th-h { border-bottom: 1.5px solid #c39a3e; padding-bottom: 4px; margin-bottom: 4px; } .th-h img { width: 16px; display: block; }
.thumb i { display: block; height: 4px; border-radius: 2px; background: rgba(60, 60, 60, .2); }
.thumb i.s { width: 50%; }
.th-f { position: absolute; bottom: 6px; inset-inline-end: 6px; font-size: 9px; font-weight: 800; color: #fff; background: #7c3aed; padding: 1px 5px; border-radius: 4px; font-family: "Inter", sans-serif; }
.wiz { background: var(--sheet); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh); overflow: hidden; }
.wz-steps { display: flex; border-bottom: 1px solid var(--line); background: var(--panel); overflow-x: auto; }
.wz { flex: 1; display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-weight: 600; color: var(--text-3); white-space: nowrap; border-bottom: 3px solid transparent; }
.wz span { width: 26px; height: 26px; border-radius: 50%; background: var(--slate-bg); display: grid; place-items: center; font-weight: 800; font-size: 12.5px; }
.wz.cur { color: var(--accent-h); border-color: var(--gold); background: var(--sheet); }
.wz.cur span { background: var(--grad); color: #fff; }
.wz.done { color: var(--good); } .wz.done span { background: var(--good); color: #fff; }
.wz-body { padding: 22px; min-height: 420px; }
.src { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.srcc { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 26px 18px; border-radius: 16px; border: 1.5px dashed var(--line-2); background: var(--panel); cursor: pointer; transition: border-color .12s, background .12s, transform .12s; }
.srcc:hover, .srcc.over { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.srcc b { font-size: 15px; } .srcc small { color: var(--text-3); font-size: 12.5px; line-height: 1.45; min-height: 36px; }
.sc-ic { width: 64px; height: 64px; border-radius: 18px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(24, 63, 107, .25); margin-bottom: 4px; }
.scanning { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; }
.scanner { position: relative; width: 120px; height: 90px; display: grid; place-items: center; color: var(--accent); }
.scanner .sheet { position: absolute; top: 0; width: 60px; height: 36px; background: #fff; border: 1px solid var(--line); border-radius: 2px; animation: feed 1s ease-in-out infinite; }
@keyframes feed { 0% { transform: translateY(-20px); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(30px); opacity: 0; } }
.pages { display: flex; gap: 12px; margin-top: 10px; }
.pgc { width: 110px; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: pop .3s; }
.pgc .thumb { width: 100%; }
.ocrrun, .ocrres { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.or-l { position: relative; overflow: hidden; border-radius: 6px; }
.or-l .paper { transform: none; }
.scanline { position: absolute; inset-inline: 0; height: 60px; background: linear-gradient(180deg, transparent, rgba(37, 99, 235, .25), transparent); animation: scanl 1.4s linear infinite; }
@keyframes scanl { from { top: -60px; } to { top: 100%; } }
.or-r { display: flex; flex-direction: column; gap: 14px; }
.or-r h3 { display: flex; gap: 8px; align-items: center; font-size: 17px; }
.or-conf { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--good-bg); color: var(--good); }
.or-conf .big { font-size: 34px; font-weight: 800; }
.or-conf > span:last-child { display: flex; flex-direction: column; font-weight: 700; }
.or-conf small { font-weight: 500; opacity: .8; }
.found { display: flex; flex-wrap: wrap; gap: 8px; }
.fd2 { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.fd2 small { font-size: 11px; color: var(--text-3); } .fd2.ok { background: #e6f6fa; border-color: #a5e3f0; } [data-theme="dark"] .fd2.ok { background: #0f2b33; border-color: #155e75; }
.classify { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.cl-l { display: flex; flex-direction: column; gap: 6px; }
.cl-l small { color: var(--text-3); }
.cl-r { display: flex; flex-direction: column; gap: 14px; }
.sugg-box { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.sugg-box > .ic { color: var(--gold); } .sugg-box > span { flex: 1; }
.pct { font-weight: 800; color: #7a5a14; } [data-theme="dark"] .pct { color: var(--gold-2); }
.refprev { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-h); }
.refprev span { flex: 1; font-weight: 600; } .refprev b { font-size: 15px; }
.regdone { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 30px 10px; }
.rd-ok { width: 84px; height: 84px; border-radius: 50%; background: var(--good-bg); color: var(--good); display: grid; place-items: center; animation: pop .4s; }
.regdone p { color: var(--text-2); max-width: 520px; }
.editor { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.ed-side { background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 4px; height: fit-content; }
.ed-side .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-3); padding: 6px 8px; }
.tpl { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; text-align: start; font-weight: 550; }
.tpl:hover { background: var(--hover); } .tpl.on { background: var(--accent-soft); color: var(--accent-h); }
.ed-main { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ed-bar { display: flex; align-items: center; gap: 4px; padding: 8px 12px; background: var(--sheet); border-bottom: 1px solid var(--line); }
.ed-bar button { width: 32px; height: 30px; border: 0; border-radius: 7px; background: transparent; display: grid; place-items: center; }
.ed-bar button:hover { background: var(--hover); }
.ed-bar > span:not(.grow):not(.muted) { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.ed-page { background: #fffefb; color: #1b2433; width: min(720px, calc(100% - 32px)); margin: 20px auto; padding: 30px 36px; min-height: 560px; box-shadow: 0 4px 18px rgba(0, 0, 0, .08); font-family: "Amiri", serif; font-size: 17px; line-height: 1.9; }
.ed-doc { outline: none; min-height: 420px; }
.ed-doc h2 { text-align: center; color: #1d3a5c; font-size: 22px; } .ed-doc h3 { text-align: center; }
.lib { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.tree { padding: 8px; display: flex; flex-direction: column; gap: 1px; max-height: calc(100vh - 200px); overflow-y: auto; position: sticky; top: 0; }
.tr { display: flex; align-items: center; gap: 8px; padding: 7px 10px; padding-inline-start: calc(10px + var(--d, 0) * 18px); border-radius: 9px; font-size: 13px; color: var(--text-2); }
.tr:hover { background: var(--hover); } .tr.on { background: var(--accent-soft); color: var(--accent-h); font-weight: 650; }
.tr span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr small { font-size: 11px; color: var(--text-3); font-weight: 600; }
.dgrid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.dcard { background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--sh); transition: transform .12s, border-color .12s; display: flex; flex-direction: column; }
.dcard:hover { transform: translateY(-2px); border-color: var(--violet); }
.dcard .thumb { border-radius: 0; box-shadow: none; aspect-ratio: 1.5 / 1; border-bottom: 1px solid var(--line); padding: 12px 16px; }
.dc-b { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.dc-b b { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dc-b .mono { color: var(--text-3); font-size: 11px; }
.dc-f { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; }
.viewer { position: sticky; top: 0; }
.vw-bar { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.vw-stage { padding: 26px 20px; background: repeating-linear-gradient(45deg, var(--panel), var(--panel) 10px, var(--hover) 10px, var(--hover) 20px); max-height: calc(100vh - 230px); overflow: auto; }
.vw-stage > .letter, .vw-stage > .certdoc { max-width: 680px; margin: 0 auto; }
.gloss { display: flex; gap: 8px; padding: 10px 14px; font-size: 12.5px; color: var(--text-2); border-top: 1px solid var(--line); line-height: 1.5; }
.vers { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ver { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.ver > div { flex: 1; display: flex; flex-direction: column; } .ver small { font-size: 11.5px; color: var(--text-3); }
.ver.cur { border-color: color-mix(in srgb, var(--good) 40%, transparent); background: var(--good-bg); }
.vn { font-weight: 800; font-family: var(--mono); color: var(--violet); min-width: 34px; }
.lnk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; }
.lnk:hover { border-color: var(--accent); }
.lnk > .ic { color: var(--accent); }
.lnk span { display: flex; flex-direction: column; min-width: 0; } .lnk small { font-size: 11.5px; color: var(--text-3); }
.shero { border-radius: 22px; padding: 30px; color: #fff; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: radial-gradient(600px 260px at 50% -30%, rgba(224, 189, 104, .35), transparent 60%), linear-gradient(135deg, #12406a, #12273f); box-shadow: 0 10px 30px rgba(18, 39, 63, .25); }
.shero h1 { font-size: 26px; display: flex; align-items: center; gap: 10px; }
.shero h1 .ic { color: var(--gold-2); }
.shero > p { color: rgba(255, 255, 255, .78); max-width: 680px; }
.sbox { display: flex; align-items: center; gap: 10px; width: min(760px, 100%); background: #fff; border-radius: 16px; padding: 6px 6px 6px 16px; color: #8a94a6; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); margin: 4px 0 0; }
[dir="rtl"] .sbox { padding: 6px 16px 6px 6px; }
.sbox input { flex: 1; border: 0; outline: none; font-size: 18px; height: 46px; background: transparent; color: #17233a; min-width: 0; }
.sex { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sex .chip { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; height: 32px; }
.sex .chip small { color: var(--gold-2); }
.sex .chip.on, .sex .chip:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.snote { font-size: 12px; color: rgba(255, 255, 255, .7); display: flex; gap: 6px; align-items: center; }
.sres { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.sfilt { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.sstat { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hid { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--bad); background: var(--bad-bg); padding: 3px 10px; border-radius: 999px; }
.sr { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--sh); transition: border-color .12s; }
.sr:hover { border-color: var(--accent); }
.sr-b { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sr-b > b { font-size: 15px; }
.sr-m { font-size: 12px; color: var(--text-3); }
.sr-snip { font-family: "Amiri", "IBM Plex Sans Arabic", serif; font-size: 15.5px; background: #fdfcf7; color: #1d2433; border: 1px solid #ece4d0; border-radius: 10px; padding: 6px 12px; }
.sr-snip[dir="ltr"] { font-family: var(--font); font-size: 13.5px; }
.sr-w { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tagw { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; background: var(--info-bg); color: var(--info); padding: 2px 8px; border-radius: 6px; }
.sidle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.si { background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--sh); }
.si .ic { color: var(--gold); } .si span { color: var(--text-2); font-size: 13px; line-height: 1.5; }

/* ------------------------------------------------------------ admin */
.wfl { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.wfc { background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--sh); transition: border-color .12s, transform .12s; }
.wfc:hover { border-color: #be185d; transform: translateY(-2px); }
.wfc-h { display: flex; align-items: center; gap: 8px; } .wfc-h .muted { margin-inline-start: auto; }
.wfc-s { display: flex; align-items: center; }
.wdot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, var(--sheet)); color: var(--c); border: 1.5px solid var(--c); flex-shrink: 0; }
.wfc-s i { flex: 1; height: 2px; background: var(--line-2); min-width: 6px; }
.wfc-f { display: flex; gap: 12px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.designer { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.pal, .insp { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; }
.pal .lbl, .insp .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.palb { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--c) 50%, transparent); background: color-mix(in srgb, var(--c) 6%, var(--sheet)); color: var(--c); font-size: 12.5px; font-weight: 600; text-align: start; }
[data-theme="dark"] .palb { color: color-mix(in srgb, var(--c) 55%, white); }
.palb:hover { border-style: solid; }
.rule { font-size: 12.5px; color: var(--text-2); background: var(--panel); border-radius: 10px; padding: 10px; display: flex; gap: 6px; line-height: 1.45; }
.canvas { background: var(--sheet); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; align-items: center; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; min-height: 500px; }
.cv-start, .cv-end { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 700; }
.cv-end { background: var(--good); }
.cv-ar { color: var(--text-3); height: 26px; display: grid; place-items: center; }
.node { width: min(460px, 100%); display: grid; grid-template-columns: auto auto 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 2px 12px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); border-inline-start: 5px solid var(--c); background: var(--sheet); text-align: start; position: relative; box-shadow: var(--sh); transition: box-shadow .15s, transform .15s; }
.node:hover { transform: translateY(-1px); }
.node.on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent), var(--sh); border-color: var(--c); }
.node.sim { box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 45%, transparent); transform: scale(1.03); }
.nd-n { grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; background: var(--slate-bg); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.nd-ic { grid-row: span 2; width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); display: grid; place-items: center; }
.nd-b { display: flex; flex-direction: column; min-width: 0; }
.nd-b small { color: var(--text-3); font-size: 11.5px; }
.nd-w { display: flex; gap: 0; } .nd-w .av + .av { margin-inline-start: -6px; }
.nd-t { grid-column: 3 / 5; font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.nd-back { position: absolute; top: 8px; inset-inline-end: -10px; width: 20px; height: 20px; border-radius: 50%; background: var(--orange-bg); color: var(--orange); display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent); }
.insp input[type=range] { accent-color: var(--gold); padding: 0; border: 0; height: auto; }
.acts-l { display: flex; flex-wrap: wrap; gap: 5px; } .acts-l .chip { height: 24px; font-size: 11.5px; }
.esc { font-size: 12px; color: var(--text-2); background: var(--panel); padding: 8px 10px; border-radius: 10px; display: flex; gap: 6px; line-height: 1.45; }
.esc-c { display: flex; flex-direction: column; gap: 5px; } .esc-c > .ic { color: var(--gold); } .esc-c span { color: var(--text-2); } .esc-c small { color: var(--text-3); }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.rcard { background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--sh); transition: transform .12s, border-color .12s; }
.rcard:hover { transform: translateY(-2px); border-color: #15803d; }
.rc-ic { width: 40px; height: 40px; border-radius: 11px; background: #e8f7ee; color: #15803d; display: grid; place-items: center; }
[data-theme="dark"] .rc-ic { background: var(--good-bg); color: var(--good); }
.rc-f { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 4px; margin-top: auto; }
.chain { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 18px; background: var(--sheet); border: 1px solid var(--line); box-shadow: var(--sh); flex-wrap: wrap; }
.chain.good { background: linear-gradient(135deg, var(--good-bg), var(--sheet)); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.chain.bad { background: linear-gradient(135deg, var(--bad-bg), var(--sheet)); border-color: color-mix(in srgb, var(--bad) 40%, transparent); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.ch-ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-h); }
.chain.good .ch-ic { background: var(--good); color: #fff; } .chain.bad .ch-ic { background: var(--bad); color: #fff; }
.ch-t { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 3px; }
.ch-t b { font-size: 16px; } .ch-t span { color: var(--text-2); font-size: 13px; }
.ch-a { display: flex; gap: 8px; flex-wrap: wrap; }
.act { font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 6px; background: var(--slate-bg); color: var(--text-2); white-space: nowrap; }
.a-access-denied, .a-delete-blocked, .a-tamper-detected { background: var(--bad-bg); color: var(--bad); }
.a-approve, .a-sign, .a-complete, .a-archive, .a-issue-certificate { background: var(--good-bg); color: var(--good); }
.a-sign-in, .a-sign-out { background: var(--info-bg); color: var(--info); }
.a-download, .a-print, .a-export { background: var(--warn-bg); color: var(--warn); }
.a-permission-change, .a-transfer-user { background: var(--violet-bg); color: var(--violet); }
.tests { display: flex; flex-direction: column; gap: 8px; }
.test { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; flex-wrap: wrap; }
.test > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.test small { color: var(--text-3); font-size: 12px; }
.tn { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--gold-2); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pc { background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 5px; box-shadow: var(--sh); }
.pc .ic { color: #9333ea; } .pc span { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.transfer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tres { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--panel); border-radius: 12px; }
.tres > div:nth-child(2) { display: flex; gap: 6px; flex-wrap: wrap; }
.matrix td { padding: 8px; }
.cb input { display: none; }
.cb span { display: inline-grid; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); cursor: pointer; place-items: center; transition: background .1s; }
.cb input:checked + span { background: var(--accent); border-color: var(--accent); }
.cb input:checked + span::after { content: "✓"; color: #fff; font-size: 13px; font-weight: 800; }
.orgc { overflow-x: auto; }
.org-top { display: flex; justify-content: center; margin-bottom: 8px; }
.org-l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 14px 0 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.org-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.org-col { display: flex; flex-direction: column; gap: 4px; }
.org-sub { padding-inline-start: 14px; border-inline-start: 2px solid var(--line); }
.on2 { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--sheet); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.on2:hover { border-color: var(--accent); }
.on2.on { background: var(--grad); color: #fff; border-color: transparent; }
.on2.t-gm { background: var(--navy); color: #fff; padding: 10px 18px; font-size: 14px; }
.on2.t-gm .ic { color: var(--gold-2); }
.on2.t-branch .ic { color: #b45309; } .on2.t-dept .ic { color: var(--accent); } .on2.t-committee .ic { color: #9333ea; } .on2.on .ic { color: #fff; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.tlist { display: flex; flex-direction: column; gap: 1px; padding: 10px; max-height: 70vh; overflow-y: auto; }
.tlist .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-3); padding: 10px 8px 4px; }
.tli { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; font-size: 13px; color: var(--text-2); }
.tli .mono { margin-inline-start: auto; color: var(--text-3); } .tli:hover { background: var(--hover); } .tli.on { background: var(--accent-soft); color: var(--accent-h); font-weight: 650; }
.pat { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: var(--sheet); }
.tok { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.tok button { font-family: var(--mono); font-size: 11px; padding: 2px 7px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: var(--gold-soft); color: #7a5a14; }
[data-theme="dark"] .tok button { color: var(--gold-2); }
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ic2 { background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--sh); }
.ic2-h { display: flex; align-items: center; gap: 10px; } .ic2-h b { flex: 1; }
.ic2-i { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-h); display: grid; place-items: center; }
.dotok { width: 10px; height: 10px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px color-mix(in srgb, #10b981 20%, transparent); }
.ic2 p { font-size: 12.5px; color: var(--text-2); line-height: 1.45; } .ic2 small { color: var(--good); font-weight: 600; font-size: 12px; }
.ic2 .btn { width: fit-content; }
.code { background: #0f1b2d; color: #c9e3ff; border-radius: 12px; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; overflow-x: auto; margin: 0; line-height: 1.6; text-align: left; }
.drd { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.site { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--panel); }
.site.dr { border-style: dashed; }
.site-h { display: flex; align-items: center; gap: 8px; font-weight: 700; } .site-h .st { margin-inline-start: auto; }
.comp { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--sheet); border: 1px solid var(--line); font-size: 12.5px; }
.comp .ic { color: var(--accent); }
.repl { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); text-align: center; }
.repl small { color: var(--good); font-weight: 700; }
.flow { display: flex; gap: 6px; }
.flow i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: dot 1.2s infinite; }
.flow i:nth-child(2) { animation-delay: .2s; } .flow i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 50% { opacity: .2; transform: scale(.7); } }
.envs { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.drill { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.center-c { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px; text-align: center; }

/* ------------------------------------------------------------ guide */
.ghero { position: relative; overflow: hidden; border-radius: 22px; padding: 28px 30px; color: #fff; display: flex; align-items: center; gap: 20px;
  background: radial-gradient(600px 300px at 90% 0%, rgba(224, 189, 104, .4), transparent 60%), linear-gradient(135deg, #1d3a5c, #0f2136); box-shadow: 0 10px 30px rgba(18, 39, 63, .25); }
.ghero > div { flex: 1; display: flex; flex-direction: column; gap: 10px; position: relative; }
.ghero h1 { font-size: 30px; } .ghero p { color: rgba(255, 255, 255, .8); max-width: 640px; }
.ghero > img { width: 130px; opacity: .9; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .3)); }
.flowd { display: flex; flex-direction: column; gap: 10px; }
.fd-row { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 6px 2px; }
.fd-row.end { justify-content: flex-end; }
.fd-start { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #22a06b; background: #dff6ea; flex-shrink: 0; }
.fd-ln { flex: 0 0 30px; height: 2px; background: var(--line-2); position: relative; display: grid; place-items: center; }
.fd-ln.yes small { position: absolute; top: -18px; font-size: 11px; font-weight: 800; color: var(--good); }
.fd-box { flex: 0 0 200px; display: flex; gap: 8px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1.5px solid #9cc2e6; background: #edf5fc; color: #17324f; font-size: 12.5px; line-height: 1.4; transition: transform .12s; }
[data-theme="dark"] .fd-box { background: #142740; color: #d6e6f7; border-color: #2c5a88; }
.fd-box:hover { transform: translateY(-2px); }
.fd-box.done { border-color: var(--good); background: var(--good-bg); color: var(--text); }
.fd-box.cur { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent); animation: pulse 1.8s infinite; color: var(--text); }
.fd-dia { width: 64px; height: 64px; transform: rotate(45deg); background: #fbf2c7; border: 1.5px solid #e2c54a; display: grid; place-items: center; flex-shrink: 0; margin: 0 6px; }
[data-theme="dark"] .fd-dia { background: #3a3113; }
.fd-dia b { transform: rotate(-45deg); font-size: 10.5px; text-align: center; }
.fd-back { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1.5px dashed var(--line-2); color: var(--text-2); font-size: 12.5px; width: fit-content; margin-inline-start: 40px; }
.fd-back.cur { border-color: var(--orange); color: var(--orange); background: var(--orange-bg); }
.fd-back.done { border-color: var(--good); color: var(--good); }
.fd-end { padding: 6px 14px; border-radius: 999px; border: 2px solid #e05a5a; background: #fde8e8; color: #b42318; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.fd-end.done { box-shadow: 0 0 0 4px rgba(224, 90, 90, .25); }
.fd-live { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding-top: 8px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.gn { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #f5dc9a, var(--gold-2)); color: #4a3608; display: grid; place-items: center; font-weight: 800; }
.tbl.guide td { vertical-align: middle; }
.tbl.guide td b { display: block; }
.path { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--accent-h); background: var(--accent-soft); padding: 3px 9px; border-radius: 8px; white-space: nowrap; }

/* ------------------------------------------------------ narrow screens */
@media (max-width: 1380px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .designer { grid-template-columns: 190px minmax(0, 1fr) 270px; } .rtypes { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1180px) {
  .s-search { display: none; } .s-app { display: none; }
  .g-cv, .g-dv, .g-2-1, .compose, .designer, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
  .viewer, .preview, .pal, .insp { position: static; }
  .src { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); } .hero-logo { display: none; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .s-chip, .s-div { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lib, .sres { grid-template-columns: minmax(0, 1fr); } .tree, .sfilt { position: static; max-height: 260px; }
  .ocrrun, .ocrres, .classify, .editor, .sign, .drd { grid-template-columns: minmax(0, 1fr); }
  .crow { grid-template-columns: auto minmax(0, 1fr) auto; } .crow-stage { display: none; }
  .g-2, .g-3, .g-4, .sidle, .cmp, .frow3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --top-h: 56px; }
  .s-mob { display: grid; }
  .s-bw small, .s-pt { display: none; }
  .s-top { gap: 6px; padding-inline: 8px; }
  .s-tools .s-ibtn:nth-child(3) { display: none; }
  .s-body, .s-body.collapsed { grid-template-columns: minmax(0, 1fr); }
  .s-rail { display: none; }
  .s-side { position: fixed; top: var(--top-h); bottom: 0; inset-inline-start: 0; width: min(290px, 86vw); z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--sh-pop); visibility: visible !important; }
  [dir="rtl"] .s-side { transform: translateX(100%); }
  body.side-open .s-side { transform: none; }
  .page { padding: 14px 16px 30px; gap: 12px; }
  .ph-t h1 { font-size: 19px; } .ph-t { min-width: 0; }
  .hero { padding: 20px; } .hero h1 { font-size: 23px; }
  .kpis, .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .rtypes, .pgrid, .src, .mini, .dn-box, .sgtype, .cu-g { grid-template-columns: minmax(0, 1fr); }
  .cu-g > div + div { border-inline-start: 0; border-top: 1px solid var(--line); }
  .board, .board.three { grid-template-columns: repeat(6, 82vw); }
  .board.three { grid-template-columns: repeat(3, 82vw); }
  .hide-s { display: none; }
  .coach { inset-inline-end: 8px; bottom: 8px; }
  .sr { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
  .tbl { font-size: 12.5px; } .tbl th, .tbl td { padding: 8px 10px; }
  .card.flush { overflow-x: auto; }
  .letter, .certdoc { padding: 18px 16px; font-size: 15px; }
  .lh-r { display: none; }
  .ghero { flex-direction: column; align-items: flex-start; } .ghero > img { display: none; }
  .fsearch { min-width: 0; max-width: none; }
  .paper { padding: 20px; font-size: 14px; }
  .cif input { width: 100%; }
  .hb { grid-template-columns: minmax(70px, 110px) 1fr auto; }
}

@media (max-width: 420px) { .s-bw { display: none; } }

/* ------------------------------------------------------------- print */

/* Sign-in */
.lg { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--page); overflow-y: auto; }
.lg-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px 56px; color: var(--navy); background:
  radial-gradient(70% 60% at 100% 0%, color-mix(in srgb, var(--gold) 16%, transparent) 0%, transparent 70%),
  radial-gradient(60% 50% at 0% 100%, color-mix(in srgb, var(--navy) 7%, transparent) 0%, transparent 70%),
  linear-gradient(160deg, #fbf8f1 0%, #f4efe4 100%); border-inline-end: 1px solid var(--line); overflow: hidden; }
.lg-art::after { content: ""; position: absolute; inset: auto -140px -180px auto; width: 440px; height: 440px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); box-shadow: 0 0 0 56px color-mix(in srgb, var(--gold) 5%, transparent), 0 0 0 130px color-mix(in srgb, var(--gold) 3%, transparent); pointer-events: none; }
.lg-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.lg-brand img { width: 46px; height: 46px; object-fit: contain; background: #fff; border-radius: 12px; padding: 5px; box-shadow: 0 2px 8px rgba(12, 26, 48, .08), 0 0 0 1px var(--line); }
.lg-brand b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--navy); }
.lg-brand small { color: #9a7524; font-size: 12px; font-weight: 600; }
.lg-pitch { max-width: 470px; position: relative; z-index: 1; }
.lg-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9a7524; background: color-mix(in srgb, var(--gold) 14%, #fff); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); padding: 5px 10px; border-radius: 999px; margin-bottom: 16px; }
.lg-pitch h1 { font-size: clamp(24px, 2.3vw, 30px); line-height: 1.25; font-weight: 700; letter-spacing: -.02em; margin: 0 0 22px; color: var(--navy); }
.lg-pitch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lg-pitch li { display: flex; gap: 12px; align-items: center; font-size: 14px; color: #3b4a5e; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.lg-pitch li svg { flex: none; color: var(--navy); background: color-mix(in srgb, var(--gold) 16%, #fff); border-radius: 8px; padding: 6px; box-sizing: content-box; }
.lg-art-foot { font-size: 12px; color: #6b7686; position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; }
.lg-panel { background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px 20px; position: relative; min-height: 100%; }
.lg-tools { position: absolute; top: 18px; inset-inline-end: 20px; }
.lg-card { width: min(390px, 100%); background: var(--sheet); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 32px rgba(12, 26, 48, .08), 0 2px 6px rgba(12, 26, 48, .04); padding: 34px 32px 26px; display: flex; flex-direction: column; gap: 16px; margin: auto 0; }
.lg-logo { display: none; width: 56px; height: 56px; object-fit: contain; }
.lg-card h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.lg-sub { margin: -10px 0 4px; color: var(--text-3); font-size: 13.5px; }
.lg-f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.lg-in { display: flex; align-items: center; gap: 10px; height: 44px; padding-inline: 14px 6px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--sheet); color: var(--text-3); transition: border-color .15s, box-shadow .15s; }
.lg-in:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); color: var(--navy); }
.lg-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; font-weight: 500; color: var(--text); height: 100%; }
.lg-eye { border: 0; background: transparent; color: var(--text-3); width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; }
.lg-eye:hover { background: var(--line); color: var(--text); }
.lg-go { margin-top: 6px; height: 46px; border: 0; border-radius: 12px; background: linear-gradient(180deg, var(--navy), var(--navy-2)); color: #fff; font: inherit; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; box-shadow: 0 6px 18px color-mix(in srgb, var(--navy) 30%, transparent); transition: transform .1s, box-shadow .15s; }
.lg-go:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 45%, transparent), 0 8px 22px color-mix(in srgb, var(--navy) 35%, transparent); }
.lg-go:active { transform: translateY(1px); }
.lg-err { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #c0392b 10%, var(--sheet)); color: #b03023; font-size: 13px; font-weight: 600; animation: lg-shake .35s; }
@keyframes lg-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.lg-note { display: flex; gap: 6px; align-items: center; margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.lg-foot { margin-top: 18px; font-size: 12px; color: var(--text-3); text-align: center; }
.lg-foot b { color: var(--navy); font-weight: 600; }
[data-theme=dark] .lg-foot b, [data-theme=dark] .lg-in:focus-within { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .lg-foot b, :root:not([data-theme=light]) .lg-in:focus-within { color: var(--gold); } }
.dd-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.dd-out { color: #b03023; }
@media (max-width: 900px) {
  .lg { grid-template-columns: 1fr; }
  .lg-art { display: none; }
  .lg-logo { display: block; }
  .lg-card { padding: 28px 22px 22px; }
}

@media print {
  body { overflow: visible; background: #fff; }
  #app { height: auto; display: block; }
  .s-top, .s-rail, .s-side, .coach, .foot, .actbar, .banner, .ph-a, .filters, .vw-bar, .toast { display: none !important; }
  .s-body { display: block; } .s-main { overflow: visible; }
  .card { box-shadow: none; break-inside: avoid; }
}
body.print-only { overflow: visible; background: #fff; padding: 20px; }
body.print-only .letter { border: 0; box-shadow: none; max-width: 760px; margin: 0 auto; }

[data-theme=dark] .lg-panel { background: var(--page); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .lg-panel { background: var(--page); } }
