/* ورا — سیستم طراحی (مطابق ظاهر نسخه اصلی) */
@import url("../fonts/Vazirmatn-font-face.css");
@import url("../fonts/FD/Vazirmatn-FD-font-face.css");

:root {
  --accent: #8b5cf6;
  --accent-fill: #8b5cf6;
  --accent-foreground: #ffffff;
  --accent-strong: #5c3da2;
  --accent-soft: rgba(139, 92, 246, .14);
  --page: #f6f8fb;
  --surface-1: #ffffff;
  --surface-2: #f8fafc;
  --surface-glass: rgba(255, 255, 255, .94);
  --surface-raised: #ffffff;
  --surface-accent: #f4f1fe;
  --dashboard-border: #e6e2f5;
  --text: #111827;
  --text-muted: #64748b;
  --border: #dbe3ec;
  --danger: #dc5149;
  --warning: #d79013;
  --success: #0f9f63;
  --info: #3478e5;
  --chart-grid: #e3eaf1;
  --overlay: rgba(5, 12, 8, .48);
  --danger-soft: rgba(220, 81, 73, .12);
  --warning-soft: rgba(215, 144, 19, .14);
  --success-soft: rgba(15, 159, 99, .13);
  --info-soft: rgba(52, 120, 229, .12);
  --card-radius: 18px;
  --control-radius: 12px;
  --shell-sidebar-width: 248px;
  --shell-content-offset: 264px;
  --shell-content-max: 1510px;
}
:root[data-theme="dark"] {
  --accent-strong: #c4b5fd;
  --page: #071017;
  --surface-1: #0d161d;
  --surface-2: #121d25;
  --surface-glass: rgba(13, 22, 29, .94);
  --surface-raised: #121c24;
  --surface-accent: #101a22;
  --dashboard-border: rgba(255, 255, 255, .10);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, .10);
  --danger: #ff746c;
  --warning: #f0b84d;
  --success: #51e884;
  --info: #72a7ff;
  --chart-grid: rgba(255, 255, 255, .10);
  --overlay: rgba(0, 0, 0, .62);
}
:root[data-radius="compact"] { --card-radius: 14px; --control-radius: 10px; }
:root[data-radius="balanced"] { --card-radius: 18px; --control-radius: 12px; }
:root[data-radius="rounded"] { --card-radius: 24px; --control-radius: 15px; }
:root[data-surface="neutral"] { --page: #f7f8fa; --surface-2: #f3f5f8; }
:root[data-theme="dark"][data-surface="neutral"] { --page: #090d11; --surface-1: #10161b; --surface-2: #151c22; }
:root[data-surface="contrast"] { --page: #eef3f8; --surface-1: #ffffff; --surface-2: #e9eff6; --border: #cbd6e2; }
:root[data-theme="dark"][data-surface="contrast"] { --page: #05090d; --surface-1: #0b1218; --surface-2: #121f29; --border: rgba(255,255,255,.15); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  background: var(--page); color: var(--text);
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 14px; line-height: 1.7;
  transition: background .25s, color .25s;
}
html[lang="fa"] body { font-family: "Vazirmatn FD", Vazirmatn, Tahoma, sans-serif; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { opacity: .9; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.85; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }
.timer-digits { direction: ltr; unicode-bidi: isolate; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }

/* ---------- پوسته داشبورد ---------- */
.dashboard-shell {
  min-height: 100vh; width: 100%; min-width: 0;
  padding: 8px 8px 110px;
  background-image:
    radial-gradient(circle at 18% 12%, var(--accent-soft), transparent 30%),
    linear-gradient(180deg, var(--accent-soft), transparent 38%);
}
@media (min-width: 640px) { .dashboard-shell { padding: 12px 12px 110px; } }
@media (min-width: 1280px) { .dashboard-shell { padding-bottom: 12px; } }
.shell-main-offset { min-width: 0; max-width: 100%; width: min(100%, var(--shell-content-max)); margin-inline: auto; }
@media (min-width: 1280px) {
  .shell-main-offset { width: min(var(--shell-content-max), calc(100% - var(--shell-content-offset) - 24px)); }
  html[dir="rtl"] .shell-main-offset { margin-right: calc(var(--shell-content-offset) + max(0px, (100% - var(--shell-content-offset) - var(--shell-content-max)) / 2)); margin-left: auto; }
  html[dir="ltr"] .shell-main-offset { margin-left: calc(var(--shell-content-offset) + max(0px, (100% - var(--shell-content-offset) - var(--shell-content-max)) / 2)); margin-right: auto; }
}
#main-content { padding: 16px 4px 24px; }
@media (min-width: 640px) { #main-content { padding: 20px 12px 24px; } }
@media (min-width: 1024px) { #main-content { padding-inline: 20px; } }

/* ---------- سایدبار ---------- */
.sidebar {
  position: fixed; top: 8px; bottom: 8px; inset-inline-start: 8px; z-index: 40;
  width: var(--shell-sidebar-width); display: none; flex-direction: column; overflow-y: auto;
  border-radius: var(--card-radius); border: 1px solid var(--dashboard-border);
  background: linear-gradient(180deg, var(--surface-1), var(--surface-raised));
  padding: 12px; box-shadow: 0 10px 32px rgba(0,0,0,.055);
}
@media (min-width: 1280px) { .sidebar { display: flex; } }
.sidebar-brand { border-bottom: 1px solid var(--dashboard-border); padding: 8px 8px 16px; }
.sidebar-label { margin: 16px 12px 8px; font-size: 9px; font-weight: 900; letter-spacing: .08em; color: var(--text-muted); }
.side-nav { display: grid; gap: 6px; }
.side-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px;
  border-radius: var(--control-radius); padding: 0 12px;
  font-size: 14px; font-weight: 700; color: var(--text-muted);
  transition: background .15s, color .15s;
}
.side-link:hover { background: var(--accent-soft); color: var(--text); }
.side-link.active { background: var(--accent-fill); color: var(--accent-foreground); box-shadow: 0 7px 18px rgba(139,92,246,.25); }
.side-link .side-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); }
.side-link:hover .side-ic { background: var(--surface-1); }
.side-link.active .side-ic { background: rgba(255,255,255,.15); }
.side-link .dot { margin-inline-start: auto; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.7); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--dashboard-border); padding-top: 12px; display: grid; gap: 6px; }
.ready-box { margin-top: 8px; border-radius: 16px; border: 1px solid var(--dashboard-border); background: var(--surface-2); padding: 12px; font-size: 10px; color: var(--text-muted); }
.ready-box .ready-head { display: flex; align-items: center; gap: 8px; font-weight: 900; color: var(--text); font-size: 11px; }
.ready-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }

