/* OYMC — Sistema de identidad v1.0 (Guía de marca): índigo + lima sobre
   navy, tipografía Lexend. Estructura M3 heredada del dashboard original.
   Tokens de marca: --oymc-* (tokens.css del kit); el resto son los roles
   de la interfaz derivados de ellos. */

/* --- Fuentes locales (la web admin también se usa en obra sin conexión estable) --- */
/* Lexend variable (400–800, subset latino). Una sola familia para todo. */
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/lexend-latin-80258e9a.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/roboto-mono-latin-8e08a3bc.woff2") format("woff2");
}
@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url("/assets/material-symbols-outlined-subset-2d99b7ed.woff2") format("woff2");
}

:root {
  /* Marca OYMC (kit marca-oymc/tokens.css) */
  --oymc-indigo: #4f46e5; --oymc-indigo-700: #4338ca; --oymc-indigo-100: #e0e7ff;
  --oymc-lima: #c8f135; --oymc-lima-700: #a3c81c;
  --oymc-navy: #1e1b4b; --oymc-texto: #1e1b4b; --oymc-texto-2: #6b6b8f;
  --oymc-fondo: #f5f6fa; --oymc-superficie: #ffffff; --oymc-borde: #e6e8f0;
  --oymc-ok: #10b981; --oymc-curso: #f59e0b; --oymc-urgente: #f43f5e;
  --oymc-font: "Lexend", system-ui, sans-serif;
  --oymc-radio: 6px; --oymc-radio-lg: 8px;
  /* Sistema UI (ver DESIGN.md): radios, bordes y sombras de la consola */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 10px;
  --line: #eef0f5;
  --head-fill: #f7f8fb;
  --border-strong: #d6d9e6;
  --pc-soft: #eef0ff;
  --text-3: #6e6e90;
  --shadow-card: 0 1px 2px rgba(30, 27, 75, .05);
  --shadow-pop: 0 12px 32px rgba(30, 27, 75, .16), 0 2px 6px rgba(30, 27, 75, .06);
  --ring: 0 0 0 3px rgba(79, 70, 229, .28);
  --text-strong: #3f3d68;      /* texto de menú, cabeceras de tabla y códigos */
  --border-hover: #c4c8da;     /* borde de campos y botones secundarios al pasar el cursor */
  --border-accent: #cdd2f7;    /* borde índigo suave de tarjetas en hover */
  --chart-soft: #c7cdfb;       /* barras del gráfico que no son la semana actual */
  --overdue-border: #f4bccb;   /* tarjeta vencida en el tablero */

  /* Primario: índigo (botones, nav, enlaces). 6.3:1 sobre blanco */
  --p: var(--oymc-indigo);
  --p-hover: var(--oymc-indigo-700);
  --pc: var(--oymc-indigo-100);
  --onpc: #3730a3;
  /* Acento: lima (crear, destacados, progreso). Siempre con texto navy */
  --accent: var(--oymc-lima);
  --accent-hover: var(--oymc-lima-700);
  --on-accent: var(--oymc-navy);
  /* Acero: contenedores secundarios y neutros fríos */
  --sc: #eef0f6;
  --onsc: var(--oymc-navy);
  --err: #e11d48;
  --err-hover: #be123c;
  --ec: #fdeaee;
  --onec: #be123c;
  --bg: var(--oymc-superficie);
  --canvas: var(--oymc-fondo);
  --card-border: var(--oymc-borde);
  --sv: var(--oymc-borde);
  --osv: #5f5f86;
  --os: var(--oymc-texto);
  --out: #6e6e90;
  --ov: #d2d2ec;
  --scl: #f5f6fa;
  --sch: #eef0f5;
  --ok-bg: #e6f6ef;
  --ok-fg: #047857;
  --warn-bg: #fdf2e0;
  --warn-fg: #b45309;
  --green: var(--oymc-ok);
  --brand-deep: var(--oymc-navy);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  font-family: var(--oymc-font);
  color: var(--os);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--p); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--p);
  outline-offset: 2px;
  border-radius: 4px;
}

h1 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 14px; font-weight: 600; margin: 0; }

/* --- Iconos Material Symbols ---
   La fuente es un SUBSET (app/assets/fonts/material-symbols-outlined-subset.woff2):
   solo contiene los íconos usados. Si agregas un ícono nuevo y se ve como texto
   ("ACCOUNT_TREE"), regenera el subset descargando el woff2 que devuelve:
   https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&icon_names=<lista,separada,por,comas>
   Íconos incluidos: account_tree add arrow_back arrow_downward
   arrow_drop_down arrow_forward arrow_upward assignment attach_file badge
   calendar_month cell_tower check check_box check_box_outline_blank checklist
   close cloud_sync computer dashboard description domain download electric_meter
   engineering event filter_alt folder_open group handyman home_storage how_to_reg
   image info inventory_2 link local_shipping lock logout manage_accounts menu
   person person_add place play_circle print qr_code_2 rate_review refresh search
   settings smartphone sms star tag task task_alt upload view_kanban warehouse
   warning work */
.ms {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  display: inline-block;
  /* Trazo fino (peso 300, óptica 20) como los íconos de línea de una consola admin */
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
  vertical-align: middle;
}

.fs11 { font-size: 11px; }
.fs18 { font-size: 18px; }
.fs24 { font-size: 24px; }
.osv { color: var(--osv); }
.mono, .code { font-family: 'Roboto Mono', monospace; }
.muted { color: var(--osv); }
.tc { text-align: center; }

