:root {
    /* Trending Elegant Palette (SaaS Enterprise) */
    --primary: #4338ca; /* Elegant Indigo */
    --primary-hover: #3730a3;
    
    --bg-base: #f8fafc; /* Very light slate/grey for workspace */
    --bg-surface: #ffffff; /* Pure white for cards */
    --bg-nav: #0f172a; /* Deep Slate for Top Navigation */
    
    --text-main: #1e293b; /* Dark Slate */
    --text-muted: #64748b; /* Medium Slate */
    --text-nav: #f8fafc;
    
    --border: #e2e8f0; /* Light border */
    
    --danger: #ef4444; 
    --danger-hover: #dc2626;
    --success: #10b981; 
    --warning: #f59e0b; 
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; }

/* Elegant Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Premium Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-outline {
    background: white;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f1f5f9;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-main);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.15);
}

/* Crisp Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #ffffff;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

th {
    background: #f8fafc;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-size: 0.75rem;
}

tr:hover td {
    background: #f1f5f9;
}

/* Utility Classes */
.hidden { display: none !important; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.w-full { width: 100%; }

/* Badges */
.badge {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-success { background: #d1fae5; color: #047857; }
.badge-primary { background: #e0e7ff; color: #4338ca; }

/* Layout App - Top Nav Structure */
body {
    display: flex;
    flex-direction: column;
}

#app-container {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Top Navigation Bar */
#main-nav {
    background: var(--bg-nav);
    color: var(--text-nav);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    margin-right: 2rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
}

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

/* Login/Register Modal */
#auth-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#auth-modal .card {
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.no-print {
    /* Rules for screen, actual print rules in print.css */
}

/* =========================================
   DASHBOARD v2 STYLES
   ========================================= */

.dash2-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 20px;
}

.dash2-row {
    display: flex;
    gap: 20px;
}

.dash2-col-left {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.dash2-col-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dash2-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dash2-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 15px 0;
}

.dash2-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.dash2-huge-number {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    margin: 5px 0;
}

/* Lists inside dash2 */
.dash2-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dash2-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash2-list-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash2-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.dash2-list-title {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.dash2-list-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.dash2-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.dash2-badge.red { background: #fee2e2; color: #ef4444; }
.dash2-badge.green { background: #dcfce7; color: #10b981; }
.dash2-badge.orange { background: #ffedd5; color: #f97316; }
.dash2-badge.blue { background: #dbeafe; color: #3b82f6; }

/* Grid for operational summary */
.dash2-workshops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.dash2-ws-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
}

.dash2-ws-title {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
}

.dash2-vehicles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dash2-vehicle-badge {
    background: #e0e7ff;
    color: #4f46e5;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #c7d2fe;
}
.dash2-vehicle-badge.acople {
    background: #f3e8ff;
    color: #9333ea;
    border-color: #e9d5ff;
}
