@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

/* ════════════════════════════════════════
   DESIGN TOKENS
════════════════════════════════════════ */
:root {
    /* Brand */
    --primary:       #0056B3;
    --primary-h:     #1a72d4;
    --primary-dim:   rgba(0,86,179,.13);
    --primary-glow:  rgba(0,86,179,.3);

    /* Backgrounds — keep names for backward compat */
    --dark-1:  #0e0f13;
    --dark-2:  #161820;
    --dark-3:  #1e2029;
    --dark-4:  #262930;
    --dark-5:  #2f3240;

    /* Text */
    --light:     #cdd3e0;
    --light-dim: #6b7585;

    /* Borders */
    --border:   rgba(255,255,255,.07);
    --border-s: rgba(255,255,255,.13);

    /* Semantic colours */
    --success: #0fce9a;
    --danger:  #ff4d6d;
    --warning: #ffb347;
    --info:    #38c2ff;
    --purple:  #a78bfa;

    /* Sidebar */
    --sidebar-w: 258px;

    /* Radius */
    --r-xs: 5px;
    --r-sm: 8px;
    --r:    11px;
    --r-lg: 14px;
    --r-xl: 20px;

    /* Elevation */
    --sh-xs: 0 1px 3px rgba(0,0,0,.25);
    --sh-sm: 0 2px 8px rgba(0,0,0,.3);
    --sh:    0 4px 18px rgba(0,0,0,.35);
    --sh-lg: 0 8px 36px rgba(0,0,0,.45);
    --sh-blue: 0 4px 18px rgba(0,86,179,.28);
}

/* ════════════════════════════════════════
   RESET & BASE
════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    direction: rtl;
    background: var(--dark-1);
    color: var(--light);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'ss02';
}

a { color: var(--primary-h); text-decoration: none; transition: color .18s; }
a:hover { color: #5ab8ff; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--dark-2); }
::-webkit-scrollbar-thumb { background: var(--dark-5); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #3a3e50; }

/* ════════════════════════════════════════
   LAYOUT
════════════════════════════════════════ */
.layout { display: flex; min-height: 100vh; }

