/* CICROM360 · estilo plano: sin tarjetas con sombra ni esquinas muy redondeadas.
   Los elementos se integran con el fondo y se separan con líneas pálidas pero visibles; las tablas llevan cuadrícula. */
:root {
  --bg: #fcfcfd; --surface: #fcfcfd; --surface-2: #f4f6f9; --surface-3: #eceff4;
  --ink: #0f172a; --ink-2: #435063; --muted: #657285;
  --line: #dde2ea; --line-2: #c5cddb;
  --brand: #2358d6; --brand-ink: #fff; --brand-soft: #eaf0ff;
  --interno: #2358d6; --proveedor: #b8480f; --ok: #137a3d; --warn: #a8560a; --danger: #bb3226; --violet: #6d3fd0;
  --r: 4px;
  --thumb: rgb(100 116 139 / .45);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d121b; --surface: #0d121b; --surface-2: #141b27; --surface-3: #1b2434;
    --ink: #e7edf7; --ink-2: #b3bfd2; --muted: #8493ab; --line: #263145; --line-2: #36445d;
    --brand: #5b9bff; --brand-ink: #07101f; --brand-soft: #15233f;
    --interno: #6aa6ff; --proveedor: #f5a263; --ok: #4ade80; --warn: #fbbf24; --danger: #f87171; --violet: #a78bfa;
    --thumb: rgb(148 163 184 / .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d121b; --surface: #0d121b; --surface-2: #141b27; --surface-3: #1b2434;
  --ink: #e7edf7; --ink-2: #b3bfd2; --muted: #8493ab; --line: #263145; --line-2: #36445d;
  --brand: #5b9bff; --brand-ink: #07101f; --brand-soft: #15233f;
  --interno: #6aa6ff; --proveedor: #f5a263; --ok: #4ade80; --warn: #fbbf24; --danger: #f87171; --violet: #a78bfa;
  --thumb: rgb(148 163 184 / .5); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; } /* sin scroll global: cada panel gestiona el suyo */
body { background: var(--bg); color: var(--ink); font: 14.5px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* scroll fino estilo Apple: invisible hasta pasar el cursor, pulgar redondeado sin pista */
.scroll { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.scroll:hover, .scroll:focus-within { scrollbar-color: var(--thumb) transparent; }
@supports not (scrollbar-color: auto) {
  .scroll::-webkit-scrollbar { width: 11px; height: 11px; }
  .scroll::-webkit-scrollbar-track { background: transparent; }
  .scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
  .scroll:hover::-webkit-scrollbar-thumb { background-color: var(--thumb); }
}

/* botones y campos */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: transparent; border-radius: var(--r); padding: 7px 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); background: var(--brand); }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line-2)); }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: none; border-radius: var(--r); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
input, select, textarea { background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 22%, transparent); }
textarea { width: 100%; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); }
.field { display: grid; gap: 5px; font-size: 13px; color: var(--ink-2); }
.err { color: var(--danger); font-size: 13px; min-height: 1.2em; }

.logo { display: inline-block; width: 28px; height: 28px; border-radius: 6px; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='12' r='5' fill='white'/%3E%3Cpath d='M6 27c1-6 5-9 10-9s9 3 10 9z' fill='white'/%3E%3C/svg%3E") center/cover; flex: none; }
.logo.big { width: 48px; height: 48px; border-radius: 10px; }

/* acceso */
.login { height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); border: 1px solid var(--line-2); border-radius: 6px; padding: 30px; display: grid; gap: 13px; }
.login-card .logo { justify-self: center; }
.login-card h1 { text-align: center; font-size: 22px; }
.login-card .muted { text-align: center; margin-bottom: 4px; }
.login-card label { display: grid; gap: 5px; font-size: 13px; color: var(--ink-2); }
.error { color: var(--danger); min-height: 1.2em; font-size: 13px; text-align: center; }

