@font-face {
    font-family: 'Vazirmatn';
    src: url('/static/fonts/vazirmatn/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/static/fonts/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/static/fonts/vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/static/fonts/vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/static/fonts/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/static/fonts/vazirmatn/Vazirmatn-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
}

:root {
    --navy-900: #0b1e33;
    --navy-800: #10283f;
    --navy-700: #16324f;
    --navy-600: #1e3f63;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --amber-100: #fef3c7;

    --primary: #1e5f8a;
    --primary-dk: #123e5c;
    --primary-lt: #e8f2f9;

    --surface: #ffffff;
    --bg: #f4f7fa;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-soft: #94a3b8;

    --green: #16a34a;
    --green-lt: #dcfce7;
    --red: #dc2626;
    --red-lt: #fee2e2;
    --amber: #d97706;
    --amber-lt: #fef3c7;
    --purple: #7c3aed;
    --purple-lt: #ede9fe;
    --teal: #0d9488;
    --teal-lt: #ccfbf1;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(15, 30, 50, .06);
    --shadow: 0 4px 16px rgba(15, 30, 50, .08);
    --shadow-lg: 0 12px 32px rgba(15, 30, 50, .14);

    --sidebar-w: 250px;
    --topbar-h: 62px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', -apple-system, sans-serif;
    direction: rtl;
    font-size: 15px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===================== Buttons ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: none;
    border-radius: var(--radius-sm);
    padding: .6rem 1.1rem;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-amber { background: var(--amber-500); color: #1a1203; }
.btn-amber:hover { background: var(--amber-600); }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-lt); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-danger { background: var(--red-lt); color: var(--red); }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: var(--green-lt); color: var(--green); }
.btn-success:hover { background: #bbf7d0; }
.btn-sm { padding: .38rem .8rem; font-size: .78rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===================== Forms ===================== */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-muted); margin-bottom: .35rem; }
.field { margin-bottom: 1rem; }
.form-control, input[type=text], input[type=number], input[type=tel], input[type=password], select, textarea {
    width: 100%;
    padding: .65rem .85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .9rem;
    background: #fff;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-lt);
}
textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row > .field { flex: 1; min-width: 180px; }
.hint { font-size: .76rem; color: var(--text-soft); margin-top: .3rem; }

/* ===================== Layout ===================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; right: 0;
    z-index: 200;
    transition: transform .25s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand__logo {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #1a1203; font-size: 1.1rem;
    flex-shrink: 0;
}
.sidebar-brand__text { font-weight: 800; font-size: 1.05rem; color: #fff; }
.sidebar-brand__sub { font-size: .7rem; color: #94a3b8; }

.sidebar-workshop {
    padding: .9rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-workshop__name { font-weight: 700; color: #fff; font-size: .92rem; margin-bottom: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-workshop__role { font-size: .72rem; color: var(--amber-500); }

.sidebar-nav { flex: 1; padding: .75rem .6rem; overflow-y: auto; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .85rem;
    border-radius: var(--radius-sm);
    color: #cbd5e1;
    font-size: .87rem;
    font-weight: 500;
    margin-bottom: .2rem;
    transition: background .15s ease, color .15s ease;
    position: relative;
}
.sidebar-link .sidebar-icon { font-size: 1.05rem; width: 22px; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-link.active { background: linear-gradient(90deg, var(--amber-600), transparent); color: #fff; font-weight: 700; }
.sidebar-link.active::before {
    content: '';
    position: absolute; right: 0; top: 8px; bottom: 8px; width: 3px;
    background: var(--amber-500); border-radius: 3px;
}
.sidebar-link .badge-count {
    margin-right: auto;
    background: rgba(255,255,255,.12);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: .72rem;
}

.sidebar-footer { padding: .9rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.sidebar-user__avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
    flex-shrink: 0;
}
.sidebar-user__name { font-size: .82rem; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user__phone { font-size: .72rem; color: #94a3b8; }

.main-wrap {
    margin-right: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}
.topbar-title { font-weight: 700; font-size: 1.05rem; }
.topbar-actions { display: flex; align-items: center; gap: .7rem; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text); }

.subscription-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .35rem .8rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
    text-decoration: none;
}
.subscription-chip.free { background: var(--amber-lt); color: var(--amber-600); }
.subscription-chip.free.exhausted { background: var(--red-lt); color: var(--red); }
.subscription-chip.active { background: var(--green-lt); color: var(--green); }
.subscription-chip.expiring { background: var(--red-lt); color: var(--red); }

.content { padding: 1.5rem; max-width: 1320px; width: 100%; margin: 0 auto; }

/* ===================== Cards / panels ===================== */
.panel {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.1rem; flex-wrap: wrap; gap: .6rem;
}
.panel-header h2 {
    font-size: 1.05rem; font-weight: 700; margin: 0;
    padding-right: .7rem; position: relative;
}
.panel-header h2::before {
    content: ''; position: absolute; right: 0; top: 2px; bottom: 2px; width: 4px;
    border-radius: 4px; background: var(--primary);
}
.panel-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* ===================== KPI cards ===================== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi-card {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.3rem 1rem 1.1rem; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: .45rem;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: linear-gradient(90deg, var(--kpi-accent, var(--primary)), transparent); opacity: .9;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi-card--blue { --kpi-accent: #2563eb; } .kpi-card--purple { --kpi-accent: #7c3aed; }
.kpi-card--amber { --kpi-accent: #d97706; } .kpi-card--green { --kpi-accent: #16a34a; }
.kpi-card--red { --kpi-accent: #dc2626; } .kpi-card--teal { --kpi-accent: #0d9488; }
.kpi-icon {
    width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
    border-radius: 12px; font-size: 1.3rem;
    background: color-mix(in srgb, var(--kpi-accent, var(--primary)) 14%, transparent);
}
.kpi-value { font-size: 1.7rem; font-weight: 800; color: var(--kpi-accent, var(--primary)); line-height: 1.1; }
.kpi-label { font-size: .78rem; color: var(--text-muted); }
.kpi-sub { font-size: .68rem; color: var(--text-soft); margin-top: -.1rem; }

/* ===================== Tables ===================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .87rem; }
table.data-table th {
    background: var(--primary-lt); color: var(--primary-dk); font-weight: 700;
    padding: .7rem .9rem; text-align: right; border-bottom: 2px solid var(--border); white-space: nowrap;
}
table.data-table td { padding: .65rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr { transition: background .12s ease; }
table.data-table tbody tr:hover td { background: #f8fafc; }
table.data-table tr.clickable { cursor: pointer; }

.empty-state { text-align: center; color: var(--text-muted); padding: 2.5rem 1rem; font-size: .88rem; }

/* ===================== Badges / pills ===================== */
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .72rem; font-weight: 700; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-amber { background: var(--amber-lt); color: var(--amber-600); }
.badge-green { background: var(--green-lt); color: var(--green); }
.badge-red { background: var(--red-lt); color: var(--red); }
.badge-purple { background: var(--purple-lt); color: var(--purple); }
.badge-gray { background: #f1f5f9; color: var(--text-muted); }
.status-pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 11px; font-size: .74rem; font-weight: 700; }

/* ===================== Tabs (in-page) ===================== */
.subtabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 1.1rem; flex-wrap: wrap; }
.subtab-btn {
    padding: .55rem 1.1rem; border: none; background: none; cursor: pointer;
    font-size: .85rem; font-family: inherit; color: var(--text-muted);
    border-bottom: 2.5px solid transparent; margin-bottom: -2px; transition: color .2s, border-color .2s;
    display: flex; align-items: center; gap: .4rem;
}
.subtab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.subtab-btn:hover:not(.active) { color: var(--text); }
.subtab-pane { animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ===================== Modal ===================== */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(11,30,51,.55);
    z-index: 1000; align-items: center; justify-content: center; padding: 1rem;
    backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff; border-radius: var(--radius); width: 100%; max-width: 560px;
    max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg);
    animation: modalpop .18s ease;
}
.modal-box.modal-lg { max-width: 780px; }
@keyframes modalpop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 1.02rem; }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-body { padding: 1.3rem; }
.modal-foot { padding: 1rem 1.3rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }

/* گروه‌بندی دکمه‌های اقدام روی سفارش (مودال جزئیات سفارش) — به‌جای یک ردیف
   بلند «اتوبوسی»، دکمه‌های ارجاع در یک گروه فشرده و دکمه‌های ثانویه
   (توقف/بایگانی) در گروهی جدا با فاصله‌ی بصری قرار می‌گیرند. */
.modal-foot.order-actions { flex-direction: column; align-items: stretch; gap: .8rem; }
.action-group { display: flex; flex-direction: column; gap: .4rem; }
.action-group__label { font-size: .72rem; color: var(--text-muted); font-weight: 700; }
.action-group__buttons { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-start; }
.action-group__buttons .btn { flex: 0 0 auto; }
.action-group__buttons.secondary { border-top: 1px dashed var(--border); padding-top: .6rem; }
/* دکمه‌ی «تایید نهایی/آماده‌ی ترخیص» چون یک تصمیم مجوزدهی است (نه صرفاً
   ارجاع)، عمداً در ردیف خودش و با کادر بالا جدا نمایش داده می‌شود تا با
   دکمه‌های ارجاع ساده اشتباه گرفته نشود. */
.action-group--final { border-top: 1px dashed var(--border); padding-top: .7rem; }
.action-group--final .btn { font-weight: 700; }

/* تاریخچه‌ی گردش کار سفارش (کجا رفته، توسط چه کسی) */
.workflow-log { font-size: .78rem; color: var(--text-muted); margin-top: .5rem; }
.workflow-log__row {
    display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline;
    padding: .35rem 0; border-bottom: 1px dashed var(--border);
}
.workflow-log__row:last-child { border-bottom: none; }
.workflow-log__arrow { font-weight: 700; color: var(--text); }
.workflow-log__by { color: var(--primary-dk); }
.workflow-log__at { margin-inline-start: auto; color: var(--text-muted); font-size: .74rem; }
.workflow-log__note { flex-basis: 100%; color: var(--text-muted); font-size: .74rem; }

/* لیست پیش‌نمایش فایل‌های پیوستی انتخاب‌شده (آپلود چندفایلی تدریجی) */
.multi-file-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.multi-file-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--primary-lt); color: var(--primary-dk); border-radius: 999px;
    padding: .25rem .4rem .25rem .7rem; font-size: .76rem; max-width: 220px;
}
.multi-file-chip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-file-chip button {
    background: rgba(0,0,0,.08); border: none; border-radius: 50%; width: 18px; height: 18px;
    line-height: 1; cursor: pointer; color: inherit; font-size: .68rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.multi-file-chip button:hover { background: rgba(0,0,0,.16); }
.multi-file-note { width: 100%; font-size: .72rem; color: var(--amber-600); }

/* ===================== Alerts ===================== */
.alert { padding: .8rem 1.1rem; border-radius: var(--radius-sm); font-size: .86rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.alert-success { background: var(--green-lt); color: #14532d; }
.alert-error { background: var(--red-lt); color: #7f1d1d; }
.alert-warning { background: var(--amber-lt); color: #78350f; }
.alert-info { background: var(--primary-lt); color: var(--primary-dk); }

/* debt warning box */
.debt-box { margin-top: 14px; background: var(--red-lt); border: 1px solid #fecaca; border-radius: var(--radius-sm); padding: 14px 16px; }
.debt-box__title { display: flex; align-items: center; gap: 6px; color: #b91c1c; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.debt-box__amount { font-size: 13px; color: #7f1d1d; margin-bottom: 10px; line-height: 1.9; }
.debt-box .row { display: flex; gap: 8px; align-items: center; }
.debt-box input[type=number] { flex: 1; }
.debt-box .btn { white-space: nowrap; }
.debt-box__note { margin-top: 8px; font-size: 11px; color: #991b1b; }

/* ===================== Misc ===================== */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.mono { font-family: 'Courier New', monospace; direction: ltr; display: inline-block; }
.divider { height: 1px; background: var(--border); margin: 1.1rem 0; border: none; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: .5rem; } .gap-3 { gap: .8rem; }

.fab-mobile-nav { display: none; }

/* ===================== Responsive ===================== */
@media (max-width: 900px) {
    :root { --sidebar-w: 230px; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        width: 78vw;
        max-width: 300px;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .main-wrap { margin-right: 0; }
    .menu-toggle { display: block; }
    .content { padding: 1rem; padding-bottom: 5.5rem; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .panel { padding: 1rem; }
    .sidebar-backdrop {
        display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 190;
    }
    .sidebar-backdrop.open { display: block; }

    .fab-mobile-nav {
        display: flex;
        position: fixed; bottom: 0; right: 0; left: 0;
        background: #fff; border-top: 1px solid var(--border);
        z-index: 150; padding: .4rem .2rem;
        justify-content: space-around;
        box-shadow: 0 -4px 16px rgba(0,0,0,.06);
    }
    .fab-mobile-nav a {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        font-size: .65rem; color: var(--text-muted); padding: .3rem .5rem; border-radius: 8px;
    }
    .fab-mobile-nav a.active { color: var(--primary); font-weight: 700; }
    .fab-mobile-nav a .sidebar-icon { font-size: 1.15rem; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .topbar-title { font-size: .92rem; }
    .modal-body { padding: 1rem; }
}

/* ======================================================================
   صفحات احراز هویت (ورود/تایید/تکمیل پروفایل) — طراحی صنعتی تمام‌صفحه
   ====================================================================== */
.auth-shell {
    min-height: 100vh;
    display: flex;
}
.auth-visual {
    flex: 1.1;
    background:
        linear-gradient(160deg, rgba(11,30,51,.92), rgba(16,40,63,.88)),
        repeating-linear-gradient(45deg, rgba(245,158,11,.05) 0 2px, transparent 2px 34px);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    color: #fff;
    overflow: hidden;
}
.auth-visual::before {
    content: '';
    position: absolute;
    width: 520px; height: 520px;
    border-radius: 50%;
    border: 90px solid rgba(245,158,11,.07);
    top: -140px; left: -160px;
}
.auth-visual::after {
    content: '';
    position: absolute;
    width: 320px; height: 320px;
    border-radius: 50%;
    border: 60px solid rgba(245,158,11,.06);
    bottom: -100px; right: -80px;
}
.auth-visual__brand { display: flex; align-items: center; gap: .8rem; position: relative; z-index: 1; }
.auth-visual__brand .logo-mark {
    width: 52px; height: 52px; border-radius: 16px;
    background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.35rem; color: #1a1203; flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(245,158,11,.35);
}
.auth-visual__brand .name { font-weight: 800; font-size: 1.2rem; }
.auth-visual__brand .sub { font-size: .78rem; color: #94a3b8; }
.auth-visual__headline { position: relative; z-index: 1; max-width: 460px; }
.auth-visual__headline h1 { font-size: 1.9rem; font-weight: 800; line-height: 1.55; margin: 0 0 .8rem; }
.auth-visual__headline p { color: #cbd5e1; font-size: .92rem; line-height: 1.9; }
.auth-visual__features { position: relative; z-index: 1; display: flex; flex-direction: column; gap: .7rem; }
.auth-visual__features .item { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: #e2e8f0; }
.auth-visual__features .item .dot {
    width: 26px; height: 26px; border-radius: 8px; background: rgba(245,158,11,.16);
    color: var(--amber-500); display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0;
}
.auth-visual__foot { position: relative; z-index: 1; font-size: .72rem; color: #64748b; }

.auth-panel {
    flex: 1;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}
.auth-card {
    width: 100%;
    max-width: 380px;
}
.auth-card__mobile-brand { display: none; }
.auth-card h2 { font-size: 1.3rem; font-weight: 800; margin: 0 0 .3rem; }
.auth-card .lead { color: var(--text-muted); font-size: .87rem; margin-bottom: 1.6rem; }

.phone-input-wrap { position: relative; }
.phone-input-wrap .prefix {
    position: absolute; right: .85rem; top: 50%; transform: translateY(-50%);
    color: var(--text-soft); font-size: .85rem; pointer-events: none;
}
.phone-input-wrap input { padding-right: 2.6rem; direction: ltr; text-align: right; letter-spacing: .5px; }

.otp-boxes { display: flex; gap: .5rem; direction: ltr; justify-content: center; margin: 1.2rem 0; }
.otp-boxes input {
    width: 46px; height: 54px; text-align: center; font-size: 1.3rem; font-weight: 700;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
}
.otp-boxes input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-lt); }

.resend-row { text-align: center; font-size: .82rem; color: var(--text-muted); margin-top: .8rem; }
.resend-row a { color: var(--primary); font-weight: 700; }
.resend-row .countdown { color: var(--text-soft); }

@media (max-width: 900px) {
    .auth-visual { display: none; }
    .auth-card__mobile-brand {
        display: flex; align-items: center; gap: .6rem; justify-content: center; margin-bottom: 1.6rem;
    }
    .auth-card__mobile-brand .logo-mark {
        width: 42px; height: 42px; border-radius: 12px;
        background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
        display: flex; align-items: center; justify-content: center; font-weight: 800; color: #1a1203;
    }
    .auth-card__mobile-brand .name { font-weight: 800; }
}

/* ======================================================================
   لندینگ (صفحه‌ی معرفی برای کاربران خارج از حساب)
   ====================================================================== */
.landing-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.2rem 5vw; background: var(--navy-900); color: #fff;
}
.landing-header .brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; }
.landing-header .brand .logo-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
    display: flex; align-items: center; justify-content: center; color: #1a1203; font-weight: 800;
}
.landing-nav { display: flex; align-items: center; gap: 1.2rem; }
.landing-nav > a:not(.btn) { color: #e2e8f0; font-size: .9rem; text-decoration: none; }
.landing-nav > a:not(.btn):hover { color: #fff; text-decoration: underline; }
.landing-hero {
    background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
    color: #fff; padding: 5rem 5vw 6rem; text-align: center;
    position: relative; overflow: hidden;
}
.landing-hero h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 800; max-width: 780px; margin: 0 auto 1.2rem; line-height: 1.6; }
.landing-hero p { color: #cbd5e1; max-width: 600px; margin: 0 auto 2rem; font-size: 1rem; line-height: 1.9; }
.landing-hero .cta-row { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.landing-section { padding: 4rem 5vw; max-width: 1200px; margin: 0 auto; }
.landing-section h2 { text-align: center; font-size: 1.5rem; font-weight: 800; margin-bottom: .6rem; }
.landing-section .lead { text-align: center; color: var(--text-muted); max-width: 600px; margin: 0 auto 2.5rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.3rem; }
.feature-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.6rem; box-shadow: var(--shadow-sm);
}
.feature-card .ic {
    width: 46px; height: 46px; border-radius: 12px; background: var(--primary-lt); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 1rem;
}
.feature-card h3 { font-size: .98rem; margin: 0 0 .5rem; }
.feature-card p { color: var(--text-muted); font-size: .84rem; line-height: 1.8; margin: 0; }
.landing-footer { text-align: center; padding: 2rem; color: var(--text-soft); font-size: .78rem; border-top: 1px solid var(--border); }

/* ======================================================================
   هاب کارگاه‌ها (لیست/ایجاد)
   ====================================================================== */
.hub-shell { min-height: 100vh; background: var(--bg); }
.hub-topbar {
    background: var(--navy-900); color: #fff; padding: 1rem 5vw;
    display: flex; align-items: center; justify-content: space-between;
}
.hub-topbar .brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; }
.hub-content { max-width: 900px; margin: 0 auto; padding: 2.5rem 1.2rem; }
.hub-content h1 { font-size: 1.35rem; margin-bottom: .3rem; }
.hub-content .lead { color: var(--text-muted); margin-bottom: 2rem; font-size: .88rem; }
.workshop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.workshop-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.3rem; box-shadow: var(--shadow-sm); display: block; transition: transform .15s, box-shadow .15s;
}
.workshop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.workshop-card .name { font-weight: 700; font-size: 1rem; margin-bottom: .3rem; }
.workshop-card .role { display: inline-block; margin-top: .5rem; }
.workshop-card--add {
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .5rem;
    border: 2px dashed var(--border); color: var(--text-muted); cursor: pointer; min-height: 110px;
}
.workshop-card--add:hover { border-color: var(--primary); color: var(--primary); }
.workshop-card--add .plus { font-size: 1.6rem; }

/* ======================================================================
   پلن‌های اشتراک
   ====================================================================== */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; margin-bottom: 2rem; align-items: stretch; }
.plan-card {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
    padding: 1.5rem; text-align: center; position: relative; display: flex; flex-direction: column; gap: .5rem;
    height: 100%;
}
.plan-card > ul { flex: 1; }
.plan-card > .btn, .plan-card > a.btn, .plan-card > button.btn { margin-top: auto; }
.plan-card.popular { border-color: var(--amber-500); box-shadow: 0 0 0 3px var(--amber-100); }
.plan-card .ribbon {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--amber-500); color: #1a1203; font-size: .68rem; font-weight: 800;
    padding: 3px 12px; border-radius: 999px;
}
.plan-card .title { font-weight: 800; font-size: 1.05rem; }
.plan-card .price { font-size: 1.7rem; font-weight: 800; color: var(--primary); margin: .3rem 0; }
.plan-card .price small { font-size: .7rem; font-weight: 500; color: var(--text-muted); }
.plan-card .discount { font-size: .72rem; color: var(--green); font-weight: 700; }
.plan-card ul { list-style: none; padding: 0; margin: .8rem 0; text-align: right; font-size: .8rem; color: var(--text-muted); display: flex; flex-direction: column; gap: .4rem; }
.plan-card ul li::before { content: '✓ '; color: var(--green); font-weight: 800; }

.free-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    background: var(--amber-lt); border: 1px solid var(--amber-500); border-radius: var(--radius);
    padding: 1rem 1.3rem; margin-bottom: 1.5rem;
}
.free-banner.exhausted { background: var(--red-lt); border-color: var(--red); }
.free-banner .progress-track { width: 160px; height: 8px; background: #fff; border-radius: 999px; overflow: hidden; }
.free-banner .progress-fill { height: 100%; background: var(--amber-600); }
.free-banner.exhausted .progress-fill { background: var(--red); }

/* ======================================================================
   جستجوی هوشمند اعضا / مشتریان (کامبوباکس)
   ====================================================================== */
.search-combo { position: relative; }
.search-combo__results {
    position: absolute; top: calc(100% + 4px); right: 0; left: 0;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; z-index: 50; display: none;
}
.search-combo__results.open { display: block; }
.search-combo__item {
    padding: .65rem .9rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border); font-size: .85rem;
}
.search-combo__item:last-child { border-bottom: none; }
.search-combo__item:hover { background: var(--primary-lt); }
.search-combo__empty { padding: 1rem; text-align: center; color: var(--text-muted); font-size: .82rem; }

/* ======================================================================
   کارت عضو / لیست دعوت‌نامه
   ====================================================================== */
.member-row {
    display: flex; align-items: center; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-row .avatar {
    width: 40px; height: 40px; border-radius: 50%; background: var(--primary-lt); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.member-row .info { flex: 1; min-width: 0; }
.member-row .info .name { font-weight: 700; font-size: 1rem; }
.member-row .info .meta { font-size: .92rem; color: var(--text-muted); margin-top: 2px; }
.member-row .actions { display: flex; align-items: center; gap: .5rem; }

/* ======================================================================
   ریسپانسیو عمومی جدول‌ها روی موبایل
   ====================================================================== */
@media (max-width: 640px) {
    table.data-table thead { display: none; }
    table.data-table, table.data-table tbody, table.data-table tr, table.data-table td { display: block; width: 100%; }
    table.data-table tr {
        border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .7rem; padding: .4rem .2rem;
    }
    table.data-table td {
        display: flex; justify-content: space-between; align-items: center; gap: .8rem;
        border-bottom: 1px dashed var(--border); padding: .5rem .8rem; text-align: left;
    }
    table.data-table td:last-child { border-bottom: none; }
    table.data-table td::before {
        content: attr(data-label); font-weight: 700; color: var(--text-muted); font-size: .72rem; text-align: right;
    }
    .auth-visual, .landing-header .nav-links { display: none; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ پیش‌نمایش پیوست‌های سفارش (تصاویر) در مودال جزئیات ============ */
.attachment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: .6rem;
}

.attachment-thumb {
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: block;
    background: #f1f5f9;
    transition: transform .15s ease, box-shadow .15s ease;
}

.attachment-thumb:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attachment-file-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .78rem;
    color: var(--text);
    text-decoration: none;
    background: var(--surface);
    max-width: 160px;
}

.attachment-file-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ================== تقویم شمسی (Jalali Picker) ================== */
.jalali-picker-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 12px;
    width: 260px;
    font-family: inherit;
    direction: rtl;
}
.jp-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.jp-title { font-weight: 700; font-size: .95rem; color: var(--text); }
.jp-nav {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 1.1rem;
    color: var(--primary);
}
.jp-nav:hover { background: var(--primary-lt); }
.jp-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr);
    text-align: center; font-size: .7rem; color: var(--text-muted); margin-bottom: 4px;
}
.jp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jp-day {
    background: transparent; border: none; padding: 6px 0;
    border-radius: 6px; cursor: pointer; font-family: inherit; font-size: .85rem;
    color: var(--text);
}
.jp-day:hover { background: var(--primary-lt); color: var(--primary); }
.jp-day.today { background: var(--amber-lt); color: var(--amber-600); font-weight: 700; }
.jp-foot {
    display: flex; justify-content: space-between; margin-top: 8px;
    padding-top: 8px; border-top: 1px solid var(--border);
}
.jp-today-btn, .jp-clear-btn {
    background: transparent; border: none; font-size: .78rem; cursor: pointer;
    font-family: inherit; padding: 4px 8px; border-radius: 6px;
}
.jp-today-btn { color: var(--primary); }
.jp-clear-btn { color: var(--text-muted); }
.jp-today-btn:hover, .jp-clear-btn:hover { background: var(--primary-lt); }

/* ================== نمودارهای مینیمال SVG ================== */
.chart-pie-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.chart-legend { display: flex; flex-direction: column; gap: .5rem; min-width: 180px; }
.chart-legend__item {
    display: flex; align-items: center; gap: .6rem;
    font-size: .85rem; color: var(--text);
}
.chart-legend__dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.chart-legend__label { flex: 1; }
.chart-legend__value { font-weight: 700; color: var(--text-muted); }
.chart-legend__value small { color: var(--text-soft); font-weight: 500; font-size: .72rem; }
.chart-empty { padding: 2rem; text-align: center; color: var(--text-muted); font-size: .85rem; }

/* بخش نمودارها: کادر و پس‌زمینه‌ی مجزا تا کاملاً از جدول/پنل زیرش جدا دیده
   شود (نه فقط یک margin کوچک). */
.charts-section {
    background: var(--bg-soft, #f8fafc); border: 1px solid var(--border); border-radius: 14px;
    padding: 1.2rem; margin-bottom: 1.6rem;
}
.charts-section__title {
    font-weight: 700; font-size: .88rem; color: var(--text-muted);
    margin: 0 0 .8rem; display: flex; align-items: center; gap: .5rem;
}
.charts-section__title:not(:first-child) { margin-top: 1.4rem; }
.chart-grid { display: grid; gap: 1rem; }
.chart-grid--2 { grid-template-columns: 1fr 1fr; }
.chart-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 860px) {
    .chart-grid--2, .chart-grid--3 { grid-template-columns: 1fr; }
}

.chart-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 1.2rem; box-shadow: var(--shadow-sm);
}
.chart-card__title { font-weight: 700; font-size: .95rem; margin-bottom: .8rem; color: var(--text); }
.chart-card__subtitle { color: var(--text-muted); font-size: .78rem; margin-bottom: 1rem; }

/* نمودار قفل (برای اشتراک) */
.chart-card.locked { position: relative; overflow: hidden; }
.chart-card.locked .chart-content {
    filter: blur(6px); pointer-events: none; user-select: none; opacity: .7;
}
.chart-card.locked .chart-lock-overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: .5rem;
    background: rgba(255,255,255,.55); backdrop-filter: blur(2px);
    text-align: center; padding: 1rem;
}
.chart-card.locked .chart-lock-overlay .icon { font-size: 2rem; }
.chart-card.locked .chart-lock-overlay .msg {
    font-weight: 700; color: var(--text); font-size: .9rem;
}
.chart-card.locked .chart-lock-overlay .sub {
    font-size: .78rem; color: var(--text-muted); max-width: 240px;
}

/* ================== وبلاگ / مجله عمومی ================== */
.blog-body { background: #f8fafc; color: var(--text); }
.blog-header {
    background: var(--navy-900); color: #fff; padding: 1rem 0;
    position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.blog-header__inner {
    max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.blog-brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 700; }
.blog-brand__logo {
    width: 34px; height: 34px; border-radius: 8px;
    background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
    display: flex; align-items: center; justify-content: center; color: #1a1203;
}
.blog-nav { display: flex; align-items: center; gap: 1.2rem; }
.blog-nav a { color: #cbd5e1; text-decoration: none; font-size: .9rem; }
.blog-nav a:hover, .blog-nav a.active { color: #fff; }
.blog-main { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.blog-hero {
    text-align: center; padding: 3rem 1rem;
    background: linear-gradient(135deg, #fff, #f1f5f9);
    border-radius: 16px; margin-bottom: 2.5rem;
}
.blog-hero h1 { font-size: 2rem; margin: 0 0 .5rem; color: var(--navy-900); font-weight: 800; }
.blog-hero p { color: var(--text-muted); margin-bottom: 1.5rem; }
.blog-search {
    max-width: 500px; margin: 0 auto; display: flex; gap: .5rem;
}
.blog-search input {
    flex: 1; padding: .75rem 1rem; border: 1px solid var(--border);
    border-radius: 10px; font-family: inherit; font-size: .9rem;
}

.blog-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}
.blog-card {
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.06); transition: transform .2s, box-shadow .2s;
    display: flex; flex-direction: column;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,.12); }
.blog-card__cover {
    height: 180px; overflow: hidden; display: block;
    background: var(--surface);
}
.blog-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card__cover--placeholder {
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--text-muted);
    background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
}
.blog-card__body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.blog-card__body h2 { font-size: 1.1rem; margin: 0 0 .5rem; line-height: 1.5; }
.blog-card__body h2 a { color: var(--text); text-decoration: none; }
.blog-card__body h2 a:hover { color: var(--primary); }
.blog-card__meta { font-size: .75rem; color: var(--text-muted); margin-bottom: .8rem; }
.blog-card__meta span { display: inline-block; }
.blog-card__excerpt { flex: 1; color: var(--text-muted); font-size: .88rem; line-height: 1.8; margin: 0 0 1rem; }
.blog-card__more { color: var(--primary); font-weight: 700; font-size: .85rem; text-decoration: none; margin-top: auto; }

.blog-post { max-width: 780px; margin: 0 auto; background: #fff; padding: 2.5rem; border-radius: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.blog-post__head { text-align: center; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.blog-post__head h1 { font-size: 2rem; margin: 0 0 .8rem; line-height: 1.6; }
.blog-post__cover { margin: 1.5rem -2.5rem; max-height: 400px; overflow: hidden; }
.blog-post__cover img { width: 100%; object-fit: cover; display: block; }
.blog-post__excerpt {
    background: #f8fafc; border-right: 4px solid var(--primary);
    padding: 1rem 1.2rem; margin-bottom: 1.5rem; border-radius: 8px;
    font-weight: 600; color: var(--text); line-height: 1.8;
}
.blog-post__body { line-height: 2; font-size: 1rem; color: #334155; }
.blog-post__body h2 { margin-top: 2rem; margin-bottom: .8rem; color: var(--navy-900); }
.blog-post__body h3 { margin-top: 1.5rem; margin-bottom: .6rem; }
.blog-post__body p { margin-bottom: 1.2rem; }
.blog-post__body ul, .blog-post__body ol { padding-right: 2rem; margin-bottom: 1.2rem; }
.blog-post__body li { margin-bottom: .4rem; }
.blog-post__body img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }

.blog-related { max-width: 1200px; margin: 3rem auto 0; }
.blog-related h3 { text-align: center; margin-bottom: 1.5rem; }

.blog-empty { grid-column: 1/-1; text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.blog-footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: .82rem; border-top: 1px solid var(--border); background: #fff; }
