/* =====================================================
   همیار — سیستم طراحی مینیمال (RTL)
   فونت: وزیرمتن | رنگ اصلی: آبی #2563EB
   ===================================================== */

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

/* ---------- متغیرها ---------- */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-soft: #EFF6FF;
    --primary-border: #BFDBFE;

    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --border-strong: #CBD5E1;

    --text: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    --success: #059669;
    --success-soft: #ECFDF5;
    --warning: #D97706;
    --warning-soft: #FFFBEB;
    --danger: #DC2626;
    --danger-soft: #FEF2F2;
    --info: #0284C7;
    --info-soft: #F0F9FF;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 1px 3px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, .10);

    --sidebar-w: 250px;
    --font: 'Vazirmatn', Tahoma, Arial, sans-serif;
}

/* ---------- ریست ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* کنترل‌های فرم به‌طور پیش‌فرض فونت سیستم می‌گیرند؛ باید از والد ارث ببرند (مثل دکمه خروج در هدر) */
button, input, select, textarea { font-family: inherit; }
html { font-size: 15px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
::selection { background: var(--primary); color: #fff; }

/* اسکرول‌بار نازک */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* =====================================================
   چیدمان اصلی اپ
   ===================================================== */
.app-layout { display: flex; min-height: 100vh; }

/* ---------- سایدبار ---------- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-left: 1px solid var(--border);
    position: fixed;
    inset-block: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .25s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}
.brand-logo {
    width: 38px; height: 38px;
    background: var(--primary);
    color: #fff;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px;
    flex-shrink: 0;
}
img.brand-logo { background: transparent; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 18px; }
.brand-sub { font-size: 11px; color: var(--text-muted); display: block; margin-top: -4px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-section { font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 14px 10px 6px; letter-spacing: .5px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all .15s ease;
    position: relative;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-badge {
    margin-inline-start: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    min-width: 19px;
    height: 19px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-weight: 700;
}

.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); }
.sub-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 10px;
}

/* ---------- محتوا ---------- */
.main-area { flex: 1; margin-right: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(8px);
}
.topbar-title { font-size: 17px; font-weight: 700; }
.topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
    margin-inline-end: auto;
}
.topbar-search input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 38px 8px 14px;
    font-family: var(--font);
    font-size: 14px;
    transition: all .15s;
}
.topbar-search input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.topbar-search .search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 17px; height: 17px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