/* ---------- برند ---------- */
.brand { display: flex; align-items: center; gap: 8px; }
.brand strong { display: block; font-size: 17px; font-weight: 900; line-height: 1.3; }
.brand small { display: block; font-size: 10px; color: var(--text-muted); font-weight: 600; }
.brand-txt { display: none; flex-direction: column; gap: 2px; }
@media (min-width: 768px) { .brand-txt { display: flex; } }
.brand-mark { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.brand-glow { position: absolute; inset: 8%; border-radius: 50%; background: rgba(139,92,246,.15); filter: blur(9px); }
.brand-mask {
  position: relative; display: block; width: 100%; height: 100%;
  -webkit-mask-image: url("../brand/vora-mark.svg"); mask-image: url("../brand/vora-mark.svg");
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain;
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }

/* ---------- هدر ---------- */
.app-header {
  position: sticky; top: 8px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 62px; border-radius: var(--card-radius);
  border: 1px solid var(--dashboard-border); background: var(--surface-glass);
  padding: 8px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.035);
  backdrop-filter: blur(20px);
}
.header-route { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-route .route-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.header-route small { display: none; font-size: 9px; font-weight: 600; color: var(--text-muted); }
.header-route strong { display: block; font-size: 12px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 640px) { .header-route small { display: block; } }
.header-brand-mini { display: none; }
.header-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
@media (max-width: 520px) {
  .header-route { display: none; }
  .header-brand-mini { display: block; }
  .header-actions { flex: 1; justify-content: flex-end; }
  .app-header { min-height: 58px; border-radius: 18px; padding: 6px 10px; }
}
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 12px; border: 1px solid var(--dashboard-border);
  background: var(--surface-1); color: var(--text);
  transition: background .15s;
}
.icon-btn:hover { background: var(--accent-soft); }
.mode-switch { display: flex; align-items: center; gap: 4px; border: 1px solid var(--dashboard-border); background: var(--surface-1); border-radius: 12px; padding: 3px; }
.mode-switch button { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 700; border-radius: 9px; padding: 7px 10px; }
.mode-switch button.active { background: var(--accent-fill); color: var(--accent-foreground); }
@media (max-width: 760px) { .mode-switch button span { display: none; } .mode-switch button { padding: 7px 8px; } }
.save-state { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; color: var(--success); }
@media (max-width: 900px) { .save-state span { display: none; } }
.profile-wrap { position: relative; }
.profile-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--dashboard-border); background: var(--surface-1); color: var(--text); border-radius: 12px; padding: 4px 10px 4px 4px; }
html[dir="ltr"] .profile-btn { padding: 4px 4px 4px 10px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 900; font-size: 14px; }
.profile-btn .pname { font-size: 11px; font-weight: 700; max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .profile-btn .pname { display: none; } }
.profile-menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60;
  min-width: 230px; border-radius: 16px; border: 1px solid var(--dashboard-border);
  background: var(--surface-1); box-shadow: 0 18px 50px rgba(0,0,0,.14); padding: 8px;
  display: none;
}
.profile-menu.open { display: block; }
.profile-menu a, .profile-menu button.mi {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: start;
  border: 0; background: transparent; color: var(--text); font-size: 13px; font-weight: 600;
  border-radius: 10px; padding: 10px 12px;
}
.profile-menu a:hover, .profile-menu button.mi:hover { background: var(--accent-soft); }
.profile-menu .mi-head { padding: 10px 12px; border-bottom: 1px solid var(--dashboard-border); margin-bottom: 6px; }
.profile-menu .mi-head strong { display: block; font-size: 13px; }
.profile-menu .mi-head small { color: var(--text-muted); font-size: 11px; }

