/*
    Sistema de diseño de Gestión.

    Criterio: contención. Superficies neutras, una sola tinta de acento, líneas de
    medio píxel casi transparentes, tipografía con peso y espaciado medidos, y nada
    que se mueva o brille sin motivo. Un panel de trabajo se usa ocho horas al día:
    tiene que desaparecer y dejar ver el contenido.

    Claro por defecto, con modo oscuro (`data-tema="oscuro"` o el del sistema).
    La marca de cada empresa solo cambia `--acento`.

    Los nombres de las clases son los mismos que usa panel.css (.ficha, .tabla,
    .etiqueta, .btn…): migrar el panel de cliente/empleado es cambiar la hoja.
*/

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --acento: #0a6cf0;
    --acento-2: #30b0c7;
    --acento-suave: color-mix(in srgb, var(--acento) 10%, transparent);

    --fondo: #f5f5f7;
    --superficie: #ffffff;
    --superficie-2: #fafafc;
    --relleno: rgba(60, 60, 67, .08);          /* campos y botones secundarios */
    --relleno-fuerte: rgba(60, 60, 67, .14);
    --borde: rgba(60, 60, 67, .12);
    --borde-fuerte: rgba(60, 60, 67, .22);
    --texto: #1d1d1f;
    --texto-2: #6e6e73;
    --texto-3: #8e8e93;

    --ok: #248a3d;
    --aviso: #b25000;
    --mal: #d70015;
    --ok-fondo: rgba(52, 199, 89, .14);
    --aviso-fondo: rgba(255, 159, 10, .16);
    --mal-fondo: rgba(255, 59, 48, .12);

    --sombra: 0 0 0 .5px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .05);
    --sombra-alta: 0 0 0 .5px rgba(0, 0, 0, .06), 0 12px 40px rgba(0, 0, 0, .16);
    --r: 10px;
    --r-g: 14px;
    --tipo: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
}

:root[data-tema="oscuro"] {
    --fondo: #000000;
    --superficie: #1c1c1e;
    --superficie-2: #232326;
    --relleno: rgba(235, 235, 245, .10);
    --relleno-fuerte: rgba(235, 235, 245, .18);
    --borde: rgba(235, 235, 245, .12);
    --borde-fuerte: rgba(235, 235, 245, .24);
    --texto: #f5f5f7;
    --texto-2: #a1a1a6;
    --texto-3: #8e8e93;
    --ok: #32d74b;
    --aviso: #ff9f0a;
    --mal: #ff6961;
    --sombra: 0 0 0 .5px rgba(255, 255, 255, .06);
    --sombra-alta: 0 0 0 .5px rgba(255, 255, 255, .1), 0 16px 50px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-tema="claro"]) {
        --fondo: #000000;
        --superficie: #1c1c1e;
        --superficie-2: #232326;
        --relleno: rgba(235, 235, 245, .10);
        --relleno-fuerte: rgba(235, 235, 245, .18);
        --borde: rgba(235, 235, 245, .12);
        --borde-fuerte: rgba(235, 235, 245, .24);
        --texto: #f5f5f7;
        --texto-2: #a1a1a6;
        --texto-3: #8e8e93;
        --ok: #32d74b;
        --aviso: #ff9f0a;
        --mal: #ff6961;
        --sombra: 0 0 0 .5px rgba(255, 255, 255, .06);
        --sombra-alta: 0 0 0 .5px rgba(255, 255, 255, .1), 0 16px 50px rgba(0, 0, 0, .6);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--fondo);
    color: var(--texto);
    font-family: var(--tipo);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.006em;
    font-feature-settings: "cv11", "ss03";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: var(--acento); text-decoration: none; }