/* زنگ اعلان */
.icon-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all .15s;
    font-family: var(--font);
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot {
    position: absolute; top: 8px; left: 9px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

/* منوی کاربر */
.user-menu { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 5px 12px 5px 8px;
    cursor: pointer;
    font-family: var(--font);
    transition: all .15s;
}
.user-btn:hover { background: var(--bg); }
.avatar {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}
.avatar-lg { width: 44px; height: 44px; font-size: 17px; border-radius: 12px; }
.user-name { font-size: 13px; font-weight: 700; line-height: 1.3; }
.user-role { font-size: 11px; color: var(--text-muted); }

.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 6px;
    display: none;
    z-index: 200;
}
.dropdown.open { display: block; }
.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
}
.dropdown-item:hover { background: var(--bg); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-soft); }
.dropdown-item svg { width: 17px; height: 17px; }
.dropdown-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* اعلان‌ها */
.notif-dropdown { min-width: 330px; max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 12px; border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 8px; border: 1px solid var(--border); }
.notif-item:last-child { margin-bottom: 0; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-soft); border-color: #BFDBFE; }
.notif-item.unread:hover { background: #DBEAFE; }
.notif-title { font-size: 13px; font-weight: 700; line-height: 1.5; }
.notif-body { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.notif-time { font-size: 11px; color: var(--text-muted); }

/* ---------- بدنه محتوا ---------- */
.page-content { padding: 26px 28px; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.page-title svg { width: 21px; height: 21px; flex-shrink: 0; }
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* =====================================================
   کامپوننت‌ها
   ===================================================== */

/* ---------- دکمه‌ها ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.6;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text-secondary); }
.btn-outline:hover { background: var(--bg); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #DBEAFE; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-danger-soft:hover { background: #FEE2E2; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-sm { padding: 5px 13px; font-size: 13px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .spinner {
    width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading svg:not(.spinner) { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- کارت ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 17px; height: 17px; flex-shrink: 0; }
.card-body { padding: 22px; }
.card-body-sm { padding: 14px 18px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg); }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: all .2s;
}
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon.blue { background: var(--primary-soft); color: var(--primary); }
.kpi-icon.green { background: var(--success-soft); color: var(--success); }
.kpi-icon.red { background: var(--danger-soft); color: var(--danger); }
.kpi-icon.amber { background: var(--warning-soft); color: var(--warning); }
.kpi-icon.sky { background: var(--info-soft); color: var(--info); }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.kpi-value { font-size: 20px; font-weight: 700; line-height: 1.4; }
.kpi-hint { font-size: 11px; color: var(--text-muted); }

/* ---------- آمار فشرده (mini stat cards) ---------- */
.stats-grid { display: grid; gap: 12px; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 10px);
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.3; color: var(--text); }

/* ---------- استک عمودی (vertical stack — فاصله‌گذاری بین کانتینرهای پشت‌سرهم) ---------- */
.vstack { display: flex; flex-direction: column; gap: 16px; }
.vstack-sm { display: flex; flex-direction: column; gap: 12px; }

/* ---------- جدول ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 11px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #FAFBFC; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { font-variant-numeric: tabular-nums; }
.table-actions { display: flex; gap: 6px; align-items: center; }

/* ---------- بج ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: var(--bg); color: var(--text-muted); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }

/* ---------- فرم‌ها ---------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.form-label .req { color: var(--danger); }
.form-control {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 9px 14px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    transition: all .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control { cursor: pointer; background-image: none; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }

.input-group { position: relative; }
.input-group .suffix {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: var(--text-muted); pointer-events: none;
}
.input-group input { padding-left: 52px; }

/* چک‌باکس و رادیو */
.check-group { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.check-group input[type=checkbox], .check-group input[type=radio] {
    width: 17px; height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }

/* ---------- هشدارها ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid;
}
.alert svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 2px; }
.alert-success { background: var(--success-soft); color: #065F46; border-color: #A7F3D0; }
.alert-error { background: var(--danger-soft); color: #991B1B; border-color: #FECACA; }
.alert-warning { background: var(--warning-soft); color: #92400E; border-color: #FDE68A; }
.alert-info { background: var(--info-soft); color: #075985; border-color: #BAE6FD; }

/* ---------- مودال ---------- */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; animation: fadeIn .18s ease; }
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-lg);
    animation: slideUp .22s ease;
}
.modal-lg { max-width: 780px; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px;
    border: none; background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Toast ---------- */
.toast-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--text);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    animation: slideUp .25s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* ---------- تب‌ها ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

/* ---------- تب‌های پیل/سگمنت (مشابه login-tabs) ----------
   برای سوئیچ‌های باینری داخل card-head یا فرم.
   قابل استفاده در همه‌جا (برخلاف .login-tab که فقط در صفحه ورود است). */
.seg-tabs {
    display: flex;
    gap: 5px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 4px;
}
.seg-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    font-family: inherit;
}
.seg-tab:hover {
    color: var(--text);
    background: var(--surface);
}
.seg-tab.active {
    color: var(--primary);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.seg-tab svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}
