:root {
    --bg: #0f172a; --surface: #ffffff; --ink: #1e293b;
    --brand: #2563eb; --muted: #64748b; --line: #e2e8f0; --danger: #dc2626;
    --radius: 10px; --gap: 1rem;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --header-h: 50px;
    --nav-h: 40px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { font-family: var(--font); color: var(--ink); background: #f1f5f9;
    min-height: 100%; display: flex; flex-direction: column; }

/* ── Header ──────────────────────────────────────────────────────────────────── */
.app-header {
    background: url('/rrhh/public/assets/img/acero.jpg') center/cover no-repeat;
    position: sticky; top: 0; z-index: 100;
    flex-shrink: 0;
    box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 4px 16px rgba(0,0,0,.3);
}

/* Fila superior: marca + usuario */
.app-header-top {
    display: flex; align-items: center; gap: .75rem;
    padding: 0 1.5rem; height: var(--header-h);
}
.app-header .brand {
    display: flex; align-items: center; gap: .45rem;
    font-weight: 800; letter-spacing: .06em;
    color: #fff; text-decoration: none; font-size: 1rem;
}
.app-header .brand svg { color: var(--brand); flex-shrink: 0; }
.brand-logo {
    height: 38px;
    width: auto;
    display: block;
}
.app-header .subtitle {
    color: #1e293b; font-size: .78rem;
    padding-left: .6rem; border-left: 1px solid #475569;
    white-space: nowrap;
}
.auth-info {
    display: flex; align-items: center; gap: .55rem;
    margin-left: auto; color: #1e293b; font-size: .8rem; white-space: nowrap;
}
.auth-info svg { color: #1e293b; flex-shrink: 0; }
.auth-info span { color: #0f172a; font-weight: 500; }
.btn-logout {
    color: #1e293b; text-decoration: none; font-size: .78rem;
    border: 1px solid #475569; border-radius: 5px;
    padding: .2rem .65rem; line-height: 1.6;
    transition: color .12s, border-color .12s, background .12s;
}
.btn-logout:hover { color: #0f172a; border-color: #1e293b; background: rgba(0,0,0,.08); }
.btn-logout--exit { color: #1e293b; }
.btn-logout--exit:hover { color: #7f1d1d; border-color: #7f1d1d; background: rgba(220,38,38,.12); }

/* ── Barra de navegación horizontal ─────────────────────────────────────────── */
.app-nav {
    display: flex; align-items: stretch;
    height: var(--nav-h);
    padding: 0 1.5rem;
    border-top: 1px solid rgba(255,255,255,.055);
    background: rgba(0,0,0,.5);
    /* Sin overflow: el dropdown necesita escapar del contenedor */
    gap: 0;
}

/* Links planos del nav */
.app-nav > a,
.nav-dropdown-trigger {
    display: flex; align-items: center;
    padding: 0 .9rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: .78rem; font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    border-top: 2px solid transparent;
    transition: color .12s, background .12s;
    height: 100%;
    position: relative;
    letter-spacing: .01em;
}
.app-nav > a:hover { color: #e2e8f0; background: rgba(255,255,255,.04); }
.app-nav > a.nav-active { color: #fff; border-bottom-color: var(--brand); }

/* Separador vertical */
.nav-sep {
    width: 1px; background: rgba(255,255,255,.07);
    margin: .55rem .35rem; flex-shrink: 0; align-self: stretch;
}

/* ── Dropdowns ───────────────────────────────────────────────────────────────── */
.nav-dropdown { position: relative; display: flex; align-items: stretch; }

.nav-dropdown-trigger {
    background: none; border: none;
    font-family: inherit; cursor: pointer;
    gap: .3rem;
}
.nav-dropdown-trigger::after {
    content: '▾'; font-size: .6rem; opacity: .5;
    transition: opacity .12s;
}
.nav-dropdown:hover .nav-dropdown-trigger { color: #e2e8f0; background: rgba(255,255,255,.04); }
.nav-dropdown:hover .nav-dropdown-trigger::after { opacity: .9; }
.nav-dropdown-trigger.nav-active { color: #fff; border-bottom-color: var(--brand); }
.nav-dropdown-trigger--admin { color: #cbd5e1; }
.nav-dropdown:hover .nav-dropdown-trigger--admin { color: #fbbf24; }
.nav-dropdown-trigger--admin.nav-active { color: #fbbf24; border-bottom-color: #f59e0b; }

.nav-dropdown-menu {
    display: none;
    position: absolute; top: calc(100% + 1px); left: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.13), 0 2px 6px rgba(0,0,0,.07);
    min-width: 175px; padding: .35rem 0;
    z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }

.nav-dropdown-menu a {
    display: block; padding: .48rem 1.1rem;
    font-size: .82rem; color: var(--ink);
    text-decoration: none; white-space: nowrap;
    transition: background .1s, color .1s;
}
.nav-dropdown-menu a:hover { background: #f1f5f9; color: var(--brand); }
.nav-dropdown-divider {
    border: none; border-top: 1px solid var(--line);
    margin: .3rem 0;
}

/* ── Body layout ─────────────────────────────────────────────────────────────── */
.app-body { flex: 1; display: flex; flex-direction: column; }

/* ── Main ────────────────────────────────────────────────────────────────────── */
.app-main { flex: 1; padding: 1.5rem; padding-bottom: calc(1.5rem + 24px); min-width: 0; overflow-x: hidden; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.app-footer { text-align: center; color: var(--muted);
    font-size: .82rem; padding: .75rem 0; flex-shrink: 0;
    border-top: 1px solid var(--line); background: var(--surface); }

/* ── Login ───────────────────────────────────────────────────────────────────── */
.auth-box {
    max-width: 340px;
    margin: 4rem auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem 2.25rem 2.25rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
}
.auth-box .btn { width: 100%; margin-top: .25rem; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.5rem; }
.card h1 { margin-top: 0; }
.card.error h1 { color: var(--danger); }

/* ── Dashboard ───────────────────────────────────────────────────────────────── */
.dash-header { display:flex; align-items:baseline; justify-content:space-between;
    margin-bottom:1.5rem; }
.dash-header h1 { font-size:1.5rem; }
.dash-date { color:var(--muted); font-size:.9rem; }

.kpi-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
    gap:var(--gap); margin-bottom:1.5rem; }
.kpi-card { background:var(--surface); border:1px solid var(--line);
    border-radius:var(--radius); padding:1.25rem; }
.kpi-card--accent { border-left:4px solid var(--brand); }
.kpi-value { font-size:2.25rem; font-weight:700; color:var(--brand); line-height:1; }
.kpi-label { color:var(--muted); font-size:.85rem; margin:.25rem 0 .75rem; }
.kpi-link { font-size:.8rem; color:var(--brand); text-decoration:none; }
.kpi-link:hover { text-decoration:underline; }

.dash-grid { display:grid; grid-template-columns:1fr 1fr; gap:var(--gap); }
@media(max-width:700px){ .dash-grid { grid-template-columns:1fr; } }
.card-title { font-size:1rem; font-weight:600; margin-bottom:.75rem; }
.dash-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.dash-table th { text-align:left; padding:.4rem .5rem; border-bottom:2px solid var(--line);
    color:var(--muted); font-weight:600; font-size:.8rem; }
.dash-table td { padding:.4rem .5rem; border-bottom:1px solid var(--line); }
.dash-link { display:block; margin-top:.75rem; font-size:.8rem;
    color:var(--brand); text-decoration:none; }
.dash-link:hover { text-decoration:underline; }
.badge { display:inline-block; padding:.15rem .5rem; border-radius:4px;
    font-size:.75rem; font-weight:600; white-space: nowrap; }
.badge--ok     { background:#dcfce7; color:#166534; }
.badge--warn   { background:#fef9c3; color:#854d0e; }
.badge--danger { background:#fee2e2; color:#991b1b; }
.badge--muted  { background:#f1f5f9; color:#64748b; }
.muted { color:var(--muted); font-size:.9rem; }

/* ── Upload form ─────────────────────────────────────────────────────────────── */
.form-upload { display:flex; flex-direction:column; gap:1rem; max-width:480px; margin-top:1rem; }
.field-group { display:flex; flex-direction:column; gap:.35rem; }
.field-group label { font-weight:600; font-size:.9rem; }
.field-group input[type="file"] { font-size:.9rem; }

/* ── Botones ─────────────────────────────────────────────────────────────────── */
.btn { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--line);
    border-radius: 6px; font-size: .875rem; font-weight: 500; cursor: pointer;
    background: var(--surface); color: var(--ink); text-decoration: none;
    line-height: 1.4; transition: background .15s, border-color .15s; }
.btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-secondary { background: #f1f5f9; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
/* ── Botones icono de acción (Editar / Borrar) ── */
.btn-edit  { background: #fff; color: #2563eb; border-color: #93c5fd; }
.btn-edit:hover  { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-struct { background: #fff; color: #16a34a; border-color: #86efac; }
.btn-struct:hover { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn-danger.btn-icon { background: #fff; color: #dc2626; border-color: #fca5a5; }
.btn-danger.btn-icon:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
button.btn { font-family: inherit; }

/* ── Encabezado de página ────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem; flex-wrap: wrap; gap: .5rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; }

/* ── Alertas ─────────────────────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem;
    font-size: .9rem; border-width: 1px; border-style: solid; }
.alert-ok    { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ── Tabla de datos ──────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem;
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--line); margin-bottom: 1rem; }
.data-table th { text-align: left; padding: .55rem .75rem;
    background: #dbeafe; color: #1e40af;
    font-size: .8rem; font-weight: 700; border-bottom: 2px solid #bfdbfe; }
.data-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }

/* ── Alias .table → .data-table (usado en liquidacion / acuerdos-salariales) ── */
.table { width: 100%; border-collapse: collapse; font-size: .875rem;
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--line); margin-bottom: 1rem; }
.table th { text-align: left; padding: .55rem .75rem;
    background: #dbeafe; color: #1e40af;
    font-size: .8rem; font-weight: 700; border-bottom: 2px solid #bfdbfe; }
.table td { padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }

/* ── Paginación alternativa .pagination (usado en acuerdos-salariales) ───────── */
.pagination { display: flex; align-items: center; gap: .3rem;
    flex-wrap: wrap; margin-top: 1.25rem; }
.pagination a, .pagination .page-current {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2rem; height: 2rem; padding: 0 .6rem;
    border: 1px solid var(--line); border-radius: 6px;
    font-size: .8rem; text-decoration: none;
    color: var(--ink); background: var(--surface);
    transition: background .12s, border-color .12s;
}
.pagination a:hover { background: #f1f5f9; border-color: #cbd5e1; }
.pagination .page-current {
    background: var(--brand); border-color: var(--brand);
    color: #fff; font-weight: 600; cursor: default; }

/* ── Buscador ────────────────────────────────────────────────────────────────── */
.search-form { display: flex; gap: .5rem; margin-bottom: 1.25rem;
    align-items: center; flex-wrap: wrap; }
input[type="text"].input-search { padding: .45rem .75rem; border: 1px solid var(--line);
    border-radius: 6px; font-size: .875rem; width: 280px; max-width: 100%; }
input[type="text"].input-search:focus { outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* ── Búsqueda + filtros ──────────────────────────────────────────────────────── */
.search-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .875rem 1rem;
    margin-bottom: 1.25rem;
}
.filter-row {
    display: flex; flex-wrap: wrap; gap: .4rem;
    margin-top: .6rem;
}
.input-filter {
    padding: .3rem .55rem; border: 1px solid var(--line);
    border-radius: 6px; font-size: .8rem;
    background: var(--surface); color: var(--ink);
    font-family: inherit; min-width: 130px; max-width: 210px;
    width: auto; height: 2rem; cursor: pointer;
    transition: border-color .12s, background .12s, color .12s;
}
.input-filter:focus { outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(37,99,235,.1); }
.input-filter--active {
    border-color: var(--brand); color: var(--brand);
    background: #eff6ff; font-weight: 600;
}
.input-search--active { border-color: var(--brand); }

/* ── Input con addon (ej: porcentaje) ───────────────────────────────────────── */
.input-addon-wrap { display: flex; align-items: center; }
.input-addon-wrap .input-addon-field { border-radius: var(--radius) 0 0 var(--radius); border-right: none; }
.input-addon { display: flex; align-items: center; padding: 0 .6rem;
    background: #f1f5f9; border: 1px solid var(--line);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--muted); font-size: .875rem; height: 2.25rem; white-space: nowrap; }

/* ── Tabla empleados ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table--empleados .col-check    { width: 36px; text-align: center; padding-left: .5rem; padding-right: .5rem; }
.data-table--empleados .col-check input[type="checkbox"] { width: auto; cursor: pointer; }
.data-table--empleados tbody tr:hover { background: #f8fafc; cursor: default; }
.data-table--empleados tbody tr.is-selected { background: #eff6ff; }
.data-table--empleados .col-legajo   { width: 70px; }
.data-table--empleados .col-nombre   { min-width: 200px; }
.data-table--empleados .col-dni      { width: 100px; }
.data-table--empleados .col-estado   { width: 110px; }
.data-table--empleados .col-categoria{ width: 130px; }
.data-table--empleados .col-locacion { width: 130px; }
.data-table--empleados .col-fecha    { width: 90px; }
.data-table--empleados .col-acciones { width: 80px; }

/* ── Barra de selección masiva ───────────────────────────────────────────────── */
.bulk-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
    display: flex; align-items: center; flex-wrap: wrap; gap: .75rem;
    padding: .75rem 1.5rem;
    background: var(--bg);
    box-shadow: 0 -2px 16px rgba(0,0,0,.35);
    border-top: 1px solid rgba(255,255,255,.08);
}
.bulk-bar[hidden] { display: none; }
.bulk-bar__count {
    font-weight: 700; font-size: .875rem; color: #93c5fd;
    white-space: nowrap; margin-right: .25rem;
}
.bulk-bar__actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; flex: 1; }
.bulk-bar__label { display: flex; align-items: center; gap: .35rem;
    font-size: .825rem; color: #94a3b8; white-space: nowrap; }
.bulk-bar__select { background: #1e293b; color: #e2e8f0;
    border-color: #334155; height: 2rem; min-width: 140px; }
.bulk-bar__select:focus { border-color: var(--brand); }
.bulk-bar__clear { margin-left: auto; white-space: nowrap; }
.bulk-bar__sep { display: inline-block; width: 1px; height: 1.5rem; background: rgba(255,255,255,.25); margin: 0 .5rem; flex-shrink: 0; }
.text-mono  { font-family: ui-monospace, monospace; font-size: .82rem; }
.text-muted { color: var(--muted); }
.fw-600     { font-weight: 600; }
.empty-state { text-align: center; color: var(--muted);
    padding: 2rem 1rem !important; font-size: .9rem; }

/* ── Autocomplete localidad ──────────────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }
.autocomplete-dropdown {
    position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 500;
    background: var(--surface); border: 1px solid var(--brand);
    border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
    max-height: 220px; overflow-y: auto;
}
.autocomplete-item {
    display: flex; align-items: baseline; gap: .6rem;
    padding: .45rem .75rem; cursor: pointer; font-size: .875rem;
    border-bottom: 1px solid var(--line);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.is-active { background: #eff6ff; }
.ac-localidad { flex: 1; font-weight: 500; color: var(--ink); }
.ac-cp   { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.ac-prov { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.autocomplete-empty { padding: .6rem .75rem; font-size: .875rem; color: var(--muted); }

/* ── Instancias de empleados ─────────────────────────────────────────────────── */
.instancia-meta {
    display: flex; gap: 2rem; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: .75rem 1.25rem;
    font-size: .875rem; color: var(--ink);
}
.instancia-meta span { display: flex; gap: .35rem; }
.instancia-field {
    padding: .4rem .6rem;
    background: #f8fafc; border: 1px solid var(--line);
    border-radius: 6px; font-size: .875rem; color: var(--ink);
    min-height: 2.1rem; line-height: 1.5;
}
.instancia-field--text { white-space: pre-wrap; min-height: 4rem; }

/* ── Estado badge (doc_empleados) ───────────────────────────────────────────── */
.estado-badge { display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .875rem; border-radius: var(--radius);
    min-width: 8rem; height: 2.25rem; padding: 0 .75rem; text-align: center; }
.estado-badge--vigente { background: #16a34a; color: #fff; }
.estado-badge--vencida { background: #dc2626; color: #fff; }

/* ── Inputs, selects, textareas ──────────────────────────────────────────────── */
input[type="text"], input[type="date"], input[type="number"],
input[type="email"], input[type="password"], input[type="time"],
select, textarea {
    padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px;
    font-size: .875rem; width: 100%; background: var(--surface);
    color: var(--ink); font-family: inherit; }
input[type="text"]:focus, input[type="date"]:focus, input[type="number"]:focus,
input[type="email"]:focus, input[type="password"]:focus, input[type="time"]:focus,
select:focus, textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
input[type="checkbox"] { width: auto; accent-color: var(--brand); }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* ── Formularios ─────────────────────────────────────────────────────────────── */
.form-card { background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
    max-width: 900px; }
.form-inline { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.form-inline .field-group { flex: 1; min-width: 160px; }
.form-inline .btn { align-self: flex-end; }
label { display: block; font-weight: 600; font-size: .875rem;
    margin-bottom: .3rem; color: var(--ink); }
.form-group { margin-bottom: 1rem; }
.form-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.form-row .form-group { flex: 1; min-width: 180px; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.25rem; }
.input-sm { max-width: 220px; }
.req { color: var(--danger); }
.label-check { display: flex; align-items: center; gap: .4rem;
    font-weight: 500; cursor: pointer; }
.btn-icon { padding: .35rem .45rem; line-height: 1; }
.btn-icon svg { display: block; }
td:has(form[data-confirm]) { display: flex; align-items: center; gap: .25rem; }
td.actions { display: flex; align-items: center; gap: .25rem; }

/* ── Secciones de formulario (fieldset) ─────────────────────────────────────── */
.form-card fieldset {
    border: none;
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.25rem 1.25rem 0.25rem;
    margin-bottom: 1.25rem;
}
.form-card fieldset legend {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--brand);
    padding: 0;
    margin-bottom: .75rem;
    width: 100%;
}

/* ── Modal de confirmación ───────────────────────────────────────────────────── */
#mefa-confirm-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.45); z-index: 9000;
    align-items: center; justify-content: center;
}
#mefa-confirm-overlay.mefa-confirm-visible { display: flex; }
#mefa-confirm-dialog {
    background: var(--surface); border-radius: var(--radius);
    padding: 1.5rem 2rem; max-width: 380px; width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
#mefa-confirm-msg { margin: 0 0 1.25rem; font-size: 1rem; color: var(--ink); line-height: 1.5; }
.mefa-confirm-actions { display: flex; gap: .75rem; justify-content: flex-end; }
#mefa-confirm-cancel {
    padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 6px;
    background: var(--surface); color: var(--ink); cursor: pointer;
    font-size: .875rem; font-family: inherit;
}
#mefa-confirm-cancel:hover { background: #f1f5f9; }
#mefa-confirm-ok {
    padding: .4rem .9rem; border: 1px solid var(--danger); border-radius: 6px;
    background: var(--danger); color: #fff; cursor: pointer;
    font-size: .875rem; font-family: inherit; font-weight: 500;
}
#mefa-confirm-ok:hover { background: #b91c1c; border-color: #b91c1c; }

/* ── Breadcrumbs ─────────────────────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: .35rem;
    font-size: .82rem; color: var(--muted); margin-bottom: 1.25rem;
    flex-wrap: wrap; list-style: none; }
.breadcrumb a { color: var(--brand); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--line); user-select: none; }
.breadcrumb .current { color: var(--ink); }

/* ── Paginación ──────────────────────────────────────────────────────────────── */
.paginacion {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}
.pag-btn, .pag-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .6rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: .8rem;
    text-decoration: none;
    color: var(--ink);
    background: var(--surface);
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap;
    user-select: none;
}
a.pag-btn:hover, a.pag-num:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.pag-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
    cursor: default;
}
.pag-disabled {
    color: #cbd5e1;
    background: #f8fafc;
    cursor: default;
}
.pag-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 2rem;
    color: var(--muted);
    font-size: .85rem;
}
.pag-info {
    margin-left: .5rem;
    font-size: .8rem;
    color: var(--muted);
    white-space: nowrap;
}

/* ── Formulario horizontal (label:valor) ── */
.fh-form {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.fh-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.fh-row--top {
    align-items: flex-start;
}
.fh-label {
    flex: 0 0 14rem;
    text-align: right;
    font-weight: 600;
    font-size: .875rem;
    color: var(--ink);
    white-space: nowrap;
}
.fh-input {
    flex: 1;
}
.fh-input .input-text,
.fh-input .input-select {
    width: 100%;
    max-width: 28rem;
}
.fh-input textarea.input-text {
    max-width: 28rem;
    resize: vertical;
}

.subtitle-emp {
    font-size: .9rem;
    color: var(--muted);
    margin: -.5rem 0 1rem;
}

/* ── Modal ── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-backdrop[hidden] { display: none; }
.modal-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    width: min(600px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem .75rem;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    padding: .25rem .5rem;
    border-radius: var(--radius);
}
.modal-close:hover { background: var(--bg); }
.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}
.modal-footer {
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--line);
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    flex-shrink: 0;
}
.modal-alert {
    padding: .6rem .9rem;
    border-radius: var(--radius);
    font-size: .875rem;
    margin-bottom: .75rem;
}
.modal-alert--ok    { background: #dcfce7; color: #15803d; }
.modal-alert--error { background: #fee2e2; color: #b91c1c; }

/* ── Formulario acuerdos ── */
.acu-importe-wrap { display: flex; align-items: center; gap: .6rem; }
.acu-num { width: 9rem; text-align: right; }
.acu-currency {
    font-size: .875rem;
    font-weight: 600;
    color: var(--ink);
    min-width: 4rem;
    white-space: nowrap;
}
.acu-hint {
    font-size: .8rem;
    color: #9333ea;
    white-space: nowrap;
}
