@font-face { font-family: "VazirFD"; src: url("fonts/Vazir-Light-FD-WOL.ttf"); font-weight: 300; font-display: swap; }
@font-face { font-family: "VazirFD"; src: url("fonts/Vazir-FD-WOL.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "VazirFD"; src: url("fonts/Vazir-Medium-FD-WOL.ttf"); font-weight: 500; font-display: swap; }
@font-face { font-family: "VazirFD"; src: url("fonts/Vazir-Bold-FD-WOL.ttf"); font-weight: 700; font-display: swap; }

/* ─── رنگ‌ها: روشن */
:root {
  --bg: #f4f4f8;
  --bg-glow: radial-gradient(1200px 500px at 85% -10%, rgba(99, 91, 255, .10), transparent 60%),
             radial-gradient(900px 500px at 0% 0%, rgba(14, 159, 154, .08), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f6f6fa;
  --surface-3: #eeeef5;
  --ink: #16162a;
  --ink-2: #4b4d63;
  --muted: #8b8da3;
  --line: #e6e6ef;
  --line-2: #f0f0f6;
  --brand: #5b4cf0;
  --brand-ink: #4a3bdc;
  --brand-2: #0ea5a0;
  --brand-soft: #efedff;
  --good: #0b8a5c;  --good-soft: #e3f6ee;
  --warn: #b45309;  --warn-soft: #fff3e0;
  --bad: #d12f2f;   --bad-soft: #fdeaea;
  --side: #15132f;  --side-ink: #c9c8e6; --side-muted: #807ea8; --side-hover: rgba(255,255,255,.06); --side-on: rgba(139, 127, 255, .18);
  --shadow-sm: 0 1px 2px rgba(22, 22, 42, .05);
  --shadow: 0 1px 2px rgba(22, 22, 42, .04), 0 8px 28px -6px rgba(22, 22, 42, .08);
  --shadow-lg: 0 24px 60px -12px rgba(22, 22, 42, .25);
  --radius: 20px;
  color-scheme: light;
}
/* ─── رنگ‌ها: تیره */
:root[data-theme="dark"] {
  --bg: #0d0d18;
  --bg-glow: radial-gradient(1200px 500px at 85% -10%, rgba(99, 91, 255, .16), transparent 60%),
             radial-gradient(900px 500px at 0% 0%, rgba(14, 165, 160, .10), transparent 60%);
  --surface: #161627; --surface-2: #1c1c30; --surface-3: #24243b;
  --ink: #ededf7; --ink-2: #b8b9d0; --muted: #7c7e98; --line: #2a2a42; --line-2: #222237;
  --brand: #8b7fff; --brand-ink: #a59bff; --brand-2: #2cc6bf; --brand-soft: #25214d;
  --good: #3dd598; --good-soft: #13302a; --warn: #f5a524; --warn-soft: #36290f; --bad: #ff6b6b; --bad-soft: #3a1a1f;
  --side: #0a0a14; --side-hover: rgba(255,255,255,.05);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -8px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d18;
    --bg-glow: radial-gradient(1200px 500px at 85% -10%, rgba(99, 91, 255, .16), transparent 60%),
               radial-gradient(900px 500px at 0% 0%, rgba(14, 165, 160, .10), transparent 60%);
    --surface: #161627; --surface-2: #1c1c30; --surface-3: #24243b;
    --ink: #ededf7; --ink-2: #b8b9d0; --muted: #7c7e98; --line: #2a2a42; --line-2: #222237;
    --brand: #8b7fff; --brand-ink: #a59bff; --brand-2: #2cc6bf; --brand-soft: #25214d;
    --good: #3dd598; --good-soft: #13302a; --warn: #f5a524; --warn-soft: #36290f; --bad: #ff6b6b; --bad-soft: #3a1a1f;
    --side: #0a0a14; --side-hover: rgba(255,255,255,.05);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -8px rgba(0,0,0,.5);
    --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* وگرنه .app {display:grid} صفحهٔ پنهان را نشان می‌دهد */
html, body { margin: 0; }
html { background: var(--bg); }   /* پشت نوار سافاری هم همرنگ صفحه بماند */
body { overflow-x: clip; overscroll-behavior-y: none; }   /* clip نه hidden — hidden منوی چسبان (sticky) را از کار می‌اندازد */
body {
  font-family: "VazirFD", Tahoma, sans-serif; background: var(--bg); background-image: var(--bg-glow);
  background-attachment: fixed; color: var(--ink); font-size: 15px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; transition: background-color .25s, color .25s;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
::selection { background: var(--brand-soft); }

/* ─── چیدمان */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px 16px; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; gap: 4px; z-index: 45; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 26px; }
.brand b { display: block; font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -.2px; }
.brand small { display: block; color: var(--side-muted); font-size: 11px; letter-spacing: 1.6px; direction: ltr; text-align: right; font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--side-ink); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a.on { background: var(--side-on); color: #fff; box-shadow: inset -3px 0 0 #8b7fff; }
.nav svg { width: 20px; height: 20px; flex: none; opacity: .9; }
.nav .sep { height: 1px; background: rgba(255,255,255,.07); margin: 10px 8px; }
.side .status { margin-top: auto; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.04); font-size: 12.5px; color: var(--side-ink); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3dd598; margin-inline-end: 7px; box-shadow: 0 0 0 3px rgba(61,213,152,.18); }
.dot.busy { background: #f5a524; box-shadow: 0 0 0 3px rgba(245,165,36,.18); }
.powered { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 14px 8px 2px; font-size: 11.5px; color: var(--side-muted); text-align: center; }
.powered svg { flex: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: 14px clamp(16px, 3vw, 40px); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .ttl { font-weight: 700; font-size: 15px; }
.topbar .sp { flex: 1; }
.topbar .mobile-only { display: none; }
.tb-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: all .15s;
}
.tb-btn:hover { color: var(--brand); border-color: var(--brand); }
.tb-btn svg { width: 19px; height: 19px; }
.sys { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 500; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.sys i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); display: inline-block; }

main { width: 100%; max-width: 1320px; margin: 0 auto; padding: 8px clamp(16px, 3vw, 40px) 40px; min-width: 0; flex: 1; }
.page-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 28px; display: flex; gap: 8px; align-items: center; justify-content: center; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 0 24px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.4px; line-height: 1.3; }
.head p { margin: 4px 0 0; color: var(--muted); }

/* ─── کارت‌ها */
.grid { display: grid; gap: 18px; }
.grid > *, .card { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ghero { grid-template-columns: 1.5fr 1fr 1fr; }
.mt { margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 16px; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card h2 .sub { margin-inline-start: auto; font-weight: 400; color: var(--muted); font-size: 13px; }
.card h2 .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.card h2 .ic svg { width: 18px; height: 18px; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.stat .val { font-size: clamp(20px, 1.8vw, 26px); font-weight: 700; letter-spacing: -.4px; margin-top: 4px; white-space: nowrap; }
.stat .val small { display: inline-block; font-size: 12.5px; font-weight: 400; color: var(--muted); margin-inline-start: 6px; letter-spacing: 0; }
.stat .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.chip-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px; }
.chip-ic svg { width: 19px; height: 19px; }
.ci-brand { background: var(--brand-soft); color: var(--brand); }
.ci-teal { background: color-mix(in srgb, var(--brand-2) 14%, transparent); color: var(--brand-2); }
.ci-good { background: var(--good-soft); color: var(--good); }
.ci-warn { background: var(--warn-soft); color: var(--warn); }
.neg { color: var(--bad) !important; }
.pos { color: var(--good) !important; }

.hero {
  position: relative; overflow: hidden; color: #fff; border: none;
  background: linear-gradient(135deg, #2b2387 0%, #5b4cf0 52%, #0ea5a0 130%);
  box-shadow: 0 20px 50px -18px rgba(91, 76, 240, .55);
}
.hero .lbl { color: rgba(255,255,255,.8); }
.hero .val { font-size: clamp(32px, 3.4vw, 44px); margin-top: 10px; }
.hero .val small { color: rgba(255,255,255,.72); }
.hero .poly { position: absolute; left: -40px; bottom: -60px; opacity: .16; pointer-events: none; }
.hero .poly2 { position: absolute; left: 140px; top: -60px; opacity: .08; pointer-events: none; }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.22); overflow: hidden; margin-top: 20px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: #fff; transition: width .6s; }
.hero .row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-top: 10px; color: rgba(255,255,255,.85); }
.bar.light { background: var(--surface-3); margin-top: 14px; }
.bar.light i { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill svg { width: 14px; height: 14px; }
.pill.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }

.banner { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 16px; margin-bottom: 18px; font-size: 14px; }
.banner > svg { width: 20px; height: 20px; flex: none; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.info { background: var(--brand-soft); color: var(--brand-ink); }
.banner.good { background: var(--good-soft); color: var(--good); }
.banner b { font-weight: 700; }

/* ─── دکمه */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink);
  font-weight: 500; transition: transform .06s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, var(--brand-2))); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.lg { padding: 13px 26px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; }

/* ─── فرم */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; flex-wrap: wrap; box-shadow: var(--shadow-sm); }
.seg button { border: none; background: transparent; padding: 8px 16px; border-radius: 10px; cursor: pointer; font-weight: 500; color: var(--ink-2); transition: all .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 70%, transparent); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.f { display: flex; flex-direction: column; gap: 7px; position: relative; }
.f.full { grid-column: 1 / -1; }
.f label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.f label em { font-style: normal; color: var(--muted); font-weight: 400; }
.in {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.in:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
select.in { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: 18px 52%, 13px 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 34px; }
textarea.in { min-height: 70px; resize: vertical; }
.in.money { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.words { font-size: 12.5px; color: var(--brand-ink); min-height: 20px; }
.words.err { color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 15px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: 13.5px; transition: all .15s; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 500; }
.drop { border: 1.5px dashed var(--line); border-radius: 16px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-2); transition: border-color .15s, color .15s; }
.drop:hover, .drop.over { border-color: var(--brand); color: var(--brand); }
.drop img { max-height: 170px; border-radius: 10px; display: block; margin: 0 auto 8px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.note { font-size: 12.5px; color: var(--muted); }
.margin-note { font-size: 13px; color: var(--good); }

/* ─── تقویم شمسی */
.cal { position: absolute; top: 100%; inset-inline-start: 0; z-index: 30; margin-top: 6px; width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 12px; animation: pop .15s; }
.cal .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; }
.cal .top button { border: none; background: var(--surface-2); width: 32px; height: 32px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.cal .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal .days span { font-size: 11.5px; color: var(--muted); padding: 4px 0; }
.cal .days button { border: none; background: transparent; height: 34px; border-radius: 9px; cursor: pointer; }
.cal .days button:hover { background: var(--surface-2); }
.cal .days button.today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.cal .days button.sel { background: var(--brand); color: #fff; }
.cal .days button:disabled { opacity: .3; cursor: default; }
.cal .quick { display: flex; gap: 6px; margin-top: 10px; }
.cal .quick button { flex: 1; border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 5px; cursor: pointer; font-size: 12.5px; }

/* ─── جدول هفتگی ابزار */
.weekbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.weekbar .t { font-size: 19px; font-weight: 700; }
.weekbar .r { color: var(--muted); font-size: 13.5px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: inline-grid; place-items: center; color: var(--ink-2); }
.iconbtn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.iconbtn:disabled { opacity: .35; cursor: default; }
.tbl-wrap { overflow-x: auto; margin: 0 -4px; -webkit-overflow-scrolling: touch; }
.wk { width: 100%; border-collapse: separate; border-spacing: 0; }
.wk th, .wk td { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--line-2); }
.wk thead th { font-weight: 500; font-size: 13px; color: var(--ink-2); }
.wk thead th small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.wk thead th.today { color: var(--brand); }
.wk thead th.today small { color: var(--brand); }
.wk .tool { text-align: right; padding-inline-start: 4px; min-width: 170px; }
.wk .tool b { display: block; font-weight: 500; }
.wk .tool small { color: var(--muted); font-size: 12px; }
.wk .sum { text-align: left; white-space: nowrap; font-weight: 700; }
.wk .sum small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.tick {
  width: 44px; height: 44px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2);
  cursor: pointer; display: inline-grid; place-items: center; transition: all .15s; color: transparent;
}
.tick:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-1px); }
.tick.on { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--brand) 60%, transparent); }
.tick:disabled { cursor: default; opacity: .35; }
.tick.on:disabled { opacity: .9; }
.tick svg { width: 20px; height: 20px; }
.wk tfoot td { border-bottom: none; padding-top: 16px; }
.legacy { display: grid; gap: 10px; }
.legacy .li { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.toolcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.toolcard { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--surface-2); }
.toolcard b { display: block; font-weight: 500; }
.toolcard .m { color: var(--muted); font-size: 12.5px; }