/* ════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--dark-2);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 100;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    background-image:
        radial-gradient(ellipse at 85% 15%, rgba(0,86,179,.08) 0%, transparent 55%),
        radial-gradient(ellipse at 15% 85%, rgba(0,86,179,.05) 0%, transparent 45%);
}

.sidebar-brand {
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(0,86,179,.1) 0%, transparent 70%);
}
.sidebar-brand .logo {
    display: flex; align-items: center; gap: 11px;
    font-size: 19px; font-weight: 800; color: #fff; letter-spacing: -.4px;
}
.logo-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, #0056B3 0%, #1a80e8 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; color: #fff;
    box-shadow: 0 4px 14px rgba(0,86,179,.45), inset 0 1px 0 rgba(255,255,255,.2);
}
.logo-asu  { color: #fff; }
.logo-svc  { color: #5ab8ff; }
.sidebar-brand small {
    display: block; font-size: 10.5px; color: var(--light-dim);
    margin-top: 5px; margin-right: 47px; font-weight: 400;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }

.nav-section {
    padding: 14px 16px 4px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(107,117,133,.7);
    font-weight: 700;
}

.nav-item a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px;
    color: var(--light-dim);
    font-size: 13px; font-weight: 500;
    transition: all .17s;
    position: relative;
    border-radius: 0;
}
.nav-item a:hover { color: var(--light); background: rgba(255,255,255,.04); }
.nav-item a.active {
    color: #fff; font-weight: 600;
    background: linear-gradient(90deg, rgba(0,86,179,.18) 0%, rgba(0,86,179,.04) 100%);
}
.nav-item a.active::after {
    content: ''; position: absolute; right: 0;
    top: 7px; bottom: 7px; width: 3px;
    background: linear-gradient(180deg, #1a80e8, #0056B3);
    border-radius: 3px 0 0 3px;
}
.nav-item a i {
    font-size: 15px; width: 19px; text-align: center;
    opacity: .65; transition: opacity .17s;
}
.nav-item a:hover i, .nav-item a.active i { opacity: 1; }
.nav-item a.active i { color: #5ab8ff; }

.nav-badge {
    margin-right: auto; background: var(--primary);
    color: #fff; font-size: 9px; font-weight: 700;
    padding: 2px 7px; border-radius: 99px;
}

.sidebar-footer {
    padding: 12px 16px; border-top: 1px solid var(--border);
    background: rgba(0,0,0,.15);
}
.user-info { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 33px; height: 33px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #0056B3, #1a80e8);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; color: #fff;
    box-shadow: 0 2px 8px rgba(0,86,179,.4);
}
.user-info .info strong { font-size: 12.5px; color: var(--light); font-weight: 700; display: block; }
.user-info .info small  { color: var(--light-dim); font-size: 10.5px; }

/* ════════════════════════════════════════
   MAIN AREA
════════════════════════════════════════ */
.main { margin-right: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    background: rgba(22,24,32,.92);
    border-bottom: 1px solid var(--border);
    padding: 11px 22px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.topbar-title { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -.2px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }

.content { padding: 22px; flex: 1; }

/* ════════════════════════════════════════
   CARDS
════════════════════════════════════════ */
.card {
    background: var(--dark-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: border-color .2s;
}
.card:hover { border-color: var(--border-s); }

.card-header {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 700; font-size: 13px; color: #e0e4f0;
    background: linear-gradient(180deg, rgba(255,255,255,.025) 0%, transparent 100%);
    gap: 8px; flex-wrap: wrap;
}
.card-body { padding: 18px; }

/* ════════════════════════════════════════
   STAT CARDS
════════════════════════════════════════ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--dark-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px;
    display: flex; align-items: center; gap: 14px;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    cursor: default;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-s); box-shadow: var(--sh); }

.stat-icon {
    width: 46px; height: 46px; border-radius: var(--r);
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; flex-shrink: 0;
}
.stat-icon.blue   { background: linear-gradient(135deg,rgba(0,86,179,.28),rgba(0,86,179,.1));    color: #5ab8ff;       box-shadow: 0 4px 12px rgba(0,86,179,.22); }
.stat-icon.green  { background: linear-gradient(135deg,rgba(15,206,154,.28),rgba(15,206,154,.1)); color: var(--success); box-shadow: 0 4px 12px rgba(15,206,154,.2); }
.stat-icon.red    { background: linear-gradient(135deg,rgba(255,77,109,.28),rgba(255,77,109,.1)); color: var(--danger);  box-shadow: 0 4px 12px rgba(255,77,109,.2); }
.stat-icon.yellow { background: linear-gradient(135deg,rgba(255,179,71,.28),rgba(255,179,71,.1)); color: var(--warning); box-shadow: 0 4px 12px rgba(255,179,71,.2); }
.stat-icon.cyan   { background: linear-gradient(135deg,rgba(56,194,255,.28),rgba(56,194,255,.1)); color: var(--info);    box-shadow: 0 4px 12px rgba(56,194,255,.2); }
.stat-icon.purple { background: linear-gradient(135deg,rgba(167,139,250,.28),rgba(167,139,250,.1)); color: var(--purple); box-shadow: 0 4px 12px rgba(167,139,250,.2); }

.stat-val   { font-size: 27px; font-weight: 800; color: #fff; line-height: 1; letter-spacing: -1px; }
.stat-label { font-size: 11.5px; color: var(--light-dim); margin-top: 4px; font-weight: 500; }

/* ════════════════════════════════════════
   TABLES
════════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead th {
    background: rgba(255,255,255,.025);
    padding: 10px 14px;
    font-size: 10px; text-transform: uppercase; letter-spacing: .9px;
    color: var(--light-dim); font-weight: 700; text-align: right;
    white-space: nowrap; border-bottom: 1px solid var(--border);
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .14s; }
tbody tr:hover td { background: rgba(255,255,255,.025); }

/* ════════════════════════════════════════
   BADGES
════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 9px; border-radius: 99px;
    font-size: 11px; font-weight: 600; border: 1px solid transparent;
}
.badge-success  { background: rgba(15,206,154,.1);   color: var(--success); border-color: rgba(15,206,154,.22); }
.badge-danger   { background: rgba(255,77,109,.1);   color: var(--danger);  border-color: rgba(255,77,109,.22); }
.badge-warning  { background: rgba(255,179,71,.1);   color: var(--warning); border-color: rgba(255,179,71,.22); }
.badge-info     { background: rgba(56,194,255,.1);   color: var(--info);    border-color: rgba(56,194,255,.22); }
.badge-primary  { background: rgba(0,86,179,.14);    color: #5ab8ff;        border-color: rgba(0,86,179,.28); }
.badge-secondary{ background: rgba(255,255,255,.05); color: var(--light-dim); border-color: var(--border); }
.badge-dark     { background: rgba(255,255,255,.06); color: var(--light);   border-color: var(--border-s); }

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--r-sm);
    border: 1px solid transparent;
    font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .18s;
    white-space: nowrap; line-height: 1.4;
    position: relative; overflow: hidden;
}
.btn::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(255,255,255,0); transition: background .18s;
    pointer-events: none;
}
.btn:hover::after { background: rgba(255,255,255,.05); }
.btn:active { transform: scale(.97); }

.btn-primary {
    background: linear-gradient(135deg, #0056B3 0%, #1a72d4 100%);
    color: #fff; border-color: rgba(255,255,255,.1);
    box-shadow: 0 2px 10px rgba(0,86,179,.35), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover { box-shadow: 0 4px 18px rgba(0,86,179,.5), inset 0 1px 0 rgba(255,255,255,.15); transform: translateY(-1px); }

.btn-success { background: var(--success); color: #071a14; border-color: transparent; }
.btn-danger  { background: var(--danger);  color: #fff;    border-color: transparent; }
.btn-danger:hover { background: #ff3355; }
.btn-warning { background: var(--warning); color: #1a1200; border-color: transparent; }

.btn-secondary { background: var(--dark-3); color: var(--light); border-color: var(--border-s); }
.btn-secondary:hover { background: var(--dark-4); }

.btn-outline {
    background: transparent; border: 1px solid var(--border-s);
    color: var(--light-dim);
}
.btn-outline:hover { background: var(--dark-3); color: var(--light); }

.btn-sm  { padding: 5px 11px; font-size: 12px; border-radius: var(--r-xs); }
.btn-lg  { padding: 11px 24px; font-size: 14px; border-radius: var(--r); }
.btn-icon{ padding: 7px; border-radius: var(--r-sm); }

/* ════════════════════════════════════════
   FORMS
════════════════════════════════════════ */
.form-group  { margin-bottom: 16px; }
.form-label  { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--light); }
.form-label.required::after { content: ' *'; color: var(--danger); }

.form-control, .form-select {
    width: 100%; padding: 9px 13px;
    background: rgba(255,255,255,.04);
    border: 1.5px solid rgba(255,255,255,.09);
    border-radius: var(--r-sm);
    color: var(--light);
    font-family: inherit; font-size: 13.5px;
    transition: border-color .18s, box-shadow .18s, background .18s;
    -webkit-appearance: none;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0,86,179,.05);
    box-shadow: 0 0 0 3px rgba(0,86,179,.18);
}
.form-control::placeholder { color: rgba(107,117,133,.6); }
textarea.form-control { min-height: 86px; resize: vertical; line-height: 1.7; }
.form-hint { font-size: 11px; color: var(--light-dim); margin-top: 4px; }