/* ---------- ناوبری موبایل ---------- */
.mobile-nav {
  position: fixed; bottom: 10px; left: 10px; right: 10px; z-index: 50;
  display: flex; gap: 4px; justify-content: space-around;
  border-radius: 20px; border: 1px solid var(--dashboard-border);
  background: var(--surface-glass); backdrop-filter: blur(20px);
  padding: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.12);
}
@media (min-width: 1280px) { .mobile-nav { display: none; } }
.mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 700; color: var(--text-muted); padding: 6px 10px; border-radius: 12px; min-width: 60px; }
.mobile-nav a.active { color: var(--accent-strong); background: var(--accent-soft); }

/* ---------- فوتر ---------- */
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 6px 4px; font-size: 11px; color: var(--text-muted); }
.app-footer nav { display: flex; gap: 14px; flex-wrap: wrap; }
.app-footer a { color: var(--text-muted); font-weight: 600; }
.online-dot { display: inline-flex; align-items: center; gap: 6px; }
.online-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; }

/* ---------- کارت‌ها ---------- */
.card, .dashboard-card {
  border: 1px solid var(--dashboard-border);
  background: linear-gradient(145deg, var(--surface-1), var(--surface-raised));
  border-radius: var(--card-radius);
  box-shadow: 0 5px 18px rgba(0,0,0,.035);
}
.card { padding: 18px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.card-head h2 .h-ic, .card-head h3 .h-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); }
.card-head p { margin: 2px 0 0; font-size: 11px; color: var(--text-muted); }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.page-head { margin: 4px 2px 14px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 900; }
.page-head p { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); }

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--control-radius); border: 1px solid var(--dashboard-border);
  background: var(--surface-1); color: var(--text);
  font-size: 13px; font-weight: 700; padding: 10px 16px;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--accent-soft); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent-fill); border-color: transparent; color: var(--accent-foreground); box-shadow: 0 7px 18px rgba(139,92,246,.25); }