/* ─── جدول‌ها */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: right; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t td.n, table.t th.n { text-align: left; white-space: nowrap; font-weight: 500; }
table.t tr:hover td { background: var(--surface-2); }
table.t .desc { color: var(--ink-2); max-width: 440px; }
table.t tfoot td { font-weight: 700; border-bottom: none; }
.timeline { display: grid; gap: 2px; }
.ev { display: flex; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.ev:last-child { border-bottom: none; }
.ev .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.ev .ico.bad { background: var(--bad-soft); color: var(--bad); }
.ev .ico svg { width: 16px; height: 16px; }
.ev .tx { flex: 1; }
.ev .tm { color: var(--muted); font-size: 12px; white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 28px; }

/* ─── پنجره و پیام */
.scrim { position: fixed; inset: 0; background: rgba(10, 10, 25, .5); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 60; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; width: min(580px, 100%); max-height: 90vh; overflow: auto; padding: 26px; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal h3 { margin: 0 0 6px; font-size: 19px; }
.modal .lead { color: var(--ink-2); margin: 0 0 16px; }
.modal .acts { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.wlist { display: grid; gap: 8px; }
.wlist .w { display: flex; gap: 10px; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); font-size: 14px; align-items: flex-start; }
.wlist .w .k { font-weight: 700; color: var(--brand); min-width: 22px; }
.wlist .w.no { background: var(--bad-soft); color: var(--bad); }
pre.out { white-space: pre-wrap; background: var(--surface-2); border-radius: 12px; padding: 12px; font-family: "VazirFD", monospace; font-size: 12.5px; max-height: 260px; overflow: auto; direction: rtl; margin: 0; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 70; width: max-content; max-width: 92vw; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop .2s; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.good { background: var(--good); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
main > * { animation: rise .35s both; }
main > *:nth-child(2) { animation-delay: .03s; } main > *:nth-child(3) { animation-delay: .06s; } main > *:nth-child(4) { animation-delay: .09s; }
.spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.skel { height: 140px; border-radius: var(--radius); background: linear-gradient(90deg, var(--line-2), var(--surface-2), var(--line-2)); background-size: 200% 100%; animation: sk 1.2s infinite; margin-top: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--line); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 2px; right: 2px; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--brand); border-color: var(--brand); }
.switch input:checked + span::after { right: 22px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line-2); }
.setrow:last-child { border-bottom: none; }
.setrow .d { color: var(--muted); font-size: 13px; }
.addr { direction: ltr; font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: var(--surface-2); padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); display: inline-block; user-select: all; }

