/* FILE: static/css/style.css */
/* ═══════════════════════════════════════════════════════════
   Hakan Paylar CRM — Main Stylesheet
   استایل‌های عمومی پنل (بدون هیچ استایل چاپی)
   تمام استایل چاپ در: static/css/print-a5.css
   ═══════════════════════════════════════════════════════════ */

:root {
    --primary: #2563eb;
    --primary-2: #4f46e5;
    --primary-dark: #0f172a;
    --primary-soft: #eef4ff;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f97316;
    --info: #06b6d4;
    --text: #172033;
    --muted: #718096;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --line: #e8edf4;
    --sidebar-width: 274px;
    --topbar-height: 78px;
    --bottom-nav-height: 70px;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-sm: 0 4px 18px rgba(15, 23, 42, .045);
    --shadow: 0 12px 34px rgba(15, 23, 42, .075);
    --shadow-lg: 0 22px 60px rgba(15, 23, 42, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 0%, rgba(79,70,229,.045), transparent 26%),
        radial-gradient(circle at 90% 10%, rgba(37,99,235,.04), transparent 24%),
        var(--bg);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.75;
}
button, input, select, textarea { font-family: inherit; }
a { color: inherit; }

/* ---------- Shell ---------- */
.app-wrapper { min-height: 100vh; }
.main-content {
    min-height: 100vh;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}
.content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 26px 30px 40px; flex: 1; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    width: var(--sidebar-width);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(circle at 85% 0%, rgba(59,130,246,.22), transparent 31%),
        radial-gradient(circle at 15% 70%, rgba(79,70,229,.14), transparent 28%),
        #0b1220;
    border-left: 1px solid rgba(255,255,255,.045);
    box-shadow: -16px 0 45px rgba(2,8,23,.12);
}
.sidebar-header {
    min-height: 92px;
    padding: 20px 20px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-logo { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 45px; height: 45px; flex: 0 0 45px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 26px rgba(37,99,235,.28);
    font-size: 18px;
}
.brand-mark.large { width: 54px; height: 54px; flex-basis: 54px; border-radius: 17px; font-size: 21px; }
.brand-copy, .brand-copy small { display: flex; flex-direction: column; }
.brand-copy strong { font-size: 16px; line-height: 1.3; letter-spacing: -.2px; }
.brand-copy small { color: rgba(255,255,255,.55); font-size: 10px; margin-top: 2px; }
.sidebar-close { border: 0; background: rgba(255,255,255,.08); color: #fff; width: 38px; height: 38px; border-radius: 11px; }
.sidebar-status { display: flex; align-items: center; gap: 8px; padding: 14px 20px 7px; color: rgba(255,255,255,.58); font-size: 11px; }
.status-pulse { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 5px rgba(52,211,153,.09); }
.status-line { height: 1px; flex: 1; background: rgba(255,255,255,.06); }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 7px 12px 14px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.13); border-radius: 10px; }
.nav-section-title { padding: 16px 12px 7px; color: rgba(255,255,255,.33); font-size: 10px; font-weight: 800; letter-spacing: .8px; }
.sidebar-nav .nav-item { margin: 2px 0; }
.sidebar-nav .nav-link {
    min-height: 47px;
    padding: 9px 12px;
    display: flex; align-items: center; gap: 11px;
    color: rgba(255,255,255,.67);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 13px;
    transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.055); transform: translateX(-2px); }