/* Solo para tecnología asistiva */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Utilidades flex --- */
.fx { display: flex; }
.ac { align-items: center; }
.jb { justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.f1 { flex: 1; min-width: 0; }
.gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.wrap { flex-wrap: wrap; }

/* --- Shell del dashboard --- */
.dash { display: flex; min-height: 100vh; background: var(--canvas); }

.side {
  width: 240px;
  background: var(--bg);
  border-right: 1px solid var(--card-border);
  padding: 14px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  min-height: 100vh;
}

.side.sdark { background: var(--oymc-navy); }
.side.sdark .ni { color: #c7d2fe; }
.side.sdark .ni.nia { background: rgba(255,255,255,.12); color: #fff; }
.side.sdark .sbrand-name { color: #fff; }
.side.sdark .sbrand-sub { color: #a5a3c9; }
.side.sdark { border-right-color: transparent; }
.side.sdark .sbrand { border-bottom-color: rgba(255,255,255,.1); }
.side.sdark a.ni:hover { background: rgba(255,255,255,.08); color: #fff; }
.side.sdark .ni .ms, .side.sdark .ni.nih { color: #a5a3c9; }
.side.sdark .ni.nia .ms { color: #fff; }

.sbrand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; margin: 0 -12px 8px; padding-left: 22px; border-bottom: 1px solid var(--card-border); min-height: 46px; }
.sbrand-name { font-weight: 700; font-size: 15px; }
.sbrand-sub {
  font-size: 11px; color: var(--osv);
  max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.logo {
  width: 64px; height: 64px;
  border-radius: var(--r-md);
  background: var(--p);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; letter-spacing: 1px;
  flex-shrink: 0;
}
.logo.lsm { width: 40px; height: 40px; border-radius: var(--r-md); font-size: 11px; }

/* --- Marca: isotipo (torre) + wordmark Lexend 800 con la «C» en índigo --- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; flex-shrink: 0; }
.brand svg { flex-shrink: 0; display: block; }
.brand-word { font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--oymc-navy); }
.brand-word b { font-weight: inherit; color: var(--oymc-indigo); }
.brand-desc { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 8px; letter-spacing: .2em; text-transform: uppercase; color: var(--oymc-indigo); margin-top: 4px; }
.brand-desc::before { content: ""; width: 16px; height: 4px; border-radius: 2px; background: var(--oymc-lima); }
.brand.on-dark .brand-word { color: #fff; }
.brand.on-dark .brand-word b { color: var(--oymc-lima); }
.brand.on-dark .brand-desc { color: var(--oymc-lima); }

.ni {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500;
  color: var(--text-strong);
}
.ni .ms { font-size: 20px; color: var(--text-3); transition: color .12s; }
a.ni:hover { background: var(--scl); color: var(--os); text-decoration: none; }
a.ni:hover .ms { color: var(--osv); }
a.ni:focus-visible { outline-offset: -2px; border-radius: var(--r-sm); }
.ni.nia { background: var(--pc-soft); color: var(--p); font-weight: 600; }
.ni.nia .ms { color: var(--p); }

.nbdg {
  margin-left: auto;
  background: var(--err); color: #fff;
  font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.dmain { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topb {
  height: 60px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}

/* Botón hamburguesa: solo visible en pantallas angostas */
.navbtn {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--os);
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.navbtn:hover { background: var(--scl); }

.scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgb(25 29 33 / .4);
  z-index: 39;
  border: none; padding: 0;
}

.esel {
  display: flex; align-items: center; gap: 8px;
  height: 36px; border: 1px solid var(--card-border); border-radius: var(--r-sm);
  padding: 0 10px; background: var(--bg);
  font-size: 13px; font-weight: 500;
  color: var(--os);
  min-width: 0;
}
.esel-name {
  max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
a.esel:hover { background: var(--scl); text-decoration: none; }

.dcont {
  flex: 1;
  padding: 24px;
  display: flex; flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.dtitle { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* --- Tarjetas --- */
.dcard, .card {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}
.dcp, .card { padding: 16px 20px; }
.card { margin-bottom: 16px; }
.dh { font-size: 14px; font-weight: 600; color: var(--os); }
/* Cabecera de tarjeta con divisor (título + acciones a la derecha) */
.dhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--card-border); }
/* Las tarjetas que arman su cabecera a mano (fila .fx con un .dh al inicio)
   reciben el mismo tratamiento: divisor a todo el ancho de la tarjeta. */
.dcard.dcp > .fx:first-child:has(> .dh),
.dcard.dcp > .fx:first-child:has(> span > .dh) { margin: -16px -20px 16px; padding: 14px 20px; border-bottom: 1px solid var(--card-border); }
.dcard > .dcp.fx:first-child:has(> .dh) { padding: 14px 20px !important; border-bottom: 1px solid var(--card-border); }
.dcard > .dcp.fx:first-child:has(> .dh) + .tbl .thd { border-top: none; }
.dh .ms { color: var(--p); vertical-align: -4px; }

.kpi {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 16px 20px;
  min-width: 200px;
}
.kl { font-size: 13px; color: var(--os); font-weight: 500; }
.kv { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; margin-top: 2px; }
.kv.kerr { color: var(--err); }
.ks { font-size: 12px; color: var(--osv); margin-top: 2px; }
.ks b { font-weight: 600; }
.ks .kup { color: var(--ok-fg); } .ks .kdown { color: var(--onec); } .ks .kwarn { color: var(--warn-fg); }
/* Ícono del KPI en círculo tintado, a la derecha */
.kpi-ic { grid-column: 2; grid-row: 1 / span 3; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--pc-soft); color: var(--p); }
.kpi-ic .ms { font-size: 22px; }
.kpi-ic.ok { background: var(--ok-bg); color: var(--ok-fg); }
.kpi-ic.warn { background: var(--warn-bg); color: var(--warn-fg); }
.kpi-ic.err { background: var(--ec); color: var(--onec); }
.kpi > :not(.kpi-ic) { grid-column: 1; }

/* --- Tablas grid del design system ---
   El contenedor .tbl aporta scroll horizontal en pantallas angostas y
   semántica de tabla (role="table" en el markup). Cada tabla declara sus
   columnas con una clase cols-*; nada de estilos inline por fila. */
.tbl { overflow-x: auto; }

.thd {
  display: grid; gap: 12px;
  padding: 9px 16px;
  font-size: 12px; font-weight: 600;
  color: var(--text-strong);
  background: var(--head-fill);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--card-border);
}
.dcard > .tbl:first-child .thd, .dcard > .thd:first-child, .dhead + .tbl .thd { border-top: none; }
.trw {
  display: grid; gap: 12px;
  padding: 10px 16px;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.trw:last-child { border-bottom: none; }
/* Chips y etiquetas usados directamente como celda: se ajustan a su texto */
.trw > .code, .trw > .tag { justify-self: start; }
.trw > * { min-width: 0; overflow-wrap: anywhere; }

/* Fila-enlace: el enlace de la primera celda se estira sobre toda la fila */
.rowlink { color: inherit; font-weight: inherit; }
.rowlink::after { content: ""; position: absolute; inset: 0; }
.rowlink:hover { text-decoration: none; }
.trw:has(.rowlink):hover { background: #fafbff; }
.rowlink:focus-visible { outline: none; }
.rowlink:focus-visible::after { outline: 2px solid var(--p); outline-offset: -2px; border-radius: var(--r-sm); }

/* Un form que agrupa varias celdas de una fila sin romper la rejilla */
.rowform { display: contents; }
.qtyf { width: 80px; padding: 6px 8px; }

/* Columnas por tabla (min-width habilita el scroll horizontal en móvil) */
.cols-wo { grid-template-columns: 120px minmax(220px, 1fr) 150px 100px 120px 150px 110px; min-width: 980px; }
.cols-wo-nolevel { grid-template-columns: 120px minmax(220px, 1fr) 100px 120px 150px 110px; min-width: 830px; }
/* Cabeceras ordenables */
.sorth { color: inherit; display: inline-flex; align-items: center; gap: 2px; }
.sorth:hover { text-decoration: none; color: var(--p); }
.sorth.on { color: var(--os); }
.sorth .ms { font-size: 16px; }

/* --- Explorador de órdenes de trabajo (vista de carpetas, estilo Finder) --- */
.seg { display: inline-flex; height: 36px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--bg); }
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; color: var(--osv); font-size: 12.5px; font-weight: 500; }
.seg a .ms { font-size: 18px; }
.seg a + a { border-left: 1px solid var(--border-strong); }
.seg a:hover { background: var(--scl); text-decoration: none; }
.seg a.on { background: var(--pc-soft); color: var(--p); font-weight: 600; }
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--osv); }
.crumbs a { color: var(--osv); }
.crumbs .cur { color: var(--os); font-weight: 700; }
.crumbs .crumb-up { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--bg); }
.crumbs .crumb-up:hover { background: var(--scl); text-decoration: none; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 16px 20px; }
.folder {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 12px;
  border: 1px solid var(--card-border); border-radius: var(--r-md); background: var(--bg); color: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.folder:hover { text-decoration: none; border-color: var(--border-accent); box-shadow: 0 4px 12px rgba(30, 27, 75, .07); }
.folder svg { width: 60px; height: 45px; margin-bottom: 4px; }
.folder .fname { font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.folder .fmeta { font-size: 12px; color: var(--osv); }
.folder.empty { opacity: .65; }
.folder.empty:hover { opacity: 1; }
.cols-hierarchy { grid-template-columns: 70px minmax(200px, 1fr) 140px 320px; min-width: 740px; }
.cols-recent { grid-template-columns: 120px minmax(220px, 1fr) 110px 120px 90px 110px; min-width: 860px; }
.cols-vale { grid-template-columns: 130px 110px minmax(200px, 1fr) 60px 105px 105px 150px; min-width: 880px; }
/* Recursos de una actividad (materiales llevan además la columna SIGA) */
.cols-res { grid-template-columns: 130px minmax(200px, 1fr) 60px 105px 105px 105px; min-width: 760px; }
.cols-res-manage { grid-template-columns: 130px minmax(200px, 1fr) 60px 105px 105px 105px 90px; min-width: 840px; }
.cols-resm { grid-template-columns: 130px 110px minmax(200px, 1fr) 60px 105px 105px 105px; min-width: 870px; }
.cols-resm-manage { grid-template-columns: 130px 110px minmax(200px, 1fr) 60px 105px 105px 105px 90px; min-width: 950px; }
/* Recursos por defecto de una plantilla de tarea */
.cols-tres { grid-template-columns: 110px 140px minmax(200px, 1fr) 60px 100px 80px; min-width: 720px; }
.qty-input { width: 80px; }
/* Recursos de una actividad en el modal "Agregar actividad" */
.cols-ares { grid-template-columns: 100px 120px minmax(180px, 1fr) 55px 95px 70px; min-width: 640px; }
/* Materiales desmontados */
.cols-dis { grid-template-columns: minmax(220px, 1fr) 80px 110px; min-width: 460px; }
.cols-dis-manage { grid-template-columns: minmax(220px, 1fr) 80px 110px 90px; min-width: 540px; }
/* Catálogos sin catalog_columns: una sola columna "Detalle" */
.cols-catalog { grid-template-columns: 130px minmax(200px, 1fr) minmax(180px, 1fr) 140px 130px; min-width: 840px; }
.cols-catalog-admin { grid-template-columns: 130px minmax(200px, 1fr) minmax(180px, 1fr) 140px 130px 150px; min-width: 990px; }
/* Herramientas, vehículos, equipos de cómputo, activos VNR y suministros: una columna por campo
   (catalog_columns de cada controller); el .tbl hace scroll horizontal. */
.cols-tools { grid-template-columns: 120px minmax(180px, 1fr) 120px 100px 110px 120px 110px 110px 110px 80px 70px 130px 130px 120px; min-width: 1810px; }
.cols-tools-admin { grid-template-columns: 120px minmax(180px, 1fr) 120px 100px 110px 120px 110px 110px 110px 80px 70px 130px 130px 120px 150px; min-width: 1970px; }
.cols-vehicles { grid-template-columns: 120px minmax(180px, 1fr) 100px 110px 100px 100px 60px 110px 110px 110px 130px 130px 120px; min-width: 1660px; }
.cols-vehicles-admin { grid-template-columns: 120px minmax(180px, 1fr) 100px 110px 100px 100px 60px 110px 110px 110px 130px 130px 120px 150px; min-width: 1820px; }
.cols-computer_devices { grid-template-columns: 120px minmax(180px, 1fr) 110px 100px 120px 130px 110px 110px 110px 130px 130px 120px; min-width: 1640px; }
.cols-vnr_assets { grid-template-columns: 120px minmax(200px, 1fr) 110px 160px 110px 120px 110px 100px 100px 130px 120px; min-width: 1400px; }
.cols-vnr_assets-admin { grid-template-columns: 120px minmax(200px, 1fr) 110px 160px 110px 120px 110px 100px 100px 130px 120px 150px; min-width: 1560px; }
.cols-supplies { grid-template-columns: 110px minmax(200px, 1fr) 120px 100px 80px 80px 110px 110px 100px 100px 130px 120px; min-width: 1480px; }
.cols-supplies-admin { grid-template-columns: 110px minmax(200px, 1fr) 120px 100px 80px 80px 110px 110px 100px 100px 130px 120px 150px; min-width: 1640px; }
.cols-computer_devices-admin { grid-template-columns: 120px minmax(180px, 1fr) 110px 100px 120px 130px 110px 110px 110px 130px 130px 120px 150px; min-width: 1800px; }
.cols-vale-manage { grid-template-columns: 130px 110px minmax(200px, 1fr) 60px 105px 105px 150px 90px; min-width: 960px; }
.cols-assets { grid-template-columns: 130px 110px 100px 100px minmax(200px, 1fr) 110px 60px 70px 130px 100px; min-width: 1120px; }
.cols-assets-admin { grid-template-columns: 130px 110px 100px 100px minmax(200px, 1fr) 110px 60px 70px 130px 100px 150px; min-width: 1260px; }
.cols-sites { grid-template-columns: minmax(160px, 1fr) 200px 130px 110px 150px; min-width: 780px; }
/* Almacenes: lista, liquidación por material y movimientos */
.cols-warehouses { grid-template-columns: minmax(180px, 1fr) minmax(140px, 1fr) 100px 110px 110px; min-width: 700px; }
.cols-wh-bal { grid-template-columns: 130px minmax(200px, 1fr) 60px 100px 100px 100px; min-width: 720px; }
.cols-wh-mov { grid-template-columns: 100px 105px minmax(200px, 1fr) 110px minmax(120px, 1fr) 130px 80px; min-width: 900px; }
.wh-total { background: var(--head-fill); border-top: 1px solid var(--border-strong); }
.tar { text-align: right; }
.terr-text { color: var(--err); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cols-jrh { grid-template-columns: minmax(180px, 1fr) 110px 160px 110px 190px; min-width: 760px; }
.cols-projects { grid-template-columns: minmax(180px, 1fr) 110px 140px minmax(160px, 1fr) 90px; min-width: 760px; }
.cols-crews { grid-template-columns: minmax(180px, 1fr) 130px minmax(160px, 1fr) 90px; min-width: 620px; }
.cols-crewm { grid-template-columns: minmax(200px, 1fr) 110px 140px 110px; min-width: 600px; }
/* --- Ficha de la orden: barra de control, secciones plegables y rejilla de datos --- */
.wctl { position: sticky; top: 60px; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px -4px 12px; padding: 8px 4px; background: var(--canvas); }
.wctl .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.wctl .seg::-webkit-scrollbar { display: none; }
.wctl .seg a { white-space: nowrap; }
.wsec { padding: 0; scroll-margin-top: 128px; }
.wsec + .wsec { margin-top: 12px; }
.wsec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-radius: var(--r-md); }
.wsec > summary::-webkit-details-marker { display: none; }
.wsec > summary:hover { background: var(--scl); }
.wsec[open] > summary { border-radius: var(--r-md) var(--r-md) 0 0; border-bottom: 1px solid var(--card-border); }
.wsec > summary:focus-visible, .wact > summary:focus-visible { outline: 2px solid var(--p); outline-offset: -2px; }
.wsec > summary .dh { display: flex; align-items: center; gap: 8px; }
.chev { transition: transform .15s ease-out; color: var(--osv); }
.wsec[open] > summary .chev, .wact[open] > summary .chev { transform: rotate(90deg); }
.wsec > .wbody { padding: 16px 20px 20px; }
.wsub { font-size: 12.5px; font-weight: 700; color: var(--osv); margin-bottom: 6px; }
.wbody .wsub + .empty-state { padding-top: 4px; }
.dkv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 20px; margin: 0; font-size: 13px; }
.dkv > div { min-width: 0; }
.dkv-1 { grid-template-columns: 1fr; gap: 10px; }
/* Ficha de actividad: detalle + clasificación lado a lado */
.act-top { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .act-top { grid-template-columns: 1fr; } }
.dkv dt { font-size: 12px; font-weight: 500; color: var(--osv); margin: 0 0 1px; }
.dkv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.dkv dd .muted { font-weight: 400; }
/* Actividades: lista con divisores, sin tarjetas anidadas */
.wact { border-top: 1px solid var(--line); scroll-margin-top: 128px; }
.wact:first-of-type { border-top: none; }
.wact > summary { list-style: none; cursor: pointer; padding: 10px 8px; margin: 0 -8px; border-radius: var(--r-sm); }
.wact > summary::-webkit-details-marker { display: none; }
.wact > summary:hover { background: var(--scl); }
.wact > summary .arow { padding: 0; border: none; }
.wact > .wbody { padding: 0 0 16px 46px; }
.wact .wsub { margin: 16px 0 6px; }
.wact .wsub .ms { vertical-align: -4px; }
.wact .tbl { border: 1px solid var(--card-border); border-radius: var(--r-sm); }
.wact .dkv { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.cols-resro { grid-template-columns: 110px minmax(180px, 1fr) 70px 90px 90px 90px; min-width: 640px; }
@media (max-width: 720px) {
  .wctl { top: 60px; }
  .wsec > summary { padding: 14px 14px; }
  .wsec > .wbody { padding: 14px 14px 16px; }
  .wact > .wbody { padding-left: 0; }
}
@media print { .wctl { display: none; } }

/* Lista de personal en el formulario de la orden: filas con checkbox */
.plist { display: flex; flex-direction: column; border: 1px solid var(--card-border); border-radius: var(--r-md); overflow: hidden; background: var(--bg); }
.prow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--scl); cursor: pointer; font-size: 13px; }
.prow:last-child { border-bottom: none; }
.prow:hover { background: var(--scl); }
.prow.lead { background: var(--scl); }
.prow .ava { width: 28px; height: 28px; font-size: 10px; }
.prow input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--p); flex: none; }
.pdet > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--osv); list-style: none; display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.pdet > summary::-webkit-details-marker { display: none; }
.pdet > summary .ms { transition: transform .15s; }
.pdet[open] > summary .ms { transform: rotate(90deg); }
.cols-workers { grid-template-columns: minmax(220px, 1fr) 100px minmax(140px, 1fr) minmax(160px, 1fr) 170px; min-width: 860px; }
.cols-myco { grid-template-columns: minmax(220px, 1fr) 140px 130px 100px; min-width: 620px; }
.cols-imp { grid-template-columns: 110px minmax(240px, 1fr); min-width: 400px; }
.cols-members { grid-template-columns: minmax(200px, 1fr) 100px 130px 140px minmax(140px, 1fr) minmax(140px, 1fr) 170px; min-width: 1080px; }