/* ─── ورود */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 20px 80px; position: relative; overflow: hidden;
  background: radial-gradient(900px 600px at 80% 0%, #5b4cf0 0%, transparent 60%), radial-gradient(800px 600px at 0% 100%, #0ea5a0 0%, transparent 55%), #15132f;
}
.login .shape { position: absolute; opacity: .12; pointer-events: none; }
.login .box {
  position: relative; width: min(420px, 100%); background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid rgba(255,255,255,.12);
  border-radius: 28px; padding: 34px 30px 26px; box-shadow: 0 40px 90px -20px rgba(0,0,0,.6); backdrop-filter: blur(16px); animation: pop .3s;
}
.login .logo { display: grid; place-items: center; margin-bottom: 14px; }
.login h1 { text-align: center; margin: 0; font-size: 22px; }
.login .en { text-align: center; color: var(--muted); font-size: 11.5px; letter-spacing: 2.4px; margin: 2px 0 24px; }
.login .pw { position: relative; }
.login .pw .in { padding-left: 44px; }
.login .pw .eye { position: absolute; left: 8px; bottom: 9px; border: none; background: transparent; cursor: pointer; color: var(--muted); padding: 6px; display: grid; }
.login .pw .eye svg { width: 20px; height: 20px; }
.login .err { color: var(--bad); font-size: 13px; min-height: 22px; margin-top: 6px; }
.login .foot { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.6); font-size: 12px; display: flex; gap: 8px; justify-content: center; align-items: center; }
.login .theme-fab { position: absolute; top: 18px; left: 18px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; }

