/* ============================================
   AIRMAX CLIMATIZACIÓN - Estilos principales
   Colores corporativos: Azul oscuro + Eléctrico
   ============================================ */

:root {
    --azul-oscuro: #0a1628;
    --azul-medio: #0d2041;
    --azul-electrico: #1e90ff;
    --azul-claro: #4db8ff;
    --cyan: #00d4ff;
    --blanco: #ffffff;
    --gris-claro: #f0f4f8;
    --gris-medio: #94a3b8;
    --gris-oscuro: #334155;
    --verde: #10b981;
    --amarillo: #f59e0b;
    --rojo: #ef4444;
    --sombra: 0 4px 24px rgba(0,0,0,0.18);
    --radio: 12px;
    --radio-sm: 8px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gris-claro);
    color: var(--gris-oscuro);
    min-height: 100vh;
}

/* ---- LOGIN ---- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--azul-oscuro) 0%, var(--azul-medio) 60%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--sombra);
}

.login-card img.logo { width: 140px; margin-bottom: 24px; }

.login-card h1 {
    color: var(--blanco);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-card p { color: var(--gris-medio); font-size: 0.9rem; margin-bottom: 28px; }

/* ---- NAVBAR ---- */
.navbar {
    background: linear-gradient(90deg, var(--azul-oscuro), var(--azul-medio));
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.navbar-brand img { height: 36px; }
.navbar-brand span { color: var(--blanco); font-weight: 700; font-size: 1.1rem; }

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gris-medio);
    font-size: 0.9rem;
}

.navbar-user .tecnico-badge {
    background: var(--azul-electrico);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---- BOTTOM NAV MÓVIL ---- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--azul-oscuro);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    color: var(--gris-medio);
    text-decoration: none;
    font-size: 0.65rem;
    gap: 4px;
    transition: color 0.2s;
}

.bottom-nav a.active, .bottom-nav a:hover { color: var(--azul-electrico); }
.bottom-nav a svg { width: 22px; height: 22px; }

/* ---- CONTENIDO ---- */
.contenido {
    padding: 20px;
    padding-bottom: 80px;
    max-width: 900px;
    margin: 0 auto;
}

/* ---- CARDS ---- */
.card {
    background: white;
    border-radius: var(--radio);
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--azul-oscuro);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- DASHBOARD STATS ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: var(--radio);
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border-top: 3px solid var(--azul-electrico);
}

.stat-card .numero {
    font-size: 2rem;
    font-weight: 800;
    color: var(--azul-oscuro);
    line-height: 1;
}

.stat-card .label {
    font-size: 0.75rem;
    color: var(--gris-medio);
    margin-top: 4px;
}

/* ---- FORMULARIOS ---- */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gris-oscuro);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radio-sm);
    font-size: 0.9rem;
    color: var(--gris-oscuro);
    background: white;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--azul-electrico);
    box-shadow: 0 0 0 3px rgba(30,144,255,0.1);
}

select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ---- BOTONES ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radio-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    -webkit-appearance: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--azul-electrico), #0070e0);
    color: white;
    box-shadow: 0 4px 12px rgba(30,144,255,0.3);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(30,144,255,0.4); }

.btn-success { background: var(--verde); color: white; }
.btn-warning { background: var(--amarillo); color: white; }
.btn-danger { background: var(--rojo); color: white; }
.btn-secondary { background: var(--gris-claro); color: var(--gris-oscuro); }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--azul-electrico);
    color: var(--azul-electrico);
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* ---- BADGES TIPO INTERVENCIÓN ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-basico { background: #fef3c7; color: #92400e; }
.badge-premium { background: #dbeafe; color: #1e40af; }
.badge-instalacion { background: #d1fae5; color: #065f46; }

.badge-ok { background: #d1fae5; color: #065f46; }
.badge-proxima { background: #fef3c7; color: #92400e; }
.badge-urgente { background: #fee2e2; color: #991b1b; }

/* ---- LISTA ITEMS ---- */
.lista-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
}

.lista-item:last-child { border-bottom: none; }
.lista-item:hover { background: #f8fafc; margin: 0 -20px; padding: 14px 20px; border-radius: var(--radio-sm); }

.lista-item-info h3 { font-size: 0.95rem; font-weight: 600; color: var(--azul-oscuro); }
.lista-item-info p { font-size: 0.8rem; color: var(--gris-medio); margin-top: 2px; }

/* ---- SECCIÓN MEDICIONES ---- */
.seccion-medicion {
    background: linear-gradient(135deg, var(--azul-oscuro), var(--azul-medio));
    border-radius: var(--radio);
    padding: 16px;
    margin-bottom: 16px;
    color: white;
}

.seccion-medicion h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--azul-claro);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.seccion-medicion .form-control {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: white;
}

.seccion-medicion .form-control:focus {
    border-color: var(--cyan);
    background: rgba(255,255,255,0.12);
}

.seccion-medicion label { color: rgba(255,255,255,0.7); }

/* ---- DIAGNÓSTICO ---- */
.diagnostico-box {
    border-radius: var(--radio);
    padding: 16px;
    margin-bottom: 12px;
}

.diagnostico-ok { background: #d1fae5; border-left: 4px solid var(--verde); }
.diagnostico-proxima { background: #fef3c7; border-left: 4px solid var(--amarillo); }
.diagnostico-urgente { background: #fee2e2; border-left: 4px solid var(--rojo); }

.diagnostico-box h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 6px; }
.diagnostico-box p { font-size: 0.85rem; }

/* ---- SUPERHEAT INDICATOR ---- */
.sh-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radio-sm);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 8px;
}

.sh-normal { background: #d1fae5; color: #065f46; }
.sh-alto { background: #fef3c7; color: #92400e; }
.sh-muy-alto { background: #fee2e2; color: #991b1b; }
.sh-bajo { background: #fee2e2; color: #991b1b; }

/* ---- ALERTAS ---- */
.alerta {
    padding: 12px 16px;
    border-radius: var(--radio-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.alerta-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alerta-exito { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alerta-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ---- PÁGINA TÍTULO ---- */
.page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.page-header h1 { font-size: 1.3rem; font-weight: 800; color: var(--azul-oscuro); }
.page-header .back-btn {
    color: var(--azul-electrico);
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .contenido { padding: 16px; padding-bottom: 80px; }
}

@media (min-width: 768px) {
    .bottom-nav { display: none; }
    .contenido { padding: 30px 20px; }
}
