﻿/* ==========================================================================
   سیستم مدیریت یکپارچه معین — سیستم طراحی
   ساختار: متغیرها → پایه → چیدمان → اجزا → ابزارها
   ========================================================================== */

/* --------------------------------------------------------------------------
   ۱) فونت‌ها
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* --------------------------------------------------------------------------
   ۲) متغیرهای طراحی
   -------------------------------------------------------------------------- */
:root {
    --font: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-full: 999px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, .10);
    --shadow: 0 10px 24px -12px rgba(15, 23, 42, .22);
    --shadow-lg: 0 28px 60px -20px rgba(15, 23, 42, .35);

    --topbar-h: 64px;
    --quicknav-h: 52px;
    --content-max: 1440px;

    --transition: 160ms cubic-bezier(.4, 0, .2, 1);
}

/* رنگ سازمانی: ۶ گزینه */
[data-accent="teal"]    { --accent: #14b8a6; --accent-strong: #0d9488; --accent-soft: rgba(20, 184, 166, .14); --accent-ring: rgba(20, 184, 166, .38); }
[data-accent="blue"]    { --accent: #2563eb; --accent-strong: #1d4ed8; --accent-soft: rgba(37, 99, 235, .12);  --accent-ring: rgba(37, 99, 235, .35); }
[data-accent="violet"]  { --accent: #7c3aed; --accent-strong: #6d28d9; --accent-soft: rgba(124, 58, 237, .12); --accent-ring: rgba(124, 58, 237, .35); }
[data-accent="emerald"] { --accent: #059669; --accent-strong: #047857; --accent-soft: rgba(5, 150, 105, .12);  --accent-ring: rgba(5, 150, 105, .35); }
[data-accent="amber"]   { --accent: #d97706; --accent-strong: #b45309; --accent-soft: rgba(217, 119, 6, .14);  --accent-ring: rgba(217, 119, 6, .35); }
[data-accent="rose"]    { --accent: #e11d48; --accent-strong: #be123c; --accent-soft: rgba(225, 29, 72, .12);  --accent-ring: rgba(225, 29, 72, .35); }

/* تم روشن */
[data-theme="light"] {
    --bg: #eaeef6;
    --bg-gradient:
        radial-gradient(1100px 520px at 100% -10%, var(--accent-soft), transparent 55%),
        radial-gradient(900px 480px at -10% 0%, rgba(99, 102, 241, .10), transparent 50%),
        linear-gradient(180deg, #f3f6fb 0%, #eaeef6 45%, #e6ebf4 100%);
    --surface: #ffffff;
    --surface-2: #f6f8fc;
    --surface-3: #eef2f8;
    --border: #e2e8f2;
    --border-strong: #cfd8e6;
    --text: #101a2c;
    --text-soft: #33415c;
    --muted: #5f6d86;
    --muted-2: #93a1b8;
    --accent-fg: #ffffff;

    /* رنگ فیروزه‌ای مخصوص متن روی زمینه‌ی روشن (کنتراست دست‌کم ۴.۵) */
    --accent-ink: var(--accent-strong);
    --accent-ink: color-mix(in srgb, var(--accent) 58%, #04120f);
    --accent-ink-strong: var(--accent-strong);
    --accent-ink-strong: color-mix(in srgb, var(--accent) 46%, #04120f);

    --success: #047857;  --success-soft: rgba(4, 120, 87, .10);
    --warning: #b45309;  --warning-soft: rgba(180, 83, 9, .12);
    --danger:  #be123c;  --danger-soft: rgba(190, 18, 60, .10);
    --info:    #0369a1;  --info-soft: rgba(3, 105, 161, .10);

    --shadow-xs: 0 1px 2px rgba(16, 26, 44, .05), 0 1px 1px rgba(16, 26, 44, .03);
    --shadow-sm: 0 3px 10px -4px rgba(16, 26, 44, .14), 0 1px 2px rgba(16, 26, 44, .04);
    --shadow: 0 14px 30px -18px rgba(16, 26, 44, .35), 0 2px 6px rgba(16, 26, 44, .05);
    --shadow-lg: 0 30px 60px -24px rgba(16, 26, 44, .40);
}

/* تم تاریک */
[data-theme="dark"] {
    --bg: #0b1220;
    --bg-gradient: radial-gradient(1200px 600px at 100% 0%, var(--accent-soft), transparent 55%);
    --surface: #111a2c;
    --surface-2: #16213a;
    --surface-3: #1d2b47;
    --border: #23324e;
    --border-strong: #32456b;
    --text: #eef2f9;
    --text-soft: #cbd5e1;
    --muted: #93a4c1;
    --muted-2: #64748b;
    --accent-fg: #04121a;

    --success: #34d399;  --success-soft: rgba(52, 211, 153, .16);
    --warning: #fbbf24;  --warning-soft: rgba(251, 191, 36, .16);
    --danger:  #f87171;  --danger-soft: rgba(248, 113, 113, .16);
    --info:    #38bdf8;  --info-soft: rgba(56, 189, 248, .16);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 2px 10px -2px rgba(0, 0, 0, .5);
    --shadow: 0 14px 30px -14px rgba(0, 0, 0, .7);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .8);
}

/* --------------------------------------------------------------------------
   ۳) پایه
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text);
    background-color: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; line-height: 1.5; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }

p { margin: 0; }

a { color: var(--accent-ink, var(--accent)); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-ink-strong, var(--accent-strong)); }

img { max-width: 100%; }

/* کنترل‌های فرم: رنگ و فونت را از تم ارث می‌برند
   (وگرنه متن دکمه یا ورودی در حالت شب مشکی و ناخوانا می‌ماند) */
button, input, select, textarea { font-family: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--accent-fg); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* نوار اسکرول */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: content-box; }

/* --------------------------------------------------------------------------
   ۴) چیدمان کلی
   -------------------------------------------------------------------------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding-inline: 2cm;
}

@media (max-width: 1200px) {
    .container { padding-inline: 28px; }
}

@media (max-width: 720px) {
    .container { padding-inline: 14px; }
}

/* ــــ نوار بالا ــــ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding-inline: 2cm;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.topbar::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent) 35%, var(--accent) 65%, transparent);
    opacity: .5;
}

@media (max-width: 1200px) {
    .topbar { padding-inline: 28px; }
}

.topbar__start,
.topbar__end { display: flex; align-items: center; gap: 8px; }
.topbar__end { margin-inline-start: auto; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { color: var(--text); }

.brand__mark {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    font-size: 17px;
    box-shadow: var(--shadow-sm);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.3; }
.brand__text small { font-size: 11px; font-weight: 500; color: var(--muted); }

/* جست‌وجوی سریع */
.search-trigger {
    flex: 1;
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 14px;
    margin: 0 auto;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
}
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface-3); }
.search-trigger kbd {
    margin-inline-start: auto;
    font-family: inherit;
    font-size: 11px;
    padding: 2px 7px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
}

/* ــــ ناوبری سریع (بدون سایدبار) ــــ */
.quicknav {
    position: sticky;
    top: var(--topbar-h);
    z-index: 35;
    height: var(--quicknav-h);
    display: flex;
    align-items: center;
    gap: 6px;
    padding-inline: 2cm;
    overflow-x: auto;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}

@media (max-width: 1200px) {
    .quicknav { padding-inline: 28px; }
}
.quicknav::-webkit-scrollbar { display: none; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-soft);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    white-space: nowrap;
    transition: all var(--transition);
}
.pill:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.pill.is-active {
    color: var(--accent-ink, var(--accent));
    background: var(--accent-soft);
    border-color: var(--accent-ring);
    font-weight: 600;
}
.pill i { font-size: 13px; opacity: .85; }

/* ــــ محتوا ــــ */
.content { flex: 1; padding: 26px 0 60px; }

.page-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-head__title h1 { margin-bottom: 4px; }
.page-head__title p { color: var(--muted); font-size: 13.5px; }
.page-head__actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 8px;
}
.breadcrumb i { font-size: 10px; opacity: .6; }

.footer {
    padding: 26px 0 30px;
    font-size: 12.5px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    gap: 22px;
    text-align: start;
}

.footer-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 10px;
}

.footer-links { display: flex; flex-direction: column; gap: 7px; }
.footer-note { line-height: 2; }
.footer-links a { color: var(--muted); font-size: 12.5px; }
.footer-links a:hover { color: var(--accent-ink, var(--accent)); }
.footer-links span { font-size: 12.5px; color: var(--muted); }

.footer-bottom {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted-2);
}

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .footer-grid { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   ۵) کارت و شبکه
   -------------------------------------------------------------------------- */
.card {
    background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 96%, var(--bg)) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.card--pad { padding: 20px; }
.card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--accent) 4%, var(--surface-2));
}
.card__head h3 { font-size: 15px; }
.card__head .spacer { margin-inline-start: auto; }
.card__body { padding: 18px; }
.card__foot { padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* کارت آمار */
.stat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: linear-gradient(150deg,
        color-mix(in srgb, var(--stat-color, var(--accent)) 7%, var(--surface)) 0%,
        var(--surface) 55%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat::after {
    content: '';
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 4px;
    background: var(--stat-color, var(--accent));
}
.stat__icon {
    width: 46px; height: 46px;
    flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 14px;
    font-size: 18px;
    color: var(--stat-color, var(--accent));
    background: color-mix(in srgb, var(--stat-color, var(--accent)) 14%, transparent);
}
.stat__value { font-size: 1.55rem; font-weight: 700; line-height: 1.3; }
.stat__label { font-size: 13px; color: var(--muted); }
.stat__hint { font-size: 11.5px; color: var(--muted-2); }

/* --------------------------------------------------------------------------
   ۶) دکمه‌ها
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}
.btn:hover { background: var(--surface-2); border-color: var(--muted-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; }

.btn--primary {
    color: var(--accent-fg);
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-color: transparent;
    box-shadow: 0 6px 16px -8px var(--accent);
}
.btn--primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--accent), var(--accent-strong)); }

.btn--soft { color: var(--accent-ink, var(--accent)); background: var(--accent-soft); border-color: transparent; }
.btn--soft:hover { background: var(--accent-soft); border-color: var(--accent-ring); }

.btn--danger { color: #fff; background: var(--danger); border-color: transparent; }
.btn--danger:hover { filter: brightness(1.05); background: var(--danger); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border); }

.btn--sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn--block { width: 100%; }

.icon-btn {
    width: 38px; height: 38px;
    display: inline-grid;
    place-items: center;
    font-size: 15px;
    color: var(--text-soft);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }

/* --------------------------------------------------------------------------
   ۷) فرم‌ها
   -------------------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field__label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-soft); }
.field__label .req { color: var(--danger); }
.field__hint { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.field__error { margin-top: 5px; font-size: 12px; color: var(--danger); }

.input, .select, .textarea {
    width: 100%;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0 13px;
    height: 42px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.8; }
.select { appearance: none; padding-inline-end: 34px; background-image: none; cursor: pointer; }

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }

/* ارقام لاتین ترتیب LTR خود را نگه می‌دارند ولی هم‌تراز با بقیهٔ فیلدهای راست‌چین می‌شوند */
html[dir="rtl"] input[dir="ltr"],
html[dir="rtl"] textarea[dir="ltr"],
html[dir="rtl"] select[dir="ltr"],
html[dir="rtl"] .table th[dir="ltr"],
html[dir="rtl"] .table td[dir="ltr"] { text-align: right; }

.select-wrap { position: relative; }
.select-wrap::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    position: absolute;
    inset-inline-end: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--text-soft);
    cursor: pointer;
}
.check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