/* ─── موبایل */
.mob-nav, .drawer-scrim { display: none; }
@media (max-width: 1180px) {
  .app { grid-template-columns: 232px minmax(0, 1fr); }
  .ghero { grid-template-columns: 1fr 1fr; }
  .ghero .hero { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .g3, .g2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  /* آیفون: نوار آدرس سافاری موقع اسکرول کوچک و بزرگ می‌شود و صفحه لحظه‌ای از عناصر ثابت بلندتر می‌شود.
     ارتفاع پویا (dvh) + یک سایهٔ همرنگِ رو به پایین، شکاف زیر منو را همیشه می‌پوشاند. */
  .side { position: fixed; top: 0; right: 0; width: 280px; height: 100vh; height: 100dvh; transform: translateX(105%); transition: transform .25s ease; box-shadow: none; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .side.open { box-shadow: var(--shadow-lg), 0 60vh 0 0 var(--side); }
  .side.open { transform: none; }
  .drawer-scrim.open { display: block; position: fixed; inset: 0 0 -60vh 0; background: rgba(10,10,25,.5); z-index: 44; animation: fade .2s; }
  .topbar .mobile-only { display: inline-grid; }
  .topbar .desk-only { display: none; }
  main { padding: 4px 16px 24px; }
  .form { grid-template-columns: 1fr; }
  .hero .val { font-size: 34px; }
  .head h1 { font-size: 23px; }
  .card { padding: 18px; }
  .mob-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 40;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
    background: var(--surface);
  }
  .mob-nav::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 60vh; background: var(--surface); }   /* شکاف زیر نوار پایین هم پر شود */
  .mob-nav a, .mob-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 8px; border-radius: 12px; border: none; background: none; cursor: pointer; }
  .mob-nav a.on { color: var(--brand); }
  .mob-nav svg { width: 23px; height: 23px; }
  .tick { width: 36px; height: 36px; border-radius: 11px; }
  .wk th, .wk td { padding: 8px 3px; }
  .wk .tool { min-width: 118px; }
  .page-foot { padding-bottom: 100px; }
}

