/* Clean & Modern UI - Garage HS-Speed */

:root {
    /* Clean Color Palette */
    --bg-main: #F8FAFC;
    --bg-surface: #FFFFFF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    /* Primary Colors */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;

    /* Status Colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
}

* { box-sizing: border-box; }

body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ========== SIDEBAR ========== */
.sidebar {
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow);
}

@media (max-width: 1023px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
}

/* Section Labels */
.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 16px 12px 8px;
    margin-top: 8px;
}

/* Sidebar Menu Items */
.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 4px;
}

.sidebar-menu-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-menu-item:hover .menu-icon,
.sidebar-menu-item:hover .menu-icon-sm {
    transform: scale(1.05);
}

.sidebar-menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Menu Icon */
.menu-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.menu-icon i {
    color: white;
    font-size: 14px;
}

/* Small Menu Icon for sub-items */
.menu-icon-sm {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.menu-icon-sm i {
    color: white;
    font-size: 11px;
}

/* Sub Items */
.sidebar-menu-item.sub-item {
    padding: 8px 12px 8px 20px;
    font-size: 13px;
}

/* Menu Arrow */
.menu-arrow {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--transition-normal);
}

.menu-group.open .menu-arrow {
    transform: rotate(180deg);
}

/* Menu Groups */
.menu-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-left: 8px;
    border-left: 2px solid #E5E7EB;
    margin-top: 4px;
}

.menu-group.open .menu-group-items {
    max-height: 400px;
}

/* ========== HEADER ========== */
header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

/* ========== CARDS ========== */
.bg-white.rounded-xl {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal);
}

.bg-white.rounded-xl:hover {
    box-shadow: var(--shadow);
}

/* ========== INPUTS ========== */
.input {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all var(--transition-fast);
    width: 100%;
}

.input:hover {
    border-color: #D1D5DB;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input::placeholder {
    color: var(--text-muted);
}

.select {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    padding-right: 36px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    transition: all var(--transition-fast);
}

.select:hover {
    border-color: #D1D5DB;
}

.select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

/* ========== BUTTONS ========== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-main);
    border-color: #D1D5DB;
}

.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--success);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--danger);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.btn-danger:hover {
    background: #DC2626;
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: var(--success-light);
    color: #059669;
}

.badge-warning {
    background: var(--warning-light);
    color: #D97706;
}

.badge-danger {
    background: var(--danger-light);
    color: #DC2626;
}

.badge-info {
    background: var(--info-light);
    color: #2563EB;
}

.badge-secondary {
    background: #F3F4F6;
    color: #6B7280;
}

/* ========== TABLES ========== */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #F9FAFB;
}

thead th {
    font-weight: 500;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: #F9FAFB;
}

tbody tr:last-child {
    border-bottom: none;
}

/* Action Buttons in Table */
tbody button {
    transition: all var(--transition-fast);
}

tbody button:hover {
    transform: scale(1.1);
}

/* ========== MODAL ========== */
.modal {
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content,
.modal .bg-white {
    animation: modalFadeIn 0.2s ease;
    border-radius: 12px !important;
    box-shadow: var(--shadow-md), 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Modal Header */
.modal .border-b {
    background: var(--bg-surface);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border) !important;
}

.modal .border-b h3 {
    font-weight: 600;
    color: var(--text-primary);
}

/* Modal Close Button */
.modal button.absolute,
.modal .border-b button[onclick*="closeModal"] {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-main);
    transition: all var(--transition-fast);
}

.modal button.absolute:hover,
.modal .border-b button[onclick*="closeModal"]:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Modal Body */
.modal .p-6,
.modal .p-4 {
    background: var(--bg-surface);
}

/* Modal Footer */
.modal .border-t {
    background: #F9FAFB;
    border-top: 1px solid var(--border) !important;
    padding: 16px 20px;
}

/* ========== TOAST ========== */
.toast {
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    border-radius: 8px !important;
    box-shadow: var(--shadow-md);
}

.toast.show {
    transform: translateX(0);
}

/* ========== LOGIN SCREEN ========== */
.login-screen.hidden {
    display: none;
}

#appContainer.hidden {
    display: none;
}

/* ========== PROGRESS BAR ========== */
.bg-gray-200.rounded-full {
    background: #E5E7EB !important;
}

.bg-blue-600.rounded-full,
.bg-blue-600.h-2 {
    background: var(--primary) !important;
}

/* ========== LOADING SPINNER ========== */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
    .btn-primary,
    .btn-secondary {
        padding: 8px 14px;
        font-size: 13px;
    }

    .badge {
        padding: 3px 8px;
        font-size: 11px;
    }
}

/* ========== OVERLAY ========== */
.overlay {
    backdrop-filter: blur(4px);
}

/* ========== UTILITY ========== */
.hover-lift:hover {
    transform: translateY(-2px);
}