/* کلید روشن/خاموش */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
    width: 42px; height: 24px;
    border-radius: var(--radius-full);
    background: var(--border-strong);
    position: relative;
    transition: background var(--transition);
}
.switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    inset-inline-end: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition);
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(-18px); }
html[dir="ltr"] .switch input:checked + .switch__track::after { transform: translateX(18px); }

/* --------------------------------------------------------------------------
   ۸) جدول
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--border); }
.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-2);
    white-space: nowrap;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table th.is-actions, .table td.is-actions { width: 1%; white-space: nowrap; text-align: end; }
.table th.is-actions { font-size: 11.5px; color: var(--muted-2); }

.table--compact th, .table--compact td { padding: 9px 12px; }

/* --------------------------------------------------------------------------
   ۹) نشان‌ها و برچسب‌ها
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 500;
    border-radius: var(--radius-full);
    color: var(--muted);
    background: var(--surface-3);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.badge--success { color: var(--success); background: var(--success-soft); border-color: transparent; }
.badge--warning { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
.badge--danger  { color: var(--danger);  background: var(--danger-soft);  border-color: transparent; }
.badge--info    { color: var(--info);    background: var(--info-soft);    border-color: transparent; }
.badge--accent  { color: var(--accent-ink, var(--accent));  background: var(--accent-soft);  border-color: transparent; }
.badge--soon    { color: var(--warning); background: var(--warning-soft); border-color: transparent; font-size: 10.5px; }

.dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--danger);
    display: inline-block;
}

.avatar {
    width: 38px; height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--accent-fg);
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar--lg { width: 72px; height: 72px; font-size: 24px; }

/* --------------------------------------------------------------------------
   ۱۰) منوی کشویی
   -------------------------------------------------------------------------- */
.dropdown { position: relative; }
.dropdown__menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    z-index: 60;
    min-width: 240px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all var(--transition);
}
.dropdown.is-open .dropdown__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown__menu--floating { opacity: 1; visibility: visible; transform: none; z-index: 90; }
.dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    font-size: 13.5px;
    color: var(--text-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}
.dropdown__item:hover { background: var(--surface-2); color: var(--text); }
.dropdown__item i { width: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.dropdown__divider { height: 1px; margin: 6px 4px; background: var(--border); }
.dropdown__title { padding: 8px 11px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted-2); }
.dropdown__form { padding: 4px 6px 6px; display: grid; gap: 6px; }
.dropdown__form .select-wrap { width: 100%; }
.dropdown__form .select { width: 100%; }

/* --------------------------------------------------------------------------
   ۱۱) کشو (Drawer)، پرده و پالت فرمان
   -------------------------------------------------------------------------- */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(8, 15, 30, .55);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}
.backdrop.is-open { opacity: 1; visibility: visible; }

.drawer {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: 95;
    width: min(420px, 92vw);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-inline-start: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(.32, .72, 0, 1);
}
html[dir="rtl"] .drawer { transform: translateX(-100%); }
.drawer.is-open { transform: translateX(0); }
.drawer__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.drawer__body { flex: 1; overflow-y: auto; padding: 12px 14px 40px; }
.drawer__group { margin-bottom: 16px; }
.drawer__group-title {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted-2);
    padding: 6px 10px;
    letter-spacing: .2px;
}
.drawer__link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    font-size: 13.5px;
    color: var(--text-soft);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.drawer__link:hover { background: var(--surface-2); color: var(--text); }
.drawer__link.is-active { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); font-weight: 600; }
.drawer__link i { width: 20px; text-align: center; font-size: 14px; color: var(--muted); }
.drawer__link.is-active i { color: var(--accent-ink, var(--accent)); }
.drawer__link.is-soon { opacity: .55; cursor: not-allowed; }

/* پالت فرمان */
.palette {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 16px 16px;
    background: rgba(8, 15, 30, .5);
    backdrop-filter: blur(4px);
}
.palette.is-open { display: flex; }
.palette__box {
    width: 100%;
    max-width: 620px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: palette-in 200ms cubic-bezier(.32, .72, 0, 1);
}
@keyframes palette-in { from { opacity: 0; transform: translateY(-14px) scale(.98); } to { opacity: 1; transform: none; } }

.palette__input-wrap { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.palette__input-wrap i { color: var(--muted); }
.palette__input {
    flex: 1;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: none;
}
.palette__results { max-height: 54vh; overflow-y: auto; padding: 8px; }
.palette__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    cursor: pointer;
}
.palette__item i { width: 20px; text-align: center; color: var(--muted); }
.palette__item .meta { margin-inline-start: auto; font-size: 11px; color: var(--muted-2); }
.palette__item.is-active, .palette__item:hover { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); }
.palette__item.is-active i, .palette__item:hover i { color: var(--accent-ink, var(--accent)); }
.palette__empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }
.palette__foot {
    display: flex;
    gap: 16px;
    padding: 10px 18px;
    font-size: 11.5px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

/* --------------------------------------------------------------------------
   ۱۲) اعلان‌ها (Toast) و پیام‌ها
   -------------------------------------------------------------------------- */
.toasts {
    position: fixed;
    inset-block-end: 22px;
    inset-inline-start: 22px;
    z-index: 110;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(400px, 92vw);
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    animation: toast-in 240ms cubic-bezier(.32, .72, 0, 1);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.toast.is-hiding { opacity: 0; transform: translateY(10px); transition: all 220ms ease; }
.toast--success { border-inline-start-color: var(--success); }
.toast--danger { border-inline-start-color: var(--danger); }
.toast--warning { border-inline-start-color: var(--warning); }
.toast__icon { color: var(--accent); font-size: 15px; margin-top: 2px; }
.toast--success .toast__icon { color: var(--success); }
.toast--danger .toast__icon { color: var(--danger); }
.toast--warning .toast__icon { color: var(--warning); }
.toast__body { flex: 1; }
.toast__close { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; }

/* --------------------------------------------------------------------------
   ۱۳) صفحه‌های ورود و خطا
   -------------------------------------------------------------------------- */
.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 18px;
}
.auth__card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.auth__head { padding: 30px 28px 18px; text-align: center; }
.auth__logo {
    width: 62px; height: 62px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-size: 25px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 14px 30px -14px var(--accent);
}
.auth__head h1 { font-size: 1.25rem; margin-bottom: 6px; }
.auth__head p { font-size: 13px; color: var(--muted); }
.auth__body { padding: 8px 28px 26px; }
.auth__foot {
    padding: 15px 28px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    background: var(--surface-2);
    border-top: 1px solid var(--border);
}
.auth__themes { display: flex; justify-content: center; gap: 8px; padding: 0 28px 22px; }

.swatch {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform var(--transition);
}
.swatch:hover { transform: scale(1.12); }
.swatch.is-active { border-color: var(--text); }

.error-page { text-align: center; padding: 60px 20px; }
.error-page__code { font-size: 4.5rem; font-weight: 700; line-height: 1; color: var(--accent); opacity: .25; }
.error-page h2 { margin: 10px 0; }

/* --------------------------------------------------------------------------
   ۱۴) حالت خالی، آمار کوچک و ریز‌اجزا
   -------------------------------------------------------------------------- */
.empty {
    padding: 46px 20px;
    text-align: center;
    color: var(--muted);
}
.empty i { font-size: 34px; opacity: .35; display: block; margin-bottom: 12px; }
.empty h3 { font-size: 15px; color: var(--text-soft); margin-bottom: 5px; }
.empty p { font-size: 13px; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    font-size: 12.5px;
    color: var(--text-soft);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}
.chip i { font-size: 11px; color: var(--muted); }

.pagination { display: flex; gap: 5px; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0 9px;
    font-size: 13px;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent-ink, var(--accent)); }