/* --- Tablas HTML clásicas --- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--text-strong); font-weight: 600; font-size: 12px; background: var(--head-fill); border-bottom: 1px solid var(--card-border); }
tr:last-child td { border-bottom: none; }

/* --- Tags de estado --- */
.tag, .badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap;
  background: var(--sv); color: var(--osv);
}
.tsec { background: var(--sc); color: var(--onsc); }
.terr { background: var(--ec); color: var(--onec); }
.tpc { background: var(--pc-soft); color: var(--p); }
.tok { background: var(--ok-bg); color: var(--ok-fg); }
.twarn { background: var(--warn-bg); color: var(--warn-fg); }
.tn { background: #f0f1f5; color: var(--osv); }
.tag .ms { font-size: 14px; }

/* Roles y estados con nombre (válido tanto en .tag como en .badge) */
.tag.admin, .badge.admin { background: var(--pc); color: var(--onpc); }
.tag.jefe, .badge.jefe { background: var(--sc); color: var(--onsc); }
.tag.supervisor, .badge.supervisor { background: var(--warn-bg); color: var(--warn-fg); }
.tag.tecnico, .badge.tecnico { background: var(--ok-bg); color: var(--ok-fg); }
.tag.pending, .badge.pending { background: var(--warn-bg); color: var(--warn-fg); }
.tag.approved, .badge.approved { background: var(--ok-bg); color: var(--ok-fg); }
.tag.rejected, .badge.rejected { background: var(--ec); color: var(--onec); }
.tag.active, .badge.active { background: var(--ok-bg); color: var(--ok-fg); }
.tag.paused, .badge.paused { background: var(--warn-bg); color: var(--warn-fg); }
.tag.finished, .badge.finished { background: var(--sv); color: var(--osv); }

.code {
  font-size: 11.5px;
  background: #f0f1f7;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  color: var(--text-strong);
  white-space: nowrap;
}

/* --- Avatares --- */
.ava {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--pc); color: var(--onpc);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.avs { display: flex; padding-left: 8px; }
.avs .ava { width: 28px; height: 28px; font-size: 10px; margin-left: -8px; border: 2px solid #fff; }
.ava.alg { width: 48px; height: 48px; font-size: 16px; }

/* --- Base para controles sueltos (fuera de .tf/.fchip) --- */
input[type="text"], input[type="password"], input[type="date"], input[type="number"],
input[type="email"], input[type="tel"], select, textarea {
  font: inherit;
  font-size: 14px;
  color: var(--os);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--p);
  box-shadow: var(--ring);
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--p); }

