/* Oficina: estilos base. Pensado primero para celular. */

:root {
    --fondo: #f5f3ef;
    --papel: #ffffff;
    --tinta: #1f2328;
    --sutil: #6b6f76;
    --linea: #e2ded6;
    --acento: #1d4e5f;
    --acento-hover: #163d4a;
    --ok-fondo: #e7f3ec;
    --ok-tinta: #1e5a36;
    --error-fondo: #fbeceb;
    --error-tinta: #8a2620;
    --info-fondo: #eef3f6;
    --radio: 10px;
}

* { box-sizing: border-box; }

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

h1 { font-size: 1.35rem; line-height: 1.25; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
a { color: var(--acento); }

.contenedor { max-width: 860px; margin: 0 auto; padding: 1rem; }

/* Barra superior */
.barra {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .75rem 1rem; background: var(--papel); border-bottom: 1px solid var(--linea);
    position: sticky; top: 0; z-index: 5;
}
.marca { font-weight: 700; text-decoration: none; color: var(--tinta); letter-spacing: .02em; }
.barra nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.barra nav a { text-decoration: none; color: var(--sutil); }
.barra nav a.activo { color: var(--tinta); font-weight: 600; }
.barra form { margin: 0; }

/* Tarjetas y listas */
.tarjeta {
    background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio);
    padding: 1rem;
}
.lista { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .75rem; }
.fila { display: flex; flex-direction: column; gap: .75rem; }
.fila-datos { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: inherit; }
.fila-acciones { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.fila-acciones form { margin: 0; }
.fila.inactiva { opacity: .6; }
.codigo { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; color: var(--acento); }
.entidad { font-size: .95rem; }
.objeto { font-size: .9rem; }
.sutil { color: var(--sutil); font-size: .875rem; }
.vacio { text-align: center; color: var(--sutil); }

.encabezado { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
.encabezado h1 { margin: 0; }

/* Formularios */
.formulario { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
label { font-weight: 600; font-size: .9rem; margin-top: .6rem; }
label.check { font-weight: 400; display: flex; gap: .5rem; align-items: center; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
    width: 100%; padding: .7rem .8rem; font: inherit; color: inherit;
    background: #fff; border: 1px solid #cfcac0; border-radius: 8px;
}
textarea { resize: vertical; text-transform: uppercase; }
#codigo_nic { text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--acento); outline-offset: 1px; border-color: transparent; }

.vista-previa {
    margin-top: 1rem; padding: .85rem; border-radius: 8px;
    background: var(--fondo); border: 1px dashed #cfcac0;
}
.vista-previa p { margin: .35rem 0 0; font-family: "Times New Roman", Times, serif; font-size: 1rem; }
.vista-previa select { width: auto; display: inline-block; padding: .1rem .3rem; font: inherit; }

.buscador { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.buscador input { flex: 1 1 220px; }

/* Botones */
.boton {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .7rem 1.1rem; min-height: 44px; border: 0; border-radius: 8px;
    background: var(--acento); color: #fff; font: inherit; font-weight: 600;
    text-decoration: none; cursor: pointer;
}
.boton:hover { background: var(--acento-hover); }
.boton:disabled { opacity: .5; cursor: not-allowed; }
.boton.secundario { background: transparent; color: var(--acento); border: 1px solid var(--acento); }
.boton.secundario:hover { background: var(--info-fondo); }
.enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--acento); cursor: pointer; text-decoration: underline; }
.enlace.peligro { color: var(--error-tinta); }

.acciones { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.acciones.secundarias { justify-content: space-between; }
.acciones form { margin: 0; }

/* Avisos */
.aviso { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.aviso ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.aviso.ok { background: var(--ok-fondo); color: var(--ok-tinta); }
.aviso.error { background: var(--error-fondo); color: var(--error-tinta); }
.aviso.info { background: var(--info-fondo); }

/* Detalle */
.detalle h1 { margin-top: .25rem; font-size: 1.15rem; }
.detalle dl { margin: 0; display: grid; gap: .2rem; }
.detalle dt { font-weight: 600; font-size: .85rem; color: var(--sutil); margin-top: .6rem; }
.detalle dd { margin: 0; }

/* Login e inicio */
.login { max-width: 380px; margin: 12vh auto 0; }
.login .boton { margin-top: 1rem; width: 100%; }
.modulos { display: grid; gap: .75rem; }
.modulo { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: inherit; }
.modulo:hover { border-color: var(--acento); }

/* Paginación de Laravel (vista por defecto) */
.paginacion nav { display: flex; justify-content: center; }
.paginacion svg { width: 1rem; height: 1rem; }

@media (min-width: 640px) {
    .contenedor { padding: 1.5rem; }
    h1 { font-size: 1.6rem; }
    .encabezado { flex-direction: row; align-items: center; justify-content: space-between; }
    .fila { flex-direction: row; align-items: center; justify-content: space-between; }
    .fila-acciones { flex-shrink: 0; }
    .modulos { grid-template-columns: repeat(2, 1fr); }
}