.pagination .is-active { color: var(--accent-fg); background: var(--accent); border-color: var(--accent); }
.pagination .is-disabled { opacity: .45; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
    padding: 10px 15px;
    font-size: 13.5px;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent-ink, var(--accent)); border-bottom-color: var(--accent); font-weight: 600; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); }

.progress { height: 7px; border-radius: var(--radius-full); background: var(--surface-3); overflow: hidden; }
.progress__bar { height: 100%; border-radius: var(--radius-full); background: var(--accent); }

/* نوار پایین موبایل */
.bottomnav {
    position: fixed;
    inset-block-end: 0;
    inset-inline: 0;
    z-index: 45;
    display: none;
    grid-template-columns: repeat(5, 1fr);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottomnav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 4px;
    font-size: 10.5px;
    color: var(--muted);
}
.bottomnav__item i { font-size: 17px; }
.bottomnav__item.is-active { color: var(--accent-ink, var(--accent)); }

/* --------------------------------------------------------------------------
   ۱۵) ابزارها
   -------------------------------------------------------------------------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent-ink, var(--accent)); }
.text-center { text-align: center; }
.text-end { text-align: end; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   ۱۶) واکنش‌گرا
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .search-trigger { max-width: none; }
    .search-trigger span { display: none; }
    .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    :root { --topbar-h: 58px; --quicknav-h: 46px; }

    body { font-size: 14px; }
    .container { padding: 0 14px; }
    .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
    .bottomnav { display: grid; }
    .content { padding-bottom: 90px; }
    .topbar { padding: 0 14px; gap: 9px; }
    .brand__text small { display: none; }
    .kv { grid-template-columns: 120px 1fr; }
    .toasts { inset-inline: 14px; inset-block-end: 78px; }
    .page-head__actions { width: 100%; margin-inline-start: 0; }
    .page-head__actions .btn { flex: 1; }
}

/* چاپ */
@media print {
    .topbar, .quicknav, .bottomnav, .footer, .page-head__actions { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border-color: #ddd; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --------------------------------------------------------------------------
   ۱۷) کلاس‌های کمکی چیدمان
   هدف: حذف استایل‌های درون‌خطی از قالب‌ها و نگه‌داشتن همه‌ی ظاهر در یک فایل
   -------------------------------------------------------------------------- */

/* ستون‌بندی صفحات مدیریتی */
.grid--side       { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); }
.grid--side-wide  { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); }
.grid--detail     { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
.grid--profile    { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
.grid--tight      { gap: 10px; }

/* ترازبندی */
.align-end   { align-self: end; }
.align-start { align-self: start; }
.center-x    { margin-inline: auto; }
.push-start  { margin-inline-start: auto; }

/* نمایش */
.is-hidden     { display: none; }
.form-inline   { display: inline; }
.stack-sm      { display: flex; flex-direction: column; gap: 9px; }
.flex-center--center { justify-content: center; flex-wrap: wrap; }
.chip-row--center   { justify-content: center; }

/* کارت و فیلد */
.card--flat { box-shadow: none; }
.card--tight > .card__head { padding: 11px 14px; }
.card--tight > .card__body { padding: 12px 14px; }
.field--end { align-self: end; }
.w-220 { max-width: 220px; }
.row-divider { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.link-tile { border: 1px solid var(--border); }
.kv--start { text-align: start; }

/* رنگ کارت‌های آماری */
.stat--accent  { --stat-color: var(--accent); }
.stat--info    { --stat-color: var(--info); }
.stat--success { --stat-color: var(--success); }
.stat--warning { --stat-color: var(--warning); }
.stat--muted   { --stat-color: var(--muted); }
.stat__value--sm { font-size: 1.05rem; }

/* نشان‌ها */
.badge--push { margin-inline-start: auto; }
.badge--gap  { margin-inline-start: 6px; }
.dot--badge  { position: absolute; top: 8px; inset-inline-end: 9px; }

/* نوار بالا و منوها */
.dropdown__menu--wide { min-width: 300px; }
.dropdown__profile { padding: 10px 12px 8px; }
.dropdown__item--button {
    width: 100%;
    background: none;
    border: 0;
    font-family: inherit;
    text-align: start;
}
.dropdown__item--button.is-danger { color: var(--danger); }
.dropdown__item--static { cursor: default; }
.icon-btn--avatar { width: auto; padding: 0 6px; }
.brand__mark--sm { width: 34px; height: 34px; font-size: 15px; }
.bottomnav__item--button { background: none; border: 0; font-family: inherit; }

/* رنگ‌های سازمانی برای دکمه‌ی انتخاب رنگ */
.swatch-row { display: flex; gap: 7px; padding: 4px 12px 8px; }
.swatch--teal    { background: #0d9488; }
.swatch--blue    { background: #2563eb; }
.swatch--violet  { background: #7c3aed; }
.swatch--emerald { background: #059669; }
.swatch--amber   { background: #d97706; }
.swatch--rose    { background: #e11d48; }

/* پیام بی‌حرکت (مثلاً روی صفحه‌ی ورود) */
.toast--static { animation: none; }

/* آواتار وسط‌چین */
.avatar--center { margin: 0 auto 14px; }

/* کارت آماری انتخاب‌شده */
.stat--selected { border-color: var(--accent-ring); }

/* تودرتویی درخت (بدون استایل درون‌خطی) */
.indent-1 { padding-inline-start: 22px; }
.indent-2 { padding-inline-start: 44px; }
.indent-3 { padding-inline-start: 66px; }
.indent-4 { padding-inline-start: 88px; }
.indent-5 { padding-inline-start: 110px; }

/* نوار پیشرفت بومی (بدون استایل درون‌خطی) */
progress.progress {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    width: 100%;
    display: block;
}
progress.progress::-webkit-progress-bar { background: var(--surface-3); border-radius: var(--radius-full); }
progress.progress::-webkit-progress-value { background: var(--accent); border-radius: var(--radius-full); }
progress.progress::-moz-progress-bar { background: var(--accent); border-radius: var(--radius-full); }

@media (max-width: 900px) {
    .grid--side,
    .grid--side-wide,
    .grid--detail,
    .grid--profile { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   ۱۸) تقویم شمسی
   -------------------------------------------------------------------------- */
.dp-popup {
    position: fixed;
    z-index: 120;
    width: 292px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.dp-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }

.dp-nav {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    font-family: inherit;
    font-size: 12px;
    color: var(--text-soft);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
}
.dp-nav:hover { color: var(--accent-ink, var(--accent)); border-color: var(--accent); }

.dp-title {
    flex: 1;
    height: 30px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: var(--radius-xs);
    cursor: pointer;
}
.dp-title:hover { background: var(--surface-2); }

.dp-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.dp-weekdays span { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; }

.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.dp-day {
    height: 32px;
    display: grid; place-items: center;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--text-soft);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
}
.dp-day:hover { background: var(--surface-2); border-color: var(--border); }
.dp-day.is-today { color: var(--accent-ink, var(--accent)); border-color: var(--accent-ring); font-weight: 600; }
.dp-day.is-selected { color: var(--accent-fg); background: var(--accent); font-weight: 700; }
.dp-day.is-empty { visibility: hidden; cursor: default; }

.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.dp-years { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-height: 216px; overflow-y: auto; }

.dp-month {
    padding: 9px 4px;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--text-soft);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
}
.dp-month:hover { border-color: var(--accent); color: var(--accent-ink, var(--accent)); }
.dp-month.is-active { color: var(--accent-ink, var(--accent)); background: var(--accent-soft); border-color: var(--accent-ring); font-weight: 600; }

.dp-foot { display: flex; gap: 6px; margin-top: 9px; }
.dp-foot button {
    flex: 1;
    height: 32px;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--text-soft);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
}
.dp-foot button:hover { color: var(--accent-ink, var(--accent)); border-color: var(--accent); }

/* ورودی تاریخ، با آیکون تقویم در انتها */
input[data-jalali] {
    background-image: none;
    padding-inline-end: 34px;
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512' fill='%2394a3b8'%3E%3Cpath d='M152 24c0-13.3-10.7-24-24-24S104 10.7 104 24V64H64C28.7 64 0 92.7 0 128v48H448V128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM448 224H0V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V224z'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   ۱۹) برد وظایف (نمای ستونی)
   -------------------------------------------------------------------------- */
.board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    align-items: start;
}

.board__column {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.board__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 13px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.board__body { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 90px; }

.board__card {
    display: block;
    padding: 11px 12px;
    color: var(--text-soft);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.board__card:hover { color: var(--text); border-color: var(--accent-ring); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* نوار پیشرفت با حداقل عرض */
.w-min-110 { min-width: 110px; }
.select--sm { height: 32px; font-size: 12.5px; padding-inline-end: 28px; }
.folder-tree { display: flex; flex-direction: column; gap: 2px; }
.folder-tree__group { margin-top: 10px; font-size: 11.5px; font-weight: 600; color: var(--muted-2); padding: 0 8px; }
.folder-tree__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text-soft);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.folder-tree__item:hover { background: var(--surface-2); color: var(--text); }
.folder-tree__item.is-active { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); font-weight: 600; }
.folder-tree__item i { width: 16px; text-align: center; color: var(--muted); }
.folder-tree__item.is-active i { color: var(--accent-ink, var(--accent)); }
.folder-tree__count { margin-inline-start: auto; font-size: 11px; color: var(--muted-2); }
.folder-tree__meta { padding-inline-start: 34px; font-size: 11px; color: var(--muted-2); line-height: 1.8; }

/* ---------------- اعلان‌ها ---------------- */
.notify-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: start;
    color: var(--text);
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    cursor: pointer;
}
.notify-row:hover { border-color: var(--border-strong); }
.notify-row.is-unread { background: var(--accent-soft); }
.notify-row__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); flex: 0 0 auto; }
.notify-row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notify-row__title { font-size: 13px; font-weight: 600; }
.notify-row__text { font-size: 12px; color: var(--muted); }
.notify-row__meta { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------------- نمودار میله‌ای ---------------- */
.bar { height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--surface))); }
.bar__fill--p0 { width: 0; }
.bar__fill--p10 { width: 10%; }
.bar__fill--p20 { width: 20%; }
.bar__fill--p30 { width: 30%; }
.bar__fill--p40 { width: 40%; }
.bar__fill--p50 { width: 50%; }
.bar__fill--p60 { width: 60%; }
.bar__fill--p70 { width: 70%; }
.bar__fill--p80 { width: 80%; }
.bar__fill--p90 { width: 90%; }
.bar__fill--p100 { width: 100%; }

/* سایدبار ثابت غیرفعال شد — چیدمان هدر و دسترسی سریع به حالت اولیه برگشت */

/* لوگوی سازمان در نوار بالا */
.brand__mark--logo {
    padding: 3px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 26, 44, .10);
}
.brand__mark--logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 9px;
}
.brand__title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

/* فوتر تک‌سطری */
.footer-grid,
.footer-note,
.footer-links,
.footer-title {
    display: none !important;
}
.footer {
    padding: 14px 0 16px;
}
.footer .container {
    display: flex;
    justify-content: center;
}
.footer-bottom {
    margin: 0;
    padding: 0;
    border: none;
    justify-content: center;
    text-align: center;
    width: 100%;
    gap: 14px;
}
.footer-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.footer-bar a {
    color: var(--muted);
    font-size: 12px;
}
.footer-bar a:hover { color: var(--accent-ink, var(--accent)); }
.footer-sep { color: var(--muted-2); }

@media (max-width: 720px) {
    .brand__title { font-size: 12px; }
}

/* ---------------- تقویم رویدادها ---------------- */
.cal { padding: 14px; }
.cal__week, .cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__weekday { text-align: center; font-size: 11.5px; color: var(--muted-2); padding: 4px 0; }
.cal__cell {
    min-height: 94px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.cal__cell--empty { border: 1px dashed var(--border); background: transparent; }
.cal__cell.is-today { border-color: var(--accent); background: var(--accent-soft); }
.cal__cell.is-holiday { background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.cal__day { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.cal__event {
    font-size: 10.5px;
    line-height: 1.6;
    padding: 1px 5px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal__event--meeting { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); }
.cal__event--task { background: var(--warning-soft); color: var(--warning); }
.cal__event--contract { background: var(--danger-soft); color: var(--danger); }
.cal__more { font-size: 10px; color: var(--muted-2); }

@media (max-width: 900px) {
    .cal { padding: 8px; }
    .cal__cell { min-height: 72px; padding: 4px; }
    .cal__event { font-size: 9px; padding: 1px 3px; }
}

/* ---------------- مودال بدون جاوااسکریپت ---------------- */
.modal-toggle { position: absolute; opacity: 0; pointer-events: none; }
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.is-open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10, 16, 30, .55); backdrop-filter: blur(2px); }
.modal__card {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: 88vh;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
}
.modal__head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.modal__head h3 { margin: 0; font-size: 15px; }
.modal__body { padding: 18px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }
.modal__close { margin-inline-start: auto; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }
.modal__close:hover { color: var(--danger); }
.folder-add summary {
    cursor: pointer;
    font-size: 12.5px;
    color: var(--accent-ink, var(--accent));
    padding: 8px 0;
    list-style: none;
}
.folder-add summary::-webkit-details-marker { display: none; }

/* افزودن سریع گروه/واحد در فرم کالا */
.quick-add { margin-top: 6px; }
.quick-add summary {
    cursor: pointer;
    font-size: 12.5px;
    color: var(--accent-ink, var(--accent));
    padding: 4px 0;
    list-style: none;
}
.quick-add summary::-webkit-details-marker { display: none; }
.quick-add__row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.quick-add__row .input { flex: 1; }

/* ---------------- کیوسک ثبت تردد ---------------- */
.kiosk-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-gradient), var(--bg);
}
.kiosk-page { width: 100%; max-width: 560px; margin: 0 auto; }
.kiosk-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 30px;
}
.kiosk-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.kiosk-head h1 { font-size: 22px; margin: 0; }
.kiosk-head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.brand__mark--lg { width: 54px; height: 54px; font-size: 24px; border-radius: 16px; }
.kiosk-input {
    height: 60px;
    font-size: 22px;
    text-align: center;
    letter-spacing: .06em;
}
.kiosk-input--pin { letter-spacing: .55em; }
.kiosk-submit { width: 100%; height: 56px; font-size: 16px; margin-top: 8px; }
.kiosk-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--muted-2); }
.kiosk-form .field { margin-bottom: 14px; }