/* --- Campos de texto M3 --- */
.tf {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  min-height: 44px;
  display: flex; align-items: center;
  padding: 0 12px; gap: 10px;
  background: var(--bg);
  transition: border-color .12s, box-shadow .12s;
}
.tf:hover { border-color: var(--border-hover); }
.tfl {
  position: absolute; top: -8px; left: 9px;
  background: var(--bg);
  padding: 0 4px;
  font-size: 11.5px; font-weight: 500; color: var(--osv);
  line-height: 1.3;
}
.tf input, .tf select, .tf textarea {
  border: none; background: none; outline: none; box-shadow: none;
  font: inherit; font-size: 14px;
  width: 100%; color: var(--os);
  padding: 0;
}
.tf input:focus-visible, .tf select:focus-visible, .tf textarea:focus-visible { box-shadow: none; }
.tf textarea { padding: 12px 0; resize: vertical; min-height: 56px; }
.tf:focus-within { border-color: var(--p); box-shadow: var(--ring); }
.tf:focus-within .tfl { color: var(--p); }
.tfi { font-size: 20px; color: var(--text-3); }

.field { margin-bottom: 20px; }
.field .hint { color: var(--osv); font-size: 12px; margin-top: 4px; }
label { font-size: 13px; }

.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.fgrid .span2 { grid-column: 1 / 3; }

/* Subtítulo de sección dentro de un formulario largo */
.fsec {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  color: var(--osv); text-transform: uppercase;
  margin: 28px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}
.fsec:first-child { margin-top: 0; }

/* --- Botones --- */
.btn, .btnsm {
  height: 36px; padding: 0 16px;
  border-radius: var(--r-sm);
  background: var(--p); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 500; font-size: 13px;
  border: 1px solid transparent; cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(30, 27, 75, .08);
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.btn .ms, .btnsm .ms { font-size: 18px; }
.btn:hover, .btnsm:hover { background: var(--p-hover); text-decoration: none; color: #fff; }
.btn:focus-visible, .btnsm:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--p); }
.btnsm { height: 32px; padding: 0 12px; font-size: 12.5px; }

