/* Ctrl Z dashboard — redesign 2026-09-27.
   A warm off-white studio look: side rail with icons, soft cards, bronze accent from the Z, Jost / Cormorant.
   Dark theme keeps the same layout on dark grey. Printed documents stay white. */
:root {
  --porcelain: #FFFFFF; --card: #FFFFFF; --on-ink: #FFFFFF; --page: #F5F3EE; --ink: #16171B; --gilt: #BE9756; --mist: #E4E1DA; --line: #E9E6DF; --muted: #6C7079;
  --s1: #B8865A; --s1-deep: #8A5F36; --s1-soft: #F3E9DC; --s2: #E0703A; --s3: #1FA36B;
  --ok: #157A46; --ok-bg: #E3F4EA; --warn: #9A5B00; --warn-bg: #FFF1D6; --bad: #B42318; --bad-bg: #FDE8E6; --info: #8A5F36; --info-bg: #F3E9DC; --mute-bg: #EFEDE7;
  --display: "Cormorant Garamond", Georgia, serif; --ui: "Jost", "Segoe UI", Arial, sans-serif;
  --radius: 16px; --radius-sm: 11px; --gutter: 16px;
  --shadow: 0 1px 2px rgba(22,23,27,.04), 0 8px 24px -12px rgba(22,23,27,.10);
  --shadow-lg: 0 20px 50px -20px rgba(22,23,27,.28);
  --side: 236px;
}
html[lang="ar"] { --ui: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif; --display: "Amiri", "Traditional Arabic", serif; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--ui); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-family: var(--display); font-weight: 600; font-size: 36px; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; margin: 12px 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .grow { flex: 1; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.pre { white-space: pre-wrap; }
.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-bad { color: var(--bad); }
.container { padding-inline: var(--gutter); max-width: 1320px; margin: 0 auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--ink); background: var(--ink); color: var(--on-ink); font-weight: 500; text-decoration: none; white-space: nowrap; transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease; }
.btn:hover { box-shadow: 0 6px 16px -8px rgba(22,23,27,.5); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--mist); }
.btn-ghost:hover { border-color: var(--ink); box-shadow: none; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-accent { background: var(--s1); border-color: var(--s1); color: #fff; }
.btn-accent:hover { background: var(--s1-deep); border-color: var(--s1-deep); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--s1-deep); text-decoration: underline; text-underline-offset: 2px; }
.linkbtn.danger { color: var(--bad); }
.linkbtn:disabled { color: var(--muted); text-decoration: none; }
.lnk { color: var(--s1-deep); text-decoration: none; font-weight: 500; }
.lnk:hover { text-decoration: underline; }
.icon-btn { width: 40px; height: 40px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--card); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font-size: 13px; font-weight: 500; color: var(--muted); padding: 6px 12px; border-radius: 999px; min-height: 32px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.pill { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; margin-inline-start: 6px; text-align: center; }

/* ---------- shell: side rail + top bar ---------- */
.side { display: none; }
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--page) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.top-inner { display: flex; align-items: center; gap: 8px; min-height: 60px; padding-inline: var(--gutter); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.top .brand { display: flex; }
.who { display: none; }
.search-btn { display: none; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 14px; min-width: 260px; }
.search-btn:hover { border-color: var(--ink); color: var(--ink); }
.search-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.search-btn kbd { margin-inline-start: auto; font: 11px/1 var(--ui); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; color: var(--muted); }
.alerts-btn, .top .theme-btn, #refreshBtn, #signOut { border-radius: 999px; }
.alerts-btn.on { border-color: var(--ink); }
.alerts-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: none; padding: 4px var(--gutter) 10px; }
.nav-open .nav { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; color: var(--muted); }
.nav a svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a.on { background: var(--s1-soft); color: var(--s1-deep); }
.side-foot { display: none; }
.is-demo .top { border-bottom: 2px solid var(--gilt); }
.due-bar { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-bottom: 1px solid var(--gilt); background: var(--warn-bg); color: var(--ink); padding: 10px 16px; font: inherit; cursor: pointer; text-align: start; }
.due-bar[hidden] { display: none; }
.due-bar:hover { filter: brightness(.97); }
.due-bar svg { width: 18px; height: 18px; flex: none; color: var(--gilt); }
.due-bar b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.due-bar .due-go { color: var(--gilt); font-weight: 600; white-space: nowrap; }
/* phones: a bottom tab bar */
.tabbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: grid; grid-auto-flow: column; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: grid; justify-items: center; gap: 2px; text-decoration: none; font-size: 11px; color: var(--muted); padding: 4px 0; border-radius: 10px; }
.tabbar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--s1-deep); }
@media (min-width: 900px) {
  .menu-btn, .tabbar, .top .brand { display: none; }
  .who { display: inline; }
  .search-btn { display: inline-flex; }
  .side { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: var(--side); background: var(--card); border-inline-end: 1px solid var(--line); padding: 18px 14px 16px; z-index: 31; }
  .side .brand { padding: 4px 10px 18px; }
  .nav { display: flex; flex-direction: column; gap: 3px; padding: 0; }
  .nav a { padding: 11px 12px; border-radius: 12px; white-space: nowrap; position: relative; }
  .nav a:hover { background: var(--page); color: var(--ink); }
  .nav a.on { background: var(--s1-soft); color: var(--s1-deep); font-weight: 600; }
  .nav a.on::before { content: ""; position: absolute; inset-inline-start: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--s1); }
  .side-foot { display: grid; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
  .side-foot .seg { width: 100%; } .side-foot .seg button { flex: 1; }
  .side-row { display: flex; gap: 6px; align-items: center; }
  .side-row .btn { flex: 1; }
  .top, .due-bar, #app .view { margin-inline-start: var(--side); }
  .due-bar { width: calc(100% - var(--side)); }
  .top-inner { padding-inline: 28px; }
  #app .view { max-width: none; padding-inline: 28px; }
}
@media (max-width: 899px) {
  #app .view { padding-bottom: 96px; }
  /* one-row top bar: the bell keeps its badge, the words and the refresh button go */
  .alerts-btn .alerts-label, #refreshBtn { display: none; }
  .alerts-btn { width: 40px; padding: 0; } .alerts-btn .pill { position: absolute; top: -6px; inset-inline-end: -6px; margin: 0; } .alerts-btn { position: relative; }
  .top-inner { flex-wrap: nowrap; }
  /* stat cards: smaller numbers and tint so the money fits on one line */
  .kpi { padding: 14px 12px; } .kpi b { font-size: 19px; letter-spacing: -.02em; } .kpi::after { width: 70px; height: 70px; inset-inline-end: -26px; top: -26px; } .kpi-ico { width: 30px; height: 30px; inset-inline-end: 10px; top: 10px; } .kpi-ico svg { width: 16px; height: 16px; } .kpi-ico + .kpi-l { padding-inline-end: 34px; }
  h1 { font-size: 32px; }
  /* table cards: the name is the card title; chips stay their own size; button cells sit side by side */
  .tbl-scroll .tbl td:first-child { grid-template-columns: 1fr; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .tbl-scroll .tbl td:first-child::before { content: none; }
  .tbl-scroll .tbl td > * { justify-self: start; }
  .tbl-scroll .tbl td .ybar { width: 100%; }
  .tbl-scroll .tbl td[data-label=""] { display: inline-grid; grid-template-columns: 1fr; width: auto; margin: 8px 10px 2px 0; padding: 0; vertical-align: middle; }
  .tbl-scroll .tbl td[data-label=""]::before { content: none; }
  .tbl-scroll .tbl td[data-label=""] .row-btns { justify-content: flex-start; }
  .cell-client { min-width: 0; }
  .modal-head h2 { font-size: 22px; }
  /* the menu button opens the side rail as a drawer */
  .nav-open .side { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: 272px; background: var(--card); padding: 18px 14px 16px; z-index: 50; box-shadow: var(--shadow-lg); animation: slideIn .18s ease-out; }
  .nav-open .side .nav { display: flex; flex-direction: column; gap: 3px; padding: 0; }
  .nav-open .side .side-foot { display: grid; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
  .nav-open .side .side-row { display: flex; gap: 6px; } .nav-open .side .side-row .btn { flex: 1; }
  .nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(22,23,27,.4); z-index: 49; }
  @keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (max-width: 520px) { .top-inner { padding-bottom: 6px; flex-wrap: wrap; } }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); background: radial-gradient(1200px 600px at 20% -10%, var(--s1-soft), transparent 60%), var(--page); }