/* estructura: menú lateral + área de trabajo a pantalla completa */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100dvh; }
.sidebar { display: flex; flex-direction: column; gap: 16px; padding: 16px 12px; border-right: 1px solid var(--line); min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; border-bottom: 1px solid var(--line); }
.brand strong { display: block; line-height: 1.1; font-size: 15.5px; }
.brand .muted { font-size: 12px; }
#nav { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: none; text-align: left; padding: 9px 11px; border-radius: var(--r); color: var(--ink-2); cursor: pointer; font-weight: 500; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 650; box-shadow: inset 2px 0 0 var(--brand); }
.nav-item .chev { margin-left: auto; width: 15px; height: 15px; color: var(--muted); transition: transform .15s; }
.nav-item.group[aria-expanded="true"] .chev { transform: rotate(90deg); }
.nav-item.group[data-activo="true"] { color: var(--ink); font-weight: 650; }
.nav-sub { display: grid; gap: 1px; margin: 2px 0 4px 20px; padding-left: 8px; border-left: 1px solid var(--line); }
.nav-item.sub { padding: 7px 11px; }
.side-foot { margin-top: auto; display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-width: 0; }
.who #user { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.side-actions { display: flex; gap: 2px; padding: 0 2px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 24px 14px; border-bottom: 1px solid var(--line); }
.titles h1 { font-size: 22px; letter-spacing: -.01em; }
.titles .muted { margin-top: 2px; font-size: 13.5px; }
.head-actions { display: flex; gap: 8px; }
.page-body { flex: 1; min-height: 0; padding: 14px 24px 22px; } /* si la ventana es muy baja, este contenedor (y no la página) hace scroll */
.module { height: 100%; display: flex; flex-direction: column; gap: 12px; min-height: 0; }