a:hover { opacity: .8; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 650; letter-spacing: -0.02em; }
h1 { font-size: 28px; letter-spacing: -0.03em; }
h2 { font-size: 16px; }
p { margin: 0 0 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--acento) 45%, transparent); outline-offset: 1px; border-radius: 6px; }
.apagado { color: var(--texto-2); font-size: 13.5px; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icono { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.k__valor, .tabla td, dd, .leyenda b, .linea-ed__importe { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Marco */

.marco { display: flex; min-height: 100vh; }

.lateral {
    position: sticky; top: 0; align-self: flex-start;
    display: flex; flex-direction: column;
    flex: 0 0 236px; height: 100vh;
    padding: 20px 12px 14px;
    background: color-mix(in srgb, var(--superficie) 72%, var(--fondo));
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-right: .5px solid var(--borde);
}
.lateral__marca {
    display: flex; align-items: center; gap: 10px;
    margin: 0 8px 22px;
    font-size: 15px; font-weight: 650; letter-spacing: -0.02em; color: var(--texto);
}
.lateral__marca:hover { opacity: 1; }
.lateral__logo {
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
    background: var(--texto); color: var(--superficie); font-size: 13px; font-weight: 700;
}
.lateral__nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.lateral__nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 8px;
    color: var(--texto); font-weight: 500; font-size: 13.5px;
    transition: background .12s;
}
.lateral__nav a .icono { color: var(--texto-2); }
.lateral__nav a:hover { background: var(--relleno); opacity: 1; }
.lateral__nav a.activo { background: var(--relleno-fuerte); font-weight: 600; }
.lateral__nav a.activo .icono { color: var(--acento); }
.lateral__pie { margin-top: auto; padding: 12px 6px 0; border-top: .5px solid var(--borde); }
.lateral__quien { display: flex; flex-direction: column; margin: 0 4px 8px; line-height: 1.3; }
.lateral__quien strong { font-size: 13px; font-weight: 600; }
.lateral__quien span { font-size: 12px; color: var(--texto-3); text-transform: capitalize; }
.enlace-salir { background: none; border: 0; padding: 4px; color: var(--texto-3); font: inherit; font-size: 12.5px; cursor: pointer; }
.enlace-salir:hover { color: var(--mal); }

.principal { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.barra {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; gap: 12px;
    padding: 12px clamp(16px, 2.2vw, 40px);
    background: color-mix(in srgb, var(--fondo) 78%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.barra__buscar { flex: 1 1 auto; max-width: 380px; position: relative; }
.barra__buscar .icono { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--texto-3); width: 16px; height: 16px; pointer-events: none; z-index: 1; }
.barra__buscar input[type="search"] { height: 34px; padding: 0 12px 0 34px; background: var(--relleno); border: 0; border-radius: 9px; font-size: 13.5px; box-shadow: none; }
.barra__buscar input[type="search"]:focus { background: var(--superficie); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 30%, transparent); }
.barra__acciones { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.boton-icono {
    display: grid; place-items: center; width: 34px; height: 34px;
    background: var(--relleno); border: 0; border-radius: 9px;
    color: var(--texto-2); cursor: pointer; transition: background .12s;
}
.boton-icono:hover { background: var(--relleno-fuerte); color: var(--texto); }
.avatar {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--relleno-fuerte); color: var(--texto); font-size: 12.5px; font-weight: 600;
}
.contenido { padding: 14px clamp(16px, 2.2vw, 40px) 64px; width: 100%; max-width: 1760px; }

.menu-movil { display: none; }

@media (max-width: 900px) {
    .lateral { display: none; }
    .marco.menu-abierto .lateral { display: flex; position: fixed; inset: 0 auto 0 0; z-index: 20; box-shadow: var(--sombra-alta); background: var(--superficie); }
    .menu-movil { display: grid; }
    .barra { padding: 10px 16px; }
    .contenido { padding: 8px 16px 40px; }
}

/* ------------------------------------------------------------- Contenido */

.cabecera { margin: 6px 0 22px; }
.cabecera h1 { margin-bottom: 4px; }
.cabecera p { margin: 0; }
.cabecera--con-accion { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bloque { margin-top: 28px; }
.bloque > h2 { margin-bottom: 12px; }

.aviso { margin: 0 0 16px; padding: 11px 14px; border-radius: var(--r); font-size: 13.5px; }
.aviso--ok { background: var(--ok-fondo); color: var(--ok); }
.aviso--error { background: var(--mal-fondo); color: var(--mal); }

.tarjeta, .ficha, .panel {
    background: var(--superficie);
    border-radius: var(--r-g);
    box-shadow: var(--sombra);
}
.tarjeta { padding: 26px; }
.ficha, .panel { padding: 18px 20px; }
.tarjeta--vacia { text-align: center; padding: 48px 26px; }
.tarjeta--vacia h2 { margin-bottom: 6px; }
.tarjeta--vacia p { color: var(--texto-2); margin-bottom: 16px; }
.fichas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ficha__cab, .panel__cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel__cab h2, .ficha__cab h2 { font-size: 15px; }

.datos { display: grid; gap: 9px; margin: 0; }
.datos > div { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; }
.datos dt { color: var(--texto-2); }
.datos dd { margin: 0; text-align: right; }

/* ---------------------------------------------------------- Cuadro de mando */

.rejilla-k { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }

.k {
    position: relative; overflow: hidden;
    padding: 16px 18px 14px;
    background: var(--superficie); border-radius: var(--r-g); box-shadow: var(--sombra);
}
.k__cab { display: flex; align-items: center; gap: 8px; color: var(--texto-2); font-size: 13px; font-weight: 500; }
.k__icono { display: grid; place-items: center; width: 22px; height: 22px; color: var(--acento); }
.k__icono .icono { width: 18px; height: 18px; }
.k__valor { margin: 10px 0 2px; font-size: 32px; font-weight: 650; letter-spacing: -0.035em; line-height: 1.1; }
.k__pie { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--texto-3); }
.grafico.k__chispa { margin: 8px -4px -4px; height: 40px; }
.k--destacada { background: var(--texto); color: var(--superficie); box-shadow: none; }
.k--destacada .k__cab, .k--destacada .k__pie { color: color-mix(in srgb, var(--superficie) 62%, transparent); }
.k--destacada .k__icono { color: var(--superficie); }
.k--destacada .grafico-linea { stroke: var(--superficie); }
.k--destacada .grafico-area { fill: color-mix(in srgb, var(--superficie) 14%, transparent); }

.delta { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px; font-weight: 600; font-size: 11.5px; }
.delta--sube { background: var(--ok-fondo); color: var(--ok); }
.delta--baja { background: var(--mal-fondo); color: var(--mal); }
.delta--igual { background: var(--relleno); color: var(--texto-2); }
.k--destacada .delta { background: color-mix(in srgb, var(--superficie) 18%, transparent); color: var(--superficie); }

.rejilla-paneles { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; }
.rejilla-paneles--tres { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .rejilla-paneles, .rejilla-paneles--tres { grid-template-columns: 1fr; } }

/* Gráficas: trazo fino, sin marcas hasta que se pasa el cursor, y una rejilla que apenas se ve. */
.grafico { width: 100%; height: 230px; position: relative; }
.grafico svg { width: 100%; height: 100%; overflow: visible; }
.grafico-linea { fill: none; stroke: var(--acento); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.grafico-area { stroke: none; }
.grafico-punto { fill: var(--superficie); stroke: var(--acento); stroke-width: 1.75; opacity: 0; transition: opacity .12s; }
.grafico-hit { fill: transparent; }
.grafico-hit:hover + .grafico-punto, .grafico-punto:hover { opacity: 1; }
.grafico-guia { stroke: var(--borde-fuerte); stroke-width: .75; stroke-dasharray: 2 3; opacity: 0; }
.grafico-eje { fill: var(--texto-3); font-size: 11px; font-family: var(--tipo); }
.grafico-rejilla { stroke: var(--borde); stroke-width: .5; }
.grafico-barra { fill: var(--acento); transition: opacity .12s; }
.grafico-barra:hover { opacity: .7; }
.grafico svg .dibuja { stroke-dasharray: 1; stroke-dashoffset: 1; animation: dibuja .9s cubic-bezier(.3, .7, .2, 1) forwards; }
@keyframes dibuja { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .grafico svg .dibuja { animation: none; stroke-dashoffset: 0; } }
.grafico-aviso {
    position: absolute; pointer-events: none; transform: translate(-50%, -100%);
    padding: 5px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap;
    background: var(--texto); color: var(--superficie); opacity: 0; transition: opacity .1s;
}
.grafico-aviso small { display: block; font-weight: 500; opacity: .7; font-size: 11px; }

.donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut__dibujo { width: 140px; height: 140px; flex: 0 0 auto; position: relative; }
.donut__dibujo svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut__centro { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.donut__centro strong { font-size: 24px; font-weight: 650; letter-spacing: -0.03em; }
.donut__centro span { font-size: 11.5px; color: var(--texto-3); }
.leyenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 13px; flex: 1 1 140px; }
.leyenda li { display: flex; align-items: center; gap: 9px; }
.leyenda i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.leyenda b { margin-left: auto; font-weight: 600; }

.lista-accesos { list-style: none; margin: 0; padding: 0; display: grid; }
.lista-accesos li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: .5px solid var(--borde); }
.lista-accesos li:last-child { border-bottom: 0; }
.lista-accesos__quien { display: flex; align-items: center; gap: 10px; min-width: 0; }
.actividad__punto { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--relleno); color: var(--texto-2); flex: 0 0 auto; }
.actividad__texto { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.actividad__texto a { color: var(--texto); font-weight: 550; }
.actividad__texto small { color: var(--texto-3); font-size: 12.5px; }

/* -------------------------------------------------------------- Formularios */

.campo { display: block; margin: 0 0 14px; }
.campo > span { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 550; color: var(--texto-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="tel"], input[type="date"], select, textarea {
    width: 100%; padding: 0 12px; height: 36px;
    background: var(--superficie); border: .5px solid var(--borde-fuerte); border-radius: 9px;
    color: var(--texto); font: inherit; font-size: 14px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .03);
    transition: box-shadow .15s, border-color .15s;
}
textarea { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--texto-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--acento) 25%, transparent); }
select { appearance: none; padding-right: 30px; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--texto-3) 50%), linear-gradient(135deg, var(--texto-3) 50%, transparent 50%);
    background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.casilla { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--texto-2); cursor: pointer; }
