/* پنل تیک کار — سبک مستقل، بدون وابستگی بیرونی (قطعی اینترنت بین‌الملل) */
@import url('../lib/vazirmatn/vazirmatn.css');

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --ink: #1b2232;
  --muted: #637085;
  --line: #e3e8f1;
  --brand: #2257d6;
  --brand-ink: #ffffff;
  --brand-soft: #e8efff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fff3df;
  --bad: #c62828;
  --bad-soft: #fdecec;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131d; --surface: #161d2b; --surface-2: #1b2334; --ink: #e7ebf3; --muted: #9aa5b9;
    --line: #283246; --brand: #6d95ff; --brand-ink: #0b1220; --brand-soft: #1e2a46;
    --ok: #4ade80; --ok-soft: #12301f; --warn: #fbbf24; --warn-soft: #34270d; --bad: #f87171; --bad-soft: #3a1717;
    --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.75 Vazirmatn, Tahoma, system-ui, sans-serif;
  font-feature-settings: "ss01";
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.4; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.nowrap { white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }

/* چیدمان */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-inline-start: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; font-weight: 800; font-size: 18px; color: var(--ink); }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 16px; }
.org-name { padding: 0 10px 12px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav .count { margin-inline-start: auto; background: var(--warn); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 20px; }
.nav-title { color: var(--muted); font-size: 11px; padding: 14px 12px 4px; }
.sidebar .foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.topbar .title { flex: 1; min-width: 0; }
.topbar .who { color: var(--muted); font-size: 13px; }
.content { padding: 22px 24px 48px; display: flex; flex-direction: column; gap: 18px; max-width: 1280px; width: 100%; }
.menu-toggle { display: none; }
.menu-btn { display: none; cursor: pointer; padding: 6px; border-radius: 8px; }

.topbar { flex-wrap: wrap; }
@media (max-width: 600px) { .topbar .who { display: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 0 0 auto; width: 260px; z-index: 20; transform: translateX(100%); transition: transform .2s; box-shadow: var(--shadow); }
  .menu-toggle:checked ~ .shell .sidebar { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar, .content { padding-inline: 16px; }
}

/* اجزا */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card > .head h2 { flex: 1; }
.card > .body { padding: 16px 18px; }
.card > .body.flush { padding: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-size: 26px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.ok .n { color: var(--ok); } .stat.warn .n { color: var(--warn); } .stat.bad .n { color: var(--bad); }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th, .t td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t td.actions { white-space: nowrap; text-align: end; }
.t .sub { color: var(--muted); font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 0 9px; border-radius: 999px; font-size: 12px; line-height: 22px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); padding: 7px 14px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 3px 10px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline { display: inline; }

form.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12px; }
.field .err { color: var(--bad); font-size: 12px; }
input[type=text], input[type=tel], input[type=number], input[type=search], input[type=password], input[type=file], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input.ltr-input { direction: ltr; text-align: left; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.toolbar .field { min-width: 150px; }
.toolbar .grow { flex: 1; }

.alert { padding: 12px 16px; border-radius: 10px; border: 1px solid transparent; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--brand-soft); color: var(--brand); }
.alert ul { margin: 6px 0 0; padding-inline-start: 18px; }

.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 6px; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pager a, .pager span { padding: 3px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.pager .cur { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pager .dis { color: var(--muted); }

details.pop { position: relative; display: inline-block; }
details.pop > summary { list-style: none; cursor: pointer; }
details.pop > summary::-webkit-details-marker { display: none; }
details.pop > .pop-body {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 10; width: 280px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); padding: 14px; text-align: start;
}

.map { height: 360px; border-radius: 12px; border: 1px solid var(--line); z-index: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.copy { display: flex; gap: 8px; }
.copy input { direction: ltr; font-size: 12px; }

/* صفحهٔ ورود */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 400px; }
.auth .brand { justify-content: center; padding: 22px 0 6px; font-size: 22px; }
.auth .tagline { text-align: center; color: var(--muted); margin: 0 0 6px; }
.code-input { letter-spacing: 10px; text-align: center !important; font-size: 22px !important; direction: ltr; }
