/**
 * CARMONA Auto Service - Sistema de Gestión Automotriz
 * Estilo: Dark Theme con acentos naranja/rojo deportivo
 */

/* ===== CSS Variables ===== */
:root {
    /* Colors - Dark Racing Theme */
    --bg-primary: #0d0d0d;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-card: #1f1f1f;
    --bg-card-hover: #282828;
    
    /* Accent Colors - Orange/Red Racing Style */
    --accent-primary: #ff6b35;
    --accent-secondary: #e85a2a;
    --accent-tertiary: #d14420;
    --accent-glow: rgba(255, 107, 53, 0.2);
    
    /* Text Colors */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;
    
    /* Status Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    /* Borders & Shadows */
    --border-color: #27272a;
    --border-light: #3f3f46;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);
    
    /* Typography - Racing Style */
    --font-primary: 'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Rajdhani', 'Barlow', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Pattern - Racing Style */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 0% 0%, var(--accent-glow) 0%, transparent 40%),
        radial-gradient(ellipse at 100% 50%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(100, 100, 100, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Racing stripe accent */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-tertiary) 50%, transparent 100%);
    pointer-events: none;
    z-index: 1000;
    opacity: 0.6;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, #ccc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-tagline {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--accent-primary);
    letter-spacing: 2px;
    text-transform: lowercase;
    font-style: italic;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-weight: 450;
}