.btn-primary:hover { background: var(--accent-fill); filter: brightness(1.06); }
.btn-secondary { background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-lg { padding: 13px 22px; font-size: 14px; width: 100%; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- بج‌ها و بنرها ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 10px; font-weight: 800; background: var(--accent-soft); color: var(--accent-strong); }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-amber { background: var(--warning-soft); color: var(--warning); }
.badge-blue { background: var(--info-soft); color: var(--info); }
.badge-gray { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--dashboard-border); }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: var(--card-radius); padding: 14px 18px; margin-bottom: 14px; border: 1px solid transparent; font-size: 13px; }
.banner strong { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.banner p { margin: 2px 0 0; font-size: 11px; opacity: .85; }
.banner-red { background: #fdeeee; color: #b3372f; border-color: #f6d2cf; }
.banner-green { background: #ddf3e7; color: #0b6e44; border-color: #bfe6d2; }
:root[data-theme="dark"] .banner-red { background: rgba(255,116,108,.1); color: var(--danger); border-color: rgba(255,116,108,.25); }
:root[data-theme="dark"] .banner-green { background: rgba(81,232,132,.09); color: var(--success); border-color: rgba(81,232,132,.22); }

/* ---------- فرم‌ها ---------- */
label.f { display: grid; gap: 7px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="time"], input[type="date"], input[type="datetime-local"], select, textarea {
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text);
  border-radius: var(--control-radius); padding: 10px 12px; font-size: 13px; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 90px; resize: vertical; }
input[type="color"] { width: 44px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); padding: 3px; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
.form-grid { display: grid; gap: 14px; }
.row-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.row-3 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .row-3 { grid-template-columns: 1fr; } }
.checkline { display: flex !important; align-items: center; gap: 8px; flex-direction: row !important; font-size: 13px !important; color: var(--text) !important; font-weight: 600 !important; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline-form label.f { flex: 1; min-width: 130px; }

/* ---------- جدول‌ها ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--control-radius); border: 1px solid var(--dashboard-border); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--surface-1); }
.tbl th { background: var(--surface-2); color: var(--text-muted); font-size: 11px; font-weight: 700; padding: 10px 12px; text-align: start; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--dashboard-border); vertical-align: middle; }
.tbl tr:hover td { background: var(--surface-accent); }
.tbl .row-actions { display: flex; gap: 6px; }

/* ---------- هیرو امروز ---------- */
.hero {
  display: grid; gap: 16px; align-items: center; grid-template-columns: 1fr;
  padding: 18px 20px; margin-bottom: 14px; min-height: 124px;
}
@media (min-width: 720px) { .hero { grid-template-columns: minmax(250px,.85fr) minmax(0,1.55fr) minmax(160px,.65fr); } }
.hero-date { display: grid; grid-template-columns: 42px minmax(0,1fr) 42px; gap: 8px; align-items: stretch; }
.hero-date .icon-btn { width: 42px; height: auto; min-height: 52px; border-radius: 12px; background: var(--surface-2); }
.hero-date input { text-align: center; font-weight: 700; background: var(--surface-2); border: 1px solid var(--dashboard-border); }
.date-nav { display: flex; gap: 8px; align-items: stretch; }
.date-nav .icon-btn { width: 42px; min-width: 42px; min-height: 52px; border-radius: 12px; background: var(--surface-2); }
.date-nav input.date-text { flex: 1; min-width: 0; text-align: center; font-weight: 800; background: var(--surface-2); border: 1px solid var(--dashboard-border); }
.date-display-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.date-display { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--dashboard-border); background: var(--surface-2); border-radius: 12px; font-weight: 800; font-size: 13px; color: var(--text); padding: 0 12px; min-height: 52px; white-space: nowrap; overflow: hidden; }
input.date-overlay { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.side-link.soft-active { background: var(--accent-soft) !important; color: var(--accent-strong) !important; box-shadow: none !important; }
.side-link.soft-active .side-ic { background: var(--surface-1) !important; }
.hero-mid { text-align: center; min-width: 0; }
.hero-mid h1 { margin: 0; font-size: clamp(1.2rem, 2.3vw, 2rem); font-weight: 900; line-height: 1.4; letter-spacing: -.02em; }
.hero-mid p { margin: 6px 0 0; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.hero-side { display: flex; justify-content: flex-end; }
@media (max-width: 719px) { .hero-side { justify-content: center; } }
.quick-nav { min-width: 150px; border-radius: 12px; border: 1px solid var(--dashboard-border); background: var(--surface-2); padding: 8px 12px; display: none; }
@media (min-width: 1280px) { .quick-nav { display: block; } }
.quick-nav span { display: block; font-size: 9px; font-weight: 700; color: var(--text-muted); }
.quick-nav strong { display: block; margin-top: 2px; font-size: 11px; }

/* ---------- متریک‌های خلاصه ---------- */
.metrics { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .metrics { grid-template-columns: repeat(5, 1fr); } }
.metric { border: 1px solid var(--dashboard-border); background: var(--surface-1); border-radius: 16px; padding: 14px; text-align: center; }
.metric .m-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 6px; }
.metric small { display: block; font-size: 10px; color: var(--text-muted); font-weight: 600; }
.metric strong { display: block; font-size: 17px; font-weight: 900; }
.metric-ring { position: relative; width: 64px; height: 64px; margin: 0 auto 4px; }
.metric-ring svg { transform: rotate(-90deg); }
.metric-ring .ring-val { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 15px; }

/* ---------- تایمر زنده ---------- */
.flip { display: flex; gap: 8px; justify-content: center; direction: ltr; }
.flip .cell { background: var(--surface-2); border: 1px solid var(--dashboard-border); border-radius: 14px; min-width: 66px; padding: 10px 6px; text-align: center; }
.flip .cell b { display: block; font-size: 26px; font-weight: 900; }
.flip .cell small { font-size: 10px; color: var(--text-muted); font-weight: 700; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--dashboard-border); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent-fill); border-radius: 999px; transition: width .4s; }

/* ---------- تقویم ماه ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 10px; font-weight: 800; color: var(--text-muted); padding: 6px 0; }
.cal-day {
  position: relative; min-height: 64px; border-radius: 12px; border: 1px solid var(--dashboard-border);
  background: var(--surface-1); padding: 6px; font-size: 11px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text);
  transition: border-color .15s;
}
.cal-day:hover { border-color: var(--accent); }
.cal-day .dnum { font-weight: 900; font-size: 13px; }
.cal-day .dh { font-size: 9px; color: var(--text-muted); }
.cal-day.holiday { background: var(--danger-soft); border-color: transparent; }
.cal-day.today { border: 2px solid var(--accent); }
.cal-day.selected { background: var(--accent-soft); border-color: var(--accent); }
.cal-day.off { opacity: .45; }
.cal-day .mdot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--dashboard-border); display: block; }
.heat i.l1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); }
.heat i.l2 { background: color-mix(in srgb, var(--accent) 45%, var(--surface-2)); }
.heat i.l3 { background: color-mix(in srgb, var(--accent) 70%, var(--surface-2)); }
.heat i.l4 { background: var(--accent-fill); }
/* نمودار میله‌ای */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 10px 4px 0; border-bottom: 1px solid var(--dashboard-border); direction: ltr; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .bar i { width: 70%; max-width: 34px; border-radius: 6px 6px 0 0; background: var(--accent-fill); opacity: .85; display: block; }
.bars .bar.hol i { background: var(--danger); opacity: .6; }
.bars .bar small { font-size: 9px; color: var(--text-muted); }

/* ---------- لیست‌ها ---------- */
.list { display: grid; gap: 10px; }
.row-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--dashboard-border); background: var(--surface-1); border-radius: 14px; padding: 12px 14px; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item strong { display: block; font-size: 13px; }
.row-item small { color: var(--text-muted); font-size: 11px; }
.color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.proj-card { display: grid; gap: 10px; }
.proj-top { display: flex; align-items: center; gap: 10px; }
.proj-top .grow { flex: 1; min-width: 0; }
.proj-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--text-muted); }
.proj-stats b { color: var(--text); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 8px 14px; border-radius: 10px; font-size: 12px; font-weight: 700; color: var(--text-muted); border: 1px solid var(--dashboard-border); background: var(--surface-1); }
.tabs a.active { background: var(--accent-fill); color: var(--accent-foreground); border-color: transparent; }
.feed { display: grid; gap: 8px; }
.feed-item { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; border: 1px solid var(--dashboard-border); background: var(--surface-1); border-radius: 12px; padding: 10px 12px; }
.feed-item time { margin-inline-start: auto; font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* ---------- تنظیمات ---------- */
.settings-layout { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .settings-layout { grid-template-columns: 230px 1fr; align-items: start; } }
.settings-nav { display: flex; gap: 6px; overflow-x: auto; padding: 12px; }
@media (min-width: 900px) { .settings-nav { flex-direction: column; position: sticky; top: 84px; } }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.settings-nav a:hover { background: var(--accent-soft); color: var(--text); }
.settings-nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
.accent-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.accent-pick label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--dashboard-border); border-radius: 12px; padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer; background: var(--surface-1); }
.accent-pick input { accent-color: var(--accent); }
.swatch { width: 18px; height: 18px; border-radius: 50%; display: inline-block; }
.seg { display: flex; gap: 4px; border: 1px solid var(--dashboard-border); border-radius: 12px; padding: 3px; background: var(--surface-1); width: max-content; max-width: 100%; flex-wrap: wrap; }
.seg label { padding: 7px 14px; border-radius: 9px; font-size: 12px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--accent-fill); color: var(--accent-foreground); }
.schedule-row { display: grid; grid-template-columns: 1fr; gap: 8px; border: 1px solid var(--dashboard-border); border-radius: 12px; padding: 12px; background: var(--surface-1); }
@media (min-width: 700px) { .schedule-row { grid-template-columns: 130px repeat(4, 1fr); align-items: end; } }
.schedule-row .day-name { font-weight: 900; font-size: 13px; display: flex; align-items: center; gap: 8px; }