/* نوع‌های رنگی برای سگمنت‌های درآمد/هزینه */
.seg-tab.seg-success.active {
    color: var(--success);
    background: var(--success-soft, #ECFDF5);
}
.seg-tab.seg-danger.active {
    color: var(--danger);
    background: var(--danger-soft, #FEF2F2);
}

/* ---------- حالت خالی ---------- */
.empty {
    text-align: center;
    padding: 52px 20px;
    color: var(--text-muted);
}
.empty-icon {
    width: 68px; height: 68px;
    background: var(--bg);
    border-radius: 20px;
    display: inline-flex;
    align-items: center; justify-content: center;
    margin-bottom: 14px;
    color: var(--text-muted);
}
.empty-icon svg { width: 30px; height: 30px; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
.empty-desc { font-size: 13px; margin-bottom: 18px; }

/* ---------- صفحه‌بندی ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 18px 0 4px; }
.page-link {
    min-width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--surface);
    padding: 0 8px;
}
.page-link:hover { background: var(--bg); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.page-link.disabled { opacity: .45; pointer-events: none; }

/* ---------- فیلترها ---------- */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
}
.filter-bar .form-control { width: auto; min-width: 160px; }
.filter-bar input.form-control { min-width: 220px; }

/* ---------- grid ها ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-side { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-side-l { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }

/* ---------- وضعیت اشتراک ---------- */
.sub-hero {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 60%, #1E40AF 100%);
    border-radius: var(--radius-lg);
    color: #fff;
    padding: 32px;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}
.sub-hero::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    top: -120px; left: -80px;
}
.sub-hero .row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; position: relative; z-index: 1; }
.sub-hero h2 { font-size: 20px; margin-bottom: 4px; }
.sub-hero p { opacity: .85; font-size: 14px; }
.sub-days {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    padding: 12px 24px;
    border-radius: var(--radius);
    text-align: center;
    backdrop-filter: blur(4px);
}
.sub-days .n { font-size: 28px; font-weight: 700; line-height: 1.2; }
.sub-days .l { font-size: 12px; opacity: .85; }

/* ---------- قیمت‌گذاری ---------- */
.pricing-table td { padding: 14px 18px; }

/* =====================================================
   POS (صندوق فروش)
   ===================================================== */