.sidebar-nav a:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-nav a i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-nav li.active a {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    color: var(--bg-primary);
    font-weight: 600;
    box-shadow: 0 0 20px var(--accent-glow);
    border-left: 3px solid #fff;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    border: 2px solid var(--border-color);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logout-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.header-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.header-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.header-search input {
    width: 100%;
    padding: 12px 16px 12px 46px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.header-search input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-search input::placeholder {
    color: var(--text-tertiary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-wrapper {
    flex: 1;
    padding: 24px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn i {
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px var(--accent-glow), var(--shadow-md);
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.btn-outline:hover {
    background: var(--accent-glow);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title i {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-tertiary));
    opacity: 0.5;
    transition: all var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(255, 107, 53, 0.15);
    border-color: rgba(255, 107, 53, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
    box-shadow: 0 0 15px var(--accent-glow);
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-glow);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: 1px;
}

.stat-change {
    font-size: 0.85rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    background: var(--bg-tertiary);
}

th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: var(--bg-card-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: white;
}

.badge-success { background: var(--success); }
.badge-warning { background: var(--warning); color: var(--bg-primary); }
.badge-danger { background: var(--danger); }
.badge-info { background: var(--info); }
.badge-secondary { background: var(--text-muted); }

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-label.required::after {
    content: '*';
    color: var(--danger);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 44px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* ===== Alerts ===== */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--info);
}

.alert-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title i {
    color: var(--accent-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 160px);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 20px;
    flex-wrap: wrap;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.page-title i {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-weight: 400;
    text-transform: none;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

/* ===== Avatar ===== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ===== Client Card ===== */
.client-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.client-info span {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* ===== Vehicle Badge ===== */
.vehicle-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.vehicle-badge i {
    color: var(--accent-primary);
}

.vehicle-badge .plate {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Image Gallery ===== */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.gallery-item:hover {
    transform: scale(1.02);
    border-color: var(--accent-primary);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    font-size: 0.8rem;
}

.gallery-item .type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
}

/* ===== Upload Zone ===== */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
}

.upload-zone i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.upload-zone h4 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-zone p {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: var(--danger);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.preview-item:hover .remove-btn {
    opacity: 1;
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 6px;
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--bg-card);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.timeline-content {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.timeline-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--bg-card);
    color: var(--accent-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.pagination .active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 600;
}

/* ===== Login Page ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.login-header {
    padding: 40px 40px 30px;
    text-align: center;
    background: linear-gradient(180deg, var(--accent-glow), transparent);
}

.login-logo {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-tertiary);
}

.login-body {
    padding: 30px 40px 40px;
}

.login-footer {
    padding: 20px 40px;
    background: var(--bg-tertiary);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* ===== Detail Page ===== */
.detail-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.detail-main {
    flex: 1;
}

.detail-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.detail-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-card h3 i {
    color: var(--accent-primary);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius-md);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.lightbox-close:hover {
    background: var(--danger);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lightbox-nav:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ===== Actions Dropdown ===== */
.actions-cell {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.action-btn.danger:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* ===== Search & Filters ===== */
.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-search {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.filter-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.filter-search input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
}

.filter-search input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filter-select {
    min-width: 160px;
}

.filter-select select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.filter-select select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ===== Loading ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .detail-header {
        flex-direction: column;
    }
    
    .detail-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .top-header {
        padding: 0 16px;
    }
    
    .header-search {
        display: none;
    }
    
    .content-wrapper {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal {
        width: 95%;
        margin: 20px;
    }
    
    .login-body,
    .login-header {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-100 { width: 100%; }
.hidden { display: none; }

/* ===== Enhanced Searchable Select ===== */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select-trigger {
    width: 100%;
    padding: 14px 44px 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.searchable-select-trigger::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform var(--transition-fast);
}

.searchable-select.open .searchable-select-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.searchable-select-trigger:hover,
.searchable-select-trigger:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.searchable-select.open .searchable-select-trigger {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.searchable-select-trigger .brand-icon {
    width: 28px;
    height: 28px;
    background: var(--bg-card);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-primary);
    flex-shrink: 0;
    text-transform: uppercase;
}

.searchable-select-trigger .placeholder {
    color: var(--text-tertiary);
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-primary);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg), 0 0 20px var(--accent-glow);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all var(--transition-fast);
}

.searchable-select.open .searchable-select-dropdown {
    max-height: 350px;
    opacity: 1;
}

.searchable-select-search {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-tertiary);
    z-index: 2;
}

.searchable-select-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.searchable-select-search input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.searchable-select-search input::placeholder {
    color: var(--text-tertiary);
}

.searchable-select-search i {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.searchable-select-options {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
}

.searchable-select-options::-webkit-scrollbar {
    width: 6px;
}

.searchable-select-options::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 3px;
}

.searchable-select-options::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.searchable-select-options::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.searchable-select-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.searchable-select-option:last-child {
    margin-bottom: 0;
}

.searchable-select-option:hover {
    background: var(--bg-card-hover);
}

.searchable-select-option.selected {
    background: var(--accent-glow);
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.searchable-select-option.highlighted {
    background: var(--bg-card);
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.searchable-select-option .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
    text-transform: uppercase;
    border: 1px solid var(--border-color);
    letter-spacing: -0.5px;
}

.searchable-select-option.selected .brand-icon,
.searchable-select-option:hover .brand-icon {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-tertiary) 100%);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
}

.searchable-select-option .brand-info {
    flex: 1;
}

.searchable-select-option .brand-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.searchable-select-option .brand-country {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.searchable-select-option.selected .brand-name {
    color: var(--accent-primary);
}

.searchable-select-no-results {
    padding: 24px;
    text-align: center;
    color: var(--text-tertiary);
}

.searchable-select-no-results i {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
    opacity: 0.5;
}

/* Brand Categories */
.searchable-select-category {
    padding: 8px 14px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.searchable-select-category i {
    color: var(--accent-primary);
    font-size: 0.8rem;
}

/* Popular brands grid view */
.popular-brands {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.popular-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.popular-brand:hover {
    background: var(--bg-card-hover);
}

.popular-brand.selected {
    background: var(--accent-glow);
}

.popular-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.popular-brand:hover .brand-icon,
.popular-brand.selected .brand-icon {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-tertiary) 100%);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
    transform: scale(1.05);
}

.popular-brand span {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.popular-brand:hover span,
.popular-brand.selected span {
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .popular-brands {
        grid-template-columns: repeat(3, 1fr);
    }
}