/* ==============================================================
   Digital Car Service Book - Automotive Modern Theme
   ============================================================== */

:root {
    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    --sidebar-active: #2563eb;
    --sidebar-text: #9ca3af;
    --sidebar-text-active: #ffffff;
    --sidebar-width: 260px;
    --primary-color: #2563eb;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;
    --accent-green: #10b981;
    --body-bg: #f3f4f6;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
}

body {
    background-color: var(--body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
    color: #1f2937;
    overflow-x: hidden;
}

/* ---------------- Layout Wrapper ---------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ---------------- Sidebar ---------------- */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out, width 0.3s ease;
    z-index: 1040;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #1f2937;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.sidebar-brand i {
    color: #3b82f6;
    font-size: 1.4rem;
    margin-right: 0.75rem;
}

.sidebar-nav {
    padding: 1rem 0;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
    padding: 0.75rem 1.5rem 0.25rem;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.925rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-link i {
    width: 22px;
    font-size: 1rem;
    margin-right: 0.75rem;
    text-align: center;
    transition: color 0.2s;
}

.sidebar-link:hover {
    color: var(--sidebar-text-active);
    background-color: var(--sidebar-hover);
    border-left-color: #60a5fa;
}

.sidebar-link.active {
    color: var(--sidebar-text-active);
    background-color: rgba(37, 99, 235, 0.15);
    border-left-color: var(--sidebar-active);
    font-weight: 600;
}

.sidebar-link.active i {
    color: #60a5fa;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #1f2937;
    background-color: rgba(0, 0, 0, 0.15);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
}

.user-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 0.75rem;
}

/* ---------------- Main Content ---------------- */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--body-bg);
}

.top-navbar {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.content-body {
    padding: 1.75rem;
    flex-grow: 1;
}

/* ---------------- Cards & Widgets ---------------- */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    background: var(--card-bg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
    padding: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.stat-icon.success { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.stat-icon.warning { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.stat-icon.danger { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.stat-icon.info { background: rgba(6, 182, 212, 0.12); color: #0891b2; }

/* ---------------- Alert Badges ---------------- */
.alert-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-urgent {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    animation: pulseBorder 2s infinite;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-normal {
    background-color: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

.badge-completed {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

@keyframes pulseBorder {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ---------------- Service Timeline ---------------- */
.service-timeline {
    position: relative;
    padding: 1.5rem 0;
}

.service-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 3px;
    background: #e5e7eb;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 54px;
}

.timeline-marker {
    position: absolute;
    left: 8px;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #2563eb;
    box-shadow: 0 0 0 4px #eff6ff;
}

/* ---------------- Car Card Visuals ---------------- */
.car-card-img {
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 3rem;
}

.license-plate-badge {
    display: inline-block;
    background: #ffffff;
    border: 2px solid #1e293b;
    border-radius: 4px;
    padding: 0.15rem 0.6rem;
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.license-plate-badge .eu-flag {
    display: inline-block;
    background: #003399;
    color: #ffcc00;
    padding: 0.05rem 0.25rem;
    border-radius: 2px;
    font-size: 0.65rem;
    margin-right: 0.35rem;
}

/* ---------------- Mobile Sidebar ---------------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
    }
    
    .app-sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* ---------------- Print Styles ---------------- */
@media print {
    .app-sidebar, .top-navbar, .btn, .no-print, .flash-messages-container {
        display: none !important;
    }
    
    .app-main {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }
    
    .content-body {
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}
