/* ═══ تم اکبری کارز: مشکی و طلایی (هماهنگ با لوگو) ═══ */
:root {
  --gold: #d4b25e;
  --gold-soft: #e9d48a;
  --ink: #0b0b0c;
  --ink-2: #15151a;
  --paper: #f6f4ef;
  --text: #1c1c22;
  --muted: #7a7567;
  --radius: 1.1rem;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
}
body { font-family: Vazirmatn, Tahoma, sans-serif; background: var(--paper); color: var(--text); }

/* نوار بالا */
.navbar { background: var(--ink) !important; border-bottom: 1px solid #2a2a30; }
.navbar-brand, .navbar .btn { color: var(--gold-soft) !important; }
.navbar .btn { border: 1px solid #3a3a42; border-radius: 999px; padding: .35rem .9rem; }
.navbar .btn:hover { background: var(--gold); color: var(--ink) !important; border-color: var(--gold); }
.navbar-brand img { box-shadow: 0 0 0 1px var(--gold); }

/* بنر نمایشگاه */
.dealer-banner {
  background: radial-gradient(circle at 15% 20%, #2a2412 0%, var(--ink) 55%);
  color: var(--gold-soft); border-radius: var(--radius); padding: 1.4rem 1.5rem;
  border: 1px solid #2d2a1c; box-shadow: var(--shadow); margin-bottom: 1.25rem !important;
}
.dealer-banner h4 { font-weight: 800; letter-spacing: .3px; }
.dealer-banner .small { color: #bfb07a !important; }
.dealer-logo { width: 84px; height: 84px; object-fit: contain; border-radius: 1rem;
  box-shadow: 0 0 0 2px var(--gold), 0 8px 20px rgba(212,178,94,.25); background: var(--ink); }

/* کارت‌ها و فیلترها */
.card { border-radius: var(--radius) !important; border: 1px solid #ebe7db !important; }
.shadow-sm { box-shadow: var(--shadow) !important; }
.car-card { transition: transform .2s ease, box-shadow .2s ease; overflow: hidden; }
.car-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0,0,0,.14) !important; }
.car-card .thumb { aspect-ratio: 4/3; background: #1b1b20; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.car-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.car-card:hover .thumb img { transform: scale(1.04); }
.car-card h6 { font-weight: 700; }
.price { color: #9a7a2a; font-weight: 800; }
.badge.bg-light { background: #f3ecd2 !important; color: #7a5e1c !important; }

.form-control, .form-select { border-radius: .75rem; border-color: #d9d4c4; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(212,178,94,.2); }

.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--gold-soft); border-radius: .75rem; font-weight: 700; }
.btn-primary:hover { background: #26262c; border-color: #26262c; color: var(--gold); }
.btn-outline-primary { color: #7a5e1c; border-color: var(--gold); border-radius: .75rem; }
.btn-outline-primary:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* گالری */
.gallery { display: flex; gap: .6rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .25rem; }
.gallery img { flex: 0 0 88%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius);
  scroll-snap-align: start; background: #1b1b20; box-shadow: var(--shadow); }

/* واترمارک محو لوگو پشت صفحه */
body::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url('../assets/logo.png') center / min(70vw, 560px) no-repeat; opacity: .045; }
#app, .navbar { position: relative; z-index: 1; }

/* موبایل */
@media (max-width: 576px) {
  .dealer-banner { padding: 1rem; }
  .dealer-logo { width: 64px; height: 64px; }
  .dealer-banner h4 { font-size: 1.15rem; }
}

/* استایل‌های فرم ورود انیمیشنی */
.login-wrapper {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  padding: 20px;
}
.glass-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(30px);
}
@keyframes slideUpFade {
  to { opacity: 1; transform: translateY(0); }
}
.glass-panel .form-control {
  border-radius: 10px;
  padding: 12px 15px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  transition: all 0.3s;
}
.glass-panel .form-control:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: #fff;
}
.glass-panel .btn-primary {
  border-radius: 10px;
  padding: 12px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

/* نقطه سبز آنلاین */
.pulse-dot {
  width: 10px;
  height: 10px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ═══ نمای موبایل ═══ */
html, body { overflow-x: hidden; }
#app { max-width: 100%; }
@media (max-width: 767px) {
  .navbar .container-fluid { flex-wrap: wrap; gap: .5rem; }
  .navbar-brand span { font-size: 1rem; }
  .navbar .btn { font-size: .78rem; padding: .3rem .6rem; }
  .dealer-banner { padding: .9rem; gap: .75rem !important; }
  .dealer-banner h4 { font-size: 1.05rem; }
  #filters { row-gap: .5rem; }
  #filters .form-control, #filters .form-select { font-size: .88rem; padding: .45rem .6rem; }
  #grid { --bs-gutter-x: .6rem; --bs-gutter-y: .6rem; }
  .car-card .thumb { height: 165px !important; }
  .car-card .card-body { padding: .6rem !important; }
  .car-card h6, .car-card .h6 { font-size: .9rem; }
  .price { font-size: .95rem; }
  .gallery img { flex: 0 0 92%; }
}
@media (max-width: 380px) {
  #grid > div { flex: 0 0 100%; max-width: 100%; }
}

/* ═══ تعرفه‌ها: ویرایشگر فرمول ═══ */
.var-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.var-chip { border: 1px solid var(--gold); background: #fffaf0; color: #7a5e1c; border-radius: 999px;
  padding: .25rem .65rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; cursor: pointer; }
.var-chip span { font-family: Vazirmatn, Tahoma, sans-serif; color: var(--muted); margin-right: .35rem; font-size: .75rem; }
.var-chip:hover { background: var(--gold); color: var(--ink); }
.formula-input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; }
.formula-view { direction: ltr; text-align: left; background: #0f0f12; color: #e9d48a; border-radius: .75rem;
  padding: .6rem .8rem; font-size: .85rem; white-space: pre-wrap; word-break: break-word; }
.formula-editor { border-top: 1px dashed #e4dccb; padding-top: .75rem; }
.kind-badge { background: #f1ead3; color: #7a5e1c; font-weight: 600; }
.kind-badge.kind-late_penalty, .kind-badge.kind-cancellation { background: #fde8e8; color: #9b1c1c; }
.kind-badge.kind-installment { background: #e6f0ff; color: #1e40af; }
.kind-badge.kind-profit, .kind-badge.kind-commission { background: #e8f7ee; color: #166534; }
.formula-result.text-success { color: #15803d !important; }
.formula-result.text-danger { color: #b91c1c !important; }

/* ═══ پنل مدیریتی کارکنان ═══ */
.admin-top { background: linear-gradient(120deg, #0b0b0c 0%, #1d1a12 100%); color: var(--gold-soft);
  padding: .9rem 1.1rem; border-bottom: 2px solid var(--gold); display: flex; flex-wrap: wrap;
  gap: .75rem; align-items: center; justify-content: space-between; position: sticky; top: 56px; z-index: 1040; }
.admin-brand { display: flex; align-items: center; gap: .6rem; }
.admin-brand small { display: block; color: #bfb07a; }
.admin-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--gold); color: var(--ink);
  display: grid; place-items: center; font-weight: 800; box-shadow: 0 0 0 3px #2a2412; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.admin-tab { color: #d9cf9b; text-decoration: none; padding: .38rem .8rem; border-radius: 999px;
  border: 1px solid #3a3420; font-size: .88rem; white-space: nowrap; transition: all .15s ease; }
.admin-tab i { margin-left: .25rem; }
.admin-tab:hover { border-color: var(--gold); color: var(--gold); }
.admin-tab.active { background: var(--gold); color: var(--ink); border-color: var(--gold); font-weight: 700; }
.admin-body { background: #f4f1e8; min-height: calc(100vh - 140px); padding: 1.1rem; }
.panel { background: #fff; border-radius: 1rem; box-shadow: var(--shadow); border: 1px solid #ece6d3; padding: 1.1rem; margin-bottom: 0; }
.panel-title { font-weight: 800; margin-bottom: .8rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.panel-title i { margin-left: .3rem; }
.kpi { background: #fff; border-radius: 1rem; padding: 1rem; box-shadow: var(--shadow); border: 1px solid #ece6d3;
  height: 100%; transition: transform .15s ease; }
.kpi:hover { transform: translateY(-2px); }
.kpi-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.25rem; flex: 0 0 46px; }
.kpi-label { color: var(--muted); font-size: .82rem; }
.kpi-val { font-size: 1.45rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.kpi-unit { font-size: .72rem; font-weight: 600; color: var(--muted); }
.tone-gold { background: #faf1d6; color: #9a7a2a; }
.tone-blue { background: #e6efff; color: #1d4ed8; }
.tone-dark { background: #e5e7eb; color: #111827; }
.tone-green { background: #e6f7ed; color: #15803d; }
.tone-amber { background: #fff4d6; color: #b45309; }
.tone-purple { background: #f0e8ff; color: #6d28d9; }
.tone-red { background: #fde7e7; color: #b91c1c; }
.chart-num { font-size: 13px; font-weight: 800; fill: #1c1c22; }
.chart-lbl { font-size: 12px; fill: #7a7567; }
.chart-sub { font-size: 10px; fill: #9b9482; }
.donut-num { font-size: 13px; font-weight: 800; fill: #1c1c22; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: .35rem; }
.bar-track { background: #efeadc; border-radius: 999px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #e9d48a, #b8912f); border-radius: 999px; transition: width .6s ease; }
.admin-table { --bs-table-bg: transparent; }
.admin-table thead th { background: #faf7ee; color: #6b6452; font-weight: 700; font-size: .85rem; border-bottom: 1px solid #ece6d3; }
.admin-table td { vertical-align: middle; }
.list-clean .list-group-item { border-color: #f0ebdd; }
.list-clean .btn-link { color: var(--ink); text-decoration: none; font-weight: 600; }
.list-clean .btn-link:hover { color: #9a7a2a; }
.jdate-msg { font-size: .75rem; color: var(--muted); margin-top: .15rem; min-height: 1em; }
.jdate-text.is-invalid { border-color: #dc3545; }
.jdate-text.is-valid { border-color: #22c55e; }
@media (max-width: 767px) {
  .admin-top { top: 0; }
  .admin-body { padding: .75rem; }
  .kpi-val { font-size: 1.2rem; }
}

/* ═══ مشتریان ═══ */
.cust-section { font-weight: 800; color: #7a5e1c; border-bottom: 1px dashed #e4dccb; padding-bottom: .3rem; margin-bottom: .6rem; font-size: .95rem; }
.cust-section i { margin-left: .3rem; color: var(--gold); }
.cust-tabs .nav-link { color: #6b6452; border-radius: 999px; border: 1px solid #e4dccb; background: #fff; }
.cust-tabs .nav-link.active { background: var(--ink); color: var(--gold-soft); border-color: var(--ink); }
.photo-thumb { width: 100%; max-width: 240px; aspect-ratio: 3/4; object-fit: cover; border-radius: 1rem; box-shadow: var(--shadow); background: #1b1b20; }
.photo-empty { width: 100%; max-width: 240px; aspect-ratio: 3/4; border: 2px dashed #e4dccb; border-radius: 1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); background: #fbfaf6; }
.photo-empty i { font-size: 2rem; margin-bottom: .4rem; }
.deal-card { border: 1px solid #ece6d3; border-radius: 1rem; padding: .9rem 1rem; margin-bottom: .75rem; background: #fff; }
.score-ring { width: 150px; height: 150px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  font-size: 2.4rem; font-weight: 800; color: var(--ink); border: 12px solid; }
.score-ring.score-success { border-color: #22c55e; background: #f0fdf4; }
.score-ring.score-warning { border-color: #f59e0b; background: #fffbeb; }
.score-ring.score-danger { border-color: #ef4444; background: #fef2f2; }
.score-ring.score-secondary { border-color: #cbd5e1; background: #f8fafc; color: var(--muted); }
.list-group.list-clean { display: none; }
tr.cRow { cursor: pointer; }
tr.cRow:hover td { background: #faf6e8; }

/* ═══ مدارک هویتی ═══ */
.doc-card { border: 1px solid #ece6d3; border-radius: 1rem; padding: .85rem 1rem; background: #fff; margin-bottom: .75rem; }
.doc-card .fw-bold i { color: var(--gold); margin-left: .3rem; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: .3rem 0; font-size: .92rem; }
.check-list li.ok { color: #15803d; }
.check-list li.todo { color: #6b6452; }
.check-list li i { margin-left: .35rem; }

/* ═══ ویزارد قرارداد ═══ */
.wz-steps { display: flex; flex-wrap: wrap; gap: .5rem; }
.wz-step { display: flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid #e4dccb; color: #6b6452; font-size: .9rem; }
.wz-step span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #efeadc; font-weight: 700; font-size: .8rem; }
.wz-step.active { background: var(--ink); color: var(--gold-soft); border-color: var(--ink); }
.wz-step.active span { background: var(--gold); color: var(--ink); }
.wz-step.done span { background: #22c55e; color: #fff; }
