@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/SpaceGrotesk-var.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1a1d21;
  --muted: #565c63;
  --line: #ddd8ce;
  --line2: #ece8e0;
  --ground: #eeeae2;
  --soft: #f8f6f2;
  --paper: #ffffff;
  --acc: #0e6b63;
  --acc-ink: #ffffff;
  --acc-soft: #dceeea;
  --amb: #8a5200;
  --amb-soft: #fbefd9;
  --red: #b42318;
  --red-soft: #fde8e6;
  --gray-soft: #ede9e1;
  --good: #006300;
  --note: #fff6e0;
  --bar: #2a78d6;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceae4;
    --muted: #b5b1a8;
    --line: #3a3833;
    --line2: #2e2c28;
    --ground: #151412;
    --soft: #1d1c19;
    --paper: #232220;
    --acc: #3bb3a6;
    --acc-ink: #0b1f1d;
    --acc-soft: #173a36;
    --amb: #f0b45a;
    --amb-soft: #3a2c14;
    --red: #f2837a;
    --red-soft: #3d1c19;
    --gray-soft: #2e2c28;
    --good: #5fcf6a;
    --note: #332b17;
    --bar: #3987e5;
    color-scheme: dark;
  }
}
html[lang='fa'] { --font-body: 'Vazirmatn', system-ui, sans-serif; --font-display: 'Vazirmatn', system-ui, sans-serif; }

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--ground); font-size: 15px; line-height: 1.55; }
a { color: var(--acc); }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.caps { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.stack.loose { gap: 18px; }

.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 18px; min-height: 60px; padding: 0 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--acc); color: var(--acc-ink); font-family: var(--font-display); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; white-space: nowrap; }
.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav a { display: flex; align-items: center; min-height: 58px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; }
.nav a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--acc); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who form { margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 28px 24px 48px; }
.wrap.wide { max-width: none; padding: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - 61px); }
@media (min-width: 1000px) {
  .cols.two { grid-template-columns: 320px minmax(0, 1fr); }
  .cols.three { grid-template-columns: 320px minmax(0, 1fr) 380px; }
  .cols.main-side { grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; }
}
.pane { padding: 22px 24px; min-width: 0; }
.pane.side { background: var(--soft); border-inline-end: 1px solid var(--line); }
.pane.side.end { border-inline-end: 0; border-inline-start: 1px solid var(--line); background: var(--paper); }
.pane.main { background: var(--paper); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.card.soft { background: var(--soft); }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi .v { font-size: 28px; font-weight: 600; line-height: 1.15; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.outline { border-color: var(--acc); color: var(--acc); }
.btn.small { min-height: 30px; padding: 0 12px; font-size: 13px; }
.btn.big { min-height: 48px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--muted); }
.chip.acc { background: var(--acc-soft); color: var(--acc); }
.chip.amb { background: var(--amb-soft); color: var(--amb); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.line { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--good); }
.dot::before { content: ''; width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
.dot.off { color: var(--red); }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg a { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 12px; font-weight: 600; text-decoration: none; }
.seg a.on { border-color: var(--acc); background: var(--acc-soft); color: var(--acc); }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .field .label { font-size: 12px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%;
}
textarea { resize: vertical; line-height: 1.55; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 4px 0; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--acc); }
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.list-item { display: flex; flex-direction: column; gap: 5px; padding: 11px 12px; border-radius: 10px; border: 1px solid transparent; text-decoration: none; color: var(--ink); }
.list-item:hover { background: var(--paper); }
.list-item.on { background: var(--paper); border-color: var(--line); }
.inbox-row { display: flex; gap: 10px; }
.av { width: 34px; height: 34px; flex-shrink: 0; border-radius: 17px; background: #d9d2c5; color: #1a1d21; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.av.staff { background: var(--acc); color: var(--acc-ink); }
.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg .who-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.msg .who-line b { font-size: 14px; color: var(--ink); }
.bubble { background: #f4f1eb; border-radius: 4px 12px 12px 12px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
[dir=rtl] .bubble { border-radius: 12px 4px 12px 12px; }
.msg.staff .bubble { background: var(--acc-soft); }
.msg.note .bubble { background: var(--note); border: 1px dashed var(--amb); }
@media (prefers-color-scheme: dark) { .bubble { background: #2b2a27; } }
.sys { font-size: 13px; color: var(--muted); padding-inline-start: 46px; }
.auto { margin-inline-start: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); padding: 12px 14px; font-size: 14px; }
.ticket-mark { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ticket-mark::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--line); }
details.old { border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
details.old > summary { cursor: pointer; padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; }
details.old > summary::-webkit-details-marker { display: none; }
details.old[open] > .thread { padding: 4px 14px 14px; }
.composer { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--paper); display: flex; flex-direction: column; gap: 10px; }
.composer textarea { border: 0; padding: 0; min-height: 80px; }
.composer.draft { border-color: var(--acc); }

.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line2); }
.kv span:first-child { color: var(--muted); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: start; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px 8px; border-bottom: 1px solid var(--line2); vertical-align: middle; font-variant-numeric: tabular-nums; }
table.t .num { text-align: end; }
.scroll-x { overflow-x: auto; }

.bars { display: flex; flex-direction: column; gap: 2px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 180px) minmax(0, 1fr); align-items: center; gap: 10px; min-height: 28px; font-size: 13px; }
.bar-track { display: flex; align-items: center; gap: 8px; border-inline-start: 1px solid #c3c2b7; min-height: 28px; }
.bar { height: 14px; background: var(--bar); border-start-end-radius: 4px; border-end-end-radius: 4px; }
.bar.alt { background: #eb6834; }
.bar-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }

.toast { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: var(--acc-soft); color: var(--acc); font-weight: 600; font-size: 14px; }
.toast.bad { background: var(--red-soft); color: var(--red); }
.notice { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); background: var(--soft); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.privacy { background: var(--acc-soft); border: 0; color: var(--ink); }

.hero { font-family: var(--font-display); font-size: 32px; font-weight: 600; }
.search { display: flex; align-items: center; gap: 10px; border: 2px solid var(--acc); border-radius: 12px; padding: 0 8px 0 14px; background: var(--paper); }
.search input { border: 0; min-height: 50px; font-size: 16px; background: transparent; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-decoration: none; color: var(--ink); }
.article-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.75; }

.login { max-width: 460px; margin: 48px auto; padding: 0 16px; }
.center { text-align: center; }
.rating { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-inline-start: 46px; font-size: 13px; color: var(--muted); }
.rating form { margin: 0; }
.rating button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 600; cursor: pointer; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: start; }
.matrix input { width: 18px; height: 18px; accent-color: var(--acc); }
.pager { display: flex; gap: 10px; margin-top: 14px; }
