/* =========================================================
   MyHangar — Design System
   Dark, modern, data-dense dashboard aesthetic.
   ========================================================= */

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

:root {
    --bg: #0b0e14;
    --bg-elevated: #10141d;
    --surface: #131822;
    --surface-2: #1a2130;
    --surface-hover: #1f2838;
    --border: #232b3a;
    --border-soft: #1b2230;

    --text: #eef1f7;
    --text-dim: #9aa4b8;
    --text-faint: #636f85;

    --accent: #6d5ef8;
    --accent-2: #38d0ff;
    --accent-grad: linear-gradient(135deg, #6d5ef8 0%, #38b4ff 100%);
    --accent-soft: rgba(109, 94, 248, 0.14);

    --success: #27d796;
    --success-soft: rgba(39, 215, 150, 0.12);
    --warning: #ffb547;
    --warning-soft: rgba(255, 181, 71, 0.12);
    --danger: #ff5c7a;
    --danger-soft: rgba(255, 92, 122, 0.12);
    --info: #38b4ff;
    --info-soft: rgba(56, 180, 255, 0.12);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);

    --sidebar-w: 264px;
    --topbar-h: 72px;

    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(109, 94, 248, 0.12), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(56, 180, 255, 0.08), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Manrope', 'Inter', sans-serif; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

::selection { background: var(--accent); color: #fff; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-hover); }

/* =========================================================
   Layout: Guest (auth pages)
   ========================================================= */

.guest-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.guest-shell::before {
    content: '';
    position: absolute;
    inset: -20%;
    background: conic-gradient(from 180deg at 50% 50%, #6d5ef822, #38d0ff22, transparent 40%, #6d5ef822);
    filter: blur(60px);
    z-index: 0;
    animation: drift 20s linear infinite;
}

@keyframes drift {
    to { transform: rotate(360deg); }
}

.guest-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.guest-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    font-weight: 800;
    font-size: 20px;
    font-family: 'Manrope', sans-serif;
}

.guest-brand .logo-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--accent-grad);
    display: grid; place-items: center;
    font-size: 18px;
    box-shadow: 0 6px 18px rgba(109, 94, 248, 0.45);
}

.guest-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.guest-subtitle { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }

/* =========================================================
   App shell: sidebar + topbar
   ========================================================= */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-elevated);
    border-right: 1px solid var(--border-soft);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 22px;
    font-weight: 800;
    font-size: 18px;
    font-family: 'Manrope', sans-serif;
}

.sidebar-brand .logo-mark {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--accent-grad);
    display: grid; place-items: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(109, 94, 248, 0.4);
}

.nav-group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    padding: 16px 12px 6px;
    font-weight: 700;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.nav-link:active { transform: scale(0.98); }

.nav-link .icon { width: 20px; text-align: center; font-size: 16px; }

.nav-link:hover {
    background: var(--surface);
    color: var(--text);
}

.nav-link.active {
    background: var(--accent-soft);
    color: #cfc9ff;
}

.nav-link.active .icon { color: var(--accent-2); }

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vehicle-mini-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 220px;
    overflow-y: auto;
}

.vehicle-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
}

.vehicle-mini:hover, .vehicle-mini.active { background: var(--surface); color: var(--text); }

.vehicle-mini .thumb {
    width: 26px; height: 26px;
    border-radius: 7px;
    background: var(--surface-2);
    object-fit: cover;
    flex-shrink: 0;
    display: grid; place-items: center;
    font-size: 13px;
}

.main-col { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    background: rgba(11, 14, 20, 0.75);
    backdrop-filter: blur(14px);
    z-index: 20;
}

.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }

.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--accent-grad);
    display: grid; place-items: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.page { padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--accent-grad);
    color: #fff;
    box-shadow: 0 8px 20px rgba(109, 94, 248, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(109, 94, 248, 0.5); }

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); }

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}
.btn-danger:hover { background: rgba(255, 92, 122, 0.22); }

.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* =========================================================
   Cards / Banners
   ========================================================= */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; overflow-wrap: anywhere; word-break: break-word; }
.card-sub { color: var(--text-dim); font-size: 13px; }

.banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.banner {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    overflow: hidden;
}

.banner::after {
    content: '';
    position: absolute;
    top: -40%; right: -20%;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: var(--accent-soft);
    filter: blur(30px);
}

.banner-value { font-size: 30px; font-weight: 800; font-family: 'Manrope', sans-serif; margin-bottom: 2px; }
.banner-label { color: var(--text-dim); font-size: 13px; font-weight: 500; }
.banner-label .sep { color: var(--text-faint); margin: 0 4px; }
.banner-meta { margin-top: 10px; font-size: 12px; color: var(--text-faint); }

.banner.tone-danger .banner-value { color: var(--danger); }
.banner.tone-warning .banner-value { color: var(--warning); }
.banner.tone-info .banner-value { color: var(--info); }
.banner.tone-success .banner-value { color: var(--success); }

/* =========================================================
   Badges / Pills
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--surface-2); color: var(--text-dim); }

/* =========================================================
   Forms
   ========================================================= */

.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--text-dim);
}

.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], select, textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { resize: vertical; min-height: 80px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 16px;
}

.input-group { display: flex; gap: 8px; }
.input-group select { flex: 0 0 90px; }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-dim);
}
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--accent); }

.file-drop {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    color: var(--text-dim);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.file-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-drop input { display: none; }

/* =========================================================
   Tabs
   ========================================================= */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-link {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.tab-link:hover { color: var(--text); }
.tab-link.active { color: var(--text); border-color: var(--accent); }

/* =========================================================
   Tables
   ========================================================= */

.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-faint);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-soft); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-hover); }

/* =========================================================
   Vehicle cards (dashboard grid)
   ========================================================= */

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.vehicle-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.vehicle-card:hover { transform: translateY(-3px); border-color: var(--accent); }

.vehicle-card .photo {
    height: 150px;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    font-size: 40px;
    color: var(--text-faint);
    object-fit: cover;
    width: 100%;
}

.vehicle-card .body { padding: 16px; }
.vehicle-card .name { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.vehicle-card .meta { color: var(--text-dim); font-size: 13px; }
.vehicle-card .stats {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
    font-size: 12.5px;
    color: var(--text-faint);
}

.add-vehicle-card {
    display: grid;
    place-items: center;
    gap: 8px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-lg);
    min-height: 220px;
    color: var(--text-dim);
    font-weight: 600;
}
.add-vehicle-card:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.add-vehicle-card .plus { font-size: 32px; color: var(--accent-2); }

/* =========================================================
   Type picker (add vehicle step 1)
   ========================================================= */

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 640px;
}

.type-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.type-card .emoji { font-size: 48px; }
.type-card .label { font-weight: 700; font-size: 16px; }
.type-card:hover { transform: translateY(-4px); border-color: var(--accent); background: var(--accent-soft); }

/* =========================================================
   Wizard
   ========================================================= */

.wizard-steps {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
}
.wizard-step {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: var(--border);
    transition: background 0.3s ease;
}
.wizard-step.active, .wizard-step.done { background: var(--accent-grad); }

.vin-row { display: flex; gap: 10px; align-items: flex-end; }
.vin-row .field { flex: 1; min-width: 0; margin-bottom: 0; }
.vin-row input { width: 100%; min-width: 0; box-sizing: border-box; }

.wizard-pane { animation: paneIn 0.25s ease; }

@keyframes paneIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.vin-status {
    margin-top: 10px;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: none;
}
.vin-status.show { display: block; }
.vin-status.found { background: var(--success-soft); color: var(--success); }
.vin-status.notfound { background: var(--warning-soft); color: var(--warning); }

/* =========================================================
   Utilities
   ========================================================= */

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-center { text-align: center; }
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-dim);
}
.empty-state .emoji { font-size: 40px; margin-bottom: 12px; }

.lang-toggle { display: flex; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.lang-toggle a {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    transition: background 0.2s ease, color 0.2s ease;
}
.lang-toggle a.active { background: var(--accent-grad); color: #fff; }

.page { animation: pageIn 0.3s ease; }

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-stack { position: fixed; top: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.flash {
    min-width: 260px;
    max-width: 360px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    font-size: 13.5px;
    animation: slideIn 0.25s ease;
}
.flash.success { border-color: rgba(39, 215, 150, 0.4); }
.flash.error { border-color: rgba(255, 92, 122, 0.4); }

@keyframes slideIn {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(5, 7, 12, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
.modal-overlay.open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0s linear 0s;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(12px) scale(0.97);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}
.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }

.progress-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.progress-bar .fill { height: 100%; background: var(--accent-grad); }

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .page { padding: 18px; }
}
