/* =========================================================
   دیار — سامانه نوبت‌دهی خدمات پس از فروش
   پالت رنگی: زمینه خاکستری‌ـ‌آبی روشن + تیره ذغالی برای متن + نارنجی سوخته
   به‌عنوان رنگ عملیاتی (متفاوت از تراکوتای رایج generative UI).
   ========================================================= */

@font-face {
    font-family: 'Vazirmatn';
    src: local('Vazirmatn');
    font-display: swap;
}

:root{
    --bg:            #F3F5F8;
    --surface:       #FFFFFF;
    --surface-alt:   #EEF1F5;
    --ink:           #1B2430;
    --ink-muted:     #6B7684;
    --line:          #E1E5EA;
    --accent:        #E1592B;
    --accent-dark:   #B8451E;
    --accent-soft:   #FCE7DE;
    --success:       #2E9563;
    --danger:        #D64545;
    --radius:        10px;
    --shadow:        0 1px 2px rgba(20,24,31,.04), 0 6px 20px rgba(20,24,31,.05);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
    margin:0;
    background:var(--bg);
    color:var(--ink);
    font-family:'Vazirmatn','Tahoma',sans-serif;
    font-size:15px;
    line-height:1.9;
    direction:rtl;
}
a{ color:inherit; }

.app-shell{
    max-width:1180px;
    margin:0 auto;
    padding:28px 20px 60px;
}

/* ---------- هدر برند ---------- */
.brand-bar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding-bottom:22px;
    margin-bottom:22px;
    border-bottom:1px solid var(--line);
}
.brand-bar .brand-name{
    font-size:19px;
    font-weight:700;
    letter-spacing:.2px;
}
.brand-bar .brand-name span{ color:var(--accent); }
.brand-bar .brand-links{ display:flex; gap:18px; font-size:13.5px; }
.brand-bar .brand-links a{ color:var(--ink-muted); text-decoration:none; }
.brand-bar .brand-links a:hover{ color:var(--accent); }

/* ---------- استپر مراحل ---------- */
.stepper{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    margin-bottom:30px;
    position:relative;
}
.stepper::before{
    content:"";
    position:absolute;
    top:16px;
    right:6%;
    left:6%;
    height:1px;
    background:var(--line);
    z-index:0;
}
.step-item{
    position:relative;
    z-index:1;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:8px;
    flex:1;
    text-align:center;
}
.step-circle{
    width:34px; height:34px;
    border-radius:50%;
    background:var(--surface);
    border:1.5px solid var(--line);
    display:flex; align-items:center; justify-content:center;
    font-size:13px; font-weight:700;
    color:var(--ink-muted);
}
.step-item.is-done .step-circle{
    background:var(--success);
    border-color:var(--success);
    color:#fff;
}
.step-item.is-active .step-circle{
    background:var(--accent);
    border-color:var(--accent);
    color:#fff;
}
.step-item .step-label{
    font-size:12.5px;
    color:var(--ink-muted);
}
.step-item.is-active .step-label{ color:var(--ink); font-weight:700; }

/* ---------- کارت محتوا ---------- */
.card{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:26px;
    margin-bottom:20px;
}
.card h1, .card h2{
    margin-top:0;
    font-size:17px;
    font-weight:700;
}
.card p.lead{
    color:var(--ink-muted);
    font-size:14px;
}

.panel{
    background:var(--surface-alt);
    border-radius:var(--radius);
    padding:22px;
}

/* ---------- فرم‌ها ---------- */
.field{ margin-bottom:16px; }
.field label{
    display:block;
    font-size:13px;
    font-weight:700;
    margin-bottom:6px;
    color:var(--ink);
}
.field .hint{ font-size:12px; color:var(--ink-muted); margin-top:4px; }
.field .error{ font-size:12px; color:var(--danger); margin-top:4px; }

.input, select.input, textarea.input{
    width:100%;
    padding:10px 12px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
    font-family:inherit;
    font-size:14px;
    color:var(--ink);
    transition:border-color .15s;
}
.input:focus, select.input:focus, textarea.input:focus{
    outline:none;
    border-color:var(--accent);
    box-shadow:0 0 0 3px var(--accent-soft);
}
textarea.input{ resize:vertical; min-height:90px; }

.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.grid-3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:18px; }
@media (max-width:720px){
    .grid-2, .grid-3{ grid-template-columns:1fr; }
}

/* ---------- سوییچ ---------- */
.switch-row{ display:flex; align-items:center; gap:10px; margin-bottom:18px; }
.switch{ position:relative; width:42px; height:24px; flex:none; }
.switch input{ opacity:0; width:0; height:0; }
.switch .track{
    position:absolute; inset:0; background:var(--line); border-radius:999px; transition:.15s;
}
.switch .thumb{
    position:absolute; top:3px; right:3px; width:18px; height:18px; border-radius:50%;
    background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.25); transition:.15s;
}
.switch input:checked + .track{ background:var(--accent); }
.switch input:checked + .track + .thumb{ transform:translateX(-18px); }
.switch-row .switch-text{ font-size:13.5px; color:var(--ink-muted); }