.kiosk-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    border: 1px solid var(--border);
}
.kiosk-result--success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 32%, transparent); }
.kiosk-result--info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 32%, transparent); }
.kiosk-result--warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 32%, transparent); }
.kiosk-result--danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 32%, transparent); }
.kiosk-result__icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 24px;
    background: var(--surface);
    flex: 0 0 auto;
}
.kiosk-result__icon--center { margin-inline: auto; margin-bottom: 16px; }
.kiosk-result__body h2 { margin: 0; font-size: 18px; }
.kiosk-result__name { margin: 5px 0; font-weight: 600; }
.kiosk-result__time { font-size: 26px; font-weight: 700; margin: 4px 0; }
.kiosk-result__body p { margin: 4px 0; }
.grid-full { grid-column: 1 / -1; }

/* --------------------------------------------------------------------------
   ۲۰) صفحه‌ی انتخاب پرتال
   -------------------------------------------------------------------------- */
.w-900 { max-width: 900px; margin-inline: auto; }

.portal-card {
    display: block;
    padding: 26px 22px;
    text-align: center;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}
.portal-card:hover {
    color: var(--text);
    border-color: var(--accent-ring);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.portal-card h2 { margin: 14px 0 8px; font-size: 1.15rem; color: var(--accent-ink, var(--accent)); }
.portal-card p { font-size: 13px; color: var(--muted); line-height: 1.9; margin-bottom: 12px; }

.icon-circle {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 26px;
}
.icon-circle.blue   { color: #1d4ed8; background: rgba(37, 99, 235, .14); }
.icon-circle.green  { color: #047857; background: rgba(5, 150, 105, .14); }
.icon-circle.purple { color: #7c3aed; background: rgba(124, 58, 237, .14); }

[data-theme="dark"] .icon-circle.blue   { color: #93c5fd; }
[data-theme="dark"] .icon-circle.green  { color: #6ee7b7; }
[data-theme="dark"] .icon-circle.purple { color: #c4b5fd; }

@media (max-width: 720px) {
    .board { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   گفت‌وگوی داخلی
   -------------------------------------------------------------------------- */
.chat {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    min-height: 64vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.chat__list {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-inline-end: 1px solid var(--border);
    background: var(--surface-2);
}

.chat__search { position: relative; padding: 12px; border-bottom: 1px solid var(--border); }
.chat__search i {
    position: absolute;
    inset-inline-start: 26px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--muted-2);
    pointer-events: none;
}
.chat__search .input { height: 38px; padding-inline-start: 36px; }

.chat__items { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.chat__list-empty { padding: 28px 14px; text-align: center; color: var(--muted); }
.chat__list-empty i { font-size: 26px; color: var(--muted-2); margin-bottom: 6px; }

.chat__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: inherit;
    transition: background var(--transition);
}
.chat__item:hover { background: var(--surface-3); color: inherit; }
.chat__item.is-active { background: var(--accent-soft); }
.chat__item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat__item-top { display: flex; align-items: center; gap: 8px; }
.chat__item-name {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat__item-kind { font-size: 10px; color: var(--muted-2); margin-inline-end: 3px; }
.chat__item-time { font-size: 10.5px; color: var(--muted-2); }
.chat__item-bottom { display: flex; align-items: center; gap: 6px; }
.chat__item-text {
    flex: 1;
    min-width: 0;
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat__unread {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--accent-fg);
    background: var(--accent);
    border-radius: var(--radius-full);
}

.chat__main { display: flex; flex-direction: column; min-height: 0; }

.chat__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.chat__head-name { font-weight: 600; font-size: 14px; }
.chat__head-meta { font-size: 11.5px; color: var(--muted); }

.chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--surface-2);
    min-height: 320px;
    max-height: 60vh;
}

.chat__empty,
.chat__hint {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 6px;
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
}
.chat__empty { flex: 1; }
.chat__empty i,
.chat__hint i { font-size: 30px; color: var(--muted-2); }

.msg { display: flex; align-items: flex-start; gap: 8px; max-width: 78%; }
.msg--mine { margin-inline-start: auto; flex-direction: row-reverse; }
.msg__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.msg__author { font-size: 11px; font-weight: 600; color: var(--muted); }
.msg__bubble {
    padding: 9px 13px;
    font-size: 13px;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px 4px 16px 16px;
    box-shadow: var(--shadow-xs);
}
.msg--mine .msg__bubble {
    color: var(--accent-fg);
    background: var(--accent);
    border-color: var(--accent);
    border-radius: 4px 16px 16px 16px;
}
.msg__text { white-space: pre-wrap; word-break: break-word; }
.msg__time { font-size: 10px; color: var(--muted-2); }
.msg--mine .msg__time { text-align: start; }

.msg__file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    margin-top: 6px;
    padding: 6px 10px;
    font-size: 11.5px;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    color: var(--text-soft);
}
.msg--mine .msg__file { background: rgba(255, 255, 255, .18); color: var(--accent-fg); }
.msg__file-name { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg__file-size { opacity: .75; }

.chat__composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.chat__composer .textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding-block: 10px; }
.chat__attach {
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition);
}
.chat__attach:hover { color: var(--accent); border-color: var(--accent); }
/* ورودی فایل روی خودِ دکمه می‌نشیند و از کادرش بیرون نمی‌زند.
   glass.css قاعده‌ی input[type="file"]{width:100%} را با اولویت برابر
   ولی دیرتر اعمال می‌کند؛ اگر این عرض مهار نشود، صفحه اسکرول افقی می‌خورد. */
.chat__attach input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}
.chat__file-name {
    max-width: 130px;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat__send { flex: 0 0 auto; height: 42px; }

.chat-picker { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.chat-picker__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition);
}
.chat-picker__item:hover { background: var(--surface-2); }
.chat-picker__item input { accent-color: var(--accent); }
.chat-picker__name { display: flex; flex-direction: column; font-size: 13px; color: var(--text-soft); }
.chat-picker__name small { font-size: 11px; color: var(--muted); }

@media (max-width: 900px) {
    .chat { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .chat__list { border-inline-end: 0; border-bottom: 1px solid var(--border); max-height: 240px; }
    .chat__messages { max-height: none; min-height: 300px; }
    .msg { max-width: 92%; }

    /* در موبایل وقتی گفت‌وگویی باز است، فهرست کل صفحه را نگیرد */
    .chat[data-active="1"] .chat__list { display: none; }
}

@media (max-width: 560px) {
    .chat__composer { flex-wrap: wrap; padding: 10px 12px; gap: 6px; }
    .chat__composer .textarea { flex: 1 1 100%; order: -1; min-height: 40px; }
    .chat__file-name { display: none; }
    .chat__head { padding: 10px 12px; flex-wrap: wrap; }
    .chat__messages { padding: 14px 12px; }
}

/* مودال عریض برای فرم‌های چندستونه */
.modal__card--wide { max-width: 920px; }

/* --------------------------------------------------------------------------
   نامه — نسخه‌ی چاپی و سربرگ
   -------------------------------------------------------------------------- */
.letter-print { background: #e9edf4; }
.letter-print__bar { display: flex; gap: 8px; justify-content: center; padding: 16px; }
.letter-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 24px;
    padding: 20mm 16mm;
    background: #fff;
    color: #111;
    box-shadow: var(--shadow-lg);
    font-size: 12pt;
    line-height: 2;
}
.letter-sheet--fs11 { font-size: 11pt; }
.letter-sheet--fs12 { font-size: 12pt; }
.letter-sheet--fs13 { font-size: 13pt; }
.letter-sheet--fs14 { font-size: 14pt; }
.letter-sheet__head { text-align: center; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 16px; }
.letter-sheet__org { font-size: 1.5em; font-weight: 700; }
.letter-sheet__contact { margin-top: 4px; font-size: .72em; color: #444; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.letter-sheet__meta { display: flex; justify-content: space-between; font-size: .8em; margin-bottom: 14px; }
.letter-sheet__to { margin-bottom: 10px; font-weight: 600; }
.letter-sheet__subject { margin-bottom: 14px; font-weight: 700; border-bottom: 1px dashed #bbb; padding-bottom: 6px; }
.letter-sheet__body { text-align: justify; min-height: 140mm; }
.letter-sheet__signature { margin-top: 18mm; text-align: center; }
.letter-sheet__respect { margin-bottom: 10mm; }
.letter-sheet__signer { font-weight: 700; }
.letter-sheet__signer-title, .letter-sheet__signer-date { font-size: .8em; color: #444; }
.letter-sheet__foot { margin-top: 12mm; padding-top: 6px; border-top: 1px solid #999; font-size: .7em; color: #444; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

@media print {
    .no-print { display: none !important; }
    body.letter-print { background: #fff; }
    .letter-sheet { width: auto; min-height: auto; margin: 0; padding: 0; box-shadow: none; }
    @page { size: A4; margin: 16mm; }
}

/* فیلدهای نوع‌دار بایگانی */
.tabs--pad { padding: 0 16px; }
.archive-group { display: none; }
.archive-group.is-active { display: block; }

/* --------------------------------------------------------------------------
   گواهی آموزشی
   -------------------------------------------------------------------------- */
.cert-print { background: #e9edf4; }
.cert-sheet {
    width: 297mm;
    min-height: 200mm;
    margin: 16px auto;
    padding: 18mm 20mm;
    background: #fff;
    color: #111;
    border: 6px double #0d9488;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.cert-sheet__org { font-size: 1.2em; font-weight: 600; color: #0f766e; }
.cert-sheet__title { margin: 10mm 0 4mm; font-size: 2em; font-weight: 700; letter-spacing: 1px; }
.cert-sheet__subtitle { font-size: .9em; color: #444; margin-bottom: 8mm; }
.cert-sheet__name { font-size: 1.8em; font-weight: 700; margin: 4mm 0; }
.cert-sheet__text { font-size: 1.05em; line-height: 2.2; }
.cert-sheet__course { font-size: 1.2em; font-weight: 700; color: #0f766e; }
.cert-sheet__meta { margin-top: 10mm; display: flex; justify-content: space-between; font-size: .85em; color: #444; }
.cert-sheet__sign { margin-top: 12mm; font-size: .9em; }
@media print {
    .cert-print { background: #fff; }
    .cert-sheet { width: auto; min-height: auto; margin: 0; box-shadow: none; }
    @page { size: A4 landscape; margin: 10mm; }
}

/* ==========================================================================
   ۲۱) چیدمان با سایدبار
   ========================================================================== */

.shell__body { flex: 1; display: flex; align-items: stretch; min-width: 0; }

.shell__col {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar {
    --sidebar-w: 276px;

    display: flex;
    flex-direction: column;
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
    gap: 2px;
    padding: 12px 10px 10px;
    background: color-mix(in srgb, var(--surface) 76%, transparent);
    backdrop-filter: blur(20px) saturate(165%);
    -webkit-backdrop-filter: blur(20px) saturate(165%);
    border-inline-end: 1px solid var(--border);
    transition: flex-basis var(--transition), width var(--transition);
}

.sidebar__scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-inline: -4px;
    padding-inline: 4px;
}

.sidebar__scroll::-webkit-scrollbar { width: 6px; }

/* ــــ گروه ــــ */
.side-group { margin-block-end: 4px; }

/* سرتیتر منو: درشت‌تر و پررنگ‌تر از آیتم‌ها تا از زیرمنو تشخیص داده شود */
.side-group__head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .1px;
    color: var(--text);
    text-align: start;
    background: none;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.side-group__head:hover { color: var(--text); background: var(--surface-2); }

.side-group__head > i:first-child {
    width: 16px;
    font-size: 11.5px;
    color: var(--accent-ink, var(--accent));
    opacity: .95;
    text-align: center;
}

.side-group__head .chev {
    order: -1;
    margin-inline-start: 0;
    margin-inline-end: -2px;
    font-size: 9px;
    opacity: .5;
    transition: transform var(--transition);
}

.side-group.is-collapsed .chev { transform: rotate(-90deg); }
.side-group.is-collapsed .side-group__items { display: none; }

/* زیرمنو: زمینهٔ ملایم‌تر از سایدبار تا محدوده‌اش مشخص باشد */
.side-group__items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 6px;
    padding: 5px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) var(--sub-tint, 8%), transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}

[data-theme="dark"] .side-group__items { --sub-tint: 10%; }

/* در حالت آیکن‌فقط، کادر زیرمنو لازم نیست */
.sidebar.is-mini .side-group__items {
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
}

/* ــــ آیتم ــــ */
.side-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-soft);
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}

.side-link:hover {
    color: var(--text);
    background: var(--surface-2);
}

.side-link:focus-visible { outline-offset: -2px; }

.side-link.is-active {
    color: var(--accent-ink-strong, var(--accent-strong));
    font-weight: 700;
    background: linear-gradient(to left, var(--accent-soft), transparent 92%);
}

.side-link.is-active::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    inset-block-start: 50%;
    width: 3px;
    height: 17px;
    border-radius: 3px;
    background: var(--accent);
    transform: translateY(-50%);
}

.side-link__icon {
    display: grid;
    place-items: center;
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--muted);
    background: var(--surface-2);
    transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.side-link:hover .side-link__icon { color: var(--text-soft); }

.side-link.is-active .side-link__icon {
    color: var(--accent-fg);
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 5px 12px -6px var(--accent-ring);
}

.side-link__badge {
    display: grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    margin-inline-start: 8px;
    padding: 0 5px;
    font-size: 10.5px;
    font-weight: 700;
    color: #fff;
    background: var(--danger);
    border-radius: var(--radius-full);
    box-shadow: 0 4px 10px -5px var(--danger);
}

.side-link.is-soon {
    opacity: .55;
    cursor: not-allowed;
}

.side-link__soon {
    margin-inline-start: 8px;
    padding: 1px 7px;
    font-size: 9.5px;
    font-weight: 600;
    color: var(--muted-2);
    background: var(--surface-3);
    border-radius: var(--radius-full);
}

/* ــــ پای سایدبار ــــ */
.sidebar__foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-block-start: 8px;
    padding-block-start: 8px;
    border-block-start: 1px solid var(--border);
}

.sidebar__ver {
    font-size: 10.5px;
    color: var(--muted-2);
    white-space: nowrap;
}

.sidebar__collapse {
    margin-inline-start: auto;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    font-size: 11px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar__collapse:hover { color: var(--text); border-color: var(--border-strong); }

/* ــــ حالت جمع‌شده ــــ */
.sidebar.is-mini { --sidebar-w: 80px; }

.sidebar.is-mini .side-group__head { justify-content: center; padding-inline: 0; }
.sidebar.is-mini .side-group__head span,
.sidebar.is-mini .side-group__head .chev,
.sidebar.is-mini .side-link span,
.sidebar.is-mini .sidebar__ver { display: none; }

.sidebar.is-mini .side-link { justify-content: center; padding-inline: 0; }
.sidebar.is-mini .side-link.is-active::before { height: 22px; }
.sidebar.is-mini .side-group { margin-block-end: 4px; }
.sidebar.is-mini .sidebar__collapse { margin-inline: auto; }

/* ــــ نشان برند در سایدبار و نوار بالا ــــ */
.brand__mark--logo {
    padding: 4px;
    background: #fff;
    border: 1px solid var(--border);
}

.brand__mark--logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 6px 10px;
    margin-block-end: 4px;
    border-block-end: 1px solid var(--border);
    color: var(--text);
}

.sidebar__brand:hover { color: var(--text); }

.sidebar__brand .brand__mark { flex: 0 0 34px; width: 34px; height: 34px; }

.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.sidebar__brand-text strong { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.sidebar__brand-text small { font-size: 10px; color: var(--muted-2); white-space: nowrap; }

/* ــــ واکنش‌گرا ــــ */
@media (min-width: 1100px) {
    .sidebar {
        position: sticky;
        inset-block-start: var(--topbar-h);
        height: calc(100dvh - var(--topbar-h));
        align-self: flex-start;
    }

    .shell__col .container { padding-inline: 30px; }
}

@media (max-width: 1099px) {
    .sidebar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .side-link,
    .side-link__icon,
    .side-group__head .chev { transition: none; }
}
/* دکمه‌ی منوی موبایل فقط در نمای کوچک */
@media (min-width: 1100px) {
    .topbar__burger { display: none; }
}
/* ==========================================================================
   ابزارهای مشترک (افزوده: تقویم، تنظیمات پیامک)
   ========================================================================== */

.grid--two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 720px) {
    .grid--two { grid-template-columns: 1fr; }
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin: 6px 0 12px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: 12.5px;
    line-height: 1.8;
}

.alert--warning {
    border-color: color-mix(in srgb, var(--warning, #b45309) 35%, var(--border));
    background: var(--warning-soft, rgba(217, 119, 6, .14));
    color: var(--warning, #b45309);
}

.inline-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.inline-form .field {
    margin: 0;
    min-width: 180px;
}

.code-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.9;
    direction: ltr;
    text-align: left;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-3);
    color: var(--text-soft);
    overflow-x: auto;
    word-break: break-all;
    margin-bottom: 8px;
}

.alert--success {
    border-color: color-mix(in srgb, var(--success, #047857) 35%, var(--border));
    background: var(--success-soft, rgba(4, 120, 87, .12));
    color: var(--success, #047857);
}

.alert--muted {
    border-color: var(--border);
    background: var(--surface-3);
    color: var(--text-soft);
}

.alert--pink {
    border-color: rgba(219, 39, 119, .35);
    background: rgba(219, 39, 119, .12);
    color: #be185d;
}

/* ==========================================================================
   اعلان‌ها: نشان شمارنده در نوار بالا و ردیف پیام‌ها (پرتال همکاران)
   ========================================================================== */

.icon-btn--badge {
    position: relative;
}

.icon-btn__badge {
    position: absolute;
    top: -3px;
    inset-inline-start: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: var(--danger, #dc2626);
    border-radius: 999px;
    box-shadow: 0 0 0 2px var(--surface);
}

.msg-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px dashed var(--border);
}

.msg-row:last-child {
    border-bottom: 0;
}

.msg-row.is-unread {
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    border-bottom-color: transparent;
}

.msg-row__icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    color: var(--accent-ink, var(--accent-strong));
    flex: 0 0 auto;
}

.msg-row__body {
    flex: 1 1 auto;
    min-width: 0;
}

.msg-row__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.msg-row.is-unread .msg-row__title {
    font-weight: 700;
}

.msg-row__time {
    white-space: nowrap;
}

@media (max-width: 720px) {
    .msg-row {
        flex-wrap: wrap;
    }

    .msg-row__time {
        width: 100%;
        text-align: end;
    }
}

/* --------------------------------------------------------------------------
   تماس تصویری یک‌به‌یک
   -------------------------------------------------------------------------- */
.call-layer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 50% 0%, #16233a 0%, #05070d 70%);
}

.call-layer[hidden],
.call-incoming[hidden] { display: none !important; }

.call-layer__stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }

.call-layer__remote {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0a0d14;
}

.call-layer__local {
    position: absolute;
    inset-inline-end: 16px;
    bottom: 16px;
    width: 132px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, .22);
    background: #0a0d14;
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .8);
    transform: scaleX(-1);
}

.call-layer__info {
    position: absolute;
    top: 18px;
    inset-inline: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
    pointer-events: none;
}

.call-layer__status { font-size: 13px; opacity: .9; }
.call-layer__timer { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

.call-layer__bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent);
}

.call-btn {
    width: 54px;
    height: 54px;
    display: inline-grid;
    place-items: center;
    font-size: 18px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition);
}

.call-btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .2); }
.call-btn.is-off { background: #fff; color: #111; }
.call-btn--hangup { background: #dc2626; border-color: #dc2626; }
.call-btn--hangup:hover { background: #b91c1c; }
.call-btn--accept { background: #16a34a; border-color: #16a34a; }
.call-btn--accept:hover { background: #15803d; }

.call-incoming {
    position: fixed;
    inset-inline: 12px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    animation: callIn .35s ease-out;
}

@keyframes callIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.call-incoming__ring {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    animation: callPulse 1.6s infinite;
}

@keyframes callPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, .45); }
    50%      { box-shadow: 0 0 0 10px rgba(20, 184, 166, 0); }
}

.call-incoming__body { flex: 1; min-width: 0; }
.call-incoming__title { font-size: 11.5px; color: var(--muted); }
.call-incoming__name { font-size: 14px; font-weight: 700; color: var(--text); }

.call-incoming__actions { display: flex; gap: 8px; }
.call-incoming__actions .call-btn { width: 46px; height: 46px; font-size: 16px; }

body.is-calling { overflow: hidden; }

@media (max-width: 560px) {
    .call-layer__local { width: 104px; inset-inline-end: 12px; bottom: 12px; }
    .call-layer__bar { gap: 10px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
    .call-btn { width: 50px; height: 50px; }
}

/* --------------------------------------------------------------------------
   پنجره‌ی اجازه‌ی دوربین و میکروفن
   -------------------------------------------------------------------------- */
.call-perm {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(3, 7, 14, .74);
    backdrop-filter: blur(5px);
}

.call-perm[hidden] { display: none !important; }

.call-perm__card {
    width: 100%;
    max-width: 430px;
    padding: 22px 20px 18px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.call-perm__icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
    font-size: 22px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 50%;
}

.call-perm__title { font-size: 16px; margin-bottom: 6px; }

.call-perm__text {
    margin-bottom: 12px;
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--muted);
}

.call-perm__alert {
    margin-bottom: 12px;
    padding: 9px 11px;
    font-size: 12px;
    line-height: 1.9;
    text-align: start;
    color: #fecaca;
    background: rgba(220, 38, 38, .14);
    border: 1px solid rgba(220, 38, 38, .38);
    border-radius: 10px;
}

.call-perm__actions { display: flex; flex-direction: column; gap: 8px; }

.call-perm__hint {
    margin-top: 12px;
    font-size: 11px;
    line-height: 1.9;
    color: var(--muted-2);
}

@media (max-width: 560px) {
    .call-perm__card { padding: 18px 14px 14px; border-radius: 16px; }
    .call-perm__text { font-size: 12px; }
}

.call-layer__diag {
    margin-top: 2px;
    font-size: 10.5px;
    opacity: .65;
    direction: ltr;
}

/* --------------------------------------------------------------------------
   کلاس آنلاین
   -------------------------------------------------------------------------- */
.room {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 50% 0%, #16233a 0%, #05070d 70%);
    color: #fff;
}

.room__bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .04);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.room__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.room__badge {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
}

.room__title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room__meta { font-size: 11.5px; opacity: .7; }

.room__head-actions { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; }

.room__stage { position: relative; flex: 1; min-height: 0; padding: 12px; overflow: auto; }

.room__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    align-content: start;
}

.room-tile {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0b1220;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    overflow: hidden;
}

.room-tile--self { border-color: rgba(20, 184, 166, .55); }
.room-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }

.room-tile__name {
    position: absolute;
    inset-inline-start: 10px;
    bottom: 8px;
    padding: 3px 9px;
    font-size: 11px;
    background: rgba(0, 0, 0, .55);
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.room__empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .65);
    text-align: center;
    padding: 20px;
}

.room__empty i { font-size: 34px; opacity: .5; }

.room__controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, .6), transparent);
}

.room__roster {
    position: absolute;
    inset-inline-end: 12px;
    top: 68px;
    bottom: 96px;
    width: 220px;
    padding: 10px;
    background: rgba(8, 13, 24, .92);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    overflow: auto;
    backdrop-filter: blur(8px);
}

.room__roster-head { font-size: 12px; font-weight: 700; opacity: .8; margin-bottom: 8px; }
.room__roster-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.room__roster-item .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: 0 0 auto; }

