@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --container-max: 1200px;

    --fire-red: #B3231C;
    --fire-red-dark: #8F1B16;
    --char: #1C1B19;
    --gauge-green: #2E7D4F;
    --gauge-green-dark: #24623F;
    --hazard-amber: #E8A33D;
    --hazard-amber-dark: #C4842A;
    --info-steel: #3B6E91;
    --plum: #6E4C63;
    --steel-gray: #EDEBE6;
    --paper: #FFFDF9;

    --ink: #1C1B19;
    --ink-mute: #6B6559;
    --ink-faint: #9A9384;
    --line: #E4E0D8;

    --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--steel-gray);
    color: var(--ink);
    min-height: 100vh;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--fire-red) 0%, var(--fire-red-dark) 100%);
    color: var(--paper);
    padding: 24px 32px 30px;
    box-shadow: 0 2px 8px rgba(28,27,25,0.15);
}

/* Franja de peligro — el unico remate grafico del header, referencia directa
   a la cinta de advertencia del equipo contra incendios. */
header::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 6px;
    background: repeating-linear-gradient(135deg,
        var(--char) 0 12px,
        var(--fire-red-dark) 12px 24px);
}
header h1 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

header .subtitle {
    font-family: var(--font-body);
    font-size: 13px;
    opacity: 0.85;
    margin-top: 4px;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 32px;
}

section {
    position: relative;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(28,27,25,0.06);
}

/* Ojal de ficha perforada — el mismo lenguaje que el ::before de .badge,
   ahora a escala de seccion. Cada bloque del dashboard se lee como una
   ficha de inspeccion colgada, no como una card de SaaS generico. */
section::before {
    content: '';
    position: absolute;
    left: 14px; top: 12px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--steel-gray);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 2px rgba(28,27,25,0.15);
}

section.hero-instrument::before { content: none; }

section h2 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink-mute);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.text-eyebrow {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-mute);
    cursor: pointer;
}
.text-caption { font-size: 12px; color: var(--ink-faint); margin: 12px 0 16px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--steel-gray); border-bottom: 2px solid var(--line); }
th {
    padding: 10px 12px; text-align: left; font-size: 11px;
    font-family: var(--font-display);
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-mute); font-weight: 700;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--steel-gray); }
.table-scroll { overflow-x: auto; }

/* Badge tipo etiqueta colgante de inspeccion: el ojal (::before) evoca la
   perforacion donde se cuelga la etiqueta del extintor. */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px 2px 6px; border-radius: 3px 8px 8px 3px;
    font-family: var(--font-display);
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}
.badge::before {
    content: ''; width: 5px; height: 5px; border-radius: 50%;
    border: 1.4px solid currentColor; background: var(--paper); flex-shrink: 0;
}
.badge-priority { background: #F7E4E1; color: var(--fire-red); }

.btn {
    border: none; border-radius: 6px; padding: 8px 14px; font-size: 12px;
    font-weight: 600; cursor: pointer; font-family: var(--font-body);
}
.btn-primary { background: var(--fire-red); color: var(--paper); }
.btn-primary:hover { background: var(--fire-red-dark); }
.btn-success { background: var(--gauge-green); color: var(--paper); }
.btn-success:hover { background: var(--gauge-green-dark); }
.btn-secondary { background: var(--steel-gray); color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.empty { text-align: center; padding: 32px; color: var(--ink-faint); font-size: 13px; }
.error { background: #F7E4E1; color: var(--fire-red); padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }

.toast {
    position: fixed; top: 20px; right: 20px; padding: 14px 20px; border-radius: 8px;
    font-size: 13px; font-weight: 600; color: var(--paper); z-index: 1000;
    box-shadow: 0 4px 12px rgba(28,27,25,0.2); display: none;
}
.toast.success { background: var(--gauge-green); }
.toast.error { background: var(--fire-red); }

.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(28,27,25,0.5);
    align-items: center; justify-content: center; z-index: 500;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--paper); border-radius: 12px; padding: 28px; width: 380px;
    box-shadow: 0 10px 40px rgba(28,27,25,0.25);
}
.modal h3 { font-family: var(--font-display); font-size: 18px; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.modal .modal-sub { font-size: 12px; color: var(--ink-mute); margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field label {
    display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
    font-family: var(--font-display); letter-spacing: 0.4px; color: var(--ink-mute); margin-bottom: 6px;
}
.field input, .field select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px;
    font-size: 14px; font-family: var(--font-body);
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

footer {
    text-align: center; padding: 20px; font-size: 11px; color: var(--ink-faint);
    font-family: var(--font-display); letter-spacing: 0.3px; text-transform: uppercase;
}