/* ─── پروژه */
.proj-switch { margin: -10px 4px 16px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); cursor: pointer; text-align: right; color: var(--side-ink); width: calc(100% - 8px); display: flex; align-items: center; gap: 10px; transition: background .15s; }
.proj-switch:hover { background: rgba(255,255,255,.09); }
.proj-switch small { display: block; color: var(--side-muted); font-size: 11.5px; }
.proj-switch b { display: block; color: #fff; font-size: 14px; font-weight: 500; line-height: 1.5; }
.proj-switch svg { width: 18px; height: 18px; margin-inline-start: auto; opacity: .7; flex: none; }
.picker { min-height: 100vh; padding: 48px clamp(16px, 4vw, 56px) 90px; max-width: 1200px; margin: 0 auto; }
.picker .top { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; flex-wrap: wrap; }
.picker .top h1 { margin: 0; font-size: 26px; }
.picker .top p { margin: 2px 0 0; color: var(--muted); }
.picker .top .sp { flex: 1; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.pcard { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; text-align: right; color: var(--ink); }
.pcard:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 18px 40px -14px color-mix(in srgb, var(--brand) 40%, transparent); }
.pcard h3 { margin: 12px 0 2px; font-size: 18px; }
.pcard .m { color: var(--muted); font-size: 13px; }
.pcard .nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.pcard .nums div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.pcard .nums span { display: block; color: var(--muted); font-size: 11.5px; }
.pcard .nums b { font-size: 15px; }
.pcard .badge { position: absolute; top: 18px; left: 18px; }
.pcard.new { border-style: dashed; display: grid; place-items: center; text-align: center; min-height: 230px; color: var(--muted); box-shadow: none; background: transparent; }
.pcard.new .plus { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin: 0 auto 12px; }
.pcard.new .plus svg { width: 26px; height: 26px; }
.cat-h { margin: 18px 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.cat-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.wk tr.cat td { text-align: right; font-size: 12px; font-weight: 700; color: var(--brand-ink); background: var(--surface-2); padding: 6px 8px; border-bottom: none; }
.catalog { display: flex; flex-wrap: wrap; gap: 6px; max-height: 170px; overflow: auto; padding: 2px; }
.catalog .chip { font-size: 12.5px; padding: 5px 11px; }

/* ویرایش و حذف ردیف · دسته‌های پروژه (۱۴۰۵/۰۸/۱۴) */
.rowact { display: inline-flex; gap: 4px; white-space: nowrap; }
.ib { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0; }
.ib svg { width: 16px; height: 16px; }
.ib:hover { color: var(--brand); border-color: var(--brand); }
.ib[data-del]:hover { color: var(--bad); border-color: var(--bad); }
.pcard.dim { opacity: .78; }
.pcard.dim:hover { opacity: 1; }
.pgroup { margin-top: 28px; }
.pgroup > summary { cursor: pointer; font-weight: 700; font-size: 16px; padding: 8px 0 14px; color: var(--ink); list-style: none; }
.pgroup > summary::-webkit-details-marker { display: none; }
.pgroup > summary::before { content: "‹"; display: inline-block; margin-left: 8px; transition: transform .15s; }
.pgroup[open] > summary::before { transform: rotate(-90deg); }