.input-group { display: flex; }
.input-group .form-control { border-radius: var(--r-sm) 0 0 var(--r-sm); flex: 1; }
.input-group .btn { border-radius: 0 var(--r-sm) var(--r-sm) 0; border-right: none; }
.input-group .btn + .btn { border-right: none; border-radius: 0; }
.input-group .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.form-row        { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ════════════════════════════════════════
   ALERTS
════════════════════════════════════════ */
.alert {
    padding: 11px 16px; border-radius: var(--r-sm); margin-bottom: 16px;
    font-size: 13px; display: flex; align-items: center; gap: 10px;
    border: 1px solid;
}
.alert-success { background: rgba(15,206,154,.07); border-color: rgba(15,206,154,.22); color: var(--success); }
.alert-danger  { background: rgba(255,77,109,.07);  border-color: rgba(255,77,109,.22);  color: var(--danger); }
.alert-warning { background: rgba(255,179,71,.07);  border-color: rgba(255,179,71,.22);  color: var(--warning); }
.alert-info    { background: rgba(56,194,255,.07);  border-color: rgba(56,194,255,.22);  color: var(--info); }

/* ════════════════════════════════════════
   PAGINATION
════════════════════════════════════════ */
.pagination { display: flex; gap: 4px; justify-content: center; padding: 14px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 10px;
    background: var(--dark-3); color: var(--light-dim);
    border: 1px solid var(--border); border-radius: 7px;
    font-size: 13px; font-weight: 600; transition: all .15s;
}
.pagination .current { background: var(--primary); color: #fff; border-color: transparent; box-shadow: var(--sh-blue); }
.pagination a:hover { background: var(--dark-4); color: var(--light); }

/* ════════════════════════════════════════
   MODAL
════════════════════════════════════════ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.65); z-index: 200;
    align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: var(--dark-2); border: 1px solid var(--border-s);
    border-radius: var(--r-xl); width: 90%; max-width: 520px;
    max-height: 88vh; overflow-y: auto;
    box-shadow: var(--sh-lg);
    animation: modalIn .22s cubic-bezier(.34,1.5,.64,1);
}
@keyframes modalIn { from{opacity:0;transform:scale(.94)} to{opacity:1;transform:scale(1)} }
.modal-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 700; font-size: 14px; color: #fff;
}
.modal-body   { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close  { background: none; border: none; color: var(--light-dim); cursor: pointer; font-size: 18px; padding: 3px 5px; border-radius: 5px; transition: all .15s; }
.modal-close:hover { color: var(--light); background: var(--dark-3); }

/* ════════════════════════════════════════
   SCANNER
════════════════════════════════════════ */
#scanner-video { width: 100%; border-radius: var(--r); border: 2px solid var(--primary); }
#scanner-viewport { position: relative; }
#scanner-viewport canvas { position: absolute; top: 0; left: 0; }
.scan-line {
    position: absolute; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scanMove 2s ease-in-out infinite;
}
@keyframes scanMove { 0%,100%{top:10%} 50%{top:87%} }

/* ════════════════════════════════════════
   STATUS TIMELINE
════════════════════════════════════════ */
.status-timeline { display: flex; align-items: center; flex-wrap: wrap; }
.status-step { display: flex; flex-direction: column; align-items: center; position: relative; flex: 1; min-width: 60px; }
.status-step:not(:last-child)::before {
    content: ''; position: absolute;
    top: 13px; left: calc(-50% + 13px); right: calc(50% + 13px);
    height: 2px; background: var(--border); z-index: 0;
}
.status-step.done:not(:last-child)::before {
    background: linear-gradient(90deg, var(--primary), var(--primary-h));
}
.step-dot {
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid var(--border); background: var(--dark-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; position: relative; z-index: 1;
    transition: all .2s;
}
.status-step.done .step-dot   { border-color: var(--primary);   background: var(--primary);           color: #fff; }
.status-step.active .step-dot { border-color: var(--warning); background: rgba(255,179,71,.15);  animation: pulseStep 1.5s infinite; }
.status-step label { font-size: 10px; margin-top: 5px; color: var(--light-dim); text-align: center; }
.status-step.done label, .status-step.active label { color: var(--light); }
@keyframes pulseStep { 0%,100%{box-shadow:0 0 0 0 rgba(255,179,71,.4)} 50%{box-shadow:0 0 0 7px rgba(255,179,71,0)} }

/* ════════════════════════════════════════
   SEARCH BOX
════════════════════════════════════════ */
.search-box { position: relative; }
.search-box i { position: absolute; top: 50%; transform: translateY(-50%); right: 11px; color: var(--light-dim); font-size: 13px; pointer-events: none; }
.search-box input { padding-right: 34px; }

/* ════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════ */
.empty-state { text-align: center; padding: 44px 20px; color: var(--light-dim); }
.empty-state i { font-size: 42px; margin-bottom: 12px; display: block; opacity: .3; }
.empty-state p { font-size: 13px; }

/* ════════════════════════════════════════
   PUBLIC PAGE
════════════════════════════════════════ */
.public-page { min-height: 100vh; background: var(--dark-1); display: flex; flex-direction: column; }

.public-header {
    background: rgba(22,24,32,.88);
    border-bottom: 1px solid var(--border);
    padding: 13px 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.public-header .brand { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -.3px; }
.public-header .brand span { color: #5ab8ff; }

.check-hero {
    padding: 60px 20px 36px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}
.check-hero h1 { font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 10px; letter-spacing: -.5px; }
.check-hero p  { color: var(--light-dim); margin-bottom: 28px; font-size: 14.5px; line-height: 1.85; }

.check-form {
    display: flex; gap: 4px;
    background: var(--dark-2);
    border: 1.5px solid var(--border-s);
    border-radius: 99px;
    padding: 5px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.05);
}
.check-form input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--light); font-family: inherit; font-size: 14px;
    padding: 9px 14px;
}
.check-form input::placeholder { color: rgba(107,117,133,.65); }
.check-form .btn { border-radius: 99px; padding: 9px 22px; }

/* ── Result Card ── */
.result-card {
    background: var(--dark-2); border: 1px solid var(--border-s);
    border-radius: var(--r-xl); overflow: hidden; margin-top: 26px;
    box-shadow: var(--sh);
    animation: resultIn .38s cubic-bezier(.34,1.2,.64,1);
}
@keyframes resultIn { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeIn   { from{opacity:0;transform:translateY(8px)}  to{opacity:1;transform:translateY(0)} }

.result-header { padding: 20px; display: flex; align-items: center; gap: 16px; }
.result-icon {
    width: 52px; height: 52px; border-radius: var(--r-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.result-icon.active  { background: linear-gradient(135deg,rgba(15,206,154,.2),rgba(15,206,154,.07));  color: var(--success); box-shadow: 0 4px 14px rgba(15,206,154,.2); }
.result-icon.expired { background: linear-gradient(135deg,rgba(255,77,109,.2),rgba(255,77,109,.07));  color: var(--danger);  box-shadow: 0 4px 14px rgba(255,77,109,.2); }
.result-icon.pending { background: linear-gradient(135deg,rgba(255,179,71,.2),rgba(255,179,71,.07));  color: var(--warning); box-shadow: 0 4px 14px rgba(255,179,71,.2); }

.result-header h2 { font-size: 16.5px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.result-header p  { font-size: 13px; color: var(--light-dim); }

.result-body { padding: 0 20px 20px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.result-field label { font-size: 10.5px; color: var(--light-dim); font-weight: 500; }
.result-field span  { display: block; font-weight: 600; color: var(--light); margin-top: 2px; font-size: 13.5px; }

.progress-bar-wrap { background: rgba(255,255,255,.06); border-radius: 99px; height: 7px; overflow: hidden; }
.progress-bar-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--primary), var(--primary-h));
    transition: width .7s cubic-bezier(.4,0,.2,1);
}

/* ════════════════════════════════════════
   PRINT
════════════════════════════════════════ */
@media print {
    body, .print-area { background: #fff !important; color: #000 !important; font-family: 'Vazirmatn', sans-serif; direction: rtl; }
    .no-print { display: none !important; }
    .print-area { max-width: 80mm; margin: 0 auto; padding: 10px; }
    .print-header { text-align: center; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
    .print-header h2 { font-size: 14px; margin-bottom: 3px; }
    .print-header p  { font-size: 10px; color: #444; }
    .print-ticket-num { font-size: 20px; font-weight: 800; text-align: center; margin: 6px 0; }
    .print-section { margin-bottom: 8px; border-bottom: 1px dashed #ccc; padding-bottom: 8px; }
    .print-row { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 3px; }
    .print-desc { font-size: 11px; line-height: 1.6; margin: 4px 0; }
    .print-sign { display: flex; justify-content: space-between; margin-top: 20px; }
    .print-sign div { text-align: center; width: 40%; }
    .print-sign .sign-line { border-top: 1px solid #000; padding-top: 5px; font-size: 10px; margin-top: 25px; }
    .print-terms { font-size: 9px; color: #666; margin-top: 8px; border-top: 1px solid #ccc; padding-top: 6px; line-height: 1.8; }
}

/* ════════════════════════════════════════
   GRID UTILITIES
════════════════════════════════════════ */
.g2        { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.g-split   { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.g-split-sm{ display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.g-info    { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.g-info-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 10px; }

/* ════════════════════════════════════════
   SIDEBAR BACKDROP
════════════════════════════════════════ */
.sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.58); z-index: 99;
    backdrop-filter: blur(3px);
    animation: fadeBackdrop .24s ease;
}
@keyframes fadeBackdrop { from{opacity:0} to{opacity:1} }
.sidebar-backdrop.show { display: block; }

/* ════════════════════════════════════════
   MOBILE BOTTOM NAV
════════════════════════════════════════ */
.mobile-bottom-nav {
    display: none; position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(22,24,32,.96);
    border-top: 1px solid var(--border);
    z-index: 50; padding: 6px 0 env(safe-area-inset-bottom, 6px);
    backdrop-filter: blur(16px);
}
.mobile-bottom-nav .nav-items { display: flex; justify-content: space-around; }
.mobile-bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 18px; color: var(--light-dim);
    font-size: 10px; font-weight: 600; border-radius: var(--r-sm);
    transition: color .18s;
}
.mobile-bottom-nav a i { font-size: 19px; }
.mobile-bottom-nav a.active, .mobile-bottom-nav a:hover { color: var(--primary-h); }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 900px) {
    .g2 { grid-template-columns: 1fr; }
    .g-split, .g-split-sm { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Sidebar off-canvas */
    .sidebar { transform: translateX(110%); z-index: 200; }
    .sidebar.open { transform: translateX(0); box-shadow: -4px 0 32px rgba(0,0,0,.55); }
    .main { margin-right: 0; }

    /* Always show hamburger */
    #menu-toggle { display: flex !important; }

    .topbar { padding: 10px 14px; }
    .topbar-title { font-size: 14px; }
    .topbar-date  { display: none; }

    .content { padding: 12px; }
    .card-body { padding: 14px; }

    /* All grids → single column */
    .g2, .g-split, .g-split-sm, .g-info, .g-info-3 { grid-template-columns: 1fr !important; }
    .form-row, .form-row.cols-3 { grid-template-columns: 1fr; }

    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 14px; }
    .stat-icon { width: 40px; height: 40px; font-size: 16px; }
    .stat-val  { font-size: 22px; }

    table { min-width: 540px; }
    thead th, tbody td { padding: 9px 10px; font-size: 12px; }

    .form-control, .form-select { font-size: 14px; padding: 10px 13px; }

    /* Modal → bottom sheet */
    .modal-overlay { align-items: flex-end; }
    .modal-box {
        width: 100%; max-width: 100%;
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        max-height: 90vh; margin: 0;
        animation: sheetIn .3s cubic-bezier(.4,0,.2,1);
    }
    @keyframes sheetIn { from{transform:translateY(100%)} to{transform:translateY(0)} }

    /* Timeline */
    .status-step { min-width: 52px; }
    .step-dot { width: 22px; height: 22px; font-size: 10px; }
    .status-step label { font-size: 9px; }

    /* Public pages */
    .check-hero { padding: 28px 0 20px; }
    .check-hero h1 { font-size: 22px; }
    .check-form { border-radius: var(--r-lg); }
    .check-form input { font-size: 13px; }
    .result-header { padding: 14px; gap: 12px; }
    .result-icon { width: 44px; height: 44px; font-size: 18px; }
    .result-header h2 { font-size: 15px; }
    .result-body { padding: 0 14px 14px; }

    .features { grid-template-columns: 1fr 1fr; gap: 10px; }
    .mobile-bottom-nav { display: block; }
    .public-page { padding-bottom: 66px; }
    .public-header { padding: 11px 16px; }
}

@media (max-width: 480px) {
    .stat-grid    { grid-template-columns: 1fr 1fr; }
    .result-grid  { grid-template-columns: 1fr; }
    .features     { grid-template-columns: 1fr; }
    .check-hero h1{ font-size: 20px; }
    .content      { padding: 10px; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
}
