:root {
    --bg: #eef1f6;
    --primary: #2563eb;
    --teal: #0d9488;
    --text: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
}

* { font-family: Vazirmatn, Tahoma, sans-serif; box-sizing: border-box; }

body { margin: 0; color: var(--text); background: linear-gradient(180deg, #eef2f9 0%, #eef1f6 240px); }

/* ================= Topbar ================= */
.topbar {
    position: sticky; top: 0; z-index: 1030; height: 54px;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 10px rgba(15,44,94,.06);
    display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
}
.topbar-right, .topbar-left { display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-logo { font-size: 22px; }
.brand-name {
    font-weight: 800; font-size: 18px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.menu-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: #334155; }

.quick-nav { display: flex; gap: 4px; }
.quick {
    padding: 7px 14px; border-radius: 9px; color: #475569; text-decoration: none;
    font-size: 13.5px; font-weight: 700; transition: background .12s, color .12s;
}
.quick:hover { background: #eef2ff; color: var(--primary); }
.quick.active { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.30); }

.topbar-date { font-size: 12.5px; color: var(--muted); }
.user-btn { background: #f1f5f9; border: none; border-radius: 9px; padding: 7px 13px; font-size: 13px; font-weight: 700; cursor: pointer; }

/* ================= Layout / Sidebar ================= */
.layout { display: flex; align-items: flex-start; }
.sidebar {
    width: 232px; flex-shrink: 0; background: #fff; border-left: 1px solid var(--line);
    padding: 12px 10px; position: sticky; top: 54px; height: calc(100vh - 54px); overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.content { flex: 1; min-width: 0; padding: 22px; }

.nav-cat { margin-bottom: 12px; }
.cat-title { font-size: 10.5px; font-weight: 800; color: #94a3b8; margin: 0 6px 6px; letter-spacing: .03em; }
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    padding: 10px 4px; border-radius: 14px; text-decoration: none; min-height: 58px;
    text-align: center; color: #fff; position: relative;
    background: linear-gradient(160deg, var(--c1), var(--c2));
    box-shadow: 0 3px 0 var(--cs), 0 6px 14px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.38);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.tile:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 5px 0 var(--cs), 0 12px 22px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.5); }
.tile:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cs), 0 3px 8px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.3); }
.tile.active { outline: 2px solid rgba(255,255,255,.95); outline-offset: -3px; box-shadow: 0 3px 0 var(--cs), 0 0 0 3px rgba(255,255,255,.22), 0 8px 20px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.45); }
.tile-ic { font-size: 20px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.22)); }
.tile-lb { font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.18); }

