/* --- CONFIGURACIÓN GENERAL --- */
:root {
    --bg-main: #f8fafc;
    --sidebar-bg: #0b1329;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary-blue: #1d4ed8;
    --dark-button: #0f172a;
    --border-color: #e2e8f0;
    --success-bg: #dcfce7;
    --success-text: #15803d;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* --- VISTA DE LOGIN (ESTILO FARDO PRIME) --- */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f1f5f9;
}

.login-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.login-card .brand-logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--sidebar-bg);
    margin-bottom: 24px;
}

.login-card .brand-logo span {
    color: #eab308; /* Toque dorado similar al logo de tu referencia */
}

.login-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--text-muted);
    background-color: #fff;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background-color: var(--dark-button);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #1e293b;
}

/* --- DISEÑO DEL PANEL (SISTEMA CON SIDEBAR) --- */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Barra lateral */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    box-sizing: border-box;
}

.sidebar .brand {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.sidebar nav {
    flex: 1;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar nav a.active, .sidebar nav a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.logout-link {
    color: #f87171;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

/* Área de contenido principal */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 40px;
    box-sizing: border-box;
    background-color: var(--bg-main);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.top-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
}

.user-tag {
    background-color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* Tarjetas de Contenido (Dashboard Content Cards) */
.content-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.content-card h3 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 20px;
}

/* Galería de fotos por VIN */
.vin-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.vin-section:last-child {
    border-bottom: none;
}

.vin-title {
    font-size: 15px;
    font-weight: 700;
    background: #f1f5f9;
    padding: 8px 16px;
    display: inline-block;
    border-radius: 8px;
    margin-bottom: 16px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.photo-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    overflow: hidden;
}

.photo-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Alertas de Feedback */
.alert-message {
    background-color: var(--success-bg);
    color: var(--success-text);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
}


/* --- NUEVOS ESTILOS: TARJETAS Y BUSCADOR --- */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background-color: #f8fafc;
}

/* Grilla de Tarjetas de Autos */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.vehicle-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    position: relative;
}

.vehicle-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    border-color: var(--primary-blue);
}

.vehicle-card h4 {
    margin: 0 0 10px 0;
    color: var(--sidebar-bg);
    font-size: 18px;
}

.vehicle-card p {
    margin: 5px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.badge-fotos {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--success-bg);
    color: var(--success-text);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
}

/* --- ESTILOS DEL MODAL (POPUP) --- */
.modal-overlay {
    display: none; 
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(11, 19, 41, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 16px;
    padding: 30px;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.modal-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* --- COMPATIBILIDAD CON ICONOS EN TITULARES --- */
.sidebar .brand, .sidebar nav a, .user-tag, .content-card h3, .toolbar h3, .btn-primary {
    display: flex;
    align-items: center;
    gap: 8px; /* Separa de forma idéntica el icono del texto */
}

.sidebar nav a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}