.casilla input { width: 15px; height: 15px; margin: 0; accent-color: var(--acento); box-shadow: none; }
.error { display: block; margin-top: 5px; font-size: 12px; font-style: normal; color: var(--mal); }
.buscador { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.buscador input[type="search"] { flex: 1 1 260px; width: auto; }

/* Botones: planos, de 36 px, sin brillo ni sombra. El primario lleva el acento; el resto, un relleno gris. */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%; height: 36px; padding: 0 18px;
    background: var(--acento);
    border: 0; border-radius: 9px; color: #fff; font: inherit; font-size: 14px; font-weight: 550;
    cursor: pointer; transition: filter .12s, background .12s;
}
.btn:hover, .btn:focus-visible { filter: brightness(.92); color: #fff; opacity: 1; }
.btn:active { filter: brightness(.85); }
.btn--compacto { width: auto; }
.btn--fantasma { width: auto; background: var(--relleno); color: var(--acento); }
.btn--fantasma:hover, .btn--fantasma:focus-visible { background: var(--relleno-fuerte); color: var(--acento); filter: none; }
.btn .icono { width: 15px; height: 15px; }
.acciones-fila { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.acciones-fila form { margin: 0; }

.etiqueta { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--relleno); color: var(--texto-2); }
.etiqueta--ok { background: var(--ok-fondo); color: var(--ok); }
.etiqueta--urgente { background: var(--mal-fondo); color: var(--mal); }
.etiqueta--aviso { background: var(--aviso-fondo); color: var(--aviso); }
.etiqueta--libre { background: var(--relleno); color: var(--texto-2); }

/* ------------------------------------------------------------------ Tablas */

.tabla-envoltorio { overflow-x: auto; background: var(--superficie); border-radius: var(--r-g); box-shadow: var(--sombra); }
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla th, .tabla td { padding: 11px 18px; text-align: left; }
.tabla thead th { font-size: 12px; font-weight: 500; color: var(--texto-3); border-bottom: .5px solid var(--borde); white-space: nowrap; }
.tabla tbody td { border-bottom: .5px solid var(--borde); }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr { transition: background .1s; }
.tabla tbody tr:hover { background: var(--superficie-2); }
.tabla a { color: var(--texto); font-weight: 550; }
.tabla a:hover { color: var(--acento); opacity: 1; }

.paginacion { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.paginacion a, .paginacion span { padding: 6px 12px; border-radius: 8px; background: var(--relleno); color: var(--acento); font-size: 13px; font-weight: 500; }
.paginacion .actual { background: none; color: var(--texto-2); }
.paginacion .inactivo { opacity: .4; color: var(--texto-2); }

/* -------------------------------------------------------- Pantalla de acceso */

body.centrado { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; background: var(--fondo); }
body.centrado .tarjeta { box-shadow: var(--sombra-alta); border-radius: 18px; padding: 32px 30px; }
body.centrado h1 { font-size: 24px; text-align: center; }

/* ------------------------------------------------- Ventana emergente (<dialog>) */

dialog.modal {
    width: min(860px, 94vw); max-height: 92vh; padding: 0; margin: auto;
    border: 0; border-radius: 16px;
    background: var(--superficie); color: var(--texto);
    box-shadow: var(--sombra-alta);
    overflow: hidden;
}
dialog.modal[open] { animation: aparece .18s cubic-bezier(.2, .8, .2, 1); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .32); backdrop-filter: blur(6px); animation: velo .18s ease-out; }
@keyframes aparece { from { opacity: 0; transform: scale(.97); } }
@keyframes velo { from { opacity: 0; } }
html.con-modal { overflow: hidden; }

.modal__forma { display: flex; flex-direction: column; max-height: 92vh; margin: 0; }
.modal__cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 26px 12px; }
.modal__cab h2 { font-size: 18px; margin-bottom: 2px; }
.modal__cab p { margin: 0; }
.modal__cuerpo { overflow-y: auto; padding: 4px 26px 8px; }
.modal__pie { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 26px; border-top: .5px solid var(--borde); background: var(--superficie-2); }

