/* ============================================================
   Sistema Integrado de Laboratorios — IESTP San Pedro del Valle
   Identidad institucional — verde + diseño profesional
   ============================================================ */

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

.font-mono-custom { font-family: monospace; }

/* ---------- Tarjetas de navegación principal ---------- */
.tab-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #334155;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tab-card:hover {
    border-color: #86efac;
    background-color: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.12);
}

.tab-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background-color: #ecfdf5;
    color: #15803d;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.tab-card-label {
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-align: center;
}

.tab-card-active {
    background-color: #15803d;
    border-color: #15803d;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(21, 128, 61, 0.25);
}

.tab-card-active:hover {
    background-color: #166534;
    border-color: #166534;
    transform: none;
}

.tab-card-active .tab-card-icon {
    background-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

/* ============================================================
   IMPRESIÓN (sin cambios de lógica — igual que antes)
   ============================================================ */
@media print {
    body * { visibility: hidden !important; }

    body.printing-ficha #print-area,
    body.printing-ficha #print-area * { visibility: visible !important; }

    body.printing-ficha #print-area {
        position: absolute !important; left: 0 !important; top: 0 !important; width: 100vw !important; display: flex !important;
        flex-direction: column !important; justify-content: space-between !important;
        background: white !important; padding: 8mm 10mm !important; color: black !important;
        min-height: 97vh !important; box-sizing: border-box !important;
    }

    body.printing-reporte #print-report-area,
    body.printing-reporte #print-report-area * { visibility: visible !important; }

    body.printing-reporte #print-report-area {
        position: absolute !important; left: 0 !important; top: 0 !important; width: 100vw !important; display: flex !important;
        flex-direction: column !important; justify-content: space-between !important;
        background: white !important; padding: 10mm 12mm !important; color: black !important;
        min-height: 97vh !important; box-sizing: border-box !important;
    }

    @page { size: A4 portrait; margin: 0mm; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    table { border-collapse: collapse !important; width: 100% !important; }
    th { background-color: #15803d !important; color: #ffffff !important; font-weight: bold !important; border: 1px solid #94a3b8 !important; padding: 4px 6px !important; font-size: 10px !important; }
    td { border: 1px solid #cbd5e1 !important; color: #1e293b !important; padding: 4px 6px !important; font-size: 10px !important; }

    .print-signatures-container {
        margin-top: auto !important;
        padding-top: 25px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}


/* ============================================================
   PALETA INSTITUCIONAL — colores sobrios por tipo de acción
   ============================================================ */

body { background-color: #f3f6f4; }

/* ---------- Acción principal: verde institucional ---------- */
body .bg-blue-600 { background-color: #15803d; }
body .hover\:bg-blue-700:hover { background-color: #166534; }

/* ---------- Acción secundaria: verde azulado (teal) ---------- */
body .bg-emerald-600,
body .bg-emerald-700,
body .bg-indigo-600 { background-color: #0f766e; }
body .hover\:bg-emerald-700:hover,
body .hover\:bg-emerald-800:hover,
body .hover\:bg-indigo-700:hover { background-color: #115e59; }

/* ---------- Importar: ocre apagado ---------- */
body .bg-amber-500 { background-color: #b45309; }
body .hover\:bg-amber-600:hover { background-color: #92400e; }

/* ---------- Peligro: rojo más profundo ---------- */
body .bg-red-600 { background-color: #b91c1c; }
body .hover\:bg-red-700:hover { background-color: #991b1b; }

/* ---------- Textos de acento ---------- */
body .text-blue-600,
body .text-emerald-600 { color: #15803d; }
body .text-indigo-600 { color: #0f766e; }
body .text-amber-500 { color: #b45309; }

/* ---------- Pestañas internas de Reportes ---------- */
body .border-blue-600 { border-color: #15803d; }

/* ---------- Máquina seleccionada en la lista lateral ---------- */
body .bg-blue-50 { background-color: #f0fdf4; }
body .text-blue-800 { color: #166534; }

/* ---------- Encabezados de tabla en verde institucional ---------- */
body thead tr.bg-slate-800,
body thead .bg-slate-800 { background-color: #166534; }
body thead th { border-color: #15803d; }

/* ---------- Tarjetas y campos ---------- */
body .shadow-sm { box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06); }

body input:focus,
body select:focus {
    outline: none;
    border-color: #15803d;
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}



/* ============================================================
   LOGIN Y HEADER — identidad institucional
   ============================================================ */

/* ---------- Fondo del login ---------- */
#login-screen {
    background: linear-gradient(135deg, #052e16 0%, #14532d 55%, #15803d 100%);
}

/* ---------- Tarjeta del login ---------- */
#login-screen > div {
    border: none;
    border-top: 5px solid #15803d;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

#login-screen h1 { color: #14532d; }

/* ---------- Botón Iniciar Sesión: verde principal ---------- */
#login-screen button[type="submit"] {
    background-color: #15803d;
    letter-spacing: 0.03em;
}
#login-screen button[type="submit"]:hover { background-color: #166534; }

/* ---------- Header del sistema: degradado sutil ---------- */
#main-app-container > header {
    background: linear-gradient(90deg, #14532d 0%, #15803d 100%);
    border-bottom: 3px solid #166534;
}


/* ============================================================
   MENÚ LATERAL DESPLEGABLE
   ============================================================ */
.app-layout { display: flex; align-items: flex-start; min-height: calc(100vh - 76px); }
.app-main { flex: 1; min-width: 0; }

.sidebar {
    width: 250px; flex-shrink: 0; background: #ffffff;
    border-right: 1px solid #e2e8f0; padding: 1rem 0.75rem;
    position: sticky; top: 0; align-self: flex-start;
    min-height: calc(100vh - 76px); overflow: hidden;
    transition: width 0.2s ease;
}
.sidebar-title {
    font-size: 0.65rem; font-weight: 800; letter-spacing: 0.12em;
    color: #94a3b8; text-transform: uppercase;
    padding: 0 0.85rem; margin-bottom: 0.5rem; white-space: nowrap;
}
.sidebar-item {
    display: flex; align-items: center; gap: 0.85rem; width: 100%;
    padding: 0.7rem 0.85rem; margin-bottom: 0.25rem; border-radius: 0.65rem;
    color: #475569; font-weight: 600; font-size: 0.875rem; text-align: left;
    white-space: nowrap; cursor: pointer; border: none; background: transparent;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.sidebar-item i { width: 1.25rem; text-align: center; font-size: 1.05rem; color: #15803d; flex-shrink: 0; }
.sidebar-item:hover { background: #f0fdf4; color: #14532d; }
.sidebar-item.tab-card-active { background: #15803d; color: #ffffff; border: none; box-shadow: 0 4px 10px rgba(21, 128, 61, 0.25); }
.sidebar-item.tab-card-active i { color: #ffffff; }
.sidebar-item.tab-card-active:hover { background: #166534; transform: none; }

.sidebar.collapsed { width: 76px; }
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-item span { display: none; }
.sidebar.collapsed .sidebar-item { justify-content: center; padding: 0.8rem 0; }

.sidebar-toggle {
    width: 40px; height: 40px; border-radius: 0.6rem; border: none; cursor: pointer;
    background: rgba(255, 255, 255, 0.14); color: #ffffff; font-size: 1.05rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: background-color 0.15s ease;
}
.sidebar-toggle:hover { background: rgba(255, 255, 255, 0.26); }

.sidebar-overlay { display: none; }

@media (max-width: 767px) {
    .sidebar {
        position: fixed; top: 0; left: -270px; height: 100vh; z-index: 40;
        width: 250px; padding-top: 1.25rem; transition: left 0.25s ease;
        box-shadow: 0 0 30px rgba(15, 23, 42, 0.3);
    }
    .sidebar.mobile-open { left: 0; }
    .sidebar.collapsed { width: 250px; }
    .sidebar.collapsed .sidebar-title { display: block; }
    .sidebar.collapsed .sidebar-item span { display: inline; }
    .sidebar.collapsed .sidebar-item { justify-content: flex-start; padding: 0.7rem 0.85rem; }
    .sidebar-overlay.show { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 30; }
}