/* ---------- دیالوگ ---------- */
dialog.sheet { border: 1px solid var(--dashboard-border); border-radius: 20px; background: var(--surface-1); color: var(--text); padding: 20px; max-width: 520px; width: calc(100vw - 32px); box-shadow: 0 24px 70px rgba(0,0,0,.25); }
dialog.sheet::backdrop { background: var(--overlay); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { margin: 0; font-size: 15px; font-weight: 900; }

/* ---------- تست‌ها/بنر نصب ---------- */
.install-banner { display: none; }

/* ---------- صفحات عمومی و ورود ---------- */
.public-shell { min-height: 100vh; padding: 20px 14px 40px; background-image: radial-gradient(circle at 18% 12%, var(--accent-soft), transparent 30%); }
.public-wrap { max-width: 1020px; margin: 0 auto; }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--dashboard-border); background: var(--surface-glass); border-radius: var(--card-radius); padding: 10px 16px; margin-bottom: 18px; backdrop-filter: blur(20px); }
.public-header nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.public-header nav a { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 8px 12px; border-radius: 10px; }
.public-header nav a:hover, .public-header nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
.public-header nav a.btn-primary { color: var(--accent-foreground); }
.public-header nav a.btn-primary:hover { color: var(--accent-foreground); filter: brightness(1.06); }
.auth-layout { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .auth-layout { grid-template-columns: 1fr 1fr; } }
.auth-hero { padding: 26px; }
.auth-hero h1 { margin: 10px 0 6px; font-size: 24px; font-weight: 900; }
.auth-hero p { color: var(--text-muted); font-size: 13px; margin: 0 0 16px; }
.feat { display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; padding: 8px 0; }
.feat .f-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); }
.auth-card { padding: 26px; }
.auth-card h1 { margin: 0 0 4px; font-size: 20px; font-weight: 900; }
.auth-card .sub { color: var(--text-muted); font-size: 12px; margin: 0 0 18px; }
.auth-switch { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 16px; }
.prose { line-height: 2; font-size: 13px; }
.prose h1 { font-size: 20px; }
.prose h2 { font-size: 16px; margin-top: 22px; }
.prose ul { padding-inline-start: 20px; }

/* ---------- آنبوردینگ ---------- */
.onboard-wrap { max-width: 680px; margin: 30px auto; }
.onboard-card { padding: 30px; text-align: center; }
.onboard-card h1 { margin: 12px 0 4px; font-size: 22px; }
.steps { display: flex; gap: 6px; justify-content: center; margin: 16px 0; }
.steps i { width: 34px; height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--dashboard-border); }
.steps i.on { background: var(--accent-fill); border-color: transparent; }
.mode-cards { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 14px 0; text-align: start; }
@media (min-width: 640px) { .mode-cards { grid-template-columns: repeat(3, 1fr); } }
.mode-cards label { border: 2px solid var(--dashboard-border); border-radius: 16px; padding: 16px 12px; cursor: pointer; background: var(--surface-1); display: grid; gap: 4px; justify-items: center; text-align: center; }
.mode-cards label:has(input:checked) { border-color: var(--accent); background: var(--surface-accent); }
.mode-cards input { display: none; }
.mode-cards strong { font-size: 14px; }
.mode-cards small { color: var(--text-muted); font-size: 11px; }
.day-pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 12px 0; }
.day-pills label { border: 1px solid var(--dashboard-border); border-radius: 999px; padding: 8px 16px; font-size: 12px; font-weight: 700; cursor: pointer; background: var(--surface-1); }
.day-pills label:has(input:checked) { background: var(--accent-fill); color: var(--accent-foreground); border-color: transparent; }
.day-pills input { display: none; }