.room-join {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(3, 7, 14, .82);
    backdrop-filter: blur(6px);
}

.room-join[hidden] { display: none !important; }

.room-join__card {
    width: 100%;
    max-width: 380px;
    padding: 22px 18px;
    text-align: center;
    background: #0f1728;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
}

.room-join__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 20px;
}

.room-join h2 { font-size: 16px; margin-bottom: 6px; color: #fff; }
.room-join p { font-size: 12.5px; line-height: 1.9; color: rgba(255, 255, 255, .7); margin-bottom: 14px; }

.room-join__error {
    margin-bottom: 12px;
    padding: 9px 11px;
    font-size: 12px;
    line-height: 1.9;
    text-align: start;
    color: #fecaca;
    background: rgba(220, 38, 38, .16);
    border: 1px solid rgba(220, 38, 38, .4);
    border-radius: 10px;
}

@media (max-width: 640px) {
    .room__grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .room__meta { display: none; }
    .room__roster { width: 180px; top: 62px; }
}

/* نوار فعال‌سازی اعلان تماس */
.notif-bar {
    position: fixed;
    inset-inline: 12px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 1450;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
}

.notif-bar[hidden] { display: none !important; }
.notif-bar__icon { color: var(--accent); font-size: 16px; }

.notif-bar__text {
    flex: 1;
    font-size: 12px;
    line-height: 1.8;
    color: var(--muted);
}

.notif-bar__close {
    padding: 4px 6px;
    color: var(--muted-2);
    background: none;
    border: 0;
    cursor: pointer;
}

@media (max-width: 560px) {
    .notif-bar { flex-wrap: wrap; }
    .notif-bar__text { flex: 1 1 100%; }
}

/* --------------------------------------------------------------------------
   انتخاب‌گر چندنفره (کلاس آنلاین)
   -------------------------------------------------------------------------- */
.picker {
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.picker__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.picker__icon { font-size: 12px; color: var(--muted-2); }

.picker__search {
    flex: 1;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 0;
}

.picker__search:focus { outline: none; box-shadow: none; }

.picker__count {
    padding: 2px 9px;
    font-size: 11px;
    white-space: nowrap;
    color: var(--accent-ink, var(--accent-strong));
    background: var(--accent-soft);
    border-radius: 999px;
}

.picker__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 264px;
    padding: 6px;
    overflow-y: auto;
}

.picker__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: background var(--transition);
}