.seccion-form { padding: 12px 0 2px; }
.seccion-form + .seccion-form { border-top: .5px solid var(--borde); }
.seccion-form h3 { margin: 0 0 12px; font-size: 12px; font-weight: 600; color: var(--texto-3); letter-spacing: 0; }

.rejilla-form { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 14px; }
.rejilla-form > .campo { margin-bottom: 12px; }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; } .c-6 { grid-column: span 6; }
.c-5 { grid-column: span 5; } .c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; }
@media (max-width: 640px) {
    .rejilla-form > .campo { grid-column: span 12; }
    dialog.modal { width: 100vw; max-height: 100vh; border-radius: 0; }
    .modal__forma { max-height: 100vh; }
}

/* Cliente / proveedor: control segmentado, como el de iOS. */
.pastillas { display: flex; padding: 2px; background: var(--relleno); border-radius: 9px; height: 36px; }
.pastilla { flex: 1; cursor: pointer; position: relative; }
.pastilla input { position: absolute; opacity: 0; pointer-events: none; }
.pastilla span {
    display: grid; place-items: center; height: 100%; margin: 0; border-radius: 7px;
    font-size: 13px; font-weight: 550; color: var(--texto-2); transition: all .15s;
}
.pastilla input:checked + span { background: var(--superficie); color: var(--texto); box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04); }
.pastilla input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--acento) 45%, transparent); }