.btn.accent, .btnlime { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.accent:hover, .btnlime:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn.secondary, .btnso { background: var(--bg); border-color: var(--border-strong); color: var(--os); box-shadow: none; }
.btn.secondary:hover, .btnso:hover { background: var(--scl); color: var(--os); border-color: var(--border-hover); }
.btn.danger { background: var(--err); }
.btn.danger:hover { background: var(--err-hover); }
.btn:disabled, .btnsm:disabled { background: #f0f1f5; color: var(--text-3); border-color: transparent; box-shadow: none; cursor: not-allowed; }
.btnst { background: none; color: var(--err); border: none; }
.btnst:hover { background: var(--ec); color: var(--err); }
.btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btnt {
  color: var(--p); font-weight: 500; font-size: 13px;
  background: none; border: none; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  /* Botón de texto con área de hover propia (fondo suave al pasar el cursor) */
  padding: 3px 6px; border-radius: var(--r-sm);
  transition: background-color .12s;
}
.btnt:hover { background: var(--pc-soft); text-decoration: none; }
.btnt.bdanger:hover { background: var(--ec); }
.btnt.bdanger { color: var(--err); }
.btn.wide { width: 100%; height: 44px; border-radius: var(--r-sm); font-size: 14px; }

.inline-form { display: inline-flex; }
.inline-controls { display: inline-flex; gap: 8px; align-items: center; }

/* --- Búsqueda y filtros --- */
.srch {
  display: flex; align-items: center; gap: 10px;
  height: 36px; border-radius: var(--r-sm);
  background: var(--bg); border: 1px solid var(--border-strong);
  padding: 0 12px;
  font-size: 13px; color: var(--text-3);
  flex: 1; max-width: 380px; min-width: 200px;
}
.srch input { border: none; background: none; outline: none; box-shadow: none; font: inherit; width: 100%; color: var(--os); padding: 0; }
.srch:focus-within { border-color: var(--p); box-shadow: var(--ring); }
.srch .ms { font-size: 18px; }

.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  font-size: 12.5px; font-weight: 500; color: var(--osv);
  white-space: nowrap; background: var(--bg);
}
a.fchip:hover { background: var(--scl); text-decoration: none; }
.fchip select { border: none; background: none; outline: none; box-shadow: none; font: inherit; font-weight: 600; color: var(--os); padding: 0 2px; }
.fchip:focus-within { border-color: var(--p); box-shadow: var(--ring); }

/* --- Notas y flashes --- */
.note {
  display: flex; align-items: center; gap: 10px;
  background: var(--pc-soft); color: #3730a3;
  border: 1px solid #dfe3ff;
  border-radius: var(--r-sm); padding: 10px 14px;
  font-size: 13px;
}
.flash {
  border-radius: var(--r-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 4px;
  background: var(--bg); color: var(--os); border: 1px solid var(--card-border);
}
.flash.notice { background: var(--ok-bg); color: #0b6e4c; border-color: #c9ecdb; }
.flash.alert { background: var(--ec); color: var(--onec); border-color: #f8cfd9; }

/* --- Paginación --- */
.pgn { display: flex; align-items: center; gap: 6px; }
.pgn a, .pgn .pgn-current, .pgn .pgn-gap {
  min-width: 30px; height: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); font-size: 12.5px; font-weight: 500;
}
.pgn a { color: var(--os); border: 1px solid var(--card-border); background: var(--bg); }
.pgn a:hover { background: var(--scl); text-decoration: none; }
.pgn .pgn-current { background: var(--p); color: #fff; font-weight: 700; }
.pgn .pgn-gap { color: var(--osv); }

/* --- Solicitudes (cards) --- */
.screq {
  background: #fff; border: 1px solid var(--card-border); border-radius: var(--r-md);
  padding: 18px 20px;
  display: flex; gap: 16px; align-items: center;
  flex-wrap: wrap;
}

/* --- Gráfico de barras --- */
.bars {
  display: flex; align-items: flex-end; gap: 16px; height: 190px; padding: 14px 4px 0;
  /* Líneas guía horizontales cada 25% */
  background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 25%) 0 0 / 100% calc(100% - 22px) no-repeat;
}
.bcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: min(34px, 60%); border-radius: var(--r-xs) var(--r-xs) 0 0; background: var(--chart-soft); min-height: 3px; position: relative; }
.bar.bhi { background: var(--p); }
.bar[data-count]::before { content: attr(data-count); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--osv); }
.blb { font-size: 11px; color: var(--osv); height: 14px; }
/* Panel: rejilla de KPIs y fila gráfico + actividad */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpis .kpi { min-width: 0; }
.panel-row { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: stretch; }
@media (max-width: 1100px) { .panel-row { grid-template-columns: 1fr; } }
.dcp-tight { padding-top: 6px; padding-bottom: 6px; }
/* Tarjeta de gráfico: el gráfico ocupa todo el alto disponible */
.chart-card { display: flex; flex-direction: column; }
.chart-card > .dcp { flex: 1; display: flex; flex-direction: column; }
.chart-card .bars { flex: 1; height: auto; min-height: 200px; }

/* --- Actividad --- */
.arow { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
/* Línea de tiempo (actividad reciente): ícono en círculo tintado unido por una guía vertical */
.tl { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; position: relative; padding: 10px 0; }
.tl-item + .tl-item::before { content: ""; position: absolute; left: 15.5px; top: -12px; height: 22px; width: 1px; background: var(--card-border); }
.tl-ic { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--pc-soft); color: var(--p); }
.tl-ic .ms { font-size: 17px; }
.tl-ic.ok { background: var(--ok-bg); color: var(--ok-fg); }
.tl-ic.warn { background: var(--warn-bg); color: var(--warn-fg); }
.tl-ic.err { background: var(--ec); color: var(--onec); }
.tl-title { font-size: 13px; color: var(--osv); line-height: 1.4; }
.tl-title b { color: var(--os); font-weight: 600; }
.tl-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tl-time { font-size: 11.5px; color: var(--text-3); white-space: nowrap; padding-top: 2px; }
.arow:last-child { border-bottom: none; }

/* --- Pasos --- */
.stepr { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--osv); }
.stepn {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--sv); color: var(--osv);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; flex-shrink: 0;
}
.stepr.stepa { color: var(--os); font-weight: 700; }
.stepr.stepa .stepn { background: var(--p); color: #fff; }
.stline { width: 36px; height: 1px; background: var(--border-strong); }
.hstep { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; }
.hstep .stepn { background: var(--p); color: #fff; }

/* --- Login --- */
/* --- Login a pantalla completa: foto de marca (torre de alta tensión al anochecer) a la
   izquierda, corte recto, y el formulario con el logo a la derecha. --- */
.wsplit { min-height: 100vh; display: flex; background: #fff; }
.wbrand {
  position: relative; isolation: isolate; flex: 0 0 50%;
  background: #0e2233 url("/assets/login-torre-60de7f22.webp") center 35% / cover no-repeat;
  color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 48px 56px;
}
/* Un toque índigo en el cielo y el suelo oscurecido para leer el texto. */
.wbrand::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(160deg, rgb(79 70 229 / .22) 0%, rgb(79 70 229 / 0) 45%),
    linear-gradient(180deg, rgb(8 12 30 / 0) 60%, rgb(8 12 30 / .5) 100%);
}
.wbrand-title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; text-shadow: 0 2px 16px rgb(0 0 0 / .35); }
.wbrand-foot {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .8);
}
.wbrand-foot::before { content: ""; width: 16px; height: 4px; border-radius: 2px; background: var(--oymc-lima); }
.wform { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 56px; }
.wcard { width: 100%; max-width: 420px; display: flex; flex-direction: column; }
@media (min-width: 1400px) { .wbrand { flex-basis: 54%; } }
.wcard > .brand { align-self: flex-start; }
.wform-title { margin: 36px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--oymc-navy); }
.wform-sub { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--osv); }
.wform-fields { display: grid; gap: 18px; margin-top: 32px; }
.wform-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.wform-actions .btn { height: 44px; font-size: 14px; }
.wcard-wide { max-width: 560px; }
.wcard-brand { align-self: flex-start; }
.wcard .note { margin: 0; }
.wsteps { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.wsteps .stline { flex: 1; width: auto; min-width: 12px; }
.wsteps .stepr { font-size: 12.5px; white-space: nowrap; }
.wverified { gap: 8px; font-size: 14px; color: var(--os); }
.wverified .ms { color: var(--ok); }
.wkicker { display: flex; align-items: center; gap: 6px; margin: 36px 0 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--p); }
.wkicker + .wform-title { margin-top: 8px; }
.wkicker .ms { text-transform: none; letter-spacing: 0; }
.wform-actions.wspaced { margin-top: 28px; }
.wkicker-err { color: var(--err); }
.wbreak { overflow-wrap: anywhere; }
.wjoin { list-style: none; margin: 28px 0 24px; padding: 0; display: grid; gap: 12px; }
.wjoin li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); font-size: 13.5px; line-height: 1.55; color: var(--os); }
.wjoin-ic { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--pc-soft); color: var(--p); }
.wjoin-ic .ms { font-size: 20px; }
.line { flex: 1; height: 1px; background: var(--border-strong); }
.fs12 { font-size: 12px; } .fs13 { font-size: 13px; } .fs15 { font-size: 15px; }
.fw5 { font-weight: 500; } .fw7 { font-weight: 700; }


/* --- QR --- */
.qr-svg svg { width: 230px; height: 230px; }