.picker__item:hover { background: var(--surface-3); }
.picker__item input { display: none; }
.picker__item.is-selected { background: var(--accent-soft); }
.picker__item.is-selected .picker__name { color: var(--accent-ink, var(--accent-strong)); font-weight: 600; }

.picker__name {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.picker__tick {
    font-size: 12px;
    color: var(--accent);
    opacity: 0;
}

.picker__item.is-selected .picker__tick { opacity: 1; }

.picker__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px dashed var(--border);
}

.picker__chips:empty { display: none; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px 3px 10px;
    font-size: 11.5px;
    color: var(--accent-ink, var(--accent-strong));
    background: var(--accent-soft);
    border-radius: 999px;
}

.chip button {
    padding: 0 2px;
    font-size: 14px;
    line-height: 1;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

.avatar--xs {
    width: 26px;
    height: 26px;
    font-size: 11px;
    flex: 0 0 auto;
}

/* نوار بالا در موبایل: جلوگیری از سرریز افقی */
@media (max-width: 760px) {
    .topbar {
        padding-inline: 12px;
        gap: 8px;
    }

    .topbar__start { min-width: 0; flex: 1 1 auto; }
    .brand__text small { display: none; }
    .brand__text { min-width: 0; }
    .brand__text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .search-trigger {
        flex: 0 0 auto;
        width: 38px;
        height: 38px;
        padding: 0;
        justify-content: center;
    }

    .search-trigger span,
    .search-trigger kbd { display: none; }

    .topbar__end { gap: 4px; flex: 0 0 auto; }
}

/* نمودار کارکرد همکار */
.wchart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 10px;
    height: 180px;
    padding: 6px 4px 0;
}