/* ------------------------------------------------------------ Presupuestos */

/* Filtros de estado: control segmentado. */
.filtros { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; margin-bottom: 16px; background: var(--relleno); border-radius: 10px; }
.filtro { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 8px; color: var(--texto-2); font-size: 13px; font-weight: 550; transition: background .12s; }
.filtro b { font-size: 11.5px; font-weight: 600; color: var(--texto-3); }
.filtro:hover { color: var(--texto); opacity: 1; background: var(--relleno); }
.filtro--activo, .filtro--activo:hover { background: var(--superficie); color: var(--texto); box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04); }

.lineas-editor { display: grid; gap: 10px; }
.linea-ed { padding: 14px 16px; background: var(--superficie-2); border-radius: var(--r); box-shadow: inset 0 0 0 .5px var(--borde); }
.linea-ed__numeros { display: grid; grid-template-columns: 90px 130px 90px 90px 1fr; gap: 12px; margin: 12px 0; align-items: end; }
.linea-ed__importe { height: 36px; display: flex; align-items: center; justify-content: flex-end; font-weight: 600; }
.linea-ed__pie { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.subir-foto { cursor: pointer; padding: 5px 12px; border-radius: 8px; color: var(--acento); font-size: 13px; font-weight: 550; background: var(--relleno); }
.subir-foto:hover { background: var(--relleno-fuerte); }
.subir-foto input { display: none; }
.miniatura { width: 56px; height: 44px; object-fit: cover; border-radius: 7px; box-shadow: 0 0 0 .5px var(--borde); }
.enlace-quitar { margin-left: auto; background: none; border: 0; color: var(--texto-3); font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 6px; }
.enlace-quitar:hover { color: var(--mal); }
@media (max-width: 720px) { .linea-ed__numeros { grid-template-columns: 1fr 1fr; } }

.seguimiento { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.seguimiento li { display: flex; justify-content: space-between; gap: 12px; padding-left: 20px; position: relative; font-size: 13px; color: var(--texto-3); }
.seguimiento li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--relleno-fuerte); }
.seguimiento li.hecho { color: var(--texto); }
.seguimiento li.hecho::before { background: var(--ok); }
.seguimiento li b { font-weight: 600; }
.seguimiento li span { color: var(--texto-2); text-align: right; }

.publico { max-width: 860px; margin: 0 auto; padding: 28px 16px 60px; display: grid; gap: 14px; }
.publico__cab { display: flex; align-items: center; gap: 12px; }
.publico__acciones { display: grid; gap: 8px; max-width: 400px; width: 100%; margin: 4px auto 0; }