/* barras, pestañas y filtros */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.bar .grow { flex: 1; }
.bar input[type=search] { width: 280px; max-width: 100%; }
.bar .row-flex { flex-wrap: nowrap; }
.row-flex { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs button { display: inline-flex; align-items: center; gap: 7px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; padding: 8px 14px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.n { font-size: 11.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); padding: 0 6px; border-radius: 3px; }
.tabs button[aria-selected="true"] .n { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.cats { display: flex; flex-wrap: wrap; gap: 6px; }
.cats button { border: 1px solid var(--line-2); background: transparent; border-radius: var(--r); padding: 5px 12px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.cats button:hover { border-color: var(--brand); color: var(--ink); }
.cats button[aria-selected="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 650; }
.cats .n { margin-left: 7px; }

.panel { flex: 1; min-height: 260px; }
.card { border: 1px solid var(--line); border-radius: var(--r); background: transparent; }
.empty { padding: 56px 16px; text-align: center; color: var(--muted); }

/* avatares y etiquetas */
.avatar { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; font-weight: 700; font-size: 13px; color: var(--interno); border: 1px solid color-mix(in srgb, var(--interno) 35%, var(--line)); background: color-mix(in srgb, var(--interno) 8%, var(--bg)); }
.avatar.proveedor { color: var(--proveedor); border-color: color-mix(in srgb, var(--proveedor) 35%, var(--line)); background: color-mix(in srgb, var(--proveedor) 8%, var(--bg)); border-radius: 6px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
#avatar { width: 30px; height: 30px; font-size: 12px; color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 3px; color: var(--interno); border: 1px solid color-mix(in srgb, var(--interno) 35%, var(--line)); background: transparent; white-space: nowrap; }
.pill.proveedor { color: var(--proveedor); border-color: color-mix(in srgb, var(--proveedor) 35%, var(--line)); }
.pill.vacante { color: var(--muted); border: 1px dashed var(--line-2); }
.pill.baja { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.pill.pago-mensual { color: var(--interno); }
.pill.pago-anual { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 38%, var(--line)); }
.pill.pago-periodico { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 38%, var(--line)); }
.pill.pago-unico { color: var(--proveedor); border-color: color-mix(in srgb, var(--proveedor) 38%, var(--line)); }
.pill.est-planificado { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 38%, var(--line)); }
.pill.est-en_curso { color: var(--interno); }
.pill.est-en_pausa { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.pill.est-completado { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 38%, var(--line)); }
.pill.est-cancelado { color: var(--muted); border-color: var(--line-2); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }

/* fichas de personal */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); grid-auto-rows: max-content; gap: 12px; align-content: start; padding: 1px 4px 6px 1px; }
.ficha { padding: 14px 16px; display: grid; gap: 10px; cursor: pointer; text-align: left; border-left: 3px solid var(--interno); }
.ficha.proveedor { border-left-color: var(--proveedor); }
.ficha.vacante { background: var(--surface-2); border-style: dashed; border-left-style: solid; }
.ficha:hover, .onode:hover { border-color: var(--brand); background: var(--surface-2); }
.ficha-top { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ficha-top h3 { font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.puesto { color: var(--ink-2); font-size: 13px; }
.pago { font-weight: 650; font-variant-numeric: tabular-nums; }
.pago.sin { color: var(--muted); font-weight: 400; }
.rep { font-size: 12.5px; color: var(--muted); }

/* tablas: cuadrícula suave, encabezado fijo */
.tabla-wrap { height: 100%; border: 1px solid var(--line); border-radius: var(--r); }
table.tabla { width: 100%; border-collapse: separate; border-spacing: 0; }
.tabla th, .tabla td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tabla th:last-child, .tabla td:last-child { border-right: 0; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla td.wrap { white-space: normal; }
.tabla th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); border-bottom: 1px solid var(--line-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); cursor: pointer; user-select: none; }
.tabla tbody tr { cursor: pointer; }
.tabla tbody tr:hover td { background: var(--surface-2); }
.tabla td.num { font-variant-numeric: tabular-nums; }
.tabla th.der, .tabla td.der { text-align: right; }
.tabla .sub { display: block; font-size: 12px; }
.tabla tr.off td { opacity: .6; }
.tabla td.desc { max-width: 17vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.tabla td:first-child { max-width: 230px; }
.tabla td:first-child .sub { white-space: normal; }

/* organigrama: lienzo que se ajusta al área (sin scroll), con zoom y arrastre */
.org-stage { position: relative; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); cursor: grab; touch-action: none; user-select: none;
  background: radial-gradient(circle, var(--line) 1px, transparent 1.4px) 0 0 / 22px 22px, var(--bg); }
.org-stage.drag { cursor: grabbing; }
.org-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.org-canvas svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.org-canvas path { fill: none; stroke: var(--line-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.onode { position: absolute; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 10px; text-align: left; cursor: pointer; border-left: 3px solid var(--interno); background: var(--bg); overflow: hidden; }
.onode.proveedor { border-left-color: var(--proveedor); }
.onode.vacante { background: var(--surface-2); border-style: dashed; border-left-style: solid; }
.onode .ot { display: grid; min-width: 0; }
.onode strong { font-size: 13.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onode .puesto { font-size: 12px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-label { position: absolute; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.org-label .muted { font-weight: 400; margin-left: 8px; }
.zoom { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line-2); cursor: default; }
.zoom span { align-self: center; min-width: 46px; text-align: center; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.org-hint { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--muted); pointer-events: none; }

/* licencias: catálogo en tarjetas */
.totales { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.totales b { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.totales i { font-style: normal; margin: 0 9px; color: var(--line-2); }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(390px, 1fr)); grid-auto-rows: max-content; gap: 12px; align-content: start; padding: 1px 4px 6px 1px; }
.tool { display: flex; flex-direction: column; overflow: hidden; }
.tool-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tool-head strong { font-size: 15px; overflow-wrap: anywhere; }
.tool-head .muted { font-size: 12.5px; display: block; }
.plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.plan.off .plan-name, .plan.off .costo { color: var(--muted); text-decoration: line-through; }
.plan-main { display: grid; min-width: 0; }
.plan-desc { color: var(--muted); font-size: 12.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.plan-cost { display: grid; justify-items: end; gap: 3px; }
.costo { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.costo.gratis { color: var(--muted); font-weight: 500; }
.sin-planes { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tool-foot { display: flex; gap: 8px; padding: 9px 14px; margin-top: auto; }

/* licencias por persona */
.split { display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100%; min-height: 0; border: 1px solid var(--line); border-radius: var(--r); }
.people { padding: 6px; min-height: 0; border-right: 1px solid var(--line); }
.people button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 7px 9px; border-radius: var(--r); cursor: pointer; }
.people button:hover { background: var(--surface-2); }
.people button[aria-current="true"] { background: var(--brand-soft); box-shadow: inset 2px 0 0 var(--brand); }
.people .who-t { min-width: 0; display: grid; }
.people .who-t strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .who-t .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .cnt { margin-left: auto; font-size: 12px; color: var(--muted); }
.detail { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.detail-head .who-t { display: grid; flex: 1; min-width: 180px; }
.detail-head h2 { font-size: 16px; }
.mini { display: flex; gap: 18px; }
.mini div { display: grid; text-align: right; }
.mini .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mini .v { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.lrows { flex: 1; min-height: 0; }
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 150px; gap: 14px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.lrow .t strong { display: block; }
.lrow .t .muted { font-size: 12.5px; }
.lrow select { width: 100%; }
.lrow .c { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.who-t { min-width: 0; }

/* proyectos */
.proj-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); grid-auto-rows: max-content; gap: 12px; align-content: start; padding: 1px 4px 6px 1px; }
.proj { padding: 16px; display: grid; gap: 12px; align-content: start; border-left: 3px solid var(--line-2); }
.proj.est-en_curso { border-left-color: var(--interno); }
.proj.est-planificado { border-left-color: var(--violet); }
.proj.est-en_pausa { border-left-color: var(--warn); }
.proj.est-completado { border-left-color: var(--ok); }
.proj-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.proj h3 { font-size: 16.5px; overflow-wrap: anywhere; }
.proj .desc { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.proj dl { display: grid; grid-template-columns: auto 1fr; margin: 0; font-size: 13.5px; border-top: 1px solid var(--line); }
.proj dt, .proj dd { padding: 6px 0; border-bottom: 1px solid var(--line); margin: 0; }
.proj dt { color: var(--muted); padding-right: 16px; }
.team { display: flex; align-items: center; }
.team .avatar { margin-left: -6px; border: 2px solid var(--bg); }
.team .avatar:first-child { margin-left: 0; }
.team .more { margin-left: 8px; font-size: 12.5px; color: var(--muted); }
.proj-foot { display: flex; flex-wrap: wrap; gap: 8px; }
a.btn { text-decoration: none; color: inherit; }

/* ventanas */
dialog { border: 1px solid var(--line-2); border-radius: 6px; padding: 0; width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); background: var(--bg); color: var(--ink); box-shadow: 0 18px 50px rgb(0 0 0 / .28); }
dialog[open] { display: flex; flex-direction: column; }
dialog form { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 34px); }
dialog::backdrop { background: rgb(8 14 28 / .45); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 17px; }
.dlg-body { padding: 16px 20px; display: grid; gap: 14px; align-content: start; flex: 1; min-height: 0; }
.dlg-foot { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.dlg-foot .sp { margin-left: auto; display: flex; gap: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; width: max-content; max-width: 100%; }
.seg label { position: relative; cursor: pointer; padding: 6px 16px; color: var(--ink-2); font-size: 14px; border-right: 1px solid var(--line); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: -2px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px 12px; cursor: pointer; }
.checks label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.sel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sel-tools input { flex: 1 1 200px; }
.sel-list { display: grid; align-content: start; border: 1px solid var(--line); border-radius: var(--r); max-height: 340px; }
.sel-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sel-row:last-child { border-bottom: 0; }
.sel-row:hover { background: var(--surface-2); }
.sel-row input { width: 15px; height: 15px; accent-color: var(--brand); }
.sel-row .pill.vacante { margin-left: 8px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: var(--r); z-index: 50; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--danger); color: #fff; }

/* personal inactivo */
.inactivo { opacity: .6; }
.inactivo.ficha, .inactivo.onode { border-style: dashed; }

/* página del plan de Azure DevOps */
.doc { padding: 2px 6px 24px 2px; line-height: 1.55; }
.doc h2 { font-size: 15px; margin: 22px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.doc h3 { font-size: 14px; margin: 0 0 6px; }
.doc p { margin: 0 0 10px; }
.doc ul, .doc ol { margin: 0 0 10px; padding-left: 20px; }
.doc li { margin: 4px 0; }
.doc code { font: 12.5px ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--surface-3); padding: 1px 6px; border-radius: 3px; overflow-wrap: anywhere; }
.doc .tabla td:nth-child(2) { min-width: 330px; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--brand); background: var(--brand-soft); padding: 11px 14px; margin: 0 0 14px; border-radius: var(--r); }
.trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); }
.trio > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.trio > div:last-child { border-right: 0; }
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin: 8px 0 6px; }
.flow i { align-self: center; font-style: normal; color: var(--muted); font-size: 20px; }
.paso { display: grid; gap: 3px; min-width: 190px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); }
.paso span { color: var(--muted); font-size: 12.5px; }
.fuentes a { color: var(--brand); }
.decisiones li { margin: 8px 0; }

/* pantallas estrechas: el menú pasa arriba; el área de trabajo sigue ocupando la pantalla */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand { padding: 0; border: 0; }
  .brand div { display: none; }
  #nav { display: flex; gap: 2px; }
  .nav-group { display: contents; }
  .nav-item.group { display: none; }
  .nav-sub, .nav-sub[hidden] { display: flex !important; margin: 0; padding: 0; border: 0; gap: 2px; }
  .nav-item { padding: 8px 11px; white-space: nowrap; width: auto; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; align-items: center; }
  .who #user { display: none; }
  .page-head { padding: 12px 14px; flex-wrap: wrap; align-items: center; }
  .titles h1 { font-size: 19px; }
  .page-body { padding: 12px 14px 14px; }
  .bar .row-flex { flex-wrap: wrap; }
  .totales { white-space: normal; }
  .split { grid-template-columns: 1fr; grid-template-rows: 160px minmax(360px, 1fr); }
  .people { border-right: 0; border-bottom: 1px solid var(--line); }
  .lrow { grid-template-columns: 1fr; gap: 6px; }
  .lrow .c { text-align: left; }
  .row2 { grid-template-columns: 1fr; }
  .tools, .proj-cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .nav-item span { display: none; }
  .nav-item { padding: 9px 12px; }
}
@media (max-width: 560px) { .nav-item.sub span { display: inline; } }
.tools { align-items: start; }
.tabla td.desc { max-width: 0; width: 100%; min-width: 160px; }

/* formularios y tablas de los módulos de gestión */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field.inline { display: inline-grid; gap: 3px; font-size: 12px; }
.field.inline input, .field.inline select { width: 150px; padding: 5px 9px; }
.field.inline select { width: auto; min-width: 220px; }
.tabla tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--line-2); border-bottom: 0; white-space: nowrap; }
.tabla.costos { font-size: 13px; }
.tabla.costos th, .tabla.costos td { padding: 7px 9px; }
.tabla.costos th { font-size: 10.5px; }
.tabla.costos td:first-child { min-width: 190px; }
.nota { margin-top: 10px; font-size: 12.5px; max-width: 120ch; }
.rc-panel { display: flex; flex-direction: column; gap: 8px; }
.rc-panel > .tabla-wrap { flex: 1; min-height: 0; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* gastos: reporte */
.tabla .nowrap, td.nowrap { white-space: nowrap; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 18px; align-content: start; height: 100%; padding: 2px 6px 12px 2px; }
.rep-kpis { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: var(--r); }
.rep-kpis > div { flex: 1 1 150px; display: grid; gap: 2px; padding: 12px 16px; border-right: 1px solid var(--line); }
.rep-kpis > div:last-child { border-right: 0; }
.rep-kpis .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rep-kpis .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rep-bloque h3 { font-size: 14px; margin: 0 0 8px; }
.tabla.compacta { border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; }
.tabla.compacta th { position: static; cursor: default; }
.tabla.compacta th, .tabla.compacta td { padding: 6px 10px; }
.barra-col { width: 90px; }
.barra { display: block; height: 8px; background: var(--surface-3); border-radius: 2px; }
.barra i { display: block; height: 100%; background: var(--brand); border-radius: 2px; }
.plano { margin: 0; padding-left: 18px; font-size: 13.5px; }
.plano li { margin: 3px 0; }

.tabla td.desc2 { max-width: 260px; font-size: 12.5px; color: var(--ink-2); }
.curso-row { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 90px; }
.tabs .n { white-space: nowrap; }

/* contrataciones */
.form-sec { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.form-sec:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.cand .pasos { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; }
.paso-c { color: var(--muted); }
.paso-c.ok { color: var(--ok); }
.paso-c b { font-weight: 650; color: var(--ink-2); }
.cand.est-contratado, .cand.est-confirmado { border-left-color: var(--ok); }
.cand.est-desistio, .cand.est-descartado { border-left-color: var(--line-2); opacity: .8; }
.cand .avatar { color: var(--brand); }
.rep-grid.proceso { grid-template-columns: 1fr; flex: 1; min-height: 0; height: auto; }
.eb-fila { margin: 0 0 14px; }
.eb-tit { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.embudo { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.eb { position: relative; display: grid; gap: 1px; padding: 10px 12px; color: #fff; }
.eb b { font-size: 22px; font-variant-numeric: tabular-nums; }
.eb span { font-size: 12px; opacity: .92; }
.eb i { position: absolute; top: 8px; right: 10px; font-style: normal; font-size: 12px; opacity: .8; }
.eb0 { background: #172554; } .eb1 { background: #1e3a8a; } .eb2 { background: #1d4ed8; } .eb3 { background: #3b6fe0; } .eb4 { background: #5b8def; } .eb5 { background: var(--ok); }
.tabla.compacta tfoot td { position: static; }
@media (max-width: 900px) { .embudo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
