
:root{
  --bg:#f5f7fb;
  --surface:#ffffff;
  --surface-2:#f8fafc;
  --text:#172033;
  --muted:#6b7280;
  --border:#e6eaf0;
  --primary:#2563eb;
  --primary-dark:#1d4ed8;
  --success:#16a34a;
  --warning:#d97706;
  --danger:#dc2626;
  --info:#0891b2;
  --shadow:0 8px 30px rgba(15,23,42,.06);
  --radius:16px;
  --sidebar:250px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
a{text-decoration:none;color:inherit}
img{max-width:100%;display:block}
.app{min-height:100vh}
.sidebar{position:fixed;left:0;top:0;bottom:0;width:var(--sidebar);background:#fff;border-right:1px solid var(--border);padding:22px 16px;z-index:50;display:flex;flex-direction:column}
.brand{display:flex;align-items:center;gap:11px;padding:3px 10px 25px;font-weight:800;font-size:20px}
.brand-mark{width:38px;height:38px;border-radius:12px;background:var(--primary);color:#fff;display:grid;place-items:center;font-size:19px;box-shadow:0 8px 18px rgba(37,99,235,.22)}
.nav{display:flex;flex-direction:column;gap:5px}
.nav a{display:flex;align-items:center;gap:12px;padding:12px 13px;border-radius:11px;color:#566074;font-size:14px;font-weight:600}
.nav a:hover,.nav a.active{background:#eff6ff;color:var(--primary)}
.nav-icon{width:20px;text-align:center;font-size:16px}
.sidebar-bottom{margin-top:auto;border-top:1px solid var(--border);padding-top:14px}
.main{margin-left:var(--sidebar);min-height:100vh}
.topbar{height:72px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:30}
.topbar-left{display:flex;align-items:center;gap:12px}
.menu-toggle{display:none;border:0;background:transparent;font-size:22px}
.page{padding:28px;max-width:1500px;margin:auto}
.page-title{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:24px}
.page-title h1{font-size:25px;margin:0 0 5px}
.page-title p{margin:0;color:var(--muted);font-size:14px}
.actions{display:flex;gap:9px;flex-wrap:wrap}
.btn{border:1px solid var(--border);background:#fff;color:var(--text);padding:10px 15px;border-radius:10px;font-weight:700;font-size:13px;display:inline-flex;align-items:center;justify-content:center;gap:7px;transition:.18s}
.btn:hover{transform:translateY(-1px);box-shadow:0 6px 16px rgba(15,23,42,.07)}
.btn-primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dark)}
.btn-danger{background:#fff;border-color:#fecaca;color:var(--danger)}
.btn-success{background:#15803d;border-color:#15803d;color:#fff}
.btn-sm{padding:7px 10px;font-size:12px}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin-bottom:22px}
.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow)}
.stat-top{display:flex;align-items:center;justify-content:space-between}
.stat-label{font-size:13px;color:var(--muted);font-weight:600}
.stat-icon{width:38px;height:38px;border-radius:11px;background:#eff6ff;color:var(--primary);display:grid;place-items:center}
.stat-value{font-size:27px;font-weight:800;margin-top:12px}
.stat-note{font-size:12px;color:var(--muted);margin-top:4px}
.grid-2{display:grid;grid-template-columns:1.5fr 1fr;gap:18px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.card{background:#fff;border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
.card-head{padding:17px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:10px}
.card-head h2,.card-head h3{margin:0;font-size:16px}
.card-body{padding:18px}
.muted{color:var(--muted)}
.small{font-size:12px}
.badge{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:800}
.badge-success{background:#ecfdf3;color:#15803d}
.badge-danger{background:#fef2f2;color:#b91c1c}
.badge-warning{background:#fff7ed;color:#c2410c}
.badge-info{background:#ecfeff;color:#0e7490}
.badge-neutral{background:#f1f5f9;color:#475569}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;min-width:650px}
th,td{padding:13px 14px;border-bottom:1px solid var(--border);text-align:left;font-size:13px}
th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#556070;background:#fafbfc}
tr:last-child td{border-bottom:0}
.car-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.car-card{background:#fff;border:1px solid var(--border);border-radius:16px;overflow:hidden;box-shadow:var(--shadow);transition:.18s}
.car-card:hover{transform:translateY(-2px);box-shadow:0 14px 35px rgba(15,23,42,.09)}
.car-img{height:155px;background:#eef2f7;position:relative;overflow:hidden}
.car-img img{width:100%;height:100%;object-fit:cover}
.car-status{position:absolute;top:11px;right:11px}
.car-content{padding:15px}
.car-title{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.car-title h3{margin:0;font-size:16px}
.car-meta{color:var(--muted);font-size:12px;margin-top:4px}
.car-specs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:15px 0}
.spec{background:var(--surface-2);border-radius:9px;padding:9px}
.spec span{display:block;color:var(--muted);font-size:12px}
.spec strong{font-size:12px}
.car-footer{border-top:1px solid var(--border);padding-top:12px;display:flex;justify-content:space-between;align-items:center}
.price{font-weight:800}
.filterbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:17px}
.search{position:relative;min-width:230px;flex:1}
.search input{padding-left:38px}
.search-icon{position:absolute;left:13px;top:11px;color:#9aa2b1}
input,select,textarea{width:100%;border:1px solid #dfe4eb;background:#fff;color:var(--text);border-radius:10px;padding:10px 11px;outline:none}
input:focus,select:focus,textarea:focus{border-color:#93b4ff;box-shadow:0 0 0 3px rgba(37,99,235,.08)}
textarea{resize:vertical;min-height:90px}
label{font-size:12px;font-weight:700;color:#4b5563;display:block;margin-bottom:6px}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:15px}
.form-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}
.field.full{grid-column:1/-1}
.form-section{margin-bottom:23px}
.form-section h3{font-size:15px;margin:0 0 13px}
.required{color:var(--danger)}
.upload-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.upload-box{border:1.5px dashed #cbd5e1;border-radius:13px;background:#fafcff;min-height:145px;padding:10px;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.upload-box input{display:none}
.upload-icon{font-size:24px;margin-bottom:7px}
.upload-label{font-size:12px;font-weight:800}
.upload-hint{font-size:12px;color:var(--muted);margin-top:4px}
.preview-img{width:100%;height:100px;object-fit:cover;border-radius:9px;margin-bottom:7px}
.file-remove{position:absolute;top:7px;right:7px;width:24px;height:24px;border-radius:50%;border:0;background:#fff;color:var(--danger);box-shadow:0 3px 10px rgba(0,0,0,.12)}
.form-actions{display:flex;justify-content:flex-end;gap:9px;border-top:1px solid var(--border);padding-top:18px}
.alert{padding:12px 14px;border-radius:11px;font-size:13px;display:flex;gap:10px;align-items:flex-start}
.alert-warning{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa}
.alert-success{background:#ecfdf3;color:#166534;border:1px solid #bbf7d0}
.maintenance-list{display:flex;flex-direction:column;gap:10px}
.maintenance-item{border:1px solid var(--border);border-radius:12px;padding:13px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.maintenance-item strong{font-size:13px}
.progress{height:7px;background:#edf1f6;border-radius:99px;overflow:hidden;margin-top:8px}
.progress span{display:block;height:100%;background:var(--primary);border-radius:99px}
.kv{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.kv-item{background:var(--surface-2);padding:12px;border-radius:10px}
.kv-item span{display:block;color:var(--muted);font-size:12px}
.kv-item strong{font-size:13px;display:block;margin-top:3px}
.detail-header{display:flex;gap:20px;align-items:center}
.detail-car-img{width:145px;height:100px;border-radius:13px;object-fit:cover;background:#eef2f7}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);margin-bottom:18px;overflow:auto}
.tab{border:0;background:transparent;padding:11px 13px;color:var(--muted);font-weight:700;font-size:13px;white-space:nowrap;border-bottom:2px solid transparent}
.tab.active{color:var(--primary);border-bottom-color:var(--primary)}
.empty{text-align:center;padding:45px 20px;color:var(--muted)}
.toast{position:fixed;right:20px;bottom:20px;z-index:100;background:#172033;color:#fff;padding:12px 16px;border-radius:11px;box-shadow:0 12px 30px rgba(0,0,0,.18);font-size:13px;display:none}
.toast.show{display:block;animation:toast .25s ease}
@keyframes toast{from{transform:translateY(8px);opacity:0}to{transform:none;opacity:1}}
.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.45);display:none;align-items:center;justify-content:center;padding:18px;z-index:90}
.modal-backdrop.open{display:flex}
.modal{background:#fff;border-radius:17px;width:min(680px,100%);max-height:90vh;overflow:auto;box-shadow:0 25px 80px rgba(0,0,0,.22)}
.modal-head{padding:17px 19px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}
.modal-head h3{margin:0;font-size:16px}
.modal-body{padding:19px}
.close{border:0;background:#f1f5f9;width:31px;height:31px;border-radius:9px;font-size:17px}
.photo-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.photo-strip img{height:95px;width:100%;object-fit:cover;border-radius:9px;background:#eef2f7}
.customer-avatar{width:38px;height:38px;border-radius:50%;background:#e0ecff;color:var(--primary);display:grid;place-items:center;font-weight:800}
.person{display:flex;align-items:center;gap:10px}
.divider{height:1px;background:var(--border);margin:18px 0}
.mobile-only{display:none}
@media(max-width:1100px){
  .car-grid{grid-template-columns:repeat(2,1fr)}
  .stats{grid-template-columns:repeat(2,1fr)}
  .upload-grid{grid-template-columns:repeat(2,1fr)}
  .grid-2{grid-template-columns:1fr}
}
@media(max-width:760px){
  .sidebar{transform:translateX(-100%);transition:.22s;box-shadow:15px 0 40px rgba(15,23,42,.12)}
  .sidebar.open{transform:translateX(0)}
  .main{margin-left:0}
  .menu-toggle{display:block}
  .mobile-only{display:block}
  .topbar{padding:0 15px}
  .page{padding:18px 14px}
  .page-title{align-items:flex-start;flex-direction:column}
  .page-title h1{font-size:22px}
  .stats{grid-template-columns:1fr 1fr;gap:10px}
  .stat{padding:14px}
  .stat-value{font-size:23px}
  .car-grid{grid-template-columns:1fr}
  .form-grid,.form-grid-3{grid-template-columns:1fr}
  .upload-grid{grid-template-columns:1fr 1fr}
  .kv{grid-template-columns:1fr}
  .detail-header{align-items:flex-start;flex-direction:column}
  .detail-car-img{width:100%;height:170px}
  .grid-3{grid-template-columns:1fr}
  .filterbar{flex-direction:column}
  .search{min-width:0}
}
@media(max-width:430px){
  .stats{grid-template-columns:1fr 1fr}
  .upload-grid{grid-template-columns:1fr}
  .form-actions{flex-direction:column}
  .form-actions .btn{width:100%}
}
/* Authentication + AuroraS Super Admin */
.auth-page{min-height:100vh;background:linear-gradient(135deg,#f5f7fb 0%,#eaf1ff 100%);display:flex;align-items:center;justify-content:center;padding:24px}
.auth-wrap{width:100%;max-width:440px}.auth-card{background:#fff;border:1px solid var(--border);border-radius:22px;padding:32px;box-shadow:0 20px 60px rgba(15,23,42,.10)}
.auth-brand{display:flex;align-items:center;gap:12px;margin-bottom:32px}.auth-brand strong{display:block;font-size:20px}.auth-brand span{display:block;color:var(--muted);font-size:12px;margin-top:2px}.auth-heading{margin-bottom:23px}.auth-heading h1{margin:0 0 7px;font-size:27px}.auth-heading p{margin:0;color:var(--muted);font-size:14px}.auth-card form{display:flex;flex-direction:column;gap:17px}.auth-password{position:relative}.auth-password input{padding-right:62px}.auth-password button{position:absolute;right:8px;bottom:8px;border:0;background:transparent;color:var(--primary);font-size:11px;font-weight:800}.auth-row{display:flex;justify-content:space-between;align-items:center;font-size:12px}.auth-row a{color:var(--primary);font-weight:700}.check{margin:0;display:flex;align-items:center;gap:7px;font-weight:600;color:var(--muted)}.check input{width:auto}.auth-submit{width:100%;padding:13px;margin-top:2px}.demo-note{background:#f8fafc;border:1px solid var(--border);border-radius:11px;padding:11px 13px;margin-top:18px;font-size:11px;color:var(--muted);line-height:1.55}.demo-note strong{color:var(--text)}.auth-footer{text-align:center;color:#9aa2b1;font-size:11px;margin-top:22px}.admin-auth{background:linear-gradient(135deg,#eef2ff 0%,#f8fafc 100%)}.admin-mark{background:#172033!important;box-shadow:0 8px 18px rgba(23,32,51,.18)!important}.admin-label{font-size:10px;color:#9aa2b1;font-weight:800;letter-spacing:.12em;padding:0 13px 9px}.admin-sidebar .nav a.active{background:#eef2ff;color:#172033}.admin-user{display:flex;align-items:center;gap:9px}.admin-app .stat-icon{background:#f1f5f9;color:#172033}.admin-app .progress span{background:#172033}
@media(max-width:500px){.auth-page{padding:14px}.auth-card{padding:24px 20px;border-radius:18px}.auth-heading h1{font-size:24px}.admin-user>div:last-child{display:none}}

/* ===== Additions for the working PHP version (the original design above is unchanged) ===== */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
:focus-visible{outline:3px solid rgba(37,99,235,.45);outline-offset:2px}
.btn[disabled],.btn:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:none}
.field-error{color:var(--danger);font-size:12px;margin-top:5px;font-weight:600}
.form-hint{color:var(--muted);font-size:12px;margin-top:5px}
input[readonly],input:disabled{background:#f3f5f9;color:#4b5563}
.alert{display:block;line-height:1.55;margin-bottom:16px}
.alert-danger{background:#fef2f2;color:#991b1b;border:1px solid #fecaca}
.alert-info{background:#ecfeff;color:#155e75;border:1px solid #a5f3fc}
.nav-logout{display:flex;align-items:center;gap:12px;width:100%;padding:12px 13px;border:0;background:transparent;border-radius:11px;color:#566074;font-size:14px;font-weight:600;text-align:left}
.nav-logout:hover{background:#fef2f2;color:var(--danger)}
.sidebar-user{padding:12px 13px 0;line-height:1.5}
.sidebar-scrim{display:none}
.topbar-company{max-width:45vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pagination{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:18px;font-size:13px}
.page-link{padding:7px 12px;border:1px solid var(--border);border-radius:9px;font-weight:700;background:#fff}
.page-link:hover{border-color:var(--primary);color:var(--primary)}
.page-info{color:var(--muted)}
.upload-preview{width:100%;display:flex;justify-content:center}
.upload-actions{display:flex;gap:6px;margin-top:9px;flex-wrap:wrap;justify-content:center}
.upload-box.has-file{border-style:solid;border-color:#86efac;background:#f0fdf4}
.upload-box .file-remove[hidden]{display:none}
.doc-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.doc-card{border:1px solid var(--border);border-radius:13px;padding:10px;background:#fff;display:flex;flex-direction:column;gap:8px}
.doc-card img{width:100%;height:110px;object-fit:cover;border-radius:9px;background:#eef2f7}
.doc-card .doc-missing{height:110px;border-radius:9px;background:var(--surface-2);display:grid;place-items:center;color:var(--muted);font-size:12px;text-align:center;padding:6px}
.doc-card strong{font-size:12px}
.inline-form{display:inline}
.row-actions{display:flex;gap:6px;flex-wrap:wrap}
.check-row{display:flex;align-items:center;gap:8px;font-weight:600;color:var(--text)}
.check-row input{width:auto}
.kv-wide{grid-template-columns:repeat(3,1fr)}
.empty .btn{margin-top:14px}
.demo-note code{background:#eef2f7;padding:1px 5px;border-radius:5px}
.secret-box{background:#0f172a;color:#e2e8f0;border-radius:12px;padding:14px 16px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:15px;word-break:break-all}
.log-meta{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:11px;color:var(--muted);word-break:break-all}
.sev{display:inline-block;padding:3px 8px;border-radius:999px;font-size:11px;font-weight:800}
.sev-security{background:#fef2f2;color:#b91c1c}.sev-warning{background:#fff7ed;color:#c2410c}.sev-error{background:#fee2e2;color:#991b1b}.sev-info{background:#f1f5f9;color:#475569}
@media(max-width:1100px){.doc-grid{grid-template-columns:repeat(2,1fr)}.kv-wide{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){
  .sidebar.open+.sidebar-scrim{display:block;position:fixed;inset:0;background:rgba(15,23,42,.4);z-index:40}
  .topbar-company{display:none}
  .menu-toggle{min-width:44px;min-height:44px}
  .btn{min-height:44px}
  .btn-sm{min-height:36px}
  table.stack{min-width:0}
  table.stack thead{display:none}
  table.stack tr{display:block;border:1px solid var(--border);border-radius:13px;margin-bottom:12px;padding:6px 4px;background:#fff}
  table.stack td{display:flex;justify-content:space-between;gap:14px;align-items:center;border-bottom:1px dashed var(--border);padding:9px 12px;text-align:right}
  table.stack td:last-child{border-bottom:0}
  table.stack td::before{content:attr(data-label);color:var(--muted);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;text-align:left;flex:0 0 auto}
  table.stack td[data-label=""]::before{display:none}
  .kv-wide{grid-template-columns:1fr}
}
@media(max-width:430px){.doc-grid{grid-template-columns:1fr 1fr}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
