/* ═══════════════ فونت ═══════════════ */
@font-face {
  font-family: "Vazirmatn";
  src: url("../lib/vazirmatn/fonts/Vazirmatn-Variable.woff2") format("woff2-variations"),
       url("../lib/vazirmatn/fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ═══════════════ پالت رنگی ═══════════════ */
:root {
  --brand-950: #081427;
  --brand-900: #0b1f3a;
  --brand-800: #12305a;
  --primary: #0e7c86;
  --primary-600: #0a6a73;
  --primary-400: #22a6b3;
  --primary-50: #e7f6f7;
  --accent: #f5a524;
  --accent-50: #fff6e5;
  --success: #17a36b;
  --success-50: #e6f7ef;
  --warning: #e08a00;
  --warning-50: #fff4e0;
  --danger: #e5484d;
  --danger-50: #fdeced;
  --info: #5b5bd6;
  --info-50: #eeeefc;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f1b2d;
  --muted: #66758a;
  --border: #e3e8ef;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .06);
  --shadow: 0 6px 24px -8px rgba(15, 27, 45, .12), 0 2px 6px rgba(15, 27, 45, .04);
  --shadow-lg: 0 20px 50px -12px rgba(11, 31, 58, .25);
  --sidebar-w: 268px;

  --bs-primary: var(--primary);
  --bs-primary-rgb: 14, 124, 134;
  --bs-body-font-family: "Vazirmatn", Tahoma, sans-serif;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-link-color: var(--primary);
  --bs-link-hover-color: var(--primary-600);
  --bs-border-radius: 10px;
}

/* ═══════════════ حالت تاریک ═══════════════ */
:root[data-theme="dark"] {
  --primary: #22a6b3;
  --primary-600: #1c8b96;
  --primary-400: #4fc2cd;
  --primary-50: rgba(34, 166, 179, .16);
  --accent: #f5a524;
  --accent-50: rgba(245, 165, 36, .16);
  --success: #3ecf8e;
  --success-50: rgba(62, 207, 142, .14);
  --warning: #f0a93e;
  --warning-50: rgba(240, 169, 62, .14);
  --danger: #f36a6e;
  --danger-50: rgba(243, 106, 110, .16);
  --info: #8f8ff0;
  --info-50: rgba(143, 143, 240, .16);
  --bg: #0e1620;
  --surface: #161f2b;
  --surface-2: #1d2836;
  --text: #e7edf4;
  --muted: #93a2b6;
  --border: #2a3646;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 6px 24px -8px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .25);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .6);
}
:root[data-theme="dark"] .topbar { background: rgba(14, 22, 32, .82); }
:root[data-theme="dark"] .badge-soft-secondary { background: #26323f; color: #a9b8c9; }
:root[data-theme="dark"] .login-page { background: var(--bg); }
:root[data-theme="dark"] .form-control, :root[data-theme="dark"] .form-select {
  background-color: var(--surface-2); color: var(--text); border-color: var(--border);
}
:root[data-theme="dark"] .form-control:focus, :root[data-theme="dark"] .form-select:focus { background-color: var(--surface-2); color: var(--text); }
:root[data-theme="dark"] .table-x { color: var(--text); }
:root[data-theme="dark"] .table-x thead { color: var(--muted); }

html, body { font-family: "Vazirmatn", Tahoma, sans-serif; }
body { background: var(--bg); color: var(--text); font-size: .94rem; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
::selection { background: var(--primary); color: #fff; }
.ltr { direction: ltr; unicode-bidi: embed; }
.fw-600 { font-weight: 600; }
.fw-800 { font-weight: 800; }
.text-muted { color: var(--muted) !important; }
.small-muted { color: var(--muted); font-size: .8rem; }

/* scrollbars */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #c9d3df; border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ═══════════════ دکمه‌ها ═══════════════ */
.btn { border-radius: 10px; font-weight: 600; padding: .55rem 1.05rem; transition: all .18s ease; }
.btn-sm { padding: .35rem .7rem; border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-600); --bs-btn-hover-border-color: var(--primary-600); --bs-btn-active-bg: var(--primary-600); --bs-btn-disabled-bg: var(--primary); box-shadow: 0 6px 16px -6px rgba(14, 124, 134, .6); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #3d2600; border: none; box-shadow: 0 6px 16px -6px rgba(245, 165, 36, .7); }
.btn-accent:hover { background: #e79614; color: #2b1b00; transform: translateY(-1px); }
.btn-soft { background: var(--primary-50); color: var(--primary); border: 1px solid transparent; }
.btn-soft:hover { background: var(--primary); color: #fff; }
.btn-soft-danger { background: var(--danger-50); color: var(--danger); border: none; }
.btn-soft-danger:hover { background: var(--danger); color: #fff; }
.btn-soft-success { background: var(--success-50); color: var(--success); border: none; }
.btn-soft-success:hover { background: var(--success); color: #fff; }
.btn-soft-warning { background: var(--warning-50); color: var(--warning); border: none; }
.btn-soft-warning:hover { background: var(--warning); color: #fff; }
.btn-light { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-light:hover { background: var(--surface-2); border-color: #cfd8e3; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }

/* ═══════════════ فرم ═══════════════ */
.form-control, .form-select { border-radius: 10px; border-color: var(--border); padding: .6rem .85rem; background-color: var(--surface); transition: border-color .15s, box-shadow .15s; }
.form-control:focus, .form-select:focus { border-color: var(--primary-400); box-shadow: 0 0 0 4px rgba(34, 166, 179, .15); }
.form-control::placeholder { color: #a3afbf; }
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .35rem; color: #334155; }
.form-label .req { color: var(--danger); margin-inline-start: 2px; }
.input-group-text { background: var(--surface-2); border-color: var(--border); color: var(--muted); border-radius: 10px; font-size: .85rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(34, 166, 179, .15); border-color: var(--primary-400); }
.field-validation-error, .text-danger.field-error { color: var(--danger) !important; font-size: .78rem; margin-top: .25rem; display: block; }
.input-validation-error { border-color: var(--danger) !important; background-color: #fffafa; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 1rem; }
.form-hint { font-size: .76rem; color: var(--muted); margin-top: .25rem; }

/* ═══════════════ لایه اصلی ═══════════════ */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w); z-index: 1040;
  background: radial-gradient(120% 60% at 100% 0%, #16457a 0%, transparent 60%), linear-gradient(180deg, var(--brand-900), var(--brand-950));
  color: #cdd8e6; display: flex; flex-direction: column; padding: 1.25rem .9rem;
}
.brand { display: flex; align-items: center; gap: .75rem; padding: .25rem .6rem 1.4rem; color: #fff; }
.brand-logo { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.35rem; color: #fff;
  background: linear-gradient(135deg, var(--primary-400), var(--primary)); box-shadow: 0 8px 20px -6px rgba(34, 166, 179, .7); }
.brand-title { font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.brand-sub { font-size: .72rem; color: #8ea3bd; }
.nav-caption { font-size: .7rem; color: #6f86a3; padding: 1rem .9rem .4rem; font-weight: 600; letter-spacing: .3px; }
.side-link { display: flex; align-items: center; gap: .8rem; padding: .72rem .9rem; border-radius: 12px; color: #c3cfdf; font-weight: 500; margin-bottom: 3px; transition: all .18s; position: relative; }
.side-link i { font-size: 1.12rem; width: 22px; text-align: center; opacity: .9; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.active { background: linear-gradient(90deg, rgba(34, 166, 179, .08), rgba(34, 166, 179, .28)); color: #fff; font-weight: 600; }
.side-link.active::after { content: ""; position: absolute; inset-inline-start: -0.9rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
[dir=rtl] .side-link.active::after { border-radius: 4px 0 0 4px; }
.side-link .count { margin-inline-start: auto; background: var(--danger); color: #fff; font-size: .7rem; border-radius: 20px; padding: 1px 8px; font-weight: 700; }
.sidebar-footer { margin-top: auto; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); border-radius: 14px; padding: .8rem; }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), #f07b24); flex-shrink: 0; }

.main { margin-inline-start: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; background: rgba(243, 246, 250, .82); backdrop-filter: blur(12px); padding: .85rem 1.75rem; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .page-title { font-weight: 800; font-size: 1.2rem; margin: 0; }
.topbar .today-chip { background: var(--surface); border: 1px solid var(--border); border-radius: 30px; padding: .38rem .9rem; font-size: .8rem; color: var(--muted); }
.quick-search { position: relative; max-width: 360px; width: 100%; }
.quick-search input { padding-inline-start: 2.4rem; border-radius: 30px; background: var(--surface); }
.quick-search i { position: absolute; inset-inline-start: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.content { padding: .5rem 1.75rem 2rem; flex: 1; }
.footer { padding: 1rem 1.75rem; color: var(--muted); font-size: .78rem; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(100%); transition: transform .25s ease; }
  [dir=ltr] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(8, 20, 39, .45); z-index: 1030; }
  .main { margin-inline-start: 0; }
  .topbar, .content { padding-inline: 1rem; }
  .quick-search { display: none; }
}

/* ═══════════════ کارت ═══════════════ */
.card-x { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-x .card-x-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.card-x .card-x-body { padding: 1.25rem; }
.card-x-title { font-weight: 700; font-size: 1rem; margin: 0; display: flex; align-items: center; gap: .55rem; }
.title-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 1rem; background: var(--primary-50); color: var(--primary); }
.title-icon.warn { background: var(--warning-50); color: var(--warning); }
.title-icon.danger { background: var(--danger-50); color: var(--danger); }
.title-icon.success { background: var(--success-50); color: var(--success); }
.title-icon.info { background: var(--info-50); color: var(--info); }
.title-icon.accent { background: var(--accent-50); color: #c77d00; }

/* stat cards */
.stat { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.2rem; box-shadow: var(--shadow-sm); height: 100%; transition: transform .2s, box-shadow .2s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat .stat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; }
.stat .stat-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.stat .stat-value { font-size: 1.55rem; font-weight: 800; line-height: 1.3; }
.stat .stat-foot { font-size: .75rem; color: var(--muted); }
.stat::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; inset-inline-end: -40px; bottom: -60px; opacity: .08; background: currentColor; }
.stat.c-primary { color: var(--primary); } .stat.c-primary .stat-icon { background: var(--primary-50); }
.stat.c-success { color: var(--success); } .stat.c-success .stat-icon { background: var(--success-50); }
.stat.c-warning { color: var(--warning); } .stat.c-warning .stat-icon { background: var(--warning-50); }
.stat.c-danger { color: var(--danger); } .stat.c-danger .stat-icon { background: var(--danger-50); }
.stat.c-info { color: var(--info); } .stat.c-info .stat-icon { background: var(--info-50); }
.stat .stat-value, .stat .stat-label, .stat .stat-foot { position: relative; z-index: 1; }
.stat .stat-value { color: var(--text); }

.hero {
  border-radius: 20px; padding: 1.5rem 1.75rem; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(80% 120% at 0% 0%, rgba(245, 165, 36, .35), transparent 55%), linear-gradient(120deg, var(--brand-800), var(--primary));
  box-shadow: var(--shadow);
}
.hero h2 { font-weight: 800; font-size: 1.45rem; }
.hero p { color: rgba(255, 255, 255, .8); margin: 0; }
.hero .hero-deco { position: absolute; inset-inline-end: 1.5rem; bottom: -1.2rem; font-size: 7rem; opacity: .12; }

/* ═══════════════ badge ═══════════════ */
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; padding: .32rem .65rem; border-radius: 30px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.badge-soft-success { background: var(--success-50); color: var(--success); }
.badge-soft-warning { background: var(--warning-50); color: var(--warning); }
.badge-soft-danger { background: var(--danger-50); color: var(--danger); }
.badge-soft-info { background: var(--info-50); color: var(--info); }
.badge-soft-secondary { background: #eef2f6; color: #5b6b80; }
.badge-soft-primary { background: var(--primary-50); color: var(--primary); }
.type-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .28rem .6rem; border-radius: 8px; font-size: .74rem; font-weight: 700; }
.type-third { background: #e8f1ff; color: #2563eb; }
.type-body { background: #f3e8ff; color: #8b3fd9; }
.type-driver { background: #fff1e6; color: #d9620b; }
.type-combo { background: #e6f7f3; color: #0f8a6c; }
.type-other { background: #eef2f6; color: #5b6b80; }

/* ═══════════════ پلاک ایران ═══════════════ */
.plate { direction: ltr; display: inline-flex; align-items: stretch; border: 2px solid #1b1b1b; border-radius: 7px; overflow: hidden; background: #fff; font-weight: 800; color: #111; height: 34px; font-size: 1rem; box-shadow: 0 1px 0 rgba(0, 0, 0, .15); white-space: nowrap; }
.plate .p-flag { background: #1f4fb4; color: #fff; width: 20px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; font-size: .45rem; padding-bottom: 2px; position: relative; }
.plate .p-flag::before { content: ""; position: absolute; top: 3px; width: 12px; height: 8px; background: linear-gradient(#239f40 33%, #fff 33% 66%, #da0000 66%); }
.plate .p-main { display: flex; align-items: center; gap: .35rem; padding: 0 .5rem; letter-spacing: 1px; }
.plate .p-letter { font-family: "Vazirmatn"; }
.plate .p-iran { border-left: 2px solid #1b1b1b; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 .4rem; line-height: 1; }
.plate .p-iran small { font-size: .45rem; font-weight: 600; }
.plate.plate-lg { height: 52px; font-size: 1.55rem; border-width: 3px; border-radius: 10px; }
.plate.plate-lg .p-flag { width: 30px; font-size: .6rem; }
.plate.plate-lg .p-flag::before { width: 18px; height: 12px; top: 5px; }
.plate.plate-lg .p-iran small { font-size: .62rem; }
.plate.plate-lg .p-iran { border-left-width: 3px; padding: 0 .65rem; }

/* plate input */
.plate-input { direction: ltr; display: flex; align-items: stretch; border: 2px solid #26303d; border-radius: 12px; overflow: hidden; background: #fff; height: 56px; max-width: 420px; }
.plate-input .p-flag { background: #1f4fb4; color: #fff; width: 34px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; font-size: .6rem; padding-bottom: 4px; position: relative; font-weight: 700; }
.plate-input .p-flag::before { content: ""; position: absolute; top: 7px; width: 20px; height: 13px; background: linear-gradient(#239f40 33%, #fff 33% 66%, #da0000 66%); }
.plate-input input, .plate-input select { border: none; outline: none; text-align: center; font-weight: 800; font-size: 1.35rem; background: transparent; min-width: 0; color: #111; }
.plate-input input:focus, .plate-input select:focus { background: var(--primary-50); }
.plate-input .pi-2 { width: 64px; }
.plate-input .pi-l { width: 92px; appearance: none; -webkit-appearance: none; cursor: pointer; font-family: "Vazirmatn"; font-size: 1.15rem; border-inline: 1px dashed #d4dbe4; }
.plate-input .pi-3 { width: 84px; flex: 1; }
.plate-input .pi-iran { border-left: 2px solid #26303d; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 76px; }
.plate-input .pi-iran small { font-size: .62rem; font-weight: 700; color: #334155; line-height: 1; padding-top: 4px; }
.plate-input .pi-iran input { width: 100%; height: 100%; font-size: 1.2rem; }
.plate-input.is-invalid { border-color: var(--danger); }

/* ═══════════════ لیست پرونده‌ها (کارت) ═══════════════ */
.policy-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; height: 100%; display: flex; flex-direction: column; color: inherit; }
.policy-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: inherit; }
.policy-card .pc-img { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, #dfe7f1, #eef3f8); overflow: hidden; }
.policy-card .pc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.policy-card:hover .pc-img img { transform: scale(1.05); }
.policy-card .pc-img .no-img { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; color: #b6c3d3; }
.policy-card .pc-img .pc-badges { position: absolute; top: .7rem; inset-inline: .7rem; display: flex; justify-content: space-between; gap: .4rem; }
.policy-card .pc-img .pc-badges > * { backdrop-filter: blur(6px); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.policy-card .pc-body { padding: 1rem 1.1rem; flex: 1; display: flex; flex-direction: column; gap: .6rem; }
.policy-card .pc-title { font-weight: 800; font-size: 1.02rem; margin: 0; }
.policy-card .pc-meta { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .8rem; }
.policy-card .pc-foot { border-top: 1px dashed var(--border); padding: .75rem 1.1rem; display: flex; align-items: center; justify-content: space-between; font-size: .8rem; }

.progress-x { height: 8px; background: #edf1f6; border-radius: 10px; overflow: hidden; }
.progress-x > span { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--primary-400), var(--primary)); transition: width .6s ease; }
.progress-x.done > span { background: linear-gradient(90deg, #3cc98e, var(--success)); }

.filter-pills { display: flex; gap: .45rem; flex-wrap: wrap; }
.filter-pill { padding: .45rem .95rem; border-radius: 30px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: .83rem; display: inline-flex; gap: .45rem; align-items: center; transition: all .15s; }
.filter-pill:hover { border-color: var(--primary-400); color: var(--primary); }
.filter-pill.active { background: var(--brand-900); border-color: var(--brand-900); color: #fff; }
.filter-pill .cnt { background: rgba(100, 116, 139, .12); padding: 0 .45rem; border-radius: 20px; font-size: .72rem; }
.filter-pill.active .cnt { background: rgba(255, 255, 255, .18); }

/* ═══════════════ جدول ═══════════════ */
.table-x { margin: 0; --bs-table-bg: transparent; }
.table-x thead th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: .78rem; border-bottom: 1px solid var(--border); padding: .8rem 1rem; white-space: nowrap; }
.table-x tbody td { padding: .8rem 1rem; vertical-align: middle; border-color: #eef2f6; }
.table-x tbody tr { transition: background .12s; }
.table-x tbody tr:hover { background: #f9fbfd; }
.table-x tbody tr.row-paid { background: #fbfefc; }
.table-x tbody tr.row-overdue { background: #fffafa; }
.table-x .thumb { width: 54px; height: 40px; border-radius: 8px; object-fit: cover; background: #eef2f6; }
.thumb-empty { width: 54px; height: 40px; border-radius: 8px; background: #eef2f6; display: grid; place-items: center; color: #aab6c5; }

/* ═══════════════ یادآورها ═══════════════ */
.reminder-list { max-height: 440px; overflow-y: auto; }
.reminder { display: flex; align-items: center; gap: .85rem; padding: .8rem 1.25rem; border-bottom: 1px solid #eef2f6; color: inherit; transition: background .12s; }
.reminder:last-child { border-bottom: none; }
.reminder:hover { background: #f9fbfd; color: inherit; }
.reminder .r-date { min-width: 62px; text-align: center; border-radius: 12px; padding: .35rem .3rem; background: var(--surface-2); border: 1px solid var(--border); line-height: 1.25; }
.reminder .r-date b { display: block; font-size: 1.15rem; }
.reminder .r-date span { font-size: .68rem; color: var(--muted); }
.reminder .r-date.urgent { background: var(--danger-50); border-color: #f8cfd1; color: var(--danger); }
.reminder .r-date.soon { background: var(--warning-50); border-color: #fbdfb0; color: var(--warning); }
.reminder .r-img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: #eef2f6; flex-shrink: 0; }
.reminder .r-info { flex: 1; min-width: 0; }
.reminder .r-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reminder .r-sub { font-size: .78rem; color: var(--muted); }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.6rem; display: block; margin-bottom: .5rem; color: #b8c4d3; }
.empty-state.good i { color: #9fdcc0; }

.nav-tabs-x { border: none; gap: .35rem; background: var(--surface-2); padding: .3rem; border-radius: 12px; display: inline-flex; flex-wrap: wrap; }
.nav-tabs-x .nav-link { border: none; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: .83rem; padding: .45rem .85rem; display: flex; gap: .4rem; align-items: center; }
.nav-tabs-x .nav-link.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.nav-tabs-x .nav-link .cnt { background: #e5eaf1; color: #475569; border-radius: 20px; font-size: .7rem; padding: 0 .45rem; }
.nav-tabs-x .nav-link.active .cnt.danger { background: var(--danger); color: #fff; }
.nav-tabs-x .nav-link.active .cnt.warn { background: var(--warning); color: #fff; }

/* ═══════════════ فرم پرونده ═══════════════ */
.form-section { scroll-margin-top: 90px; }
.section-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.1rem; }
.section-head .step { width: 38px; height: 38px; border-radius: 12px; background: var(--brand-900); color: #fff; display: grid; place-items: center; font-weight: 800; }
.section-head h5 { margin: 0; font-weight: 800; font-size: 1.02rem; }
.section-head p { margin: 0; color: var(--muted); font-size: .8rem; }
.stepper { position: sticky; top: 84px; }
.stepper a { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .86rem; }
.stepper a:hover { background: var(--surface-2); color: var(--text); }
.stepper a.active { background: var(--primary-50); color: var(--primary); }
.stepper a .dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #eef2f6; font-size: .75rem; }
.stepper a.active .dot { background: var(--primary); color: #fff; }

.type-select { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; }
.type-select input { display: none; }
.type-select label { border: 2px solid var(--border); border-radius: 14px; padding: .85rem .5rem; text-align: center; cursor: pointer; transition: all .15s; font-weight: 700; font-size: .86rem; background: var(--surface); }
.type-select label i { display: block; font-size: 1.5rem; margin-bottom: .25rem; color: var(--muted); }
.type-select label:hover { border-color: var(--primary-400); }
.type-select input:checked + label { border-color: var(--primary); background: var(--primary-50); color: var(--primary); box-shadow: 0 0 0 4px rgba(34, 166, 179, .12); }
.type-select input:checked + label i { color: var(--primary); }

.money-words { font-size: .75rem; color: var(--primary); margin-top: .25rem; min-height: 1rem; }
.summary-card { background: linear-gradient(160deg, var(--brand-900), var(--brand-800)); color: #dbe6f3; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.summary-card .s-row { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px dashed rgba(255, 255, 255, .1); font-size: .86rem; }
.summary-card .s-row b { color: #fff; }
.summary-card .s-big { font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.schedule-preview { max-height: 260px; overflow-y: auto; }
.schedule-preview table { width: 100%; font-size: .8rem; }
.schedule-preview td { padding: .35rem .25rem; border-bottom: 1px solid rgba(255, 255, 255, .07); }

/* ═══════════════ Drag & Drop ═══════════════ */
.dropzone { position: relative; border: 2px dashed #c6d2df; border-radius: 16px; background: repeating-linear-gradient(-45deg, #fbfcfe, #fbfcfe 12px, #f6f9fc 12px, #f6f9fc 24px); padding: 1.6rem 1rem; text-align: center; cursor: pointer; transition: all .2s; }
.dropzone:hover { border-color: var(--primary-400); background: var(--primary-50); }
.dropzone.dragover { border-color: var(--primary); background: var(--primary-50); transform: scale(1.01); box-shadow: 0 0 0 6px rgba(34, 166, 179, .12); }
.dropzone.is-invalid { border-color: var(--danger); background: #fff8f8; }
.dropzone .dz-icon { width: 58px; height: 58px; margin: 0 auto .6rem; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); transition: transform .2s; }
.dropzone.dragover .dz-icon { transform: translateY(-4px) scale(1.08); }
.dropzone .dz-title { font-weight: 700; }
.dropzone .dz-sub { font-size: .78rem; color: var(--muted); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dz-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .7rem; margin-top: .85rem; }
.dz-previews:empty { display: none; }
.dz-item { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: #eef2f6; box-shadow: var(--shadow-sm); animation: pop .25s ease; border: 2px solid transparent; }
.dz-item img { width: 100%; height: 100%; object-fit: cover; }
.dz-item .dz-name { position: absolute; bottom: 0; inset-inline: 0; font-size: .66rem; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); padding: .9rem .4rem .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: left; }
.dz-item .dz-remove { position: absolute; top: 6px; inset-inline-end: 6px; width: 26px; height: 26px; border-radius: 8px; border: none; background: rgba(229, 72, 77, .92); color: #fff; display: grid; place-items: center; font-size: .8rem; }
.dz-item .dz-tag { position: absolute; top: 6px; inset-inline-start: 6px; background: var(--accent); color: #3d2600; font-size: .66rem; font-weight: 800; border-radius: 6px; padding: 1px 6px; }
.dropzone.single.has-file { padding: .6rem; }
.dropzone.single.has-file .dz-empty { display: none; }
.dropzone.single .dz-previews { margin: 0; grid-template-columns: 1fr; }
.dropzone.single .dz-item { aspect-ratio: 16/8; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

.existing-img { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; border: 2px solid var(--border); transition: all .15s; }
.existing-img img { width: 100%; height: 100%; object-fit: cover; }
.existing-img.is-main { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 165, 36, .25); }
.existing-img.marked-delete { opacity: .4; filter: grayscale(1); border-color: var(--danger); }
.existing-img .ei-actions { position: absolute; bottom: 0; inset-inline: 0; display: flex; gap: 4px; justify-content: center; padding: .4rem; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
.existing-img .ei-actions button { font-size: .7rem; border-radius: 7px; padding: .2rem .45rem; border: none; }
.existing-img .ei-tag { position: absolute; top: 6px; inset-inline-start: 6px; background: var(--accent); color: #3d2600; font-size: .66rem; font-weight: 800; border-radius: 6px; padding: 1px 6px; }

/* ═══════════════ دیت‌پیکر شمسی ═══════════════ */
.jdp-wrap { position: relative; }
.jdp-wrap .jdp-icon { position: absolute; inset-inline-end: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.jdp-wrap input { padding-inline-end: 2.3rem; direction: ltr; text-align: right; }
.jdp { position: absolute; z-index: 2000; width: 300px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: .8rem; user-select: none; animation: pop .15s ease; direction: rtl; font-family: "Vazirmatn"; }
.jdp-head { display: flex; align-items: center; justify-content: space-between; gap: .3rem; margin-bottom: .55rem; }
.jdp-head button { border: none; background: var(--surface-2); width: 32px; height: 32px; border-radius: 9px; color: var(--text); }
.jdp-head button:hover { background: var(--primary-50); color: var(--primary); }
.jdp-title { display: flex; gap: .3rem; }
.jdp-title select { border: 1px solid var(--border); border-radius: 8px; padding: .2rem .35rem; font-weight: 700; font-size: .85rem; background: var(--surface); font-family: inherit; }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.jdp-grid .wd { font-size: .72rem; color: var(--muted); font-weight: 600; padding: .25rem 0; }
.jdp-grid .wd.fri { color: var(--danger); }
.jdp-grid button { border: none; background: transparent; height: 36px; border-radius: 9px; font-size: .85rem; color: var(--text); font-family: inherit; }
.jdp-grid button:hover { background: var(--primary-50); color: var(--primary); }
.jdp-grid button.fri { color: var(--danger); }
.jdp-grid button.today { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 800; }
.jdp-grid button.sel { background: var(--primary); color: #fff; font-weight: 700; }
.jdp-foot { display: flex; justify-content: space-between; margin-top: .55rem; padding-top: .55rem; border-top: 1px solid var(--border); }
.jdp-foot button { border: none; background: transparent; color: var(--primary); font-weight: 700; font-size: .8rem; padding: .25rem .5rem; border-radius: 7px; font-family: inherit; }
.jdp-foot button:hover { background: var(--primary-50); }
.jdp-foot button.clear { color: var(--muted); }

/* ═══════════════ جزئیات ═══════════════ */
.gallery-main { position: relative; border-radius: var(--radius); overflow: hidden; background: #0b1f3a; aspect-ratio: 16/10; cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; padding-bottom: .25rem; }
.gallery-thumbs img { width: 76px; height: 56px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 2px solid transparent; opacity: .7; transition: all .15s; flex-shrink: 0; }
.gallery-thumbs img.active, .gallery-thumbs img:hover { border-color: var(--primary); opacity: 1; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; }
.info-item { background: var(--surface-2); border: 1px solid #edf1f6; border-radius: 12px; padding: .7rem .9rem; }
.info-item .k { font-size: .74rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.info-item .v { font-weight: 700; margin-top: .15rem; word-break: break-all; }
.copy-btn { border: none; background: transparent; color: var(--muted); padding: 0 .25rem; font-size: .8rem; }
.copy-btn:hover { color: var(--primary); }
.countdown { display: flex; align-items: center; gap: 1rem; }
.ring { --p: 50; --c: var(--primary); width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #e9eef4 0); flex-shrink: 0; }
.ring > div { width: 74px; height: 74px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring b { font-size: 1.2rem; }
.ring small { font-size: .65rem; color: var(--muted); }
.money-box { border-radius: 14px; padding: .9rem 1rem; }
.money-box .k { font-size: .76rem; opacity: .8; }
.money-box .v { font-size: 1.2rem; font-weight: 800; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.pay-methods input { display: none; }
.pay-methods label { border: 2px solid var(--border); border-radius: 12px; padding: .7rem .4rem; text-align: center; cursor: pointer; font-weight: 600; font-size: .82rem; transition: all .15s; }
.pay-methods label i { display: block; font-size: 1.35rem; color: var(--muted); margin-bottom: .15rem; }
.pay-methods label:hover { border-color: var(--primary-400); }
.pay-methods input:checked + label { border-color: var(--success); background: var(--success-50); color: #0e7a50; }
.pay-methods input:checked + label i { color: var(--success); }
.modal-content { border: none; border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; }
.modal-footer { border-top: 1px solid var(--border); }
.lightbox .modal-content { background: transparent; box-shadow: none; }
.lightbox img { max-height: 85vh; width: 100%; object-fit: contain; border-radius: 12px; }

/* ═══════════════ جستجو ═══════════════ */
.search-hero { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.2rem; box-shadow: var(--shadow-sm); }
.search-big { position: relative; }
.search-big input { height: 56px; border-radius: 16px; padding-inline-start: 3rem; font-size: 1.02rem; background: var(--surface-2); }
.search-big > i { position: absolute; inset-inline-start: 1.1rem; top: 50%; transform: translateY(-50%); font-size: 1.2rem; color: var(--primary); }
.chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--primary-50); color: var(--primary); border-radius: 30px; padding: .28rem .35rem .28rem .75rem; font-size: .76rem; font-weight: 600; }
[dir=rtl] .chip { padding: .28rem .75rem .28rem .35rem; }
.chip a { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(14, 124, 134, .15); color: var(--primary); font-size: .7rem; }
.chip a:hover { background: var(--danger); color: #fff; }
.check-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.check-chips input { display: none; }
.check-chips label { padding: .4rem .8rem; border-radius: 30px; border: 1px solid var(--border); font-size: .8rem; font-weight: 600; cursor: pointer; background: var(--surface); transition: all .15s; }
.check-chips input:checked + label { background: var(--brand-900); color: #fff; border-color: var(--brand-900); }

.pagination .page-link { border: none; margin: 0 2px; border-radius: 10px !important; color: var(--text); font-weight: 600; min-width: 38px; text-align: center; }
.pagination .page-item.active .page-link { background: var(--primary); color: #fff; }
.pagination .page-item.disabled .page-link { background: transparent; }

/* ═══════════════ لاگین ═══════════════ */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(60% 50% at 20% 20%, rgba(245, 165, 36, .35), transparent 60%), radial-gradient(70% 60% at 90% 90%, rgba(34, 166, 179, .5), transparent 60%), linear-gradient(140deg, var(--brand-950), var(--brand-800)); }
.login-art .big-icon { position: absolute; inset-inline-end: -3rem; top: 50%; transform: translateY(-50%); font-size: 22rem; opacity: .07; }
.login-art h1 { font-weight: 900; font-size: 2.3rem; line-height: 1.5; }
.login-art .feature { display: flex; gap: .8rem; align-items: center; margin-top: 1rem; color: #d6e2f0; }
.login-art .feature i { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); font-size: 1.15rem; color: var(--accent); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-box { width: 100%; max-width: 400px; }
.login-box .form-control { height: 52px; }
.pw-toggle { position: absolute; inset-inline-end: .5rem; top: 50%; transform: translateY(-50%); border: none; background: none; color: var(--muted); }
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ═══════════════ Toast ═══════════════ */
.toast-wrap { position: fixed; bottom: 1.25rem; inset-inline-start: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
[dir=rtl] .toast-wrap { transform: translateX(50%); }
.toast-x { display: flex; align-items: center; gap: .7rem; background: var(--brand-900); color: #fff; padding: .8rem 1.1rem; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 500; animation: toastIn .35s cubic-bezier(.2, .9, .3, 1.3); min-width: 280px; }
.toast-x i { font-size: 1.2rem; }
.toast-x.success i { color: #4ade9b; }
.toast-x.danger i { color: #ff8a8e; }
.toast-x.warning i { color: var(--accent); }
.toast-x.hide { animation: toastOut .3s forwards; }
@keyframes toastIn { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(20px); opacity: 0; } }

.fade-up { animation: fadeUp .45s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media print {
  .sidebar, .topbar, .no-print, .footer { display: none !important; }
  .main { margin: 0 !important; }
  .card-x { box-shadow: none; break-inside: avoid; }
  .print-letterhead { display: flex !important; }
}
.print-letterhead {
  display: none;
  align-items: center; justify-content: space-between;
  border-bottom: 2px solid #16211d; padding-bottom: .75rem; margin-bottom: 1.25rem;
}
.print-letterhead .pl-title { font-size: 1.3rem; font-weight: 800; }
.print-letterhead .pl-meta { font-size: .8rem; color: #555; text-align: left; }

.card-x.card-x-body { padding: 1.35rem; }
@media (max-width: 575.98px) { .card-x.card-x-body { padding: 1rem; } }
.range-pair { display: flex; gap: .5rem; }
.range-pair > * { flex: 1 1 0; min-width: 0; }
.range-pair .form-control { font-size: .84rem; padding-inline: .55rem 1.9rem; }
.range-pair .jdp-wrap .jdp-icon { inset-inline-end: .55rem; font-size: .8rem; }
.range-pair input[data-money] { padding-inline: .55rem; }
.hero .hero-deco { opacity: .08; inset-inline-end: auto; inset-inline-start: 45%; }
.table-x td .btn-sm { white-space: nowrap; }
.policy-card .plate, .reminder .plate { align-self: flex-start; }
.plate .p-iran { min-width: 30px; }