.login-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow-lg); }
.login-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.login h1 { margin-bottom: 16px; }

/* layout */
.view { padding-top: 20px; padding-bottom: 60px; animation: fadeUp .28s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; max-width: 70ch; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--s1-deep); font-weight: 600; margin-bottom: 4px; }
html[lang="ar"] .eyebrow { letter-spacing: 0; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.actions.wrap { flex-wrap: wrap; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 14px; background: var(--card); min-width: 0; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2 { font-size: 17px; }
.panel-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
.grid-2 > .panel { margin-top: 0; }
@media (min-width: 1000px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 0; }
html[lang="ar"] .sec { letter-spacing: 0; }
.banner { background: var(--warn-bg); border: 1px solid #F3D9A4; border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 12px; }
.banner.bad { background: var(--bad-bg); border-color: #F5C2BC; }
.banner.demo { background: #FBF4E8; border-color: var(--gilt); }
.banner.ok { background: var(--ok-bg); border-color: #BFE3C6; color: var(--ink); }
.banner.warn { background: var(--warn-bg); color: var(--ink); }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }
.note { background: var(--page); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.stack { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.row { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }

/* ---------- stat cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.kpi { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; align-content: start; text-align: start; min-width: 0; box-shadow: var(--shadow); overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset-inline-end: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--kpi-tint, var(--s1-soft)); opacity: .7; }
button.kpi { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
button.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-l { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; letter-spacing: .02em; }
.kpi b { font-size: 26px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; position: relative; }
.kpi small { color: var(--muted); font-size: 12.5px; }
.kpi-ico { position: absolute; inset-inline-end: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--kpi-tint, var(--s1-soft)); color: var(--kpi-fg, var(--s1-deep)); z-index: 1; }
.kpi-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.kpi-ico + .kpi-l { padding-inline-end: 42px; }   /* the label wraps before the icon instead of running under it */
.kpi-warn { --kpi-tint: var(--warn-bg); --kpi-fg: var(--warn); } .kpi-bad { --kpi-tint: var(--bad-bg); --kpi-fg: var(--bad); } .kpi-ok { --kpi-tint: var(--ok-bg); --kpi-fg: var(--ok); }
.kpi-ad-tk { --kpi-tint: #FFE4EA; --kpi-fg: #EE1D52; } .kpi-ad-ig { --kpi-tint: #FBE3EE; --kpi-fg: #D62976; } .kpi-ad-gg { --kpi-tint: #E3EDFD; --kpi-fg: #4285F4; }
.tip { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--muted); font-size: 10px; color: var(--muted); cursor: help; flex: none; }
.chg { font-size: 12px; } .chg.up { color: var(--ok); } .chg.down { color: var(--bad); }

/* ---------- "needs your attention" list on the overview ---------- */
.attn { display: grid; gap: 6px; }
.attn-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; background: none; text-align: start; text-decoration: none; color: inherit; width: 100%; transition: background .12s ease, border-color .12s ease; }
.attn-row:hover { background: var(--page); border-color: var(--line); }
.attn-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.attn-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.attn-ico.bad { background: var(--bad-bg); color: var(--bad); } .attn-ico.warn { background: var(--warn-bg); color: var(--warn); } .attn-ico.ok { background: var(--ok-bg); color: var(--ok); } .attn-ico.info { background: var(--s1-soft); color: var(--s1-deep); }
.attn-t { font-weight: 600; } .attn-s { font-size: 13px; color: var(--muted); }
.attn-n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.attn-go { color: var(--muted); font-size: 18px; }
.attn-clear { display: grid; justify-items: center; gap: 6px; padding: 26px 10px; color: var(--muted); text-align: center; }
.attn-clear .big { font-size: 34px; }

/* the year progress bar in the clients table and on the client page */
.ybar { display: grid; gap: 5px; min-width: 150px; }
.ybar-track { height: 6px; border-radius: 4px; background: var(--mute-bg); overflow: hidden; }
.ybar-fill { height: 100%; border-radius: 4px; background: var(--s3); transition: width .6s ease; }
.ybar.warn .ybar-fill { background: #F0A32B; } .ybar.bad .ybar-fill { background: var(--bad); } .ybar.mute .ybar-fill { background: var(--muted); }
.ybar-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.ybar-l b { color: var(--ink); font-weight: 600; }

/* client page header */
.client-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-family: var(--display); font-size: 26px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #D9B27A, #8A5F36); flex: none; }

/* chips and countdowns: color + icon + words */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip-i { font-size: 10px; font-weight: 700; }
.tone-ok { background: var(--ok-bg); color: var(--ok); } .tone-warn { background: var(--warn-bg); color: var(--warn); } .tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-info { background: var(--info-bg); color: var(--info); } .tone-mute { background: var(--mute-bg); color: var(--muted); }
.cd { font-size: 12px; font-weight: 500; background: none !important; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- tables: cards on phones, a table on wider screens ---------- */
.tbl-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.input, .tbl-tools select, .tbl-tools input { min-height: 40px; border: 1px solid var(--mist); border-radius: 10px; padding: 0 12px; background: var(--card); max-width: 100%; }
.tbl-tools .search { flex: 1 1 200px; }
.tbl-tools select { flex: 0 1 auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.tbl th { font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; letter-spacing: .06em; text-transform: uppercase; }
html[lang="ar"] .tbl th { letter-spacing: 0; text-transform: none; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--s1-soft) 55%, transparent); }
.tbl .num { text-align: end; padding-inline-end: 28px; }
.tbl .nowrap { white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-inline-start: 10px; }
.th-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.sort-i { font-size: 9px; }
.tbl-foot { padding-top: 8px; }
.row-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); } html[dir="rtl"] .row-bad td:first-child { box-shadow: inset -3px 0 0 var(--bad); }
.row-warn td:first-child { box-shadow: inset 3px 0 0 #eda100; } html[dir="rtl"] .row-warn td:first-child { box-shadow: inset -3px 0 0 #eda100; }
.empty { color: var(--muted); padding: 22px 0; text-align: center; }
.tbl.compact th, .tbl.compact td { padding: 6px; }
@media (max-width: 899px) {
  .tbl-scroll .tbl thead { display: none; }
  .tbl-scroll .tbl, .tbl-scroll .tbl tbody, .tbl-scroll .tbl tr, .tbl-scroll .tbl td { display: block; width: 100%; }
  .tbl-scroll .tbl tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px 10px; background: var(--card); }
  .tbl-scroll .tbl td { border: 0; padding: 5px 0; display: grid; grid-template-columns: 40% minmax(0, 1fr); gap: 8px; text-align: start; }
  .tbl-scroll .tbl td::before { content: attr(data-label); font-size: 12px; color: var(--muted); }
  .tbl-scroll .tbl td.num { text-align: start; }
  .row-bad, .row-warn { border-inline-start-width: 4px !important; }
  .row-bad { border-inline-start-color: var(--bad) !important; } .row-warn { border-inline-start-color: #eda100 !important; }
  .row-bad td:first-child, .row-warn td:first-child { box-shadow: none !important; }
}
@media (min-width: 900px) { .tbl-scroll { overflow-x: auto; } }

/* action menu */
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; z-index: 20; inset-inline-end: 0; top: calc(100% + 6px); min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; animation: fadeUp .14s ease-out; }
.menu-list button { display: block; width: 100%; text-align: start; border: 0; background: none; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--page); }

/* ---------- forms and dialogs ---------- */
.field { display: grid; gap: 4px; margin-bottom: 10px; min-width: 0; }
.field label { font-size: 13px; font-weight: 500; }
.field input, .field select, .field textarea, .form input:not([type=checkbox]):not([type=radio]):not([type=file]), .msg { width: 100%; min-height: 42px; border: 1px solid var(--mist); border-radius: 10px; padding: 8px 12px; background: var(--card); transition: border-color .12s ease, box-shadow .12s ease; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--s1); box-shadow: 0 0 0 3px var(--s1-soft); }
.field textarea { min-height: 60px; }
.field [aria-invalid] { border-color: var(--bad); }
.help { color: var(--muted); font-size: 12px; } .err { color: var(--bad); font-size: 12px; } .err:empty { display: none; }
.req { color: var(--bad); }
.form-error { color: var(--bad); min-height: 0; margin: 6px 0; } .form-error:empty { display: none; }
.form-foot { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--s1); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 2px; margin: 0 0 10px; }
legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.has-modal { overflow: hidden; }
.modal-wrap { position: fixed; inset: 0; background: rgba(22,23,27,.45); backdrop-filter: blur(3px); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal-panel { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg); animation: fadeUp .18s ease-out; }
.modal-panel.wide { max-width: 980px; }
@media (min-width: 700px) { .modal-wrap { align-items: center; padding: 20px; } .modal-panel { border-radius: 20px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.modal-head h2 { font-size: 19px; font-family: var(--display); font-size: 24px; }
.modal-body { padding: 18px 20px; }
.preview-box { background: var(--page); border-radius: 10px; padding: 10px; margin-top: 10px; }
.lines { display: grid; gap: 8px; }
.line-row { display: grid; gap: 8px; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
@media (min-width: 760px) { .line-row { grid-template-columns: 3fr 1fr 1.3fr 1.2fr 2fr auto; align-items: end; } .line-row .field { margin: 0; } }
.line-type { display: grid; gap: 4px; }
.line-note { align-self: center; }
.alloc { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.alloc-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 8px; align-items: center; padding: 4px 0; font-size: 14px; }
.msg { margin: 8px 0; font-size: 14px; }

/* command palette (Ctrl+K): jump to a client */
.palette { padding: 0; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 20px; font-size: 17px; background: transparent; outline: none; }
.palette-list { max-height: 50vh; overflow: auto; padding: 8px; }
.palette-list button { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 10px; text-align: start; }
.palette-list button:hover, .palette-list button.sel { background: var(--page); }
.palette-list .avatar { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
.palette-hint { padding: 8px 16px 12px; font-size: 12px; color: var(--muted); }

.toast { position: fixed; inset-inline: 16px; bottom: 16px; margin: 0 auto; max-width: 480px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--on-ink); z-index: 90; opacity: 0; transform: translateY(20px); transition: .2s; pointer-events: none; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: none; }
.toast.tone-bad { background: var(--bad); color: #fff; }
@media (max-width: 899px) { .toast { bottom: 86px; } }

/* detail pages */
.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; overflow-wrap: anywhere; }
.checklist { list-style: none; margin: 0; padding: 0; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.timeline li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.tl-d { color: var(--muted); font-size: 13px; white-space: nowrap; }
.doms { margin-top: 10px; display: grid; gap: 6px; font-size: 14px; }
.dom { background: var(--page); padding: 8px 10px; border-radius: 8px; }
.files { margin: 0 0 10px; padding-inline-start: 18px; }
.summary p { font-size: 15px; }
.rules ul { margin: 0 0 10px; padding-inline-start: 18px; font-size: 14px; }
.logo-prev { max-height: 48px; width: auto; align-self: center; }
.period-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.custom-range { display: flex; gap: 6px; align-items: center; }
.filters-row { display: flex; flex-wrap: wrap; gap: 12px; }
.filters-row label { display: grid; gap: 4px; font-size: 13px; }
.report-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.year-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; }

/* ---------- charts ---------- */
.chart-box { margin: 0; }
.chart-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.chart-head figcaption b { font-size: 16px; }
.chart-extra { margin-inline-start: auto; }
.chart-foot { display: flex; justify-content: flex-end; margin-top: 4px; } .chart-extra .seg button { min-height: 28px; padding: 4px 10px; font-size: 12px; }
.chart-plot { position: relative; }
.chart { width: 100%; height: auto; direction: ltr; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; } .chart .base { stroke: #C9C5BC; stroke-width: 1; }
.chart .ax { font-size: 11px; fill: var(--muted); font-family: var(--ui); }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: grow .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .chart .bar, .view, .modal-panel, .menu-list { animation: none; } }
.chart .line { fill: none; stroke-width: 2; } .chart .line.s3 { stroke: var(--s3); }
.chart .dot { stroke: #fff; stroke-width: 2; } .chart .dot.s3 { fill: var(--s3); }
.chart .hit { fill: transparent; cursor: pointer; outline: none; } .chart .hit:hover, .chart .hit:focus { fill: rgba(22,23,27,.05); }
.chart-tip { position: absolute; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow-lg); pointer-events: none; white-space: nowrap; z-index: 5; }
.tip-title { font-weight: 600; margin-bottom: 2px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; margin-bottom: 4px; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); } .sw.s3 { background: var(--s3); }
.sw.tk { background: linear-gradient(135deg, #25F4EE, #FE2C55); } .sw.ig { background: linear-gradient(135deg, #F58529, #DD2A7B, #8134AF); } .sw.gg { background: linear-gradient(135deg, #4285F4, #34A853); }
.sw-line { height: 3px; border-radius: 2px; }
.chart .gs.s1 { stop-color: var(--s1); stop-opacity: 1; } .chart .ge.s1 { stop-color: var(--s1); stop-opacity: .45; }
.chart .gs.s2 { stop-color: var(--s2); stop-opacity: 1; } .chart .ge.s2 { stop-color: var(--s2); stop-opacity: .45; }
.chart .gs.s3 { stop-color: var(--s3); stop-opacity: 1; } .chart .ge.s3 { stop-color: var(--s3); stop-opacity: .45; }
.chart .gs.tk { stop-color: #25F4EE; stop-opacity: 1; } .chart .ge.tk { stop-color: #FE2C55; stop-opacity: .9; }
.chart .gs.ig { stop-color: #F58529; stop-opacity: 1; } .chart .ge.ig { stop-color: #8134AF; stop-opacity: .9; }
.chart .gs.gg { stop-color: #4285F4; stop-opacity: 1; } .chart .ge.gg { stop-color: #34A853; stop-opacity: .9; }
.chart .val { font-size: 11px; font-weight: 600; fill: var(--ink); font-family: var(--ui); }
.hbars { display: grid; gap: 6px; }
.hb-row { display: grid; grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; background: none; border: 0; padding: 4px 0; text-align: start; font-size: 13px; }
button.hb-row:hover .hb-l { text-decoration: underline; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { position: relative; height: 14px; background: var(--page); border-radius: 4px; }
.hb-track.two::after { content: ""; position: absolute; inset-block: -2px; inset-inline-start: 50%; width: 1px; background: #B8BEC7; }
.hb-track i { position: absolute; inset-block: 0; border-radius: 4px; background: var(--s1); }
.hb-track i.s2 { background: var(--s2); } .hb-track i.neg { background: var(--bad); }
.hb-v { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* "Show as table" under a graph */
.chart-table { padding: 4px 0 2px; }
.month-tbl { width: 100%; max-width: 100%; border-collapse: collapse; font-size: 13.5px; }
.month-tbl th, .month-tbl td { padding: 8px 12px; }
.month-tbl thead th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--line); }
.month-tbl thead th.num, .month-tbl td.num, .month-tbl tfoot td.num { text-align: end; font-variant-numeric: tabular-nums; }
.month-tbl tbody th { font-weight: 500; color: var(--muted); text-align: start; width: 34%; }
.month-tbl tbody tr:nth-child(even) th, .month-tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--line) 28%, transparent); }
.month-tbl tbody td.num { font-weight: 600; }
.month-tbl tfoot th, .month-tbl tfoot td { border-top: 2px solid var(--line); font-weight: 700; padding-top: 10px; }

/* calendar (unused pages keep working) */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-cell { background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-height: 88px; padding: 4px; display: grid; align-content: start; gap: 2px; min-width: 0; }
.cal-cell.empty { background: transparent; border: 0; }
.cal-cell.today { border-color: var(--ink); }
.cal-d { font-size: 12px; font-weight: 600; }
.cal-item { display: block; font-size: 11px; line-height: 1.3; padding: 2px 4px; border-radius: 4px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-title { align-self: center; padding: 0 6px; }
.cal-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.cal-list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 700px) { .cal { display: none; } }

/* ---------- documents (invoice, receipt, statement, reports): A4, English or Arabic ---------- */
.doc-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.doc-preview { background: var(--page); padding: 12px; border-radius: 10px; overflow: auto; }
.doc-inline { overflow: auto; }
.doc { width: 190mm; max-width: 100%; margin: 0 auto; background: #fff; color: #111; padding: 12mm; font-family: "Jost", "Segoe UI", Arial, sans-serif; font-size: 11.5px; line-height: 1.45; position: relative; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.doc[lang="ar"] { font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif; font-size: 12px; }
.doc-inline .doc { box-shadow: none; border: 1px solid var(--line); }
.doc-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 14px; }
.doc-co { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.doc-logo { max-height: 44px; max-width: 120px; width: auto; }
.doc-co-name { font-size: 16px; font-weight: 600; }
.doc-small { font-size: 10.5px; color: #555; overflow-wrap: anywhere; }
.doc-title { text-align: end; flex: none; }
.doc-h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 26px; font-weight: 600; line-height: 1.4; margin-bottom: 2px; }
.doc[lang="ar"] .doc-h1 { font-family: "Amiri", "Traditional Arabic", serif; }
.doc-internal { margin-top: 6px; font-size: 10px; font-weight: 700; color: var(--bad); border: 1px solid var(--bad); padding: 2px 6px; border-radius: 4px; display: inline-block; }
.doc-stamp { display: inline-block; margin-top: 8px; font-weight: 700; font-size: 13px; letter-spacing: .06em; border: 2px solid; padding: 2px 10px; border-radius: 6px; }
.stamp-paid { color: #0a7d0a; } .stamp-overdue { color: #B42318; } .stamp-void { color: #666; } .stamp-draft { color: #666; } .stamp-partially_paid { color: #9a5b00; } .stamp-issued { color: #184f95; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.doc-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #666; margin-bottom: 4px; font-weight: 600; }
.doc[lang="ar"] .doc-label { letter-spacing: 0; font-size: 11px; }
.doc-strong { font-weight: 600; font-size: 13px; }
.doc-kv { border-collapse: collapse; width: 100%; }
.doc-kv th { text-align: start; font-weight: 500; color: #555; padding: 3px 8px 3px 0; vertical-align: top; width: 48%; }
.doc-kv td { text-align: end; padding: 3px 0; overflow-wrap: anywhere; }
.doc-table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; table-layout: auto; }
.doc-table th { background: #111; color: #fff; text-align: start; padding: 6px 7px; font-weight: 600; font-size: 10.5px; }
.doc-table td { padding: 6px 7px; border-bottom: 1px solid #E3E6EB; vertical-align: top; overflow-wrap: anywhere; }
.doc-table .num { text-align: end; white-space: nowrap; }
.doc-table .nowrap { white-space: nowrap; }
.doc-table tfoot td { border-top: 2px solid #111; font-weight: 600; background: #F4F6F9; }
.doc-totals { width: 60%; margin-inline-start: auto; }
.doc-box { border: 1px solid #E3E6EB; border-radius: 6px; padding: 8px 10px; margin-top: 10px; }
.doc-lead { font-size: 14px; margin: 6px 0 12px; }
.doc-foot { margin-top: 18px; padding-top: 8px; border-top: 1px solid #E3E6EB; font-size: 10.5px; color: #555; }
.avoid-break { page-break-inside: avoid; break-inside: avoid; }
.pdf-host { position: absolute; inset-inline-start: -10000px; top: 0; width: 210mm; }
.pdf-host .doc { box-shadow: none; width: 190mm; padding: 0; }
@media (max-width: 700px) { .doc { padding: 16px; font-size: 11px; } .doc-grid { grid-template-columns: 1fr; } .doc-totals { width: 100%; } .doc-head { flex-direction: column; } .doc-title { text-align: start; } }
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff; }
  #print-root .doc { width: auto; padding: 0; box-shadow: none; margin: 0; }
  .doc-table thead { display: table-header-group; }
  .doc-table tr { break-inside: avoid; }
}

/* folded extra sections */
.more > summary { cursor: pointer; padding: 2px 0; }
.more[open] > summary { margin-bottom: 10px; }

/* Ctrl Z wordmark (inline SVG, drawn with the page font) */
.wordmark { display: block; height: 40px; width: auto; color: var(--ink); }
.wordmark-lg { height: 60px; }
.wordmark-sm { height: 32px; }
.brand .wordmark { direction: ltr; }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .sun { display: none; }
html[data-theme="dark"] .theme-btn .sun { display: block; }
html[data-theme="dark"] .theme-btn .moon { display: none; }

/* ---------- clients table pieces ---------- */
.cell-client { display: grid; gap: 2px; min-width: 180px; }
.cell-client a { font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: -0.01em; text-decoration: none; }
.cell-client a:hover { color: var(--s1-deep); }
.cell-end b { font-weight: 600; }
.cell-price { font-size: 15px; font-variant-numeric: tabular-nums; }
.cell-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-btns { display: flex; gap: 6px; justify-content: flex-end; }
/* brand buttons: WhatsApp green, GitHub black, website blue; the icon is the real mark in white */
.brand-btn { width: 40px; height: 36px; padding: 0; border: 0; border-radius: 10px; color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: transform .12s ease, filter .12s ease, box-shadow .12s ease; }
.brand-btn svg { width: 20px; height: 20px; }
.brand-btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 4px 12px rgba(0,0,0,.22); color: #fff; }
.wa-btn { background: linear-gradient(180deg, #34D96F 0%, #1EBE57 100%); }
.gh-btn { background: linear-gradient(180deg, #3A3F46 0%, #1B1F24 100%); }
.gh-btn svg { width: 21px; height: 21px; }
.site-btn { background: linear-gradient(180deg, #3B8BEA 0%, #1F63C6 100%); }
.site-btn svg { width: 19px; height: 19px; }

/* extra work */
.cell-task { display: grid; gap: 2px; min-width: 150px; max-width: 260px; }
.cell-client-sm { min-width: 0; } .cell-client-sm a { font-size: 15px; }
.cell-task b { font-size: 15px; }
.cell-task .small { white-space: normal; }
.done-btn { background: var(--s3); border-color: var(--s3); color: #fff; }
.done-btn:hover { filter: brightness(1.08); }

/* ads: the platform's real mark in its own colours on a small tile */
.ad-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.pf-icon { width: 22px; height: 22px; flex: none; }
.pf-icon .tt-main { fill: #111; }

/* ---------- dark theme (the moon button; saved in this browser) ---------- */
html[data-theme="dark"] {
  --page: #0F1115; --card: #171A21; --porcelain: #171A21; --ink: #F3F4F6; --on-ink: #111111; --line: #262B35; --mist: #2A2F3A; --muted: #9AA0AA; --mute-bg: #232833;
  --s1: #C9A063; --s1-deep: #E0BC84; --s1-soft: #2E2416; --info: #E0BC84; --info-bg: #2E2416;
  --ok: #5FD38A; --ok-bg: #12331F; --warn: #F2B955; --warn-bg: #3A2A0A; --bad: #FF7B6E; --bad-bg: #3A1512;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5); --shadow-lg: 0 20px 50px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}
html[data-theme="dark"] .btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .btn-ghost:hover { border-color: var(--ink); }
html[data-theme="dark"] .btn-accent { color: #111; }
html[data-theme="dark"] .top { background: color-mix(in srgb, var(--page) 80%, transparent); }
html[data-theme="dark"] .chart .ax, html[data-theme="dark"] .chart text { fill: var(--muted); }
html[data-theme="dark"] .chart .grid { stroke: var(--line); } html[data-theme="dark"] .chart .base { stroke: #3A4150; }
html[data-theme="dark"] .chart .val { fill: var(--ink); }
html[data-theme="dark"] .doc { --page: #fff; --card: #fff; --porcelain: #fff; --ink: #111; --on-ink: #fff; --line: #E3E6EB; --mist: #E4E6EA; --muted: #5F646C; color-scheme: light; background: #fff; color: #111; }
html[data-theme="dark"] .banner.demo { background: #3A2E12; border-color: var(--gilt); }
html[data-theme="dark"] .banner { border-color: #5A4322; }
html[data-theme="dark"] .banner.ok { border-color: #2E5A3A; }
html[data-theme="dark"] .banner.bad { border-color: #6A2E26; }
html[data-theme="dark"] .gh-btn { background: linear-gradient(180deg, #F5F5F5 0%, #D9D9D9 100%); color: #111; }
html[data-theme="dark"] .wa-btn, html[data-theme="dark"] .wa-btn:hover { background: linear-gradient(180deg, #34D96F 0%, #1EBE57 100%); color: #fff; border: 0; }
html[data-theme="dark"] .site-btn, html[data-theme="dark"] .site-btn:hover { background: linear-gradient(180deg, #3B8BEA 0%, #1F63C6 100%); color: #fff; border: 0; }
html[data-theme="dark"] .brand-btn { box-shadow: 0 1px 3px rgba(0,0,0,.5); }
html[data-theme="dark"] .gh-btn:hover { color: #111; }
html[data-theme="dark"] .done-btn { background: #2E7D4F; border-color: #2E7D4F; }
html[data-theme="dark"] .pf-icon .tt-main { fill: #fff; }
html[data-theme="dark"] .kpi-ad-tk { --kpi-tint: #3A1A22; } html[data-theme="dark"] .kpi-ad-ig { --kpi-tint: #3A1A2C; } html[data-theme="dark"] .kpi-ad-gg { --kpi-tint: #1A2740; }
html[data-theme="dark"] .login { background: radial-gradient(1200px 600px at 20% -10%, #2E2416, transparent 60%), var(--page); }
html[data-theme="dark"] .tbl tbody tr:hover td { background: color-mix(in srgb, var(--s1-soft) 60%, transparent); }

/* backup window */
.backup-btn { width: 100%; }
.backup-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.backup-row:last-child { border-bottom: 0; }
.backup-list > p { padding: 10px 12px; margin: 0; }

/* ---------- Social menu + platform pages (redesign 2026-09-29): header, 4 tiles, pill tabs, picture grid, cards ---------- */
.nav-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 4px; }
.nav-open .nav .nav-h { grid-column: 1 / -1; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mist); flex: none; }
.dot.tone-ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); } .dot.tone-bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.dot.tone-warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); } .dot.tone-info { background: var(--s1); box-shadow: 0 0 0 3px var(--s1-soft); } .dot.tone-mute { background: var(--mist); }

/* header */
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sp-title { display: flex; gap: 14px; align-items: center; min-width: 0; }
.sp-title > .ad-mark, .sp-title > .pf-icon { width: 52px; height: 52px; border-radius: 16px; padding: 10px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); flex: none; }
.sp-title .ad-mark .pf-icon { width: 30px; height: 30px; }
.sp-title h1 { font-size: 32px; }
.sp-acc { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); text-decoration: none; margin-top: 2px; }
.sp-acc:hover { color: var(--ink); }
.sp-actions { display: flex; align-items: center; gap: 10px; }
.sp-create svg, .sp-mi-ico svg, .sp-tabs svg, .sp-empty-ico svg, .cp-ico svg, .pt-st svg, .pt-ph svg { stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sp-create { gap: 8px; } .sp-create svg { width: 18px; height: 18px; stroke-width: 2.4; }
.sp-create-menu > summary { list-style: none; } .sp-create-menu > summary::-webkit-details-marker { display: none; }
.sp-create-menu .menu-list { min-width: 190px; }
.sp-mi { display: flex !important; align-items: center; gap: 10px; font-weight: 500; }
.sp-mi-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--s1-soft); color: var(--s1-deep); flex: none; }
.sp-mi-ico svg { width: 17px; height: 17px; }

/* the four tiles */
.sp-stats { margin-top: 0; }
.sp-stats + .sp-body, .sp-stats + .sp-empty { margin-top: 16px; }
@media (min-width: 760px) { .sp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sp-tiles .kpi { transition: transform .15s ease, box-shadow .15s ease; }
.sp-tiles button.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.sp-tiles .kpi b { font-size: 24px; }
.sp-tiles .kpi::after { display: none; }

/* pill tabs with counts */
.sp-tabs { display: flex; gap: 8px; margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.sp-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.sp-tabs a:hover { color: var(--ink); border-color: var(--mist); }
.sp-tabs a.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.sp-tabs svg { width: 17px; height: 17px; }
.sp-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; }
.sp-badge:empty { min-width: 8px; width: 8px; height: 8px; padding: 0; }
.sp-badge.tone-warn:empty { background: var(--warn); }

.sp-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seg-n { margin-inline-start: 6px; font-size: 11px; opacity: .7; }
.sp-sync svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; }
.sp-sync:hover { background: var(--card); }
.sp-sync.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sp-body > .banner { margin: 0 0 12px; }

/* empty states: one picture, few words */
.sp-empty { display: grid; justify-items: center; gap: 8px; padding: 44px 16px; border: 1.5px dashed var(--mist); border-radius: var(--radius); text-align: center; color: var(--ink); }
.sp-empty-ico { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--s1-soft); color: var(--s1-deep); }
.sp-empty-ico svg { width: 26px; height: 26px; }

/* posts as a picture grid */
.pt-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (max-width: 520px) { .pt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.pt { position: relative; display: grid; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; text-align: start; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; min-width: 0; }
.pt:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pt-img, .pd-img { aspect-ratio: 1; background: var(--mute-bg); display: grid; place-items: center; overflow: hidden; }
.pt-img img, .pd-img img { width: 100%; height: 100%; object-fit: cover; }
.pt-ph { color: var(--muted); } .pt-ph svg { width: 34px; height: 34px; stroke-width: 1.5; }
.pt-st { position: absolute; top: 8px; inset-inline-end: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--card); }
.pt-st svg { width: 16px; height: 16px; stroke-width: 2.4; }
.pt-vid { position: absolute; top: 8px; inset-inline-start: 8px; font-size: 11px; color: #fff; background: rgba(0,0,0,.55); border-radius: 8px; padding: 2px 7px; }
.pt-foot { display: grid; gap: 2px; padding: 9px 11px 11px; min-width: 0; }
.pt-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pt-when { font-size: 12.5px; font-weight: 600; }
.pt-also { display: inline-flex; gap: 3px; } .pt-also .pf-icon, .pt-also .ad-mark { width: 18px; height: 18px; }
.pt-cap { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* one post's details */
.pd { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .pd { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } }
.pd-img { border-radius: 14px; aspect-ratio: 4 / 5; }
.pd-body { display: grid; gap: 4px; min-width: 0; }
.pd-plat { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pd-plat .ad-mark, .pd-plat > .pf-icon { width: 30px; height: 30px; flex: none; }
.pd-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pd-cap { margin: 6px 0 0; unicode-bidi: plaintext; text-align: start; white-space: pre-wrap; color: var(--muted); max-height: 120px; overflow: auto; }

/* settings cards */
.bd-card { display: grid; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.bd-nums { display: flex; align-items: baseline; gap: 2px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.bd-nums b { font-size: 22px; } .bd-nums span { font-size: 16px; color: var(--muted); } .bd-nums small { color: var(--muted); }
[dir="rtl"] .bd-nums { justify-content: flex-end; }
.bd-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bd-bar i { display: block; height: 100%; border-radius: inherit; background: var(--s1); }
.bd-card.over .bd-bar i { background: var(--s2); }
.bd-foot { display: flex; gap: 6px 14px; flex-wrap: wrap; }
/* Ga6ya page: the spent / total card, then one row per amount */
.gy-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--s1-soft); color: var(--s1-deep); }
.gy-ico svg, .gy-dot svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gy-sum { margin: 14px 0; max-width: 760px; }
.gy-list { display: grid; gap: 10px; max-width: 760px; }
.gy-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.gy-dot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--s1-soft); color: var(--s1-deep); }
.gy-dot svg { width: 18px; height: 18px; }
.gy-main { display: grid; gap: 2px; min-width: 0; } .gy-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gy-amt { display: grid; justify-items: end; font-variant-numeric: tabular-nums; } .gy-amt b { font-size: 17px; }
.gy-h { margin-top: 26px; gap: 10px; flex-wrap: wrap; }
.gy-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gy-use { grid-column: 1 / -1; display: grid; gap: 6px; }
.gy-use-nums { display: flex; align-items: baseline; gap: 2px; font-variant-numeric: tabular-nums; } .gy-use-nums b { font-size: 16px; } .gy-use-nums span, .gy-use-nums small { color: var(--muted); }
.gy-pct { margin-inline-start: auto; }
[dir="rtl"] .gy-use-nums { flex-direction: row-reverse; }
.gy-row.over .bd-bar i { background: var(--s2); }
.sc-list { display: grid; gap: 12px; max-width: 760px; }
.sc-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.sc-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--page); flex: none; }
.sc-ico .ad-mark, .sc-ico .pf-icon { width: 30px; height: 30px; }
.sc-ico.fb { background: #1877F2; color: #fff; font: 700 26px/1 Arial, sans-serif; }
.sc-main { display: grid; gap: 3px; min-width: 0; }
.sc-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.sc-tip { color: var(--muted); cursor: help; font-size: 18px; }
.sc-days { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.sc-bar { width: 140px; max-width: 50vw; height: 6px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; }
.sc-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.sc-days small { color: var(--muted); font-size: 12px; }
.dots svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 3.2; stroke-linecap: round; }
.dots:hover { background: var(--page); }
.cp-link { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; }
.cp-link .ad-mark { width: 32px; height: 32px; border-radius: 9px; transition: transform .15s; }
.cp-link:hover .ad-mark { transform: scale(1.08); }
.menu-list .t-bad { color: var(--bad); }
.ring-box { position: relative; width: 84px; height: 84px; flex: none; }
.ring { width: 84px; height: 84px; }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--mute-bg); }
.ring-fg { stroke: var(--s1); stroke-linecap: round; transition: stroke-dasharray .5s ease; } .ring-fg.full { stroke: var(--bad); }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring-txt b { font-size: 20px; } .ring-txt small { font-size: 11px; color: var(--muted); }

/* campaign cards with an on/off switch */
.cp-list { display: grid; gap: 10px; margin-top: 14px; }
.cp { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.cp.off { opacity: .6; }
.cp-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--s1-soft); color: var(--s1-deep); }
.cp-ico svg { width: 20px; height: 20px; }
.cp-main { display: grid; gap: 3px; min-width: 0; }
.cp-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-nums { display: flex; gap: 18px; }
.cp-nums span { display: grid; text-align: end; } .cp-nums b { font-size: 15px; } .cp-nums small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 640px) { .cp, .sc-card { grid-template-columns: auto minmax(0, 1fr) auto auto; } .cp .cp-nums { grid-column: 2 / -2; } .cp .cp-link { grid-row: 2; grid-column: -2 / -1; } .cp .cp-gap { display: none; } .cp-nums { grid-column: 2 / -1; grid-row: 2; justify-content: flex-start; } .cp-nums span { text-align: start; } }
.sw { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw input:disabled { cursor: not-allowed; }
.sw-k { position: absolute; inset: 0; border-radius: 99px; background: var(--mist); transition: background .2s ease; }
.sw-k::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.sw input:checked + .sw-k { background: var(--ok); }
.sw input:checked + .sw-k::after { transform: translateX(20px); }
html[dir="rtl"] .sw input:checked + .sw-k::after { transform: translateX(-20px); }
.sw input:focus-visible + .sw-k { outline: 2px solid var(--s1); outline-offset: 2px; }
.ma-fig { margin: 14px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 8px; box-shadow: var(--shadow); }
.ma-cap { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; } .ma-cap b { font-size: 14px; }
.cp-sec { margin-top: 18px; } .cp-sec .cp-list { margin-top: 0; } .cp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 4px 8px; } .cp-head b { font-size: 14px; }
@media (max-width: 520px) { .sp-title h1 { font-size: 26px; } .sp-tabs a { padding: 8px 12px; } }

/* TikTok: ads and account stats (2026-09-29) */
.sc-ico.tt-ico { background: #111; color: #fff; }
.sc-ico.tt-ico svg, .tt-stat svg, .pt-stats svg, .pd-stats svg { stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sc-ico.tt-ico svg { width: 22px; height: 22px; box-shadow: none; filter: drop-shadow(-1.2px -1px 0 #25F4EE) drop-shadow(1.2px 1px 0 #FE2C55); }
.cp-ico.tt-cp { background: #111; color: #fff; }
.sc-both { display: inline-flex; align-items: center; gap: 5px; } .sc-both .pf-icon { width: 16px; height: 16px; }
.tt-stats, .sc-nums { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tt-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.tt-stat b { color: var(--ink); font-size: 15px; }
.tt-stat svg { width: 17px; height: 17px; }
.pt-stats, .pd-stats { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.pt-stats span, .pd-stats span { display: inline-flex; align-items: center; gap: 3px; }
.pt-stats svg { width: 14px; height: 14px; } .pd-stats { margin-top: 4px; font-size: 13px; } .pd-stats svg { width: 16px; height: 16px; }

/* Google Ads campaign cards (2026-09-29) */
.cp-ico.gg-cp { background: #E8F0FE; color: #1A73E8; }
html[data-theme="dark"] .cp-ico.gg-cp { background: #1A2740; color: #8AB4F8; }

/* time zone note on the ads Settings cards (shown only when the ad account is not on Kuwait time) */
.tz-warn { display: block; color: var(--warn); }

/* SEO page (pages-seo.js) */
.seo-sec { margin-top: 28px; }
.seo-sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.seo-sec-h h2 { font-size: 18px; margin: 0 0 2px; }
.seo-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.seo-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seo-card-h b { font-size: 15px; }

/* tiles */
.seo-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.seo-tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.seo-tile-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.seo-tile-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--s1-soft); color: var(--s1-deep); }
.seo-tile-ico svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.seo-tile-v { font-size: 30px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.seo-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.seo-spark { width: 96px; height: 30px; flex: none; }
.seo-spark polyline { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.seo-pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.seo-pill.tone-ok { background: var(--ok-bg); color: var(--ok); } .seo-pill.tone-bad { background: var(--bad-bg); color: var(--bad); } .seo-pill.tone-mute { background: var(--mute-bg); color: var(--muted); }
.seo-seg button { min-height: 30px; padding: 5px 12px; }

/* main chart: y labels left and right, the plot, x labels under it; the text is HTML so it never stretches */
.seo-legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.seo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.seo-legend small { color: var(--muted); opacity: .7; }
.seo-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.seo-key-v { background: var(--s1); } .seo-key-c { background: var(--s3); }
.seo-chart { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 240px auto; column-gap: 10px; direction: ltr; }
.seo-yax { display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin: -7px 0; }
.seo-yax-l { text-align: right; } .seo-yax-r { text-align: left; color: var(--s3); }
.seo-area { position: relative; height: 240px; cursor: crosshair; touch-action: pan-y; }
.seo-plot { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.seo-grid { stroke: var(--line); stroke-width: 1; }
.seo-views { fill: none; stroke: var(--s1); stroke-width: 2.5; stroke-linejoin: round; }
.seo-clicks { fill: none; stroke: var(--s3); stroke-width: 2.5; stroke-linejoin: round; }
.seo-xax { grid-column: 2; position: relative; height: 22px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.seo-xax span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.seo-xax span:first-child { transform: none; } .seo-xax span:last-child { transform: translateX(-100%); }
.seo-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: .45; pointer-events: none; }
.seo-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid var(--card); pointer-events: none; }
.seo-dot-v { background: var(--s1); } .seo-dot-c { background: var(--s3); }
.seo-tip { position: absolute; top: 8px; margin-left: 12px; display: grid; gap: 4px; min-width: 150px; padding: 10px 12px; border-radius: 12px; background: var(--ink); color: var(--on-ink); font-size: 12.5px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45); pointer-events: none; z-index: 2; }
.seo-tip.seo-tip-left { margin-left: 0; transform: translateX(calc(-100% - 12px)); }
.seo-tip span { display: flex; align-items: center; gap: 6px; } .seo-tip span b { margin-left: auto; font-variant-numeric: tabular-nums; }
.seo-tip .muted { color: inherit; opacity: .7; }

/* top tables */
.seo-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.seo-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.seo-tbl th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); padding: 0 8px 8px; border-bottom: 1px solid var(--line); }
.seo-tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.seo-tbl tr:last-child td { border-bottom: 0; }
.seo-tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seo-tbl th:not(:first-child) { text-align: right; }
.seo-key-cell { text-align: left; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.seo-bar-cell { position: relative; min-width: 80px; }
.seo-bar-cell .seo-bar { position: absolute; right: 8px; top: 50%; height: 22px; transform: translateY(-50%); border-radius: 6px; background: var(--s1-soft); max-width: calc(100% - 16px); }
.seo-bar-cell span { position: relative; }
.seo-none { margin: 4px 0; }

/* indexing, plan, speed */
.seo-sum { display: flex; align-items: center; gap: 16px; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.seo-sum > div:last-child { display: grid; gap: 2px; }
.seo-ring { position: relative; display: grid; place-items: center; flex: none; }
.seo-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.seo-ring circle { fill: none; stroke-width: 6; }
.seo-ring-bg { stroke: var(--line); }
.seo-ring-fg { stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.seo-ring b { position: relative; font-size: 15px; font-variant-numeric: tabular-nums; }
.seo-ring-ok .seo-ring-fg { stroke: var(--ok); } .seo-ring-warn .seo-ring-fg { stroke: var(--warn); } .seo-ring-bad .seo-ring-fg { stroke: var(--bad); } .seo-ring-mute .seo-ring-fg { stroke: var(--muted); }
.seo-ring-ok b { color: var(--ok); } .seo-ring-warn b { color: var(--warn); } .seo-ring-bad b { color: var(--bad); }
.seo-list { list-style: none; margin: 0; padding: 0; }
.seo-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.seo-list li:last-child { border-bottom: 0; }
.seo-list-k { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-list-d { min-width: 120px; text-align: right; }
.seo-progress { display: grid; gap: 8px; margin-bottom: 14px; }
.gy-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.gy-what { display: inline-flex; align-items: center; gap: 6px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.chart-head h3 { margin: 0; }
.chart-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seo-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.seo-plan-row { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.seo-plan-next { border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.seo-plan-published .seo-plan-t { opacity: .75; }
.seo-plan-n { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.seo-plan-d { white-space: nowrap; min-width: 9ch; text-align: end; }
@media (max-width: 600px) { .seo-plan-row { grid-template-columns: 30px 1fr auto; } .seo-plan-d { grid-column: 2 / -1; } }
.seo-plan-t { font-family: "Tajawal", system-ui, sans-serif; font-size: 15px; }
.seo-sched-row { grid-template-columns: 11ch 1fr auto auto; }
.seo-sched-d { font-variant-numeric: tabular-nums; white-space: nowrap; }
.seo-sched-today { border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); background: var(--warn-bg); }
.seo-sched-late { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.seo-sched-done .seo-plan-t { opacity: .6; text-decoration: line-through; text-decoration-color: var(--muted); }
.t-warn { color: var(--warn); font-weight: 600; }
@media (max-width: 600px) { .seo-sched-row { grid-template-columns: 1fr auto auto; } .seo-sched-d { grid-column: 1 / -1; } }
.seo-speed { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.seo-speed-card { display: grid; gap: 12px; justify-items: center; }
.seo-speed-p { justify-self: start; font-size: 13.5px; }
.seo-speed-rings { display: flex; gap: 22px; }
.seo-speed-rings > div { display: grid; justify-items: center; gap: 6px; }
.seo-speed-rings small { color: var(--muted); }

@media (max-width: 900px) { .seo-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .seo-tile-v { font-size: 24px; } .seo-spark { width: 64px; }
  .seo-chart { grid-template-rows: 200px auto; } .seo-area { height: 200px; } .seo-yax-r { display: none; }
  .seo-card { padding: 14px; } .seo-list li { grid-template-columns: minmax(0, 1fr) auto; } .seo-list-d { grid-column: 1 / -1; text-align: left; min-width: 0; }
  .seo-tbl th:nth-child(4), .seo-tbl td:nth-child(4) { display: none; }
}

/* ---- Registrations: the client form's link box and the answers dialog (2026-10-27) ---- */
.reg-link { display: grid; gap: 8px; padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.reg-link-l { display: flex; align-items: center; gap: 8px; }
.reg-link-l svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reg-link-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reg-link-row .input { flex: 1 1 260px; min-width: 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.reg-view { direction: rtl; text-align: start; }
.reg-sec { margin: 16px 0 8px; font-size: 15px; font-weight: 700; color: var(--s1-deep); }
.reg-sec:first-child { margin-top: 0; }
.reg-dl { font-size: 14.5px; }
.reg-dl dd.reg-ans { white-space: pre-wrap; }
.reg-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--page); }
.reg-logo-pic { width: 72px; height: 72px; flex: none; display: grid; place-items: center; border-radius: 10px; background: #fff; overflow: hidden; }
.reg-logo-pic img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 4px; }
.reg-logo-pic svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.reg-pdf { font-weight: 800; color: var(--bad); letter-spacing: .04em; }
.reg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; direction: ltr; }
.page-head h1 .pill { vertical-align: middle; font-family: var(--ui); font-size: 12px; font-weight: 600; letter-spacing: 0; }
