:root {
    --naranja: #F99200;
    --naranja-oscuro: #D97C00;
    --verde: #2E7D32;
    --amarillo: #B8860B;
    --rojo: #C62828;
    --fondo: #F5F5F5;
    --texto: #222222;
    --borde: #DDDDDD;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--fondo);
    color: var(--texto);
    font-size: 16px;
}

a { color: var(--naranja-oscuro); }

/* --- Barra superior --- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--naranja);
    color: #fff;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar__marca {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    font-size: 1.1rem;
}

.topbar__menu summary {
    color: #fff;
    cursor: pointer;
    list-style: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
}

.topbar__menu summary::-webkit-details-marker { display: none; }

.topbar__nav {
    position: absolute;
    right: 1rem;
    margin-top: 0.5rem;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    min-width: 200px;
    overflow: hidden;
}

.topbar__nav a {
    padding: 0.75rem 1rem;
    color: var(--texto);
    text-decoration: none;
    border-bottom: 1px solid var(--borde);
}

.topbar__nav a:last-child { border-bottom: none; }
.topbar__nav a:hover { background: var(--fondo); }

/* --- Layout general --- */
.contenedor {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem;
}

.pie {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #777;
    font-size: 0.85rem;
}

.tarjeta {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* --- Formularios --- */
label {
    display: block;
    font-weight: 600;
    margin: 0.75rem 0 0.25rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--borde);
    border-radius: 6px;
    font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--naranja);
    border-color: var(--naranja);
}

.btn {
    display: inline-block;
    padding: 0.65rem 1.25rem;
    border-radius: 6px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    margin-top: 1rem;
}

.btn-primario { background: var(--naranja); color: #fff; }
.btn-primario:hover { background: var(--naranja-oscuro); }

.btn-secundario { background: #fff; color: var(--texto); border: 1px solid var(--borde); }
.btn-peligro { background: var(--rojo); color: #fff; }
.btn-bloque { display: block; width: 100%; text-align: center; }

/* --- Tablas (con scroll horizontal en celular) --- */
.tabla-scroll { overflow-x: auto; margin-bottom: 1rem; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 0.6rem; text-align: left; border-bottom: 1px solid var(--borde); white-space: nowrap; }
th { background: var(--fondo); }

/* --- Estados / semáforo (reutilizado en Fase 4) --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}

.badge-verde { background: var(--verde); }
.badge-amarillo { background: var(--amarillo); }
.badge-rojo { background: var(--rojo); }
.badge-gris { background: #888; }

/* --- Mensajes flash --- */
.mensaje {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.mensaje-exito { background: #E8F5E9; color: var(--verde); border: 1px solid var(--verde); }
.mensaje-error { background: #FFEBEE; color: var(--rojo); border: 1px solid var(--rojo); }