.sidebar-nav .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(37,99,235,.24), rgba(79,70,229,.12));
    border-color: rgba(96,165,250,.13);
    box-shadow: inset 3px 0 0 #60a5fa, 0 8px 22px rgba(0,0,0,.08);
}
.nav-icon { width: 32px; height: 32px; flex: 0 0 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: #8da5d0; background: rgba(255,255,255,.045); }
.nav-link.active .nav-icon { color: #fff; background: rgba(96,165,250,.17); }
.sidebar-footer { padding: 13px 15px 17px; border-top: 1px solid rgba(255,255,255,.07); background: rgba(2,8,23,.19); }
.sidebar-notification-link { min-height: 51px; display: flex; align-items: center; gap: 9px; padding: 8px 9px; margin-bottom: 9px; text-decoration: none; border-radius: 13px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.055); }
.sidebar-notification-link > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.sidebar-notification-link strong { font-size: 11px; }
.sidebar-notification-link small { color: rgba(255,255,255,.38); font-size: 9px; }
.sidebar-notification-link b { min-width: 23px; height: 23px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(239,68,68,.9); font-size: 10px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 7px 3px 10px; }
.sidebar-avatar, .topbar-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #334155, #1e293b); font-weight: 800; }
.sidebar-avatar { width: 38px; height: 38px; font-size: 14px; }
.sidebar-user-copy { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user-copy strong { max-width: 175px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.sidebar-user-copy small { color: rgba(255,255,255,.36); font-size: 9px; }
.sidebar-logout-form { margin: 0; }
.sidebar-logout { width: 100%; height: 39px; border: 1px solid rgba(255,255,255,.075); border-radius: 11px; background: rgba(255,255,255,.035); color: rgba(255,255,255,.62); display: flex; align-items: center; justify-content: center; gap: 8px; transition: .18s; text-decoration: none; }
.sidebar-logout:hover { color: #fff; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.18); }

/* ---------- Topbar ---------- */
.topbar {
    height: var(--topbar-height);
    position: sticky; top: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 0 30px;
    background: rgba(255,255,255,.86);
    border-bottom: 1px solid rgba(226,232,240,.8);
    backdrop-filter: blur(18px);
}
.topbar-start { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mobile-menu-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.page-heading { display: flex; flex-direction: column; min-width: 0; }
.page-heading-kicker { color: #9aa6b8; font-size: 8px; font-weight: 800; letter-spacing: 1.5px; line-height: 1.2; }
.page-title { margin: 2px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.quick-search { width: min(380px, 32vw); height: 42px; position: relative; display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.quick-search > i { color: #9aa6b8; font-size: 13px; }
.quick-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; color: var(--text); }
.quick-search input::placeholder { color: #a4adbb; }
.search-hint { color: #b6bfca; font-size: 16px; }
.icon-btn { width: 42px; height: 42px; position: relative; display: inline-flex; align-items: center; justify-content: center; color: #64748b; background: #fff; border: 1px solid var(--line); border-radius: 13px; text-decoration: none; box-shadow: var(--shadow-sm); transition: .18s; }
.icon-btn:hover { color: var(--primary); border-color: #d8e3fb; transform: translateY(-1px); }
.notification-dot { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; color: #fff; background: var(--danger); border: 2px solid #fff; font-size: 8px; font-weight: 800; }
.user-menu-trigger { height: 42px; display: flex; align-items: center; gap: 8px; padding: 3px 5px 3px 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.topbar-avatar { width: 34px; height: 34px; font-size: 12px; }
.topbar-avatar.large { width: 40px; height: 40px; }
.user-menu-copy { flex-direction: column; align-items: flex-start; min-width: 95px; line-height: 1.35; }
.user-menu-copy strong { font-size: 10px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-copy small { color: #9aa6b8; font-size: 8px; }
.user-chevron { color: #9aa6b8; font-size: 9px; }
.user-dropdown { min-width: 235px; padding: 7px; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-lg); }
.dropdown-user-header { display: flex; align-items: center; gap: 10px; padding: 9px; }
.dropdown-user-header > div { display: flex; flex-direction: column; }
.dropdown-user-header strong { font-size: 11px; }
.dropdown-user-header small { color: var(--muted); font-size: 9px; }
.user-dropdown .dropdown-item { border-radius: 10px; font-size: 11px; padding: 9px 10px; }
.danger-item { color: #dc2626; }
.danger-item:hover { color: #b91c1c; background: #fff1f2; }
.logout-form { margin: 0; }

/* ---------- General surfaces ---------- */
.card, .table-responsive, .surface-card, .list-group {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius) !important;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.card { overflow: hidden; }
.card-header { padding: 15px 18px; border-bottom: 1px solid var(--line); background: #fff; font-weight: 800; color: var(--text); }
.card-body { padding: 20px; }
.card-footer { border-top: 1px solid var(--line); background: #fbfcfe; }
.surface-card { padding: 22px; }
.surface-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.surface-card-header h3 { margin: 2px 0 0; font-size: 16px; font-weight: 800; }
.section-kicker { color: #9aa6b8; font-size: 8px; font-weight: 900; letter-spacing: 1.4px; }
.header-icon { width: 35px; height: 35px; display: inline-flex; align-items: center; justify-content: center; color: var(--primary); background: var(--primary-soft); border-radius: 10px; }
.live-chip { display: inline-flex; align-items: center; gap: 5px; color: #059669; background: #ecfdf5; border: 1px solid #d1fae5; padding: 5px 9px; border-radius: 9px; font-size: 9px; font-weight: 800; }
.live-chip i { font-size: 6px; }

/* ---------- Dashboard ---------- */
.dashboard-hero {
    position: relative; min-height: 178px; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    margin-bottom: 20px; padding: 28px 32px;
    color: #fff; border-radius: 22px;
    background: linear-gradient(120deg, #0f172a 0%, #182b52 53%, #274bb6 100%);
    box-shadow: var(--shadow-lg);
}
.dashboard-hero:before { content: ""; position: absolute; inset: auto -10% -80% 30%; height: 230px; background: radial-gradient(circle, rgba(96,165,250,.24), transparent 67%); }
.hero-copy { position: relative; z-index: 2; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: #a9c9ff; font-size: 9px; font-weight: 800; letter-spacing: .7px; }
.hero-copy h2 { margin: 8px 0 3px; font-size: 27px; letter-spacing: -.8px; font-weight: 850; }
.hero-copy p { margin: 0; max-width: 600px; color: rgba(255,255,255,.62); font-size: 11px; }
.hero-decoration { position: relative; z-index: 1; width: 190px; height: 130px; opacity: .8; }
.hero-decoration i { position: absolute; right: 28px; top: 38px; width: 65px; height: 65px; display: flex; align-items: center; justify-content: center; border-radius: 21px; color: #fff; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.1); font-size: 24px; box-shadow: 0 15px 40px rgba(0,0,0,.14); }
.hero-decoration span { position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.hero-decoration span:nth-child(2) { width: 150px; height: 150px; right: -10px; top: -10px; }
.hero-decoration span:nth-child(3) { width: 105px; height: 105px; right: 14px; top: 14px; }
.hero-decoration span:nth-child(4) { width: 55px; height: 55px; right: 39px; top: 39px; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.kpi-card { position: relative; min-height: 112px; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi-icon { width: 44px; height: 44px; flex: 0 0 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 13px; font-size: 16px; }
.kpi-info { position: relative; z-index: 2; min-width: 0; }
.kpi-info span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; }
.kpi-info h3 { margin: 1px 0 0; font-size: 19px; font-weight: 900; letter-spacing: -.7px; line-height: 1.25; white-space: nowrap; }
.kpi-info small { color: #a3adba; font-size: 8px; }
.kpi-watermark { position: absolute; left: -8px; bottom: -14px; font-size: 58px; opacity: .045; }
.kpi-primary .kpi-icon { color: #2563eb; background: #eff6ff; } .kpi-primary .kpi-watermark { color: #2563eb; }
.kpi-success .kpi-icon { color: #059669; background: #ecfdf5; } .kpi-success .kpi-watermark { color: #059669; }
.kpi-warning .kpi-icon { color: #d97706; background: #fffbeb; } .kpi-warning .kpi-watermark { color: #d97706; }
.kpi-danger .kpi-icon { color: #dc2626; background: #fef2f2; } .kpi-danger .kpi-watermark { color: #dc2626; }
.kpi-info .kpi-icon { color: #0891b2; background: #ecfeff; } .kpi-info .kpi-watermark { color: #0891b2; }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr .9fr; gap: 20px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-action { min-height: 67px; display: flex; align-items: center; gap: 10px; padding: 10px; text-decoration: none; border: 1px solid #edf1f6; border-radius: 13px; background: #fbfcfe; transition: .18s; }
.quick-action:hover { background: #fff; border-color: #dce6f8; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.quick-action > span { width: 39px; height: 39px; flex: 0 0 39px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.quick-action div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.quick-action strong { font-size: 10px; }
.quick-action small { color: var(--muted); font-size: 8px; }
.quick-action .arrow { color: #b4bdc9; font-size: 9px; }
.status-list { display: flex; flex-direction: column; gap: 5px; }
.status-list > div { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px; border-radius: 11px; background: #fafbfd; border: 1px solid #f0f2f6; }
.status-label { display: flex; align-items: center; gap: 7px; color: #667085; font-size: 9px; }
.status-label i { color: #94a3b8; width: 15px; text-align: center; }
.status-list strong { color: #334155; font-size: 9px; }
.system-action { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; border-radius: 10px; color: #b45309; background: #fff7ed; border: 1px solid #ffedd5; text-decoration: none; font-size: 9px; font-weight: 800; }

/* ---------- Tables ---------- */
.table-responsive { overflow-x: auto; }
.table { margin-bottom: 0; color: var(--text); }
.table > :not(caption) > * > * { border-bottom-color: #edf1f5; }
.table thead th { padding: 13px 15px; border-bottom: 1px solid var(--line); background: #f8fafc; color: #687589; font-size: 10px; font-weight: 900; white-space: nowrap; }
.table tbody td { padding: 13px 15px; vertical-align: middle; font-size: 11px; }
.table-hover tbody tr { transition: background .15s; }
.table-hover tbody tr:hover { background: #f8fbff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-responsive .table { min-width: 620px; }
.table .btn { margin: 2px; }

/* ---------- Forms / controls ---------- */
.form-label { color: #475569; font-size: 10px; font-weight: 800; }
.form-control, .form-select { min-height: 42px; border: 1px solid #dfe5ed; border-radius: 11px; color: var(--text); background: #fff; font-size: 11px; box-shadow: none; }
.form-control:focus, .form-select:focus { border-color: #93b4ff; box-shadow: 0 0 0 4px rgba(37,99,235,.08); }
textarea.form-control { min-height: 100px; resize: vertical; }
form p { margin-bottom: 14px; }
form p label { display: block; margin-bottom: 5px; color: #475569; font-size: 10px; font-weight: 800; }
.form-check-input { border-color: #cbd5e1; }
.btn { min-height: 38px; border-radius: 10px; font-size: 10px; font-weight: 800; border-width: 1px; transition: transform .16s, box-shadow .16s, background .16s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { border-color: var(--primary); background: linear-gradient(135deg, #2563eb, #3157d8); box-shadow: 0 7px 18px rgba(37,99,235,.17); }
.btn-primary:hover { border-color: #1d4ed8; background: #1d4ed8; }
.btn-success { box-shadow: 0 7px 18px rgba(16,185,129,.12); }
.btn-warning { box-shadow: 0 7px 18px rgba(249,115,22,.1); }
.btn-light { border-color: var(--line); background: #fff; color: #475569; }
.btn-outline-secondary { border-color: #dbe1e9; color: #64748b; }
.badge { font-size: 8px; border-radius: 7px; padding: 5px 7px; }

/* ---------- Alerts / lists / pagination ---------- */
.crm-alert { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; border-radius: 13px; box-shadow: var(--shadow-sm); font-size: 10px; }
.alert-content { display: flex; align-items: center; gap: 8px; }
.list-group { overflow: hidden; }
.list-group-item { padding: 12px 15px; border-color: #edf1f5; font-size: 10px; }
.pagination { gap: 4px; margin: 18px 0 0; }
.page-link { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px !important; color: #64748b; font-size: 9px; }
.page-item.active .page-link { border-color: var(--primary); background: var(--primary); }

/* ---------- Login ---------- */
.login-shell { min-height: 100vh; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; background: #f6f8fc; }
.login-visual { position: relative; overflow: hidden; min-height: 100vh; padding: 55px 7vw; color: #fff; background: linear-gradient(135deg, #0b1220, #172a4b 58%, #2547a7); }
.login-visual:before { content: ""; position: absolute; width: 620px; height: 620px; right: -240px; bottom: -290px; border-radius: 50%; border: 1px solid rgba(255,255,255,.09); box-shadow: 0 0 0 65px rgba(255,255,255,.018), 0 0 0 130px rgba(255,255,255,.014); }
.login-grid-pattern { position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 46px 46px; mask-image: linear-gradient(to bottom, black, transparent 80%); }
.login-orb { position: absolute; border-radius: 50%; filter: blur(1px); opacity: .18; }
.orb-one { width: 230px; height: 230px; left: -80px; top: 12%; background: #3b82f6; }
.orb-two { width: 180px; height: 180px; right: 13%; bottom: 8%; background: #8b5cf6; }
.login-brand, .login-visual-copy { position: relative; z-index: 2; }
.login-brand { display: flex; align-items: center; gap: 13px; }
.login-brand strong { display: block; font-size: 18px; }
.login-brand small { color: rgba(255,255,255,.5); font-size: 9px; }
.login-visual-copy { margin-top: 19vh; max-width: 530px; }
.login-visual-copy > span { color: #8db8ff; font-size: 9px; font-weight: 900; letter-spacing: 2px; }
.login-visual-copy h1 { margin: 10px 0 13px; font-size: clamp(36px, 4vw, 58px); line-height: 1.15; letter-spacing: -2px; font-weight: 700; }
.login-visual-copy h1 strong { color: #8db8ff; }
.login-visual-copy p { max-width: 460px; margin: 0; color: rgba(255,255,255,.55); font-size: 12px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.login-panel-inner { width: min(410px, 100%); }
.mobile-login-brand { display: none; }
.login-kicker { color: var(--primary); font-size: 10px; font-weight: 900; }
.login-panel h2 { margin: 5px 0 4px; font-size: 28px; font-weight: 900; letter-spacing: -.7px; }
.login-subtitle { margin: 0 0 28px; color: #8b97a8; font-size: 10px; }
.login-form { margin: 0; }
.login-field { margin-bottom: 17px; }
.login-field label { display: block; margin-bottom: 6px; color: #475569; font-size: 10px; font-weight: 800; }
.login-input-wrap { position: relative; }
.login-input-wrap > i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #a5afbd; z-index: 2; }
.login-input-wrap input { width: 100%; height: 47px; padding: 0 42px 0 13px; border: 1px solid #e0e6ef; border-radius: 13px; outline: 0; color: var(--text); background: #fbfcfe; font-size: 11px; transition: .18s; }
.login-input-wrap input:focus { background: #fff; border-color: #8eb0ff; box-shadow: 0 0 0 4px rgba(37,99,235,.07); }
.login-error, .field-error { margin-top: 5px; color: #dc2626; font-size: 9px; }
.login-submit { width: 100%; height: 48px; margin-top: 8px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(135deg, #2563eb, #4f46e5); box-shadow: 0 13px 28px rgba(37,99,235,.23); font-size: 11px; font-weight: 900; }
.login-submit i { width: 29px; height: 29px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: rgba(255,255,255,.13); }
.login-footer { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; color: #a1aab8; font-size: 8px; }

/* ---------- Mobile ---------- */
.sidebar-backdrop { position: fixed; inset: 0; z-index: 1100; background: rgba(2,8,23,.5); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
.bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 1050; height: var(--bottom-nav-height); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-around; background: rgba(255,255,255,.94); border-top: 1px solid var(--line); box-shadow: 0 -12px 35px rgba(15,23,42,.08); backdrop-filter: blur(18px); }
.bottom-nav-item { position: relative; min-width: 56px; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #8b97a8; text-decoration: none; font-size: 8px; font-weight: 800; border-radius: 12px; }
.bottom-nav-item i { font-size: 15px; }
.bottom-nav-item.active { color: var(--primary); background: var(--primary-soft); }
.bottom-icon-wrap { position: relative; display: inline-flex; }
.bottom-icon-wrap b { position: absolute; top: -7px; right: -9px; min-width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: #fff; background: var(--danger); border: 2px solid #fff; font-size: 6px; }

@media (max-width: 1300px) {
    :root { --sidebar-width: 250px; }
    .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .quick-search { width: 260px; }
}
@media (max-width: 991.98px) {
    :root { --topbar-height: 68px; }
    body.sidebar-open { overflow: hidden; }
    .main-content { margin-right: 0; }
    .sidebar { width: min(310px, 86vw); right: -100%; transition: right .25s ease; box-shadow: -20px 0 55px rgba(2,8,23,.25); }
    .sidebar.show { right: 0; }
    .content { padding: 18px 15px calc(var(--bottom-nav-height) + 18px); }
    .topbar { height: var(--topbar-height); padding: 0 15px; }
    .page-heading-kicker { display: none; }
    .page-title { font-size: 16px; }
    .topbar-actions { gap: 6px; }
    .user-menu-trigger { padding-left: 4px; }
    .dashboard-hero { min-height: 155px; padding: 23px; border-radius: 18px; }
    .hero-copy h2 { font-size: 22px; }
    .hero-decoration { transform: scale(.8); transform-origin: center left; margin-left: -20px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-panel { min-height: 100vh; padding: 28px 20px; }
    .mobile-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 46px; }
    .mobile-login-brand strong { display: block; font-size: 15px; }
    .mobile-login-brand small { display: block; color: #9aa6b8; font-size: 8px; }
}
@media (max-width: 640px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .kpi-card { min-height: 100px; padding: 13px; }
    .kpi-icon { width: 38px; height: 38px; flex-basis: 38px; font-size: 14px; }
    .kpi-info h3 { font-size: 15px; }
    .dashboard-hero { min-height: 145px; }
    .hero-decoration { display: none; }
    .hero-copy h2 { font-size: 20px; }
    .quick-actions { grid-template-columns: 1fr; }
    .surface-card { padding: 16px; }
    .table-responsive .table { min-width: 560px; }
    .topbar .icon-btn { width: 38px; height: 38px; }
    .user-menu-trigger { width: 38px; height: 38px; padding: 2px; justify-content: center; }
    .user-chevron { display: none; }
    .topbar-avatar { width: 32px; height: 32px; }
    .login-panel-inner { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR — ساختار کشویی مدرن
   ═══════════════════════════════════════════════════════════ */

.sidebar .sidebar-single {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 9px;
    margin: 2px 8px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease,
                color 0.2s ease,
                padding-right 0.22s ease,
                transform 0.22s ease;
    position: relative;
}
.sidebar .nav-link .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 15px;
    transition: transform 0.22s ease;
    flex-shrink: 0;
}
.sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar .nav-link:hover .nav-icon { transform: scale(1.15); }
.sidebar .nav-link.active:not(.submenu-toggle) {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.32) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: #fff;
    font-weight: 600;
}
.sidebar .nav-link.active:not(.submenu-toggle)::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    background: #6366f1;
    border-radius: 3px;
}
.sidebar .nav-link.submenu-toggle { cursor: pointer; user-select: none; }
.sidebar .nav-link.submenu-toggle .flex-grow-1 { flex-grow: 1; text-align: right; }
.sidebar .submenu-arrow {
    font-size: 11px;
    opacity: 0.7;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}
.sidebar .nav-link.submenu-toggle[aria-expanded="true"] .submenu-arrow { transform: rotate(180deg); opacity: 1; }
.sidebar .nav-link.submenu-toggle[aria-expanded="true"] { background: rgba(99, 102, 241, 0.08); color: #fff; }
.sidebar .nav-link.submenu-toggle.active { color: #fff; font-weight: 600; }
.sidebar .submenu-list {
    padding: 0;
    margin: 4px 0 8px 0;
    margin-right: 22px;
    border-right: 2px solid rgba(255, 255, 255, 0.08);
    position: relative;
}
.sidebar .nav-link.submenu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 14px;
    margin: 2px 6px 2px 0;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.72);
    transition: all 0.2s ease;
    position: relative;
}
.sidebar .nav-link.submenu-link i {
    width: 18px;
    text-align: center;
    font-size: 13px;
    opacity: 0.75;
    transition: all 0.2s ease;
}
.sidebar .nav-link.submenu-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    padding-right: 20px;
}
.sidebar .nav-link.submenu-link:hover i { opacity: 1; transform: translateX(-3px); }
.sidebar .nav-link.submenu-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.28) 0%, rgba(99, 102, 241, 0.06) 100%);
    color: #fff;
    font-weight: 500;
}
.sidebar .nav-link.submenu-link.active i { color: #a5b4fc; opacity: 1; }
.sidebar .nav-link.submenu-link.active::before {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #6366f1;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}
.sidebar .submenu.collapsing,
.sidebar .submenu.collapse { transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar-nav { padding-top: 4px; }
.sidebar-nav > ul { margin-bottom: 2px; }
@media (prefers-reduced-motion: reduce) {
    .sidebar .nav-link,
    .sidebar .nav-link .nav-icon,
    .sidebar .submenu-arrow,
    .sidebar .submenu.collapse,
    .sidebar .submenu.collapsing { transition: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   Sidebar Customization page
   ═══════════════════════════════════════════════════════════ */

.drag-handle {
    cursor: grab;
    color: #94a3b8;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
    user-select: none;
}
.drag-handle:hover { color: #4f46e5; background: rgba(79, 70, 229, 0.08); }
.drag-handle:active { cursor: grabbing; }
.custom-section.card { border: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); overflow: hidden; }
.custom-section .card-header { background: #f8fafc; border-bottom: 1px solid #e5e7eb; padding: 10px 14px; }
.custom-section .section-label,
.custom-section .item-label {
    border: 1px solid transparent;
    background: transparent;
    font-weight: 500;
    max-width: 320px;
    transition: all 0.15s ease;
}
.custom-section .section-label:hover,
.custom-section .item-label:hover { background: #fff; border-color: #e5e7eb; }
.custom-section .section-label:focus,
.custom-section .item-label:focus {
    background: #fff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.custom-section .list-group-item { padding: 8px 14px; background: #fff; transition: background 0.15s ease; }
.custom-section .list-group-item:hover { background: #fafbff; }
.drag-ghost {
    opacity: 0.35;
    background: rgba(79, 70, 229, 0.08) !important;
    border: 1px dashed #4f46e5;
    border-radius: 6px;
}
.drag-chosen {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: scale(1.005);
}
@media (max-width: 576px) {
    .custom-section .section-label,
    .custom-section .item-label { max-width: 140px; font-size: 13px; }
}

/* ═══════════════════════════════════════════════════════════
   MANAGEMENT DASHBOARD — Redesigned
   ═══════════════════════════════════════════════════════════ */

/* ─── HERO HEADER ─── */
.manage-hero {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 30px 34px;
    margin-bottom: 26px;
    background: linear-gradient(120deg, #0f172a 0%, #1e3a8a 50%, #4f46e5 100%);
    box-shadow: 0 18px 45px rgba(30, 58, 138, 0.22);
    color: #fff;
}
.manage-hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -10%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.28), transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}
.manage-hero::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: 8%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.22), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.manage-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
}
.manage-hero-start {
    display: flex;
    align-items: center;
    gap: 20px;
}
.manage-hero-icon {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 32px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.manage-hero-title {
    margin: 0 0 5px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: #fff;
}
.manage-hero-subtitle {
    margin: 0;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.75);
}
.manage-hero-kicker {
    display: block;
    font-size: 9px;
    color: rgba(165, 180, 252, 0.95);
    letter-spacing: 3.5px;
    font-weight: 800;
    margin-bottom: 6px;
}

/* ─── HERO STATS ─── */
.manage-hero-stats {
    display: flex;
    gap: 14px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
}
.manage-stat {
    text-align: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    min-width: 110px;
    transition: all 0.22s ease;
}
.manage-stat:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
}
.manage-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}
.manage-stat-label {
    display: block;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* ─── CARDS GRID ─── */
.manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

/* ─── CARD ─── */
.manage-card {
    position: relative;
    background: #fff;
    border: 1px solid #e8edf4;
    border-radius: 20px;
    padding: 22px;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.manage-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--card-color, #4f46e5);
    opacity: 0;
    transition: opacity 0.28s ease;
}
.manage-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    border-color: var(--card-color, #4f46e5);
}
.manage-card:hover::before {
    opacity: 1;
}

/* ─── CARD ICON ─── */
.manage-card-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    font-size: 24px;
    margin-bottom: 16px;
    background: var(--card-bg, #eef2ff);
    color: var(--card-color, #4f46e5);
    transition: all 0.28s ease;
}
.manage-card:hover .manage-card-icon {
    transform: scale(1.1) rotate(-4deg);
}

/* ─── CARD CONTENT ─── */
.manage-card-title {
    margin: 0 0 7px;
    font-size: 16px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.3px;
}
.manage-card-desc {
    margin: 0 0 16px;
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.65;
    min-height: 34px;
}

/* ─── CARD ACTIONS ─── */
.manage-card-actions {
    display: flex;
    gap: 8px;
}
.manage-card-actions .btn {
    flex: 1;
    padding: 9px 14px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.18s ease;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    border: 1px solid transparent;
}
.manage-card-actions .btn-list {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}
.manage-card-actions .btn-list:hover {
    background: #e5e7eb;
    color: #111827;
    transform: translateY(-1px);
}
.manage-card-actions .btn-new {
    background: var(--card-color, #4f46e5);
    color: #fff;
}
.manage-card-actions .btn-new:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    color: #fff;
}

/* ─── COLOR VARIANTS ─── */
.manage-card.color-blue    { --card-color: #3b82f6; --card-bg: #dbeafe; }
.manage-card.color-green   { --card-color: #10b981; --card-bg: #d1fae5; }
.manage-card.color-orange  { --card-color: #f97316; --card-bg: #ffedd5; }
.manage-card.color-purple  { --card-color: #8b5cf6; --card-bg: #ede9fe; }
.manage-card.color-red     { --card-color: #ef4444; --card-bg: #fee2e2; }
.manage-card.color-teal    { --card-color: #14b8a6; --card-bg: #ccfbf1; }
.manage-card.color-emerald { --card-color: #059669; --card-bg: #d1fae5; }
.manage-card.color-yellow  { --card-color: #f59e0b; --card-bg: #fef3c7; }
.manage-card.color-cyan    { --card-color: #06b6d4; --card-bg: #cffafe; }
.manage-card.color-pink    { --card-color: #ec4899; --card-bg: #fce7f3; }
.manage-card.color-indigo  { --card-color: #6366f1; --card-bg: #e0e7ff; }
.manage-card.color-rose    { --card-color: #e11d48; --card-bg: #ffe4e6; }
.manage-card.color-slate   { --card-color: #64748b; --card-bg: #e2e8f0; }

/* ─── MOBILE ─── */
@media (max-width: 767px) {
    .manage-hero {
        padding: 22px;
        border-radius: 18px;
        margin-bottom: 18px;
    }
    .manage-hero-icon {
        width: 56px;
        height: 56px;
        font-size: 26px;
        border-radius: 17px;
    }
    .manage-hero-title {
        font-size: 22px;
    }
    .manage-hero-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .manage-hero-stats {
        width: 100%;
        gap: 8px;
    }
    .manage-stat {
        padding: 8px 12px;
        min-width: 75px;
        flex: 1;
    }
    .manage-stat-value {
        font-size: 18px;
    }
    .manage-stat-label {
        font-size: 9px;
    }
    .manage-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .manage-card {
        padding: 16px;
        border-radius: 16px;
    }
    .manage-card-icon {
        width: 46px;
        height: 46px;
        font-size: 20px;
        border-radius: 14px;
        margin-bottom: 12px;
    }
    .manage-card-title {
        font-size: 14px;
    }
    .manage-card-desc {
        font-size: 11px;
        min-height: 28px;
    }
}

/* ═══════════════════════════════════════════════════════════
   END OF STYLESHEET
   ═══════════════════════════════════════════════════════════
   تمام استایل چاپ (invoice, driver, warehouse, A5) در فایل
   جداگانه‌ی: static/css/print-a5.css
   ═══════════════════════════════════════════════════════════ */