/* --- Roles / permisos --- */
.rolec { flex: 1; background: #fff; border: 1px solid var(--card-border); border-radius: var(--r-md); padding: 20px; min-width: 230px; }
.perm { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 6px 0; line-height: 18px; }
.pyes { color: var(--green); }
.pno { color: var(--out); }

/* --- Página simple --- */
.container { max-width: 960px; margin: 24px auto; padding: 0 20px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.empty-state { color: var(--osv); padding: 12px 0; font-size: 13px; }

.simple-top {
  height: 60px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--sv);
  background: var(--canvas);
}

/* --- Landing / auth --- */

/* --- Zona de peligro --- */
.confirm-name input { max-width: 320px; }

/* --- Responsive: el supervisor abre esto desde el celular en obra --- */
@media (max-width: 900px) {
  .navbtn { display: inline-flex; }

  .side {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    z-index: 40;
    transform: translateX(-103%);
    transition: transform .22s ease-out;
    box-shadow: 4px 0 24px rgb(25 29 33 / .18);
    overflow-y: auto;
  }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; }

  .topb { padding: 0 12px; gap: 10px; }
  .dcont { padding: 14px 12px; }
  .esel-name { max-width: 130px; }
  .topb .whoami { display: none; }

  .fgrid { grid-template-columns: 1fr; }
  .fgrid .span2 { grid-column: auto; }

  .simple-top { padding: 0 14px; }
  .container { margin: 16px auto; padding: 0 12px; }
}

@media (max-width: 900px) {
  /* En pantallas angostas la foto es una cabecera. */
  .wsplit { flex-direction: column; }
  .wbrand { flex: none; min-height: 180px; padding: 0; background-position: center 45%; }
  .wbrand-body { display: none; }
  .wform { align-items: flex-start; padding: 28px 24px 32px; }
  .wform-title { margin-top: 28px; }
}

@media (pointer: coarse) {
  .btnt { min-height: 44px; }
  .fchip { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .side { transition: none; }
}

@media print {
  .side, .topb, .no-print { display: none !important; }
  .dcont { padding: 0; }
  .dcard, .card { border: none; }
}

/* --- Páginas legales públicas (términos, privacidad, eliminar cuenta) --- */
/* Páginas legales: cabecera con la foto de marca y tarjeta de texto montada encima. */
.legal-page { min-height: 100vh; background: var(--canvas); padding-bottom: 56px; }
.legal-hero {
  position: relative; isolation: isolate; color: #fff;
  background: #0e2233 url("/assets/login-torre-60de7f22.webp") center 38% / cover no-repeat;
  padding: 36px 20px 104px;
}
.legal-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(160deg, rgb(79 70 229 / .28) 0%, rgb(79 70 229 / 0) 50%),
              linear-gradient(180deg, rgb(8 12 30 / .15) 0%, rgb(8 12 30 / .55) 100%);
}
.legal-hero-in { max-width: 760px; margin: 0 auto; }
.legal-date { font-size: 12px; color: rgb(255 255 255 / .75); }
.legal-card {
  position: relative; max-width: 760px; margin: -72px auto 0; background: var(--bg);
  border: 1px solid var(--card-border); border-radius: var(--r-lg); padding: 32px 36px;
  box-shadow: 0 1px 2px rgb(30 27 75 / .04), 0 24px 48px -16px rgb(30 27 75 / .18);
}
.brand-link { text-decoration: none; color: inherit; }
.legal-title { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin: 40px 0 0; color: #fff; }
.legal-body { font-size: 14.5px; line-height: 1.65; }
.legal-body h2 { font-size: 16px; font-weight: 700; margin: 26px 0 8px; color: var(--oymc-navy); }
.legal-body p { margin: 0 0 12px; }
.legal-body ul { padding-left: 20px; margin: 0 0 12px; }
.legal-body li { margin-bottom: 6px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 14px; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--card-border); }
.legal-table th { font-size: 12px; font-weight: 600; color: var(--text-strong); background: var(--head-fill); }
.legal-form { max-width: 380px; margin-top: 20px; }
.legal-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--card-border); color: var(--osv); }
.wlegal { margin-top: 32px; font-size: 12px; color: var(--osv); text-align: center; }
@media (max-width: 640px) { .legal-card { padding: 22px 18px; margin: -56px 12px 0; } .legal-hero { padding: 24px 16px 84px; } .legal-title { font-size: 26px; margin-top: 28px; } }


/* --- Sidebar: etiquetas de sección (Órdenes de trabajo, Activos…) y sus ítems --- */
.ni.nih {
  cursor: default; height: auto; padding: 16px 12px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3);
}
.ni.nih .ms { display: none; }
.ni.nih.nia-sec { color: var(--osv); }
.ni.nisub { height: 38px; padding-left: 12px; font-size: 13.5px; }

/* --- Select2 con el mismo lenguaje que los campos (su hoja carga después:
   se antepone body para ganar especificidad) --- */
body .select2-container--default .select2-selection--single,
body .select2-container--default .select2-selection--multiple { border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg); }
body .select2-container--default .select2-selection--single { height: 40px; display: flex; align-items: center; }
body .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; padding-left: 12px; color: var(--os); font-size: 13.5px; }
body .select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--text-3); }
body .select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; }
body .select2-container--default.select2-container--focus .select2-selection--single,
body .select2-container--default.select2-container--open .select2-selection--single,
body .select2-container--default.select2-container--focus .select2-selection--multiple { border-color: var(--p); box-shadow: var(--ring); }
/* Dentro de un campo .tf el borde, la etiqueta y el foco son los del campo */
.tf .select2-container { flex: 1; min-width: 0; }
body .tf .select2-container--default .select2-selection--single { border: none; background: none; box-shadow: none !important; height: 42px; outline: none; }
body .tf .select2-container--default .select2-selection--single .select2-selection__rendered { flex: 1; min-width: 0; padding-left: 0; font-size: 14px; line-height: 42px; }
body .tf .select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; right: -6px; }
body .tf .select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--os); }
body .tf .select2-container--default .select2-selection--single .select2-selection__arrow b,
body .tf .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  width: 7px; height: 7px; margin: -6px 0 0 -4px; border: solid var(--os); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
body .tf .select2-container--default .select2-selection--single .select2-selection__clear {
  position: absolute; right: 22px; top: 0; height: 42px; margin: 0; float: none; color: var(--osv); font-size: 16px; font-weight: 400;
}
body .tf .select2-container--default .select2-selection--single .select2-selection__rendered { padding-right: 44px; }
.tf:has(.select2-container--open) { border-color: var(--p); box-shadow: var(--ring); }
.tf:has(.select2-container--open) .tfl { color: var(--p); }
body .select2-dropdown { border: 1px solid var(--card-border); border-radius: var(--r-sm); box-shadow: var(--shadow-pop); overflow: hidden; font-size: 13px; }
body .select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 6px 10px; }
body .select2-container--default .select2-results__option--highlighted[aria-selected],
body .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--pc-soft); color: var(--os); }
body .select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--pc-soft); border: none; border-radius: var(--r-xs); color: var(--p); font-size: 12px; }

/* --- Formularios: dos columnas --- */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid2 .span2 { grid-column: 1 / -1; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* --- Tareas: explorador de la jerarquía --- */
.folder-wrap { position: relative; }
.folder-wrap .folder-actions { position: absolute; top: 8px; right: 8px; display: none; gap: 2px; }
.folder-wrap:hover .folder-actions, .folder-wrap:focus-within .folder-actions { display: flex; }
.cols-tasks { grid-template-columns: 120px minmax(220px, 1.4fr) minmax(160px, 1fr) 110px 100px 150px 170px; min-width: 1030px; }

/* --- Tablero kanban de órdenes --- */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--head-fill); border: 1px solid var(--card-border); border-radius: var(--r-md); min-height: 320px; display: flex; flex-direction: column; transition: background .15s, border-color .15s; }
.kcol.over { background: var(--pc); border-color: var(--p); }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px; font-size: 13px; font-weight: 600; color: var(--os); }
.kcol.st-pending .kcol-title { color: var(--oymc-indigo); }
.kcol.st-in_progress .kcol-title { color: var(--warn-fg); }
.kcol.st-review .kcol-title { color: var(--oymc-navy); }
.kcol.st-finished .kcol-title { color: var(--ok-fg); }
.kcol-count { background: #fff; border: 1px solid var(--card-border); border-radius: 999px; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; font-size: 11px; color: var(--os); }
.kcol-body { display: flex; flex-direction: column; gap: 10px; padding: 0 10px 12px; flex: 1; }
.kcol-empty { margin: 0; padding: 18px 8px; text-align: center; font-size: 12px; color: var(--text-3); border: 1px dashed var(--border-strong); border-radius: var(--r-sm); }
/* position: relative acota cualquier enlace extendido (.rowlink) a la tarjeta */
.kcard { position: relative; background: var(--bg); border: 1px solid var(--card-border); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-card); transition: border-color .12s, box-shadow .12s; }
.kcard:hover { border-color: var(--border-accent); box-shadow: 0 4px 12px rgba(30, 27, 75, .07); }
.kcard[draggable="true"] { cursor: grab; }
.kcard.dragging { opacity: .45; }
.kcard.overdue { border-color: var(--overdue-border); background: #fffbfc; }
.kcard-title { font-weight: 600; font-size: 13.5px; line-height: 1.3; color: var(--os); }
.kcard-title:hover { color: var(--p); text-decoration: none; }
.kcard-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--osv); }
.kcard-meta span { display: inline-flex; align-items: center; gap: 3px; }
.kcard-meta .ms { font-size: 15px; }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(240px, 1fr)); } }

/* --- Planificación: calendario mensual --- */
.cal-month { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.cal { overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--scl); border-bottom: 1px solid var(--card-border); }
.cal-head span { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-strong); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--card-border); }
.cal-week:last-child { border-bottom: none; }
.cal-day { min-width: 0; min-height: 118px; padding: 6px 8px 8px; border-right: 1px solid var(--card-border); display: flex; flex-direction: column; gap: 4px; }
.cal-day:last-child { border-right: none; }
.cal-day.other { background: var(--canvas); color: var(--out); }
.cal-day.weekend:not(.other) { background: #fbfbff; }
.cal-day.today .cal-daynum span:first-child { background: var(--p); color: #fff; border-radius: 999px; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.cal-daynum { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; min-height: 24px; }
.cal-add { display: none; width: 24px; height: 24px; border-radius: 12px; align-items: center; justify-content: center; color: var(--on-accent); background: var(--accent); }
.cal-day:hover .cal-add, .cal-day:focus-within .cal-add { display: inline-flex; text-decoration: none; }
.cal-ev { display: flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: var(--r-xs); font-size: 11.5px; line-height: 1.25; background: var(--pc); color: var(--onpc); overflow: hidden; }
.cal-ev:hover { text-decoration: none; filter: brightness(.97); }
.cal-ev-code { font-family: 'Roboto Mono', monospace; font-size: 10.5px; opacity: .8; flex-shrink: 0; }
.cal-ev-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.st-in_progress { background: var(--warn-bg); color: var(--warn-fg); }
.cal-ev.st-review { background: var(--sc); color: var(--onsc); }
.cal-ev.st-finished { background: var(--ok-bg); color: var(--ok-fg); }
.cal-ev.overdue { box-shadow: inset 0 0 0 1px var(--overdue-border); }
.cal-more { font-size: 11px; color: var(--p); padding-left: 4px; }
@media (max-width: 900px) { .cal-day { min-height: 84px; } .cal-ev-title { display: none; } }

/* --- OT de emergencia: resaltada y al tope --- */
.tag.temerg { background: var(--err); color: #fff; gap: 4px; }
.kcard.emergency { border-color: var(--err); background: #fffbfc; }
.kcard.emergency .kcard-title { color: var(--onec); }
.row-emergency { background: #fffbfc; }
.cal-ev.emergency { background: var(--err); color: #fff; }
.cal-ev.emergency .cal-ev-code { opacity: .9; }
.emerg-check { align-items: flex-start; gap: 8px; height: auto; padding: 10px 12px; line-height: 1.35; font-size: 12.5px; border: 1px dashed var(--err); background: #fff7f8; }
.emerg-check input { margin-top: 2px; }

/* --- Selector de tareas en el formulario de la orden --- */
.task-picker .select2-container--default .select2-selection--multiple { min-height: 42px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 4px 6px; }
.task-picker .select2-container--default.select2-container--focus .select2-selection--multiple { border-color: var(--p); box-shadow: var(--ring); }
.task-picker .select2-selection__choice { background: var(--pc-soft) !important; border: none !important; color: var(--p) !important; border-radius: var(--r-xs) !important; padding: 2px 8px !important; font-size: 12.5px; }


/* --- Formularios densos: 3 o 4 campos por fila (orden de trabajo) --- */
.fgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; }
.fgrid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 12px; }
.fgrid.c3 .span2, .fgrid.c4 .span2 { grid-column: span 2; }
.fgrid .span3 { grid-column: span 3; }
.fgrid .span4 { grid-column: 1 / -1; }
.fgrid.c4 .tf, .fgrid.c3 .tf { min-height: 48px; padding: 0 12px; }
.fgrid.c4 .tf textarea, .fgrid.c3 .tf textarea { padding: 10px 0; min-height: 44px; }
.fhint { display: block; margin-top: 6px; }
.wo-form .fsec { margin-top: 20px; }
.wo-form .emerg-check { padding: 8px 12px; }
.wo-asset { padding: 8px 0; border-bottom: 1px solid var(--card-border); }
.wo-asset:last-child { border-bottom: none; }
@media (max-width: 1100px) { .fgrid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fgrid.c4 .span3 { grid-column: 1 / -1; } }
@media (max-width: 720px) { .fgrid.c3, .fgrid.c4 { grid-template-columns: 1fr; } .fgrid .span2, .fgrid .span3 { grid-column: 1 / -1; } }

/* --- Fichas del selector (tareas y activos VNR de la orden) --- */
.pick-cards { display: grid; gap: 8px; margin-top: 10px; }
.pick-cards:empty { display: none; }
.pick-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 10px 12px; background: var(--scl);
}
.pick-card-head { display: flex; align-items: center; gap: 8px; }
.pick-card-title { font-size: 13px; font-weight: 700; flex: 1; min-width: 0; }
.pick-card-x {
  border: none; background: none; color: var(--osv); cursor: pointer;
  display: inline-flex; align-items: center; border-radius: 14px; padding: 2px;
}
.pick-card-x:hover { background: var(--ec); color: var(--err); }
.pick-card-meta { font-size: 12px; color: var(--osv); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.pick-card-desc { font-size: 13px; margin: 8px 0 0; }
.pick-card-sub {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--osv); margin-top: 10px;
}
.pick-card-res { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; }
.pick-card-res li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 12.5px; }
.pick-card-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  min-width: 116px; color: var(--onpc);
}
.pick-card-name { flex: 1; min-width: 140px; }
.pick-card-qty { font-weight: 700; }
.pick-card-steps { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--osv); display: grid; gap: 2px; }
.pick-card-res li.missing, .pick-card .missing { color: var(--err); }
.autofill-note:empty { display: none; }
.autofill-note { color: var(--p); }

/* --- Diálogo de alta rápida desde el formulario de la orden --- */
.quick-dialog {
  border: none; border-radius: var(--r-lg); padding: 20px 24px; width: min(680px, 92vw); box-shadow: var(--shadow-pop);
  background: var(--bg); color: var(--os);
}
.quick-dialog::backdrop { background: rgb(30 27 75 / .45); }
/* Modal "Agregar actividad" del formulario de la orden: más ancho y con scroll */
.quick-dialog.act-dialog { width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; }
.act-dialog .dsec { margin-top: 18px; }
.act-dialog .select2-container { z-index: 1; }
.act-dialog .select2-dropdown { z-index: 10; }
/* Actividades en el formulario de la orden: una tarjeta por actividad con su
   cabecera y una grilla de paneles (VNR, suministros, recursos, procedimiento) */
.act-cards { display: grid; gap: 12px; margin-top: 10px; }
.act-cards:empty { display: none; }
.act-card { border: 1px solid var(--card-border); border-radius: var(--r-md); padding: 14px 16px; background: var(--scl); }
.act-card-head { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 10px; }
.act-card-title { flex: 1; min-width: 200px; }
.act-card-name { font-size: 15px; font-weight: 700; color: var(--os); }
.act-card-sub { font-size: 12px; color: var(--osv); margin-top: 2px; }
.act-card-actions { display: flex; gap: 4px; margin-left: auto; }
.act-card-desc { font-size: 13px; margin: 10px 0 0; color: var(--os); }
.act-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
@media (max-width: 760px) { .act-grid { grid-template-columns: 1fr; } }
.act-panel { background: var(--bg); border: 1px solid var(--card-border); border-radius: var(--r-sm); padding: 10px 12px; min-width: 0; }
.act-panel-title {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--osv);
}
/* Sin mayúsculas en el ícono: la ligadura "checklist" no es "CHECKLIST" */
.act-panel-title .ms { color: var(--p); text-transform: none; letter-spacing: 0; }
.act-empty { font-size: 12.5px; color: var(--out); margin: 0; }
.act-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; }
.act-list li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.act-list .code { font-size: 12px; color: var(--onpc); }
.act-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.act-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--osv); padding: 0 6px 4px 0; border-bottom: 1px solid var(--sv); }
.act-table td { padding: 5px 6px 5px 0; border-bottom: 1px solid var(--sv); vertical-align: top; }
.act-table tr:last-child td { border-bottom: none; }
.act-table .code { font-size: 12px; color: var(--onpc); white-space: nowrap; }
.act-table .num { text-align: right; font-weight: 700; white-space: nowrap; }
.act-steps { margin: 0; padding-left: 20px; font-size: 12.5px; display: grid; gap: 4px; }
.act-steps li.done { color: var(--osv); text-decoration: line-through; }
/* Formulario de la orden: una tarjeta por sección y acciones fijas al pie */
.wo-form { display: flex; flex-direction: column; gap: 16px; }
.fcard { scroll-margin-top: 76px; }
.fcard > .dhead { flex-wrap: wrap; }
.fcard > .dhead .dh { margin-right: auto; }
.fcard > .dcp { padding: 20px; }
.form-actions {
  position: sticky; bottom: 0; z-index: 4;
  display: flex; gap: 10px; align-items: center;
  margin: 0 -24px -24px; padding: 12px 24px;
  background: rgb(255 255 255 / .94); border-top: 1px solid var(--card-border);
  backdrop-filter: saturate(1.2) blur(6px);
}
@media (max-width: 900px) { .form-actions { margin: 0 -12px -14px; padding: 10px 12px; } }
/* Actividades dentro de la tarjeta: filas con divisor, no cajas anidadas */
.fcard .act-cards { gap: 0; margin-top: 0; }
.fcard .act-card { border: none; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 16px 0; }
.fcard .act-card:first-child { padding-top: 0; }
.fcard .act-card:last-child { border-bottom: none; padding-bottom: 0; }
.fcard .act-cards:not(:empty) + .act-cards:not(:empty) { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.act-panel { background: var(--head-fill); border: none; }
/* Estado vacío con ícono en círculo */
.empty-block { display: flex; align-items: center; gap: 14px; padding: 8px 0; color: var(--os); }
.empty-block[hidden] { display: none; }
.empty-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--pc-soft); color: var(--p); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.empty-ic .ms { font-size: 22px; }