.wchart__col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.wchart__value { font-size: 12px; font-weight: 700; color: var(--text-soft); margin-bottom: 6px; }

.wchart__track {
    flex: 1;
    width: 100%;
    max-width: 46px;
    display: flex;
    align-items: flex-end;
    background: var(--surface-3);
    border-radius: 10px 10px 4px 4px;
    overflow: hidden;
}

.wchart__bar {
    width: 100%;
    border-radius: 8px 8px 0 0;
    transition: height .4s ease;
    background: var(--accent);
}

.wchart__bar--work { background: linear-gradient(180deg, #38bdf8, #0284c7); }
.wchart__bar--ot   { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.wchart__bar--vac  { background: linear-gradient(180deg, #fbbf24, #d97706); }
.wchart__bar--abs  { background: linear-gradient(180deg, #f87171, #dc2626); }

.wchart__label { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

/* ============================== مخزن اسناد ============================== */

.docs-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.docs-side { position: sticky; top: 84px; }

.docs-side__body { padding: 12px; }

.docs-tree {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 62vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.docs-tree__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 12.5px;
    line-height: 1.4;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.docs-tree__item i { flex: 0 0 auto; width: 16px; text-align: center; color: var(--muted-2); font-size: 12px; }
.docs-tree__item:hover { background: var(--surface-2); color: var(--text); }
.docs-tree__item.is-active { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); font-weight: 700; }
.docs-tree__item.is-active i { color: var(--accent); }
.docs-tree__item--bucket i { color: var(--accent); opacity: .75; }
.docs-tree__item--person { font-size: 12px; }

.docs-tree__children {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-inline-start: 10px;
    padding-inline-start: 8px;
    border-inline-start: 1px solid var(--border);
}

.docs-tree__name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.docs-tree__count {
    flex: 0 0 auto;
    min-width: 22px;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: var(--surface-3);
    color: var(--muted);
    font-size: 10.5px;
    text-align: center;
}

.docs-tree__item.is-active .docs-tree__count { background: var(--surface); color: var(--accent-ink, var(--accent)); }

.docs-toolbar { padding: 14px; }

.docs-search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.docs-search__field {
    position: relative;
    flex: 1 1 260px;
    min-width: 200px;
}

.docs-search__field > i {
    position: absolute;
    inset-inline-start: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-2);
    font-size: 12.5px;
    pointer-events: none;
}

.docs-search__input {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
}

.docs-search__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.docs-search__select { flex: 0 1 170px; min-width: 140px; }
.docs-search .btn { flex: 0 0 auto; }

.docs-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--muted);
}

.docs-crumbs a { color: var(--muted); text-decoration: none; }
.docs-crumbs a:hover { color: var(--accent-ink, var(--accent)); }
.docs-crumbs i { font-size: 9px; color: var(--muted-2); }
.docs-crumbs__current { color: var(--text); font-weight: 700; }

.docs-current {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    flex-wrap: wrap;
}

.docs-current__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent-ink, var(--accent));
    font-size: 19px;
}

.docs-current__text { flex: 1 1 220px; min-width: 0; }
.docs-current__text h2 { margin: 0 0 3px; font-size: 16px; }
.docs-current__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.docs-folders {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.docs-folder {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    color: var(--text);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.docs-folder:hover {
    border-color: var(--accent-ring);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.docs-folder__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--accent-ink, var(--accent));
    font-size: 16px;
}

.docs-folder__body { flex: 1 1 auto; min-width: 0; }
.docs-folder__name { display: block; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-folder__meta { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.docs-folder__go { color: var(--muted-2); font-size: 11px; }

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.docs-doc {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.docs-doc:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }

.docs-doc__thumb {
    position: relative;
    display: block;
    width: 100%;
    height: 148px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(135deg, var(--surface-2), var(--surface-3));
    cursor: pointer;
    overflow: hidden;
}

.docs-doc__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.docs-doc__thumb:hover img { transform: scale(1.03); }

.docs-doc__fileicon {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--muted-2);
    font-size: 40px;
}

.docs-doc__ext {
    position: absolute;
    inset-inline-end: 8px;
    bottom: 8px;
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    background: rgba(16, 26, 44, .62);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .4px;
    backdrop-filter: blur(2px);
}

.docs-doc__body { flex: 1 1 auto; padding: 11px 12px 6px; }

.docs-doc__title {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.5;
    text-align: start;
    cursor: pointer;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.docs-doc__title:hover { color: var(--accent-ink, var(--accent)); }

.docs-doc__meta { margin-top: 4px; font-size: 10.5px; color: var(--muted); line-height: 1.6; }

.docs-doc__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.docs-doc__tags .badge { font-size: 10px; padding: 2px 7px; }

.docs-doc__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    padding: 6px 8px 8px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.docs-doc__actions form { display: inline-flex; margin: 0; }
.docs-doc__actions .icon-btn { width: 30px; height: 30px; font-size: 12px; }

.icon-btn--danger { color: var(--danger); }
.icon-btn--danger:hover { color: #fff; background: var(--danger); border-color: transparent; }

/* ---------------------------- پیش‌نمایش ---------------------------- */

html.docs-preview-open { overflow: hidden; }

.docs-preview { position: fixed; inset: 0; z-index: 95; }
.docs-preview[hidden] { display: none; }

.docs-preview__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 30, .55);
    backdrop-filter: blur(2px);
}

.docs-preview__panel {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    display: flex;
    flex-direction: column;
    width: min(520px, 94vw);
    background: var(--surface);
    border-inline-end: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: docsSlide .22s ease;
}

@keyframes docsSlide {
    from { transform: translateX(-22px); opacity: .5; }
    to   { transform: translateX(0); opacity: 1; }
}

.docs-preview__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.docs-preview__heading { flex: 1 1 auto; min-width: 0; }
.docs-preview__heading h3 { margin: 0 0 3px; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.docs-preview__body {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: var(--surface-2);
    overflow: auto;
}

.docs-preview__body img { max-width: 100%; max-height: 100%; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.docs-preview__body iframe { width: 100%; height: 100%; min-height: 60vh; border: 0; border-radius: var(--radius-sm); background: #fff; }

.docs-preview__fallback { text-align: center; color: var(--muted); }
.docs-preview__fallback i { display: block; margin-bottom: 10px; font-size: 38px; opacity: .4; }
.docs-preview__fallback p { margin: 0 0 12px; font-size: 12.5px; }

.docs-preview__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

@media (max-width: 1100px) {
    .docs-shell { grid-template-columns: 1fr; }
    .docs-side { position: static; }
    .docs-tree { max-height: 280px; }
}

@media (max-width: 640px) {
    .docs-search__field { flex-basis: 100%; }
    .docs-search__select { flex: 1 1 140px; }
    .docs-search .btn { flex: 1 1 auto; justify-content: center; }
    .docs-current { padding: 14px; }
    .docs-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .docs-doc__thumb { height: 120px; }
    .docs-preview__panel { width: 100%; }
}

/* --------------------------------------------------------------------------
   حقوق و دستمزد — دوره، فیش و عملیات
   -------------------------------------------------------------------------- */
.pay-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pay-actions form { margin: 0; }

.pay-slip {
    max-width: 980px;
    margin: 0 auto;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.pay-slip__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.pay-slip__org strong { display: block; font-size: 17px; }
.pay-slip__org span { font-size: 12.5px; color: var(--muted); }
.pay-slip__period { text-align: end; }
.pay-slip__period-label { margin-bottom: 6px; font-size: 15px; font-weight: 700; }

.pay-slip__meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 16px;
    margin: 0 0 14px;
    padding: 14px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}

.pay-slip__meta dt { font-size: 11px; color: var(--muted); }
.pay-slip__meta dd { margin: 2px 0 0; font-size: 13px; font-weight: 600; }

.pay-slip__attendance { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.pay-slip__columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pay-slip__col h4 { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; }

.pay-slip__table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pay-slip__table td,
.pay-slip__table th { padding: 7px 10px; border-bottom: 1px dashed var(--border); }
.pay-slip__table tfoot th {
    border-top: 2px solid var(--border);
    border-bottom: 0;
    background: var(--surface-2);
    text-align: start;
}
.pay-slip__amount { text-align: end; font-variant-numeric: tabular-nums; }

.pay-slip__net {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border));
    border-radius: var(--radius-sm);
    background: var(--success-soft);
}

.pay-slip__net strong { font-size: 19px; }
.pay-slip__notes {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    font-size: 11.5px;
    color: var(--muted);
}

.pay-slip__sign {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 34px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

.pay-slip__sign div { margin-top: 34px; padding-top: 10px; border-top: 1px dashed var(--border); }

@media (max-width: 720px) {
    .pay-slip__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pay-slip__columns { grid-template-columns: 1fr; }
    .pay-slip__sign { grid-template-columns: 1fr; }
}

@media print {
    .no-print { display: none !important; }
    .pay-slip { max-width: none; padding: 0; border: 0; box-shadow: none; }
    .pay-slip__sign { margin-top: 24px; }
}

/* --------------------------------------------------------------------------
   ابزارهای تکمیلی و ماژول حسابداری
   -------------------------------------------------------------------------- */
.stat--danger { --stat-color: var(--danger); }
.badge--muted { color: var(--muted); background: var(--surface-3); border-color: transparent; }

.icon-btn--sm { width: 30px; height: 30px; font-size: 12px; border-radius: var(--radius-xs); }
.input--sm { height: 34px; padding: 0 9px; font-size: 12.5px; border-radius: var(--radius-xs); }

/* نمودار ستونی ماهانه */
.acct-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 210px;
    padding-top: 8px;
    overflow-x: auto;
}
.acct-chart__col {
    flex: 1 1 0;
    min-width: 34px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.acct-chart__bars {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    min-height: 0;
}
.acct-chart__bar {
    display: block;
    width: 11px;
    min-height: 2px;
    border-radius: 5px 5px 0 0;
}
.acct-chart__bar--rev { background: linear-gradient(180deg, var(--success), color-mix(in srgb, var(--success) 60%, var(--surface))); }
.acct-chart__bar--exp { background: linear-gradient(180deg, var(--danger), color-mix(in srgb, var(--danger) 60%, var(--surface))); }
.acct-chart__label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.acct-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.acct-legend__dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.acct-legend__dot--rev { background: var(--success); }
.acct-legend__dot--exp { background: var(--danger); }

/* خلاصه و میان‌برها */
.acct-mini-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.acct-mini-totals > div {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.acct-quicklinks { display: flex; flex-wrap: wrap; gap: 8px; }

.acct-bar-row { margin-bottom: 12px; }
.acct-bar-row:last-child { margin-bottom: 0; }
.acct-fill--rev { background: linear-gradient(90deg, var(--success), color-mix(in srgb, var(--success) 55%, var(--surface))); }
.acct-fill--exp { background: linear-gradient(90deg, var(--danger), color-mix(in srgb, var(--danger) 55%, var(--surface))); }

/* فرم‌های فیلتر و صفحه‌بندی */
.acct-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    align-items: end;
}
.acct-filters .field { margin-bottom: 0; }
.acct-filters__search { grid-column: span 2; }
.acct-filters__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acct-pager { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }

/* درخت سرفصل‌ها */
.acct-tree__row--group > td { background: var(--surface-2); }
.acct-tree__icon { color: var(--accent); margin-inline-end: 6px; }
.acct-tree__actions { width: 52px; text-align: center; }

/* فرم سند */
.acct-errors { border-inline-start: 3px solid var(--danger); }
.acct-errors .strong { color: var(--danger); }
.acct-lines td { vertical-align: middle; }
.acct-amount { text-align: end; font-variant-numeric: tabular-nums; }
.acct-form-foot { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.acct-form-foot__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* نمایش سند */
.acct-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.acct-meta > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.acct-alert { border-inline-start: 3px solid var(--accent); }
.acct-alert--danger { border-inline-start-color: var(--danger); background: var(--danger-soft); }

/* دفتر روزنامه */
.acct-journal__head td { background: var(--surface-2); }
.acct-journal__head-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.acct-journal__head-row > span:last-child { margin-inline-start: auto; }
.acct-journal tbody + tbody tr:first-child td { border-top: 2px solid var(--border-strong); }

/* تراز و صورت‌ها */
.acct-trial__row--group > td { background: var(--surface-2); }
.acct-result { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.acct-result--profit { border-inline-start: 3px solid var(--success); background: var(--success-soft); }
.acct-result--loss { border-inline-start: 3px solid var(--danger); background: var(--danger-soft); }
.acct-result__amount { font-size: 1.3rem; font-weight: 700; }

@media (max-width: 720px) {
    .acct-chart { height: 170px; }
    .acct-filters__search { grid-column: auto; }
    .acct-mini-totals { grid-template-columns: minmax(0, 1fr); }
    .acct-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
    .acct-chart, .acct-filters, .acct-pager { display: none !important; }
}