.pos-layout { display: grid; grid-template-columns: 1fr 400px; gap: 20px; align-items: start; }
.pos-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding: 4px;
}
.pos-product {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 12px;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
    position: relative;
}
.pos-product:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.pos-product.out { opacity: .5; pointer-events: none; }
.pos-p-name { font-size: 13px; font-weight: 700; line-height: 1.5; height: 40px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pos-p-price { color: var(--primary); font-weight: 700; font-size: 14px; margin-top: 6px; }
.pos-p-stock { font-size: 11px; color: var(--text-muted); }
.pos-p-stock.low { color: var(--warning); font-weight: 700; }

.pos-cart { position: sticky; top: 84px; }
.cart-items { max-height: 300px; overflow-y: auto; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.cart-item:last-child { border-bottom: none; }
.cart-i-info { flex: 1; min-width: 0; }
.cart-i-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-i-price { font-size: 11px; color: var(--text-muted); }
.qty-box { display: flex; align-items: center; gap: 0; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.qty-btn { width: 27px; height: 30px; border: none; background: var(--bg); cursor: pointer; font-size: 15px; color: var(--text-secondary); }
.qty-btn:hover { background: var(--primary-soft); color: var(--primary); }
.qty-input { width: 44px; height: 30px; border: none; text-align: center; font-family: var(--font); font-size: 13px; font-weight: 700; }
.cart-i-total { min-width: 76px; text-align: left; font-size: 13px; font-weight: 700; }
.cart-remove { border: none; background: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px; }
.cart-remove:hover { color: var(--danger); }
.cart-totals { background: var(--bg); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; }
.cart-total-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: var(--text-secondary); }
.cart-total-row.grand { font-size: 17px; font-weight: 700; color: var(--text); border-top: 1px solid var(--border-strong); margin-top: 7px; padding-top: 10px; }

/* =====================================================
   چت هوش مصنوعی
   ===================================================== */
.ai-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: stretch; height: calc(100vh - 176px); min-height: 480px; }
.ai-convs { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.ai-convs-head { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ai-convs-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; background: var(--bg); }
.ai-convs-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 24px 8px; line-height: 2; background: var(--surface); border-radius: var(--radius); }
.ai-convs-empty span { font-size: 11px; }
.conv-item {
    display: block;
    padding: 10px 12px;
    padding-left: 30px; /* فضای خالی برای دکمه‌ی × کنار آیتم */
    border-radius: var(--radius);
    cursor: pointer;
    border: 1px solid var(--border);
    margin-bottom: 5px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    position: relative;
    transition: border-color .12s;
}
.conv-item:hover { border-color: var(--primary-border); }
.conv-item.active { border-color: var(--primary-border); background: var(--primary-soft); }
.conv-item.active::before {
    content: '';
    position: absolute;
    right: -1px; top: 9px; bottom: 9px;
    width: 3px;
    border-radius: 3px 0 0 3px;
    background: var(--primary);
}
.conv-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
/* wrapper اطر آیتم گفتگو — برای نگه‌داشتن دکمه‌ی × به‌عنوان خواهر (خارج از <a>) */
.conv-item-wrap { position: relative; }

.ai-chat-panel { display: flex; flex-direction: column; height: 100%; }
.ai-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 78%; display: flex; gap: 10px; }
/* در چت RTL پیام‌های کاربر در سمت چپ و پاسخ دستیار در سمت راست قرار می‌گیرد */
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-assistant { align-self: flex-start; }
.msg-avatar {
    width: 32px; height: 32px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.msg-user .msg-avatar { background: var(--bg); border: 1px solid var(--border); }
.msg-assistant .msg-avatar { background: linear-gradient(135deg, #2563EB, #7C3AED); color: #fff; }
.msg-bubble { padding: 11px 16px; border-radius: 14px; font-size: 14px; line-height: 1.9; }
.msg-user .msg-bubble { background: var(--primary); color: #fff; border-top-left-radius: 4px; }
.msg-assistant .msg-bubble { background: var(--bg); border: 1px solid var(--border); border-top-right-radius: 4px; }
.msg-bubble p { margin-bottom: 6px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol { padding-right: 18px; margin-bottom: 6px; }

/* === استایل مارک‌داون داخل حباب پیام (هم برای صفحه چت و هم ویجت شناور) === */
.msg-bubble-md h1, .msg-bubble-md h2, .msg-bubble-md h3,
.msg-bubble-md h4, .msg-bubble-md h5, .msg-bubble-md h6 {
    font-weight: 700;
    line-height: 1.4;
    margin: 12px 0 6px;
}
.msg-bubble-md h1 { font-size: 18px; }
.msg-bubble-md h2 { font-size: 16px; }
.msg-bubble-md h3 { font-size: 15px; }
.msg-bubble-md h4, .msg-bubble-md h5, .msg-bubble-md h6 { font-size: 14px; }
.msg-bubble-md h1:first-child, .msg-bubble-md h2:first-child,
.msg-bubble-md h3:first-child, .msg-bubble-md h4:first-child { margin-top: 0; }
.msg-bubble-md p { margin: 0 0 8px; }
.msg-bubble-md p:last-child { margin-bottom: 0; }
.msg-bubble-md ul, .msg-bubble-md ol { padding-right: 22px; margin: 6px 0; }
.msg-bubble-md li { margin-bottom: 4px; }
.msg-bubble-md ul li { list-style: disc; }
.msg-bubble-md ol li { list-style: decimal; }
.msg-bubble-md code {
    font-family: var(--font-mono, 'Sarasa Mono SC', 'Liberation Mono', 'DejaVu Sans Mono', monospace);
    background: rgba(127, 127, 127, 0.18);
    color: inherit;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.92em;
    direction: ltr;
    display: inline-block;
}
.msg-bubble-md pre {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    margin: 8px 0;
    direction: ltr;
    text-align: left;
}
.msg-bubble-md pre code {
    background: transparent;
    padding: 0;
    font-size: 13px;
    display: block;
    white-space: pre;
}
.msg-bubble-md blockquote {
    border-right: 3px solid var(--primary);
    background: var(--primary-soft);
    padding: 6px 12px;
    margin: 8px 0;
    color: var(--text-muted);
    border-radius: 0 6px 6px 0;
}
.msg-bubble-md hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}
.msg-bubble-md .md-table-wrap {
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.msg-bubble-md table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}
.msg-bubble-md th, .msg-bubble-md td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    text-align: right;
}
.msg-bubble-md th {
    background: var(--bg);
    font-weight: 700;
}
.msg-bubble-md tr:nth-child(even) td { background: rgba(127, 127, 127, 0.06); }
.msg-user .msg-bubble-md code,
.msg-user .msg-bubble-md pre { background: rgba(255, 255, 255, 0.18); }
.msg-user .msg-bubble-md pre { border-color: rgba(255, 255, 255, 0.25); }
.msg-user .msg-bubble-md blockquote {
    border-right-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}
.msg-user .msg-bubble-md th { background: rgba(255, 255, 255, 0.12); color: #fff; }
.msg-user .msg-bubble-md td, .msg-user .msg-bubble-md th { border-color: rgba(255, 255, 255, 0.25); }
.msg-user .msg-bubble-md tr:nth-child(even) td { background: rgba(255, 255, 255, 0.08); }

/* === ویجت شناور دستیار هوشمند (Crisp-style) === */
.ai-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    font-family: var(--font, inherit);
}
.ai-fab-btn {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform .2s, box-shadow .2s;
    padding: 0;
}
.ai-fab-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.45);
}
.ai-fab-btn svg { width: 28px; height: 28px; }
.ai-fab-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    opacity: 0.4;
    animation: ai-fab-pulse 2.4s infinite ease-out;
    z-index: -1;
}
@keyframes ai-fab-pulse {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.6); opacity: 0; }
}
.ai-fab-panel {
    position: absolute;
    bottom: 68px;
    left: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 110px);
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom left;
}
/* لایه‌ی شفاف روی بقیه‌ی صفحه وقتی پنل باز است (فقط موبایل) — جلوی کلیک اشتباه روی آیتم‌های زیرین را می‌گیرد */
.ai-fab-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.0);
    z-index: 9998;
    display: none;
}
.ai-fab[data-open="1"] .ai-fab-backdrop { display: block; }
@media (min-width: 601px) { .ai-fab-backdrop { display: none !important; } }
.ai-fab[data-open="1"] .ai-fab-panel {
    display: flex;
    animation: ai-fab-open .22s ease-out;
}
@keyframes ai-fab-open {
    from { transform: scale(0.92) translateY(8px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.ai-fab-head {
    padding: 12px 14px;
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.ai-fab-title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.ai-fab-sub { font-size: 11px; opacity: 0.88; margin-top: 2px; }
.ai-fab-actions { display: flex; gap: 6px; align-items: center; }
.ai-fab-link, .ai-fab-close {
    color: white;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    transition: background .15s;
    font-family: inherit;
}
.ai-fab-link:hover, .ai-fab-close:hover { background: rgba(255, 255, 255, 0.32); }
.ai-fab-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    background: var(--bg, #f8fafc);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ai-fab-msgs::-webkit-scrollbar { width: 6px; }
.ai-fab-msgs::-webkit-scrollbar-thumb { background: rgba(127, 127, 127, 0.35); border-radius: 3px; }
.ai-fab-empty {
    text-align: center;
    color: var(--text-muted, #64748b);
    font-size: 13px;
    margin: auto 0;
    padding: 20px;
    line-height: 1.9;
}
.ai-fab-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.75;
    word-wrap: break-word;
    word-break: break-word;
}
.ai-fab-msg.user {
    align-self: flex-start;
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    color: white;
    border-top-left-radius: 4px;
}
.ai-fab-msg.assistant {
    align-self: flex-end;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-top-right-radius: 4px;
}
.ai-fab-msg.assistant.error {
    border-color: var(--danger, #dc2626);
    color: var(--danger, #dc2626);
}
.ai-fab-msg .msg-bubble-md h1, .ai-fab-msg .msg-bubble-md h2 { font-size: 14px; }
.ai-fab-msg .msg-bubble-md h3 { font-size: 13px; }
.ai-fab-msg .msg-bubble-md p { margin-bottom: 6px; }
.ai-fab-msg .msg-bubble-md pre { font-size: 12px; }
.ai-fab-input {
    padding: 10px;
    background: var(--surface, #fff);
    border-top: 1px solid var(--border, #e5e7eb);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.ai-fab-input input {
    flex: 1;
    border: 1px solid var(--border-strong, #d1d5db);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    background: var(--bg, #f8fafc);
    color: var(--text, #0f172a);
}
.ai-fab-input input:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.ai-fab-input button {
    padding: 8px 14px;
    font-size: 13px;
    height: auto;
    min-height: 38px;
}
.ai-fab-input .typing { padding: 4px 0; }
/* موبایل: پنل چت شناور — عرض ۷۰٪ عرض صفحه، لبه‌ی چپ پنل هم‌راستا با دکمه‌ی FAB
   (left: 20px = همان فاصله‌ی FAB از لبه‌ی چپ). ارتفاع کوتاه‌تر (۶۰٪). */
@media (max-width: 600px) {
    .ai-fab-panel {
        width: 70vw;
        max-width: 70vw;
        height: 60vh;
        max-height: 60vh;
        bottom: 76px;
        left: 20px;
        border-radius: 14px;
    }
    .ai-fab-btn { width: 52px; height: 52px; }
    .ai-fab-btn svg { width: 26px; height: 26px; }
}
/* دکمه‌ی حذف گفتگو — همیشه قرمز و واضح (مشخص) دیده می‌شود */
.conv-item { position: relative; }
.conv-del {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger, #dc2626);
    color: #fff;
    border: 1px solid var(--danger, #dc2626);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    opacity: 1;
    transition: opacity .15s, background .15s, border-color .15s, transform .15s;
    font-family: inherit;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.32);
}
.conv-del:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-50%) scale(1.08);
}
/* روی موبایل دکمه‌ی حذف همیشه واضح و کمی بزرگ‌تر دیده می‌شود */
@media (max-width: 600px) {
    .conv-del { width: 26px; height: 26px; font-size: 15px; left: 6px; }
    .conv-item { padding-left: 38px; }
}

.msg-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tool-chip {
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-flex; align-items: center; gap: 5px;
}
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span { width: 7px; height: 7px; background: var(--text-muted); border-radius: 50%; animation: bounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

.ai-input-bar { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-end; background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.ai-input-bar textarea {
    flex: 1;
    resize: none;
    max-height: 110px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.7;
}
.ai-input-bar textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.ai-sug {
    font-size: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 13px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all .15s;
}
.ai-sug:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* =====================================================
   صفحات احراز هویت و لندینگ
   ===================================================== */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.auth-side {
    background: linear-gradient(160deg, #1E40AF 0%, #2563EB 55%, #3B82F6 100%);
    color: #fff;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.auth-side::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    top: -180px; right: -140px;
}
.auth-side::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    bottom: -100px; left: -70px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; position: relative; z-index: 1; }
.auth-brand .brand-logo { width: 44px; height: 44px; font-size: 20px; border-radius: 13px; }
.auth-features { position: relative; z-index: 1; }
.auth-features h2 { font-size: 26px; margin-bottom: 22px; line-height: 1.6; }
.auth-feature { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.auth-feature .fi {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.15);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.auth-feature .fi svg { width: 19px; height: 19px; }
.auth-feature b { font-size: 15px; display: block; }
.auth-feature span { font-size: 13px; opacity: .8; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-size: 24px; margin-bottom: 6px; }
.auth-box .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 26px; }

/* لندینگ */
.landing-nav {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 1120px; margin: 0 auto; padding: 20px 24px;
}
.landing-hero {
    max-width: 1120px; margin: 0 auto; padding: 72px 24px 64px;
    text-align: center;
}
.landing-hero h1 { font-size: 42px; line-height: 1.6; margin-bottom: 16px; }
.landing-hero h1 .hl { color: var(--primary); }
.landing-hero p { font-size: 17px; color: var(--text-secondary); max-width: 640px; margin: 0 auto 30px; }
.landing-section { max-width: 1120px; margin: 0 auto; padding: 48px 24px; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.feat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; }
.feat-icon {
    width: 48px; height: 48px;
    background: var(--primary-soft); color: var(--primary);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.feat-card h3 { font-size: 16px; margin-bottom: 8px; }
.feat-card p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.9; }
.section-title { text-align: center; font-size: 28px; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--text-muted); margin-bottom: 36px; }

/* =====================================================
   تاریخ‌خوان شمسی
   ===================================================== */
.dp-wrap { position: relative; }
/* انتخاب تاریخ و ساعت در دو فیلد جدا */
.dp-split { display: flex; gap: 8px; align-items: stretch; }
.dp-split input[type=text] { flex: 1; min-width: 0; }
.dp-split .dp-time-input {
    width: 118px;
    flex-shrink: 0;
    font-family: var(--font);
    text-align: center;
    direction: ltr;
}
.dp-picker {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 292px;
    z-index: 1500;
    padding: 14px;
    display: none;
}
.dp-picker.open { display: block; animation: slideUp .15s ease; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-title { font-size: 14px; font-weight: 700; cursor: pointer; }
.dp-nav {
    width: 30px; height: 30px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.dp-nav:hover { background: var(--bg); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: 11px; color: var(--text-muted); padding: 5px 0; font-weight: 700; }
.dp-day {
    height: 34px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    border-radius: 9px;
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font);
    color: var(--text);
}
.dp-day:hover { background: var(--primary-soft); }
.dp-day.today { color: var(--primary); font-weight: 700; }
.dp-day.selected { background: var(--primary); color: #fff; font-weight: 700; }
.dp-day.other { color: #CBD5E1; }
.dp-day.weekend { color: var(--danger); }
.dp-day.weekend:hover { background: var(--danger-soft); }
.dp-day.weekend.selected { background: var(--primary); color: #fff; }
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dp-month { padding: 10px 4px; text-align: center; font-size: 13px; border-radius: 9px; cursor: pointer; border: none; background: none; font-family: var(--font); }
.dp-month:hover { background: var(--primary-soft); }
.dp-month.selected { background: var(--primary); color: #fff; font-weight: 700; }
.dp-years { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 240px; overflow-y: auto; }
.dp-time { display: flex; align-items: center; justify-content: center; gap: 8px; border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.dp-time input { width: 52px; text-align: center; border: 1px solid var(--border-strong); border-radius: 8px; padding: 4px; font-family: var(--font); font-size: 13px; }

/* =====================================================
   چاپ
   ===================================================== */
@media print {
    .sidebar, .topbar, .page-actions, .no-print, .toast-wrap { display: none !important; }
    .main-area { margin: 0 !important; }
    .page-content { padding: 0 !important; max-width: 100% !important; }
    body { background: #fff; }
    .card { border: none; box-shadow: none; }
}

/* =====================================================
   ریسپانسیو
   ===================================================== */
@media (max-width: 1100px) {
    .grid-side, .grid-side-l { grid-template-columns: 1fr; }
    .pos-layout { grid-template-columns: 1fr; }
    .pos-cart { position: static; }
    .ai-layout { grid-template-columns: 1fr; height: auto; }
    .ai-convs { max-height: 200px; }
    .ai-messages { min-height: 380px; max-height: 520px; }
}
@media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .main-area { margin-right: 0; }
    .menu-toggle { display: inline-flex !important; }
    .sidebar-backdrop {
        position: fixed; inset: 0;
        background: rgba(15,23,42,.4);
        z-index: 99;
        display: none;
    }
    .sidebar-backdrop.show { display: block; }
}
@media (max-width: 640px) {
    .page-content { padding: 18px 14px; }
    .topbar { padding: 0 14px; }
    .topbar-search { display: none; }
    .landing-hero h1 { font-size: 30px; }
    .page-title { font-size: 18px; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
}
.menu-toggle { display: none; }