/* Listas configurables: navegación de listas + panel de la lista elegida */
.lists-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .lists-layout { grid-template-columns: 1fr; } }
.lists-nav { display: grid; gap: 4px; position: sticky; top: 76px; }
@media (max-width: 860px) { .lists-nav { position: static; grid-auto-flow: column; overflow-x: auto; } }
.lists-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--os); font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.lists-nav-item:hover { background: var(--scl); text-decoration: none; }
.lists-nav-item.on { background: var(--pc-soft); color: var(--p); font-weight: 600; }
.lists-nav-item .ms { color: var(--p); }
.lists-count { font-size: 11.5px; font-weight: 700; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 10px; background: var(--sv); color: var(--osv); }
.lists-nav-item.on .lists-count { background: var(--bg); color: var(--onpc); }
.lists-panel { padding: 0; margin: 0; min-width: 0; overflow: hidden; }
.lists-head { display: flex; gap: 12px; align-items: flex-start; }
.lists-icon { width: 36px; height: 36px; flex: none; color: var(--p); background: var(--pc-soft); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.lists-icon .ms { font-size: 19px; }
.lists-title { margin: 0; font-size: 18px; }
.lists-add { margin: 0; padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: var(--scl); }
.swatches { border: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.swatches legend { float: left; margin-right: 6px; padding: 0; }
.swatch { cursor: pointer; display: inline-flex; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch .tag { border: 2px solid transparent; }
.swatch input:checked + .tag { border-color: var(--os); }
.swatch input:focus-visible + .tag { outline: 2px solid var(--p); outline-offset: 2px; }
.cols-lists { grid-template-columns: 170px 110px minmax(160px, 1fr) minmax(150px, 220px) 70px; min-width: 700px; }
/* Un significado largo no desborda la columna: la etiqueta se corta con «…» */
.cols-lists .tag { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.lists-row > summary { list-style: none; cursor: pointer; }
.lists-row > summary::-webkit-details-marker { display: none; }
.lists-row > summary:hover { background: var(--scl); }
.lists-row[open] > summary { background: var(--scl); }
.lists-row[open] .lists-edit { visibility: hidden; }
.lists-actions { text-align: right; }
.lists-edit { color: var(--p); }
.lists-editor { padding: 14px 16px 16px; border-bottom: 1px solid var(--sv); background: var(--scl); }
.w100 { width: 100%; }
/* Preview de la tarea elegida en el modal */
.act-preview { margin-top: 10px; border: 1px solid var(--card-border); border-radius: var(--r-md); padding: 12px 14px; background: var(--scl); }
.act-preview .act-panel { margin-top: 10px; }
.quick-dialog .quick-errors:empty { display: none; }
.quick-dialog .quick-errors ul { margin: 0; padding-left: 1rem; }
.quick-dialog .fgrid { margin-top: 12px; }

/* Códigos de clasificación (configuración de la empresa) */
.ccodes-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ccodes-list li { padding: 6px 0; border-bottom: 1px solid var(--sv); }
.ccodes-list li:last-child { border-bottom: 0; }
.ccodes-list form { display: inline; }

/* --- Superadmin: tablas globales e impersonación --- */
.cols-sa { grid-template-columns: minmax(180px, 1fr) 130px 90px 130px 110px 110px 150px; min-width: 940px; }
.cols-su { grid-template-columns: minmax(200px, 1fr) 100px 140px minmax(160px, 1fr) 100px 190px; min-width: 950px; }
.cols-sp { grid-template-columns: minmax(200px, 1fr) minmax(160px, 1fr) 110px 100px 100px 100px 90px; min-width: 900px; }
.cols-sum { grid-template-columns: minmax(180px, 1fr) 120px 110px minmax(120px, 1fr) minmax(200px, 1.4fr) 140px; min-width: 960px; }
.impbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px;
  background: var(--warn-bg); color: var(--warn-fg);
  font-size: 13px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.impbar form { margin: 0; }
.impbtn { background: var(--warn-fg); color: #fff; height: 32px; padding: 0 14px; border-radius: var(--r-sm); font-size: 12px; }
@media (max-width: 720px) {
  .impbar { flex-wrap: wrap; padding: 8px 12px; }
}
