/* ============================================================
   DESAPARECIDOS LA GUAIRA - style.css
   Diseño mobile-first, optimizado para conexiones lentas
   ============================================================ */

/* ── Reset mínimo ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables ────────────────────────────────────────────── */
:root {
    --rojo:      #c0392b;
    --rojo-osc:  #96281b;
    --gris-osc:  #2c3e50;
    --gris-med:  #7f8c8d;
    --gris-cla:  #ecf0f1;
    --blanco:    #ffffff;
    --verde:     #27ae60;
    --naranja:   #e67e22;
    --radio:     6px;
    --sombra:    0 2px 6px rgba(0,0,0,.15);
}

/* ── Base ─────────────────────────────────────────────────── */
html { font-size: 16px; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    background: #f4f6f8;
    color: #2c3e50;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ───────────────────────────────────────────────── */
header {
    background: var(--rojo);
    color: var(--blanco);
    padding: 1rem;
    text-align: center;
}
header h1 {
    font-size: clamp(1.3rem, 5vw, 2rem);
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-shadow: 1px 1px 3px rgba(0,0,0,.35);
}
.subtitulo {
    font-size: .85rem;
    opacity: .9;
    margin-top: .25rem;
}

/* ── Nav ──────────────────────────────────────────────────── */
nav {
    background: var(--rojo-osc);
    display: flex;
    gap: .5rem;
    padding: .5rem 1rem;
    flex-wrap: wrap;
}
nav a {
    color: var(--blanco);
    text-decoration: none;
    padding: .4rem .9rem;
    border-radius: var(--radio);
    font-size: .9rem;
    background: rgba(255,255,255,.12);
    transition: background .2s;
}
nav a:hover, nav a.activo { background: rgba(255,255,255,.28); }
nav .btn-nav-nuevo {
    background: var(--verde);
    margin-left: auto;
}
nav .btn-nav-nuevo:hover { background: #219a52; }
.nav-usuario {
    color: rgba(255,255,255,.75);
    font-size: .85rem;
    align-self: center;
    padding: 0 .25rem;
}
.btn-nav-logout {
    background: rgba(255,255,255,.15) !important;
    border: 1px solid rgba(255,255,255,.35);
    font-size: .85rem;
}
.btn-nav-logout:hover { background: rgba(255,255,255,.28) !important; }

/* ── Main ─────────────────────────────────────────────────── */
main {
    flex: 1;
    padding: 1rem;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

/* ── Secciones ────────────────────────────────────────────── */
section {
    background: var(--blanco);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 1.2rem;
    margin-bottom: 1.2rem;
}
section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--rojo);
    padding-bottom: .4rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.total {
    font-size: .8rem;
    font-weight: normal;
    background: var(--rojo);
    color: var(--blanco);
    padding: .15rem .55rem;
    border-radius: 999px;
    margin-left: auto;
}

/* ── Formularios ──────────────────────────────────────────── */
.form-group {
    margin-bottom: .9rem;
}
.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .3rem;
    color: var(--gris-osc);
}
.form-group.requerido label::after {
    content: " *";
    color: var(--rojo);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .6rem .75rem;
    border: 1.5px solid #ccd1d9;
    border-radius: var(--radio);
    font-size: 1rem;
    font-family: inherit;
    background: #fafbfc;
    color: var(--gris-osc);
    transition: border-color .2s;
    appearance: auto;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--rojo);
    background: var(--blanco);
}
.form-group textarea { resize: vertical; }
.form-row {
    display: grid;
    gap: .75rem;
    grid-template-columns: 1fr;
}
@media (min-width: 520px) {
    .form-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

/* ── Botones ──────────────────────────────────────────────── */
.form-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
button[type="submit"] {
    background: var(--rojo);
    color: var(--blanco);
    border: none;
    padding: .65rem 1.4rem;
    border-radius: var(--radio);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}
button[type="submit"]:hover { background: var(--rojo-osc); }
.btn-limpiar, .btn-editar {
    display: inline-block;
    padding: .6rem 1.2rem;
    border-radius: var(--radio);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    background: var(--gris-cla);
    color: var(--gris-osc);
    border: 1.5px solid #ccd1d9;
    transition: background .2s;
}
.btn-limpiar:hover { background: #d5d8dc; }
.btn-editar { background: #2980b9; color: var(--blanco); border-color: #2471a3; }
.btn-editar:hover { background: #2471a3; }
.btn-eliminar {
    display: inline-block;
    padding: .6rem 1.2rem;
    border-radius: var(--radio);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    background: var(--rojo);
    color: var(--blanco);
    transition: background .2s;
}
.btn-eliminar:hover { background: var(--rojo-osc); }

/* ── Alertas ──────────────────────────────────────────────── */
.alerta {
    padding: .85rem 1rem;
    border-radius: var(--radio);
    margin-bottom: 1rem;
    font-size: .95rem;
}
.alerta.exito { background: #d5f5e3; border-left: 4px solid var(--verde); color: #1a5c35; }
.alerta.error { background: #fdecea; border-left: 4px solid var(--rojo); color: #7b241c; }
.alerta ul { padding-left: 1.2rem; }

/* ── Tabla de listado ─────────────────────────────────────── */
.tabla-scroll { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
thead tr { background: var(--rojo); color: var(--blanco); }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid #e0e0e0; }
tbody tr:hover { background: #fef9f9; }
.acciones { white-space: nowrap; display: flex; gap: .4rem; flex-wrap: wrap; }
.acciones a {
    padding: .25rem .6rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 600;
    background: #2980b9;
    color: var(--blanco);
    transition: background .2s;
}
.acciones a:hover { background: #2471a3; }
.acciones a.btn-eliminar { background: var(--rojo); padding: .25rem .6rem; }
.acciones a.btn-eliminar:hover { background: var(--rojo-osc); }

/* Tabla responsive en móvil (card layout) */
@media (max-width: 640px) {
    thead { display: none; }
    tbody tr {
        display: block;
        border: 1px solid #ddd;
        border-radius: var(--radio);
        margin-bottom: .75rem;
        padding: .5rem .75rem;
        background: var(--blanco);
    }
    td {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px dashed #eee;
        padding: .35rem 0;
    }
    td:last-child { border-bottom: none; }
    td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--gris-med);
        min-width: 110px;
        font-size: .8rem;
        text-transform: uppercase;
    }
    .acciones { justify-content: flex-end; }
}

/* ── Tabla ficha (ver.php) ────────────────────────────────── */
.tabla-ficha { width: 100%; border-collapse: collapse; }
.tabla-ficha th, .tabla-ficha td {
    padding: .6rem .75rem;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}
.tabla-ficha th {
    width: 40%;
    background: #f8f9fa;
    font-weight: 700;
    color: var(--gris-osc);
    font-size: .85rem;
    text-transform: uppercase;
}

/* ── Estado vacío ─────────────────────────────────────────── */
.vacio {
    text-align: center;
    padding: 2rem;
    color: var(--gris-med);
    font-style: italic;
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
    background: var(--gris-osc);
    color: rgba(255,255,255,.7);
    text-align: center;
    padding: .75rem 1rem;
    font-size: .8rem;
}