/* ---------- دکمه‌ها ---------- */
.btn{
    display:inline-flex; align-items:center; justify-content:center; gap:6px;
    padding:11px 22px;
    border-radius:8px;
    font-size:14px;
    font-weight:700;
    border:1px solid transparent;
    cursor:pointer;
    text-decoration:none;
    transition:.15s background,.15s border-color,.15s color;
}
.btn-primary{ background:var(--accent); color:#fff; }
.btn-primary:hover{ background:var(--accent-dark); }
.btn-primary:disabled{ background:#e7b39d; cursor:not-allowed; }
.btn-ghost{ background:#fff; color:var(--ink); border-color:var(--line); }
.btn-ghost:hover{ border-color:var(--accent); color:var(--accent); }
.btn-sm{ padding:6px 14px; font-size:12.5px; }
.btn-block{ width:100%; }

.actions-row{
    display:flex; align-items:center; justify-content:space-between;
    margin-top:26px;
}

/* ---------- لیست قوانین ---------- */
.rules-list{ padding-inline-start:20px; margin:0; }
.rules-list li{ margin-bottom:10px; font-size:13.8px; color:#333; }
.rules-list li::marker{ color:var(--accent); }

/* ---------- جدول خلاصه ---------- */
.summary-table{ width:100%; border-collapse:collapse; }
.summary-table tr{ border-bottom:1px solid var(--line); }
.summary-table tr:last-child{ border-bottom:none; }
.summary-table td{ padding:11px 4px; font-size:14px; }
.summary-table td:first-child{ color:var(--ink-muted); width:38%; }
.summary-table td:last-child{ font-weight:700; text-align:left; }

/* ---------- تیکت کد رهگیری ---------- */
.ticket{
    text-align:center;
    padding:40px 24px;
}
.ticket .code{
    font-size:34px;
    font-weight:800;
    letter-spacing:2px;
    color:var(--accent-dark);
    background:var(--accent-soft);
    display:inline-block;
    padding:14px 34px;
    border-radius:12px;
    margin:16px 0;
    direction:ltr;
}
.ticket .ok-badge{
    width:52px; height:52px; border-radius:50%;
    background:var(--success); color:#fff;
    display:flex; align-items:center; justify-content:center;
    margin:0 auto 14px; font-size:26px;
}

/* ---------- روزها/ساعت‌ها ---------- */
.pill-grid{ display:flex; flex-wrap:wrap; gap:8px; }
.pill{
    border:1px solid var(--line);
    background:#fff;
    border-radius:8px;
    padding:9px 14px;
    font-size:13px;
    cursor:pointer;
    user-select:none;
}
.pill.is-selected{ background:var(--accent); border-color:var(--accent); color:#fff; }
.pill.is-disabled{ opacity:.4; cursor:not-allowed; }

/* ---------- جدول‌های داده (سوابق خودرو) ---------- */
.data-table{ width:100%; border-collapse:collapse; font-size:13.5px; }
.data-table th{
    background:var(--ink);
    color:#fff;
    padding:11px 10px;
    font-weight:700;
    text-align:center;
    white-space:nowrap;
}
.data-table td{
    padding:10px;
    text-align:center;
    border-bottom:1px solid var(--line);
    white-space:nowrap;
}
.data-table tbody tr:hover{ background:var(--surface-alt); }
.table-scroll{ overflow-x:auto; }

.kv-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px 24px;
    padding:20px 0;
    border-top:1px solid var(--line);
    border-bottom:1px solid var(--line);
    margin-bottom:20px;
}
@media (max-width:900px){ .kv-grid{ grid-template-columns:repeat(2,1fr); } }
.kv-grid .kv-label{ font-size:12px; color:var(--ink-muted); margin-bottom:4px; }
.kv-grid .kv-value{ font-size:14px; font-weight:700; }

/* ---------- Badge / وضعیت ---------- */
.badge{ display:inline-block; padding:3px 10px; border-radius:999px; font-size:11.5px; font-weight:700; }
.badge-success{ background:#E4F5EC; color:var(--success); }
.badge-warning{ background:#FDF1E5; color:#B26A16; }
.badge-danger{ background:#FBE9E9; color:var(--danger); }

/* ---------- پیام‌های سیستم ---------- */
.alert{ padding:12px 16px; border-radius:8px; font-size:13.5px; margin-bottom:18px; }
.alert-error{ background:#FBE9E9; color:#9E2B2B; border:1px solid #F3C6C6; }
.alert-success{ background:#E4F5EC; color:#1F6B44; border:1px solid #BEE6CF; }
.alert-info{ background:#EAF1FB; color:#1F4E8B; border:1px solid #C7DAF3; }

/* ---------- مودال ---------- */
.modal-backdrop{
    position:fixed; inset:0; background:rgba(15,18,24,.5);
    display:none; align-items:flex-start; justify-content:center;
    padding:40px 16px; z-index:50; overflow:auto;
}
.modal-backdrop.is-open{ display:flex; }
.modal{
    background:#fff; border-radius:12px; max-width:900px; width:100%;
    padding:24px; box-shadow:0 20px 50px rgba(0,0,0,.25);
}
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.modal-close{ background:none; border:none; font-size:20px; cursor:pointer; color:var(--ink-muted); }
.tabs{ display:flex; gap:6px; border-bottom:1px solid var(--line); margin-bottom:16px; }
.tab-btn{
    padding:9px 16px; font-size:13px; border:none; background:none; cursor:pointer;
    color:var(--ink-muted); border-bottom:2px solid transparent; font-family:inherit;
}
.tab-btn.is-active{ color:var(--accent); border-color:var(--accent); font-weight:700; }
.tab-panel{ display:none; }
.tab-panel.is-active{ display:block; }

.footer-note{
    text-align:center;
    color:var(--ink-muted);
    font-size:12px;
    margin-top:30px;
}

.spinner{
    display:inline-block; width:16px; height:16px; border-radius:50%;
    border:2px solid rgba(255,255,255,.5); border-top-color:#fff;
    animation:spin .7s linear infinite; vertical-align:middle;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