/* رنگ‌بندی گرادینتی و سه‌بعدیِ دسته‌ها (c1/c2 = گرادیان رو، cs = لبه‌ی تیره‌ی زیرین) */
.cat-blue   .tile { --c1: #4f93ff; --c2: #2563eb; --cs: #1b47b0; }
.cat-teal   .tile { --c1: #22c9b6; --c2: #0d9488; --cs: #0a6b62; }
.cat-amber  .tile { --c1: #fca44f; --c2: #ea580c; --cs: #b23f08; }
.cat-purple .tile { --c1: #b393fb; --c2: #7c3aed; --cs: #5b21b6; }

.sidebar-backdrop { display: none; }
.bottomnav { display: none; }

/* ================= Toasts (floating, non-layout-shifting) ================= */
.app-toasts { position: fixed; top: 66px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; width: auto; max-width: 92vw; pointer-events: none; }
.app-toast {
    pointer-events: auto; display: flex; align-items: center; gap: 8px;
    padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 700;
    box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: toastIn .25s ease;
    border: 1px solid transparent;
}
.app-toast.ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.app-toast.err { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.app-toast .t-close { cursor: pointer; opacity: .6; font-weight: 800; margin-right: 4px; }
.app-toast .t-close:hover { opacity: 1; }
.app-toast.hide { opacity: 0; transform: translateY(-8px); transition: opacity .35s, transform .35s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ================= Cards / KPI ================= */
.page-title { font-size: 21px; font-weight: 800; margin-bottom: 18px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi-card {
    background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
    box-shadow: 0 4px 14px rgba(15,44,94,.06); position: relative; overflow: hidden;
}
.kpi-card::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 4px; }
.kpi-card:nth-child(6n+1)::before { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.kpi-card:nth-child(6n+2)::before { background: linear-gradient(90deg, #14b8a6, #0d9488); }
.kpi-card:nth-child(6n+3)::before { background: linear-gradient(90deg, #fb923c, #ea580c); }
.kpi-card:nth-child(6n+4)::before { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.kpi-card:nth-child(6n+5)::before { background: linear-gradient(90deg, #f43f5e, #e11d48); }
.kpi-card:nth-child(6n+6)::before { background: linear-gradient(90deg, #22c55e, #16a34a); }
.kpi-card .kpi-label { color: var(--muted); font-size: 13px; }
.kpi-card .kpi-value { font-size: 27px; font-weight: 800; margin-top: 6px; }
.kpi-card .kpi-icon {
    float: left; font-size: 19px; width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #eef2fb, #dbe4f5);
    box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(15,44,94,.06);
}

.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; box-shadow: 0 4px 14px rgba(15,44,94,.05); }
.panel h2 { font-size: 16px; font-weight: 800; margin-bottom: 14px; }

/* ================= Badges ================= */
.seg { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-block; box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.seg-Vip { background: linear-gradient(160deg, #fef3c7, #fde590); color: #92400e; }
.seg-Regular { background: linear-gradient(160deg, #d1fae5, #a7f3d0); color: #047857; }
.seg-New { background: linear-gradient(160deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.seg-Potential { background: linear-gradient(160deg, #e0e7ff, #c7d2fe); color: #4338ca; }
.seg-Lost { background: linear-gradient(160deg, #fee2e2, #fecaca); color: #b91c1c; }

.risk-badge { background: linear-gradient(160deg, #fee2e2, #fecaca); color: #b91c1c; padding: 2px 9px; border-radius: 8px; font-size: 11px; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }

.score-bar { background: #e2e8f0; border-radius: 999px; height: 8px; width: 90px; overflow: hidden; display: inline-block; vertical-align: middle; }
.score-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #14b8a6, #0d9488); }

/* ================= Buttons — سیستم یکپارچه‌ی گرادیانت + سه‌بعدی ================= */
.btn {
    font-weight: 700;
    border-radius: 10px;
    transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(1px); filter: brightness(.97); }

/* واریانت‌های پُر: گرادیانت + سایه‌ی رنگی + لبه‌ی سه‌بعدی */
.btn-primary   { background: linear-gradient(160deg, #4f93ff, #1d4ed8); border: none; box-shadow: 0 2px 0 #1b47b0, 0 5px 12px rgba(37,99,235,.32), inset 0 1px 0 rgba(255,255,255,.32); }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(160deg, #3b82f6, #1e40af); box-shadow: 0 3px 0 #1b47b0, 0 8px 18px rgba(37,99,235,.38), inset 0 1px 0 rgba(255,255,255,.32); }
.btn-success   { background: linear-gradient(160deg, #34d075, #15803d); border: none; box-shadow: 0 2px 0 #116233, 0 5px 12px rgba(22,163,74,.32), inset 0 1px 0 rgba(255,255,255,.32); }
.btn-success:hover, .btn-success:focus { background: linear-gradient(160deg, #22c55e, #166534); box-shadow: 0 3px 0 #116233, 0 8px 18px rgba(22,163,74,.38), inset 0 1px 0 rgba(255,255,255,.32); }
.btn-danger    { background: linear-gradient(160deg, #fb7185, #dc2626); border: none; box-shadow: 0 2px 0 #a51d1d, 0 5px 12px rgba(220,38,38,.30), inset 0 1px 0 rgba(255,255,255,.30); }
.btn-danger:hover, .btn-danger:focus { background: linear-gradient(160deg, #f43f5e, #b91c1c); box-shadow: 0 3px 0 #a51d1d, 0 8px 18px rgba(220,38,38,.36), inset 0 1px 0 rgba(255,255,255,.30); }
.btn-warning   { background: linear-gradient(160deg, #fcd34d, #f59e0b); border: none; color: #713f12; box-shadow: 0 2px 0 #c27a06, 0 5px 12px rgba(245,158,11,.32), inset 0 1px 0 rgba(255,255,255,.45); }
.btn-warning:hover, .btn-warning:focus { background: linear-gradient(160deg, #fbbf24, #d97706); color: #713f12; box-shadow: 0 3px 0 #c27a06, 0 8px 18px rgba(245,158,11,.38), inset 0 1px 0 rgba(255,255,255,.45); }
.btn-info      { background: linear-gradient(160deg, #67e8f9, #0284c7); border: none; color: #fff; box-shadow: 0 2px 0 #026a9e, 0 5px 12px rgba(2,132,199,.30), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-info:hover, .btn-info:focus { background: linear-gradient(160deg, #38bdf8, #0369a1); color: #fff; box-shadow: 0 3px 0 #026a9e, 0 8px 18px rgba(2,132,199,.36), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-secondary { background: linear-gradient(160deg, #a5b4cb, #64748b); border: none; box-shadow: 0 2px 0 #4a586d, 0 5px 12px rgba(100,116,139,.28), inset 0 1px 0 rgba(255,255,255,.30); }
.btn-secondary:hover, .btn-secondary:focus { background: linear-gradient(160deg, #94a3b8, #475569); box-shadow: 0 3px 0 #4a586d, 0 8px 18px rgba(100,116,139,.34), inset 0 1px 0 rgba(255,255,255,.30); }
.btn-light     { background: linear-gradient(180deg, #ffffff, #eef2f7); border: 1px solid #dbe3ee; color: #334155; box-shadow: 0 2px 0 #cdd8e6, 0 4px 10px rgba(15,44,94,.08), inset 0 1px 0 #fff; }
.btn-light:hover, .btn-light:focus { background: linear-gradient(180deg, #ffffff, #e2e9f2); color: #1e293b; border-color: #c6d2e2; box-shadow: 0 3px 0 #cdd8e6, 0 7px 14px rgba(15,44,94,.12), inset 0 1px 0 #fff; }

/* واریانت‌های خطی (outline): زمینه‌ی نرمِ رنگی + با هاور، پُرشدن گرادیانتی */
.btn-outline-primary   { color: #1d4ed8; border-color: #b3ccf5; background: linear-gradient(180deg, #ffffff, #eef4ff); box-shadow: 0 2px 0 #d7e3f8, inset 0 1px 0 #fff; }
.btn-outline-primary:hover, .btn-outline-primary:focus { background: linear-gradient(160deg, #4f93ff, #1d4ed8); border-color: transparent; color: #fff; box-shadow: 0 3px 0 #1b47b0, 0 7px 14px rgba(37,99,235,.32); }
.btn-outline-secondary { color: #475569; border-color: #cbd5e1; background: linear-gradient(180deg, #ffffff, #f1f5f9); box-shadow: 0 2px 0 #dde5ee, inset 0 1px 0 #fff; }
.btn-outline-secondary:hover, .btn-outline-secondary:focus { background: linear-gradient(160deg, #a5b4cb, #64748b); border-color: transparent; color: #fff; box-shadow: 0 3px 0 #4a586d, 0 7px 14px rgba(100,116,139,.30); }
.btn-outline-success   { color: #15803d; border-color: #b5e3c6; background: linear-gradient(180deg, #ffffff, #effaf3); box-shadow: 0 2px 0 #d3eedd, inset 0 1px 0 #fff; }
.btn-outline-success:hover, .btn-outline-success:focus { background: linear-gradient(160deg, #34d075, #15803d); border-color: transparent; color: #fff; box-shadow: 0 3px 0 #116233, 0 7px 14px rgba(22,163,74,.32); }
.btn-outline-danger    { color: #b91c1c; border-color: #f3c1c1; background: linear-gradient(180deg, #ffffff, #fdf1f1); box-shadow: 0 2px 0 #f5dada, inset 0 1px 0 #fff; }
.btn-outline-danger:hover, .btn-outline-danger:focus { background: linear-gradient(160deg, #fb7185, #dc2626); border-color: transparent; color: #fff; box-shadow: 0 3px 0 #a51d1d, 0 7px 14px rgba(220,38,38,.30); }
.btn-outline-warning   { color: #b45309; border-color: #f5d9a8; background: linear-gradient(180deg, #ffffff, #fdf7ec); box-shadow: 0 2px 0 #f6e6c4, inset 0 1px 0 #fff; }
.btn-outline-warning:hover, .btn-outline-warning:focus { background: linear-gradient(160deg, #fcd34d, #f59e0b); border-color: transparent; color: #713f12; box-shadow: 0 3px 0 #c27a06, 0 7px 14px rgba(245,158,11,.32); }
.btn-outline-info      { color: #0369a1; border-color: #b6e2f5; background: linear-gradient(180deg, #ffffff, #eff9fe); box-shadow: 0 2px 0 #d4edf9, inset 0 1px 0 #fff; }
.btn-outline-info:hover, .btn-outline-info:focus { background: linear-gradient(160deg, #67e8f9, #0284c7); border-color: transparent; color: #fff; box-shadow: 0 3px 0 #026a9e, 0 7px 14px rgba(2,132,199,.30); }

/* نوارهای پیشرفت بوت‌استرپ: جلای گرادیانتی روی هر رنگی */
.progress { border-radius: 999px; background: #e8edf5; box-shadow: inset 0 1px 2px rgba(15,44,94,.08); }
.progress-bar { background-image: linear-gradient(180deg, rgba(255,255,255,.28), rgba(0,0,0,.08)); border-radius: 999px; }

/* ================= Tables ================= */
.table { background: #fff; }
.table thead th { background: #f8fafc; font-size: 13px; color: var(--muted); border-bottom: 2px solid var(--line); }
.table td, .table th { vertical-align: middle; }

/* ================= Timeline ================= */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline:before { content: ""; position: absolute; right: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 32px 18px 0; }
.timeline li:before { content: ""; position: absolute; right: 4px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }
.timeline .ti-type { font-weight: 600; }
.timeline .ti-date { font-size: 12px; color: var(--muted); }

/* ================= Auth ================= */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f2c5e, #2563eb 70%, #7c3aed); }
.auth-card { background: #fff; border-radius: 18px; padding: 34px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.30); }
.auth-card .auth-logo { text-align: center; font-size: 40px; }
.auth-card h1 { text-align: center; font-size: 22px; font-weight: 700; margin: 6px 0 2px; }
.auth-card .auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* ================= Responsive ================= */
@media (max-width: 991px) {
    .quick-nav { display: none; }
    .menu-toggle { display: block; }
    .topbar-date { display: none; }

    .sidebar {
        position: fixed; top: 0; right: 0; height: 100vh; z-index: 1050;
        transform: translateX(100%); transition: transform .25s ease;
        box-shadow: -8px 0 24px rgba(0,0,0,.18); border-left: none; width: 260px;
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-backdrop {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45);
        z-index: 1040; opacity: 0; visibility: hidden; transition: opacity .2s;
    }
    .sidebar-backdrop.show { opacity: 1; visibility: visible; }

    .content { padding: 16px; padding-bottom: 80px; }

    .bottomnav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 62px;
        background: #fff; border-top: 1px solid var(--line); z-index: 1035; box-shadow: 0 -2px 12px rgba(0,0,0,.08);
    }
    .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #64748b; text-decoration: none; font-size: 10px; font-weight: 700; }
    .bottomnav a span { font-size: 19px; }
    .bottomnav a.active { color: var(--primary); }
}

/* ================= Pro polish (global) ================= */
.panel { transition: box-shadow .15s; }
.panel:hover { box-shadow: 0 8px 26px rgba(15,44,94,.08); }
.panel > h2:first-child { display: flex; align-items: center; gap: 8px; }

/* List toolbar: title + search/filters in one professional bar */
.list-toolbar {
    display: flex; flex-wrap: wrap; align-items: end; gap: 12px;
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
    padding: 14px 16px; margin-bottom: 16px; box-shadow: 0 4px 14px rgba(15,44,94,.05);
}
.list-toolbar .form-label { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.list-toolbar .grow { flex: 1 1 240px; min-width: 180px; }

/* Filter pills (segmented quick filters) */
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.fpill {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 999px;
    background: #f1f5f9; color: #475569; text-decoration: none; font-size: 12.5px; font-weight: 700;
    border: 1px solid #e2e8f0; transition: background .12s, color .12s, transform .12s;
}
.fpill:hover { background: #e0e7ff; color: #4338ca; }
.fpill.active { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(37,99,235,.28); }
.fpill .cnt { font-size: 11px; opacity: .85; background: rgba(255,255,255,.25); padding: 0 6px; border-radius: 999px; }
.fpill:not(.active) .cnt { background: #e2e8f0; color: #475569; }

/* Tables — modern, rounded, soft zebra + hover */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 14px rgba(15,44,94,.05); }
.table-wrap .table { margin: 0; }
.table thead th { background: #f8fafc; font-size: 12.5px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); padding: 12px 14px; white-space: nowrap; }
.table tbody td { padding: 12px 14px; border-color: #f1f5f9; }
.table.table-hover tbody tr { transition: background .1s; }
.table.table-hover tbody tr:hover { background: #f8faff; }

/* Soft status badges */
.badge-soft { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.4; box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.badge-soft::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.bs-green  { background: linear-gradient(160deg, #d1fae5, #a7f3d0); color: #15803d; }
.bs-blue   { background: linear-gradient(160deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.bs-amber  { background: linear-gradient(160deg, #fef3c7, #fde590); color: #b45309; }
.bs-red    { background: linear-gradient(160deg, #fee2e2, #fecaca); color: #b91c1c; }
.bs-gray   { background: linear-gradient(160deg, #f1f5f9, #e2e8f0); color: #475569; }
.bs-purple { background: linear-gradient(160deg, #ede9fe, #ddd6fe); color: #6d28d9; }
.bs-teal   { background: linear-gradient(160deg, #ccfbf1, #99f6e4); color: #0f766e; }

/* Empty states */
.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-state .ico { font-size: 44px; opacity: .55; display: block; margin-bottom: 10px; }
.empty-state .ttl { font-weight: 800; color: #475569; font-size: 15px; margin-bottom: 4px; }
.empty-state .sub { font-size: 13px; }

/* Pagination */
.app-pager .pagination { gap: 4px; }
.app-pager .page-link { border: 1px solid var(--line); border-radius: 10px !important; color: #475569; font-weight: 700; font-size: 13px; padding: 6px 12px; min-width: 38px; text-align: center; }
.app-pager .page-link:hover { background: #eef2ff; color: var(--primary); border-color: #c7d2fe; }
.app-pager .page-item.active .page-link { background: linear-gradient(135deg, #2563eb, #1d4ed8); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.30); }
.app-pager .page-item.disabled .page-link { opacity: .45; }

/* Result meta line */
.list-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); }

/* Buttons: polish + row actions */
.btn { font-weight: 700; border-radius: 10px; }
.btn-sm { border-radius: 9px; }
.btn-light { background: #f1f5f9; border-color: #e2e8f0; }
.btn-light:hover { background: #e2e8f0; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Money emphasis */
.money { font-weight: 800; color: #0f766e; }
.money-neg { color: #b91c1c; }

/* Avatar chip for names */
.avatar { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0; }
.name-cell { display: flex; align-items: center; gap: 10px; }

/* ================= Quick-SMS widget ================= */
.sms-fab {
    position: fixed; bottom: 24px; left: 24px; z-index: 1040;
    width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
    background: linear-gradient(135deg, #14b8a6, #0d9488); color: #fff;
    box-shadow: 0 8px 22px rgba(13,148,136,.45); transition: transform .15s, box-shadow .15s;
    display: flex; align-items: center; justify-content: center;
}
.sms-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 28px rgba(13,148,136,.55); }
.sms-fab:active { transform: scale(.96); }
.sms-fab-ic { font-size: 24px; line-height: 1; }
.sms-fab::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid rgba(20,184,166,.45); animation: smsPulse 2.4s ease-out infinite;
}
@keyframes smsPulse { 0% { transform: scale(.9); opacity: .8; } 70% { transform: scale(1.25); opacity: 0; } 100% { opacity: 0; } }

.sms-modal { border: none; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.sms-modal .modal-header { background: linear-gradient(135deg, #0d9488, #0f766e); color: #fff; border: none; }
.sms-modal .modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.sms-modal .modal-title { font-size: 16px; font-weight: 800; }
.sms-modal #smsTo { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.sms-modal textarea { resize: vertical; }

/* منوی راست‌کلیک روی شماره */
.phone-menu {
    position: fixed; z-index: 2100; min-width: 180px; display: none;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px;
    box-shadow: 0 14px 38px rgba(0,0,0,.20);
}
.phone-menu.show { display: block; animation: pmIn .12s ease; }
@keyframes pmIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.phone-menu .pm-num { font-size: 12px; font-weight: 800; color: #0f766e; text-align: center; padding: 4px 6px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.phone-menu button {
    display: block; width: 100%; text-align: right; background: none; border: none; cursor: pointer;
    padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; color: #334155;
}
.phone-menu button:hover { background: #f1f5f9; color: var(--primary); }

@media (max-width: 991px) {
    .sms-fab { bottom: 76px; left: 16px; width: 50px; height: 50px; }
    .sms-fab-ic { font-size: 21px; }
}

/* ================= Notification bell ================= */
.notif-bell { position: relative; }
.notif-btn { position: relative; background: #f1f5f9; border: none; border-radius: 10px; width: 40px; height: 38px; font-size: 18px; cursor: pointer; transition: background .12s; }
.notif-btn:hover { background: #e2e8f0; }
.notif-badge { position: absolute; top: -5px; left: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(225,29,72,.5); animation: notifPop .3s ease; }
@keyframes notifPop { from { transform: scale(0); } to { transform: scale(1); } }

.notif-menu { width: 360px; max-width: 92vw; padding: 0; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(15,44,94,.20); overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-weight: 800; font-size: 14px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.btn-link-mini { background: none; border: none; color: var(--primary); font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; }
.btn-link-mini:hover { text-decoration: underline; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; text-decoration: none; color: var(--text); border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.notif-item:hover { background: #f8faff; }
.notif-item.unread { background: #eff6ff; }
.notif-item.unread:hover { background: #e0ebff; }
.notif-ic { font-size: 20px; flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.notif-body { display: flex; flex-direction: column; min-width: 0; }
.notif-title { font-weight: 700; font-size: 13px; }
.notif-msg { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.notif-empty { text-align: center; color: var(--muted); padding: 28px 14px; font-size: 13px; }
.notif-foot { display: block; text-align: center; padding: 11px; font-size: 13px; font-weight: 700; color: var(--primary); text-decoration: none; background: #f8fafc; border-top: 1px solid var(--line); }
.notif-foot:hover { background: #eef2ff; }

/* ================= Action center (dashboard "today") ================= */
.action-center { border: 1px solid #e2e8f0; }
.ac-clear { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; border-radius: 12px; padding: 14px; font-weight: 700; text-align: center; }
.ac-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ac-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; text-decoration: none; border: 1px solid transparent; transition: transform .12s, box-shadow .12s; }
.ac-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.10); }
.ac-top { display: flex; justify-content: space-between; align-items: center; }
.ac-ic { font-size: 22px; }
.ac-cnt { font-size: 26px; font-weight: 800; }
.ac-lbl { font-size: 13px; font-weight: 700; }
.ac-teal   { background: linear-gradient(135deg,#ecfdf5,#ccfbf1); color: #0f766e; }
.ac-amber  { background: linear-gradient(135deg,#fffbeb,#fef3c7); color: #b45309; }
.ac-red    { background: linear-gradient(135deg,#fef2f2,#fee2e2); color: #b91c1c; }
.ac-blue   { background: linear-gradient(135deg,#eff6ff,#dbeafe); color: #1d4ed8; }
.ac-purple { background: linear-gradient(135deg,#f5f3ff,#ede9fe); color: #6d28d9; }

.ac-appts { margin-top: 14px; border-top: 1px dashed #cbd5e1; padding-top: 12px; }
.ac-appts-head { font-size: 13px; font-weight: 800; color: #64748b; margin-bottom: 8px; }
.ac-appt { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.ac-appt:hover { background: #f8fafc; }
.ac-appt-time { font-weight: 800; color: #0f766e; min-width: 48px; }
.ac-appt-title { font-weight: 600; }
.ac-appt-who { margin-right: auto; color: #64748b; font-size: 13px; }

/* ================= Command palette (Ctrl+K) ================= */
.cmdk-trigger {
    display: flex; align-items: center; gap: 8px; background: #f1f5f9; border: 1px solid var(--line);
    border-radius: 10px; padding: 7px 12px; color: #64748b; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background .12s, border-color .12s; min-width: 200px;
}
.cmdk-trigger:hover { background: #e9eef5; border-color: #cbd5e1; }
.cmdk-trigger .kbd { margin-right: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 11px; font-weight: 800; color: #94a3b8; }

.cmdk-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(15,23,42,.45); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmdk-overlay.show { display: flex; }
.cmdk-box { width: 640px; max-width: 94vw; background: #fff; border-radius: 16px; box-shadow: 0 30px 70px rgba(0,0,0,.35); overflow: hidden; animation: cmdkIn .14s ease; }
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-8px) scale(.99); } to { opacity: 1; transform: none; } }
.cmdk-search { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cmdk-search .ic { font-size: 18px; color: #94a3b8; }
.cmdk-search input { flex: 1; border: none; outline: none; font-size: 16px; font-family: inherit; background: transparent; color: var(--text); }
.cmdk-results { max-height: 56vh; overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: 11px; font-weight: 800; color: #94a3b8; padding: 10px 12px 4px; letter-spacing: .02em; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; text-decoration: none; color: var(--text); }
.cmdk-item.sel { background: linear-gradient(135deg, #eef2ff, #e0e7ff); }
.cmdk-item .ci { width: 34px; height: 34px; border-radius: 9px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.cmdk-item.sel .ci { background: #fff; }
.cmdk-item .ct { display: flex; flex-direction: column; min-width: 0; }
.cmdk-item .ct b { font-weight: 700; font-size: 14px; }
.cmdk-item .ct span { font-size: 12px; color: #64748b; }
.cmdk-item .cgo { margin-right: auto; color: #cbd5e1; font-weight: 800; font-size: 13px; }
.cmdk-empty { text-align: center; color: #94a3b8; padding: 30px; font-size: 14px; }
.cmdk-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 11px; color: #94a3b8; background: #f8fafc; }
.cmdk-foot kbd { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; font-weight: 800; }

@media (max-width: 991px) { .cmdk-trigger { min-width: 0; padding: 7px 10px; } .cmdk-trigger .label-full { display: none; } .cmdk-trigger .kbd { display: none; } }

/* ================= Inline help (؟) ================= */
.help-tip {
    display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px;
    border-radius: 50%; background: #e2e8f0; color: #64748b; font-size: 11px; font-weight: 800;
    cursor: help; vertical-align: middle; margin-inline-start: 5px; user-select: none; transition: background .12s, color .12s;
}
.help-tip:hover, .help-tip:focus { background: var(--primary); color: #fff; outline: none; }
.popover.help-pop { font-family: Vazirmatn, Tahoma, sans-serif; max-width: 300px; border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(15,44,94,.18); border-radius: 12px; }
.popover.help-pop .popover-header { font-size: 13px; font-weight: 800; background: #f8fafc; }
.popover.help-pop .popover-body { font-size: 12.5px; line-height: 1.9; color: #475569; }

/* یک‌خط توضیح زیر عنوان صفحه‌ها */
.page-hint { color: var(--muted); font-size: 13px; margin: -10px 0 18px; }

/* ================= Help center (راهنمای کامل پنل) ================= */
.help-cat-panel { margin-bottom: 16px; }
.help-cat-title { font-size: 15px; font-weight: 800; margin-bottom: 14px; color: #1e293b; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

.help-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; transition: .15s; background: #fff; }
.help-card:hover { border-color: #5C6EFF; box-shadow: 0 4px 14px rgba(92,110,255,.12); transform: translateY(-1px); }
.help-card-top { display: flex; align-items: center; gap: 10px; }
.help-card-icon { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(160deg,#eef2fb,#dbe4f5); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.help-card-title { font-weight: 800; font-size: 14px; color: #1e293b; }
.help-card-summary { font-size: 12.5px; color: #64748b; line-height: 1.7; }
.help-card-cat { font-size: 10.5px; color: #94a3b8; }

.help-empty { text-align: center; padding: 50px 20px; color: #94a3b8; }

.help-search-panel { padding: 14px 16px; margin-bottom: 18px; }
.help-search-box { position: relative; display: flex; align-items: center; }
.help-search-box .ic { position: absolute; inset-inline-start: 14px; font-size: 15px; opacity: .6; }
.help-search-box input { width: 100%; padding: 12px 44px; border: 1.5px solid var(--line); border-radius: 12px; font-family: inherit; font-size: 14.5px; background: #f8fafc; }
.help-search-box input:focus { outline: none; border-color: #5C6EFF; background: #fff; }
.help-clear { position: absolute; inset-inline-end: 10px; width: 26px; height: 26px; border-radius: 50%; background: #eef0f6; color: #64748b; display: flex; align-items: center; justify-content: center; font-size: 16px; text-decoration: none; }
.help-clear:hover { background: #e2e6f0; color: #1e293b; }

.help-article-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.help-article-icon { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(160deg,#eef2fb,#dbe4f5); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.help-article-title { font-size: 19px; font-weight: 800; margin: 2px 0 0; color: #1e293b; }
.help-goto-btn { display: inline-block; margin-bottom: 18px; }
.help-article-body { font-size: 14px; line-height: 2; color: #334155; }
.help-article-body ul { padding-inline-start: 20px; }
.help-article-body li { margin-bottom: 8px; }
.help-article-body p { margin-bottom: 10px; }
.help-article-body b { color: #1e293b; }

/* ================= Ticket conversation ================= */
.tk-thread { display: flex; flex-direction: column; gap: 14px; }
.tk-msg { display: flex; gap: 10px; max-width: 86%; }
.tk-msg.customer { align-self: flex-start; }
.tk-msg.staff { align-self: flex-end; flex-direction: row-reverse; }
.tk-msg.internal { align-self: stretch; max-width: 100%; }
.tk-av { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.tk-msg.customer .tk-av { background: #e0e7ff; }
.tk-msg.staff .tk-av { background: #ccfbf1; }
.tk-bubble { border-radius: 14px; padding: 10px 14px; font-size: 14px; line-height: 1.85; }
.tk-msg.customer .tk-bubble { background: #f1f5f9; color: #1e293b; border-top-right-radius: 4px; }
.tk-msg.staff .tk-bubble { background: linear-gradient(135deg, #0d9488, #0f766e); color: #fff; border-top-left-radius: 4px; }
.tk-msg.internal .tk-bubble { background: #fffbeb; border: 1px dashed #fcd34d; color: #92400e; width: 100%; }
.tk-meta { font-size: 11px; margin-top: 5px; opacity: .8; }
.tk-att { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.tk-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); color: inherit; text-decoration: none; border-radius: 9px; padding: 5px 10px; font-size: 12px; font-weight: 700; }
.tk-msg.customer .tk-chip, .tk-msg.internal .tk-chip { background: #fff; border-color: #e2e8f0; color: #334155; }
.tk-chip:hover { filter: brightness(.95); }
.tk-thumb { display: block; max-width: 180px; max-height: 150px; border-radius: 10px; margin-top: 8px; border: 1px solid rgba(0,0,0,.08); }

/* priority chips */
.prio { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.prio-low { background: #f1f5f9; color: #475569; }
.prio-normal { background: #dbeafe; color: #1d4ed8; }
.prio-high { background: #ffedd5; color: #c2410c; }
.prio-urgent { background: #fee2e2; color: #b91c1c; }

/* file dropzone */
.tk-drop { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 14px; text-align: center; color: #64748b; font-size: 13px; cursor: pointer; transition: border-color .12s, background .12s; }
.tk-drop:hover, .tk-drop.drag { border-color: #14b8a6; background: #f0fdfa; }
.tk-filelist { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.tk-filelist .f { font-size: 12px; color: #334155; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; display: flex; justify-content: space-between; }

/* rating stars */
.stars { display: inline-flex; gap: 4px; direction: ltr; }
.stars .s { font-size: 26px; cursor: pointer; color: #cbd5e1; transition: color .1s; }
.stars .s.on { color: #f59e0b; }
