:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #e0e7ff;
    --bg-color: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --success: #22c55e;
    --success-bg: #dcfce7;
    
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 1rem;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#app {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding-bottom: 80px; /* Space for nav */
}

/* --- Utilities --- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.uppercase { text-transform: uppercase; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.p-4 { padding: 1rem; }
.w-full { width: 100%; }

/* --- Components --- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 0.9rem;
    transition: transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem;
    width: auto;
}

.input-group { margin-bottom: 1rem; }
.input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
}
.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: 1rem;
    outline: none;
}
.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* --- Layouts --- */
.screen-header {
    background: var(--surface);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* --- Bottom Nav --- */
nav#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    height: 80px; /* Safe area included */
    display: flex;
    justify-content: space-around;
    padding-top: 0.5rem;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}

nav button {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    width: 60px;
}

nav button.active { color: var(--primary); }

.icon-container { width: 24px; height: 24px; margin-bottom: 4px; }
.icon-container svg { width: 100%; height: 100%; }

.center-action {
    background: var(--primary);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -24px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}
.center-action svg { stroke: white; width: 24px; height: 24px; }

/* --- Specifics --- */
.stepper-row { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; }
.stepper-btn {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: 50%; border: none; font-weight: bold;
    background: #f1f5f9; color: var(--text-muted);
}
.stepper-btn.active {
    background: var(--primary); color: white; transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.photo-upload {
    aspect-ratio: 16/9;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    overflow: hidden;
}
.photo-upload img { width: 100%; height: 100%; object-fit: cover; }

.vehicle-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}
.id-badge {
    width: 3rem; height: 3rem;
    background: #1e293b; color: white;
    border-radius: 0.5rem;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; margin-right: 1rem; flex-shrink: 0;
}

.loading-screen {
    height: 100vh; display: flex; align-items: center; justify-content: center;
}
.spinner {
    width: 40px; height: 40px;
    border: 4px solid var(--primary-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Tag Switcher */
.cat-filter {
    display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem;
}
.cat-chip {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #f1f5f9;
    color: var(--text-muted);
    border: none;
    white-space: nowrap;
}
.cat-chip.active {
    background: var(--primary);
    color: white;
}