/* ---------- نصب ---------- */
.install-page { display: grid; place-items: center; min-height: 100vh; padding: 24px 14px; }
.install-wrap { width: 100%; max-width: 640px; }
.install-card { border: 1px solid var(--dashboard-border); background: var(--surface-1); border-radius: 24px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.1); }
.install-card h1 { font-size: 20px; margin: 14px 0 4px; }
.install-card h3 { font-size: 14px; margin: 8px 0 0; padding-top: 10px; border-top: 1px dashed var(--border); }
.install-brand { display: flex; align-items: center; gap: 12px; }
.install-brand .brand-mask { width: 48px; height: 48px; }
.install-brand strong { display: block; font-size: 18px; }
.install-brand small { color: var(--text-muted); font-size: 11px; }
.checks { display: grid; gap: 6px; margin: 14px 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; border-radius: 10px; padding: 8px 12px; background: var(--surface-2); }
.check.ok { color: var(--success); } .check.bad { color: var(--danger); background: var(--danger-soft); }

/* ---------- هشدارها ---------- */
.alert { border-radius: 14px; padding: 12px 16px; font-size: 13px; font-weight: 600; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-warn { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--info-soft); color: var(--info); }
:root[data-theme="dark"] .alert-warn { color: var(--warning); }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 100; background: var(--text); color: var(--page); font-size: 13px; font-weight: 700; border-radius: 999px; padding: 12px 22px; box-shadow: 0 14px 40px rgba(0,0,0,.3); animation: toast-in .3s; max-width: calc(100vw - 40px); text-align: center; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.empty { text-align: center; padding: 34px 16px; color: var(--text-muted); }
.empty .e-ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 10px; }
.flag { display: inline-flex; flex-direction: column; width: 22px; height: 16px; border-radius: 4px; overflow: hidden; border: 1px solid var(--border); vertical-align: middle; }
.flag i { flex: 1; display: block; }
.flag-ir i:nth-child(1) { background: #239f40; } .flag-ir i:nth-child(2) { background: #fff; } .flag-ir i:nth-child(3) { background: #da0000; }
.lang-switch { display: flex; align-items: center; gap: 8px; border: 1px solid var(--dashboard-border); background: var(--surface-1); border-radius: 12px; padding: 8px 12px; font-size: 12px; font-weight: 700; color: var(--text); width: 100%; justify-content: space-between; }
.skip-link { position: absolute; top: -60px; inset-inline-start: 16px; z-index: 200; background: var(--accent-fill); color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 700; transition: top .2s; }
.skip-link:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- چاپ فاکتور ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  header, footer, nav, aside, button, .no-print { display: none !important; }
  html, body, main { background: #fff !important; }
  body { color: #111 !important; font-size: 10pt; }
  .dashboard-shell { padding: 0 !important; background: none !important; }
  .card, .dashboard-card { box-shadow: none !important; break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 359px) {
  #main-content { padding: 12px 2px 20px; }
  .card { padding: 14px; }
}
@media (max-width: 640px) {
  .card-head { flex-wrap: wrap; }
  .month-nav { width: 100% !important; }
}
.month-nav { width: 340px; max-width: 100%; flex-shrink: 0; }

/* دیت‌پیکر شمسی (JalaliDatePicker): هماهنگی با تم ورا */
.jdp-date, .jdp-time { cursor: pointer; }
jdp-container { --jdp-primary: var(--accent-fill, #8b5cf6); font-family: inherit; }
:root[data-theme="dark"] jdp-container {
  --jdp-color-0: var(--surface-1);
  --jdp-color-1: var(--surface-2);
  --jdp-color-2: var(--dashboard-border);
  --jdp-color-3: rgba(255, 255, 255, .22);
  --jdp-color-4: var(--text-muted);
  --jdp-color-5: var(--text);
  --jdp-red: var(--danger);
}
