/* IMC · Plataforma comercial — tema estilo macOS
   Fuente del sistema (SF Pro en Mac/iPhone, Segoe UI en Windows). Siempre claro, con la barra superior negra;
   data-theme="dark" en <html> activa el modo oscuro si el usuario lo elige (lo pone tema.js).
   Sin estilos en línea: la CSP bloquea style="" en el HTML. Todo color sale de los tokens de :root. */

/* SF Pro es la fuente del sistema en Mac/iPhone (-apple-system). Su licencia no permite publicarla en la web,
   así que en Windows/Android se usa Inter (licencia OFL, servida desde este mismo servidor), su equivalente más cercano. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/InterVariable.2bf3d951bf9d.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("../fonts/InterVariable-Italic.8d1dc86da258.woff2") format("woff2"); }

:root {
  /* Tipografía */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-caption: 11px;  --fs-body: 13px;  --fs-callout: 15px;
  --fs-title3: 15px;   --fs-title2: 17px; --fs-title1: 22px; --fs-large: 26px;

  /* Colores del sistema (modo claro) */
  --blue: #007AFF;  --green: #34C759; --orange: #FF9500; --red: #FF3B30;
  --yellow: #FFCC00; --purple: #AF52DE; --pink: #FF2D55; --teal: #30B0C7;
  --accent: var(--blue);
  --accent-soft: rgba(0, 122, 255, .12);

  /* Texto */
  --label: rgba(0, 0, 0, .85);
  --label-2: rgba(0, 0, 0, .50);
  --label-3: rgba(0, 0, 0, .26);

  /* Superficies */
  --window: #FFFFFF;
  --content: #FFFFFF;
  --under: #F5F5F7;
  --sidebar: rgba(236, 236, 238, .78);
  --toolbar: rgba(255, 255, 255, .80);
  --control: #FFFFFF;
  --fill: rgba(0, 0, 0, .05);
  --fill-2: rgba(0, 0, 0, .08);
  --separator: rgba(0, 0, 0, .10);
  --hover: rgba(0, 0, 0, .04);
  --velo: rgba(0, 0, 0, .32);
  --tip: rgba(30, 30, 32, .94);

  /* Forma y profundidad */
  --r-control: 6px;  --r-card: 10px;  --r-window: 12px;
  --shadow-control: 0 0.5px 1px rgba(0,0,0,.15), 0 0 0 .5px rgba(0,0,0,.08);
  --shadow-window: 0 22px 70px 4px rgba(0,0,0,.18), 0 0 0 .5px rgba(0,0,0,.12);
  --shadow-pop: 0 10px 38px rgba(0,0,0,.16), 0 0 0 .5px rgba(0,0,0,.12);
  --blur: saturate(180%) blur(20px);
  --logo-filtro: invert(1);   /* el logo es blanco: en claro se ve negro */
}

:root[data-theme="dark"] {
  --blue: #0A84FF; --green: #30D158; --orange: #FF9F0A; --red: #FF453A;
  --yellow: #FFD60A; --purple: #BF5AF2; --pink: #FF375F; --teal: #40C8E0;
  --accent-soft: rgba(10, 132, 255, .20);
  --label: rgba(255,255,255,.88); --label-2: rgba(255,255,255,.55); --label-3: rgba(255,255,255,.25);
  --window: #1E1E1E; --content: #1E1E1E; --under: #121212;
  --sidebar: rgba(44, 44, 46, .72); --toolbar: rgba(38, 38, 38, .80);
  --control: #3A3A3C; --fill: rgba(255,255,255,.06); --fill-2: rgba(255,255,255,.10);
  --separator: rgba(255,255,255,.10); --hover: rgba(255,255,255,.05); --velo: rgba(0, 0, 0, .55);
  --shadow-control: 0 0 0 .5px rgba(255,255,255,.12), 0 1px 1px rgba(0,0,0,.3);
  --shadow-window: 0 22px 70px 4px rgba(0,0,0,.55), 0 0 0 .5px rgba(255,255,255,.12);
  --shadow-pop: 0 10px 38px rgba(0,0,0,.5), 0 0 0 .5px rgba(255,255,255,.14);
  --logo-filtro: none;
  color-scheme: dark;
}

/* Derivados: texto de color legible en ambos temas (se mezcla con --label) */
:root {
  --t-green: color-mix(in srgb, var(--green) 70%, var(--label));
  --t-blue: color-mix(in srgb, var(--blue) 80%, var(--label));
  --t-orange: color-mix(in srgb, var(--orange) 70%, var(--label));
  --t-red: color-mix(in srgb, var(--red) 82%, var(--label));
  --s-green: color-mix(in srgb, var(--green) 14%, transparent);
  --s-orange: color-mix(in srgb, var(--orange) 15%, transparent);
  --s-red: color-mix(in srgb, var(--red) 13%, transparent);
  --s-blue: var(--accent-soft);
  --label-15: color-mix(in srgb, var(--label) 78%, transparent);   /* texto secundario fuerte */
  /* Nombres antiguos, por compatibilidad con plantillas y SVG */
  --texto: var(--label); --texto-2: var(--label-15); --tenue: var(--label-2); --borde: var(--separator);
  --verde: var(--t-green); --azul: var(--accent); --rojo: var(--t-red); --ambar: var(--t-orange);
  --verde-fondo: var(--s-green); --rojo-fondo: var(--s-red); --ambar-fondo: var(--s-orange); --azul-fondo: var(--s-blue);
  --verde-borde: color-mix(in srgb, var(--green) 35%, transparent); --gris-fondo: var(--fill);
  --barra: var(--green); --fuente: var(--font);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: var(--fs-body); line-height: 1.38; color: var(--label); background: var(--under);
  -webkit-font-smoothing: antialiased; letter-spacing: -0.01em; font-optical-sizing: auto; }
button, input, select, textarea { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font: 700 var(--fs-large)/1.15 var(--font-display); letter-spacing: -0.02em; margin: 0; }
h2 { font: 600 var(--fs-title2)/1.25 var(--font-display); margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font: 600 var(--fs-title3)/1.3 var(--font); margin: 0 0 8px; }
::selection { background: var(--accent-soft); }
.oculto, [hidden] { display: none !important; }
.tenue { color: var(--label-2); }
.derecha { text-align: right; }
.centro { text-align: center; }
.nowrap { white-space: nowrap; }
.mono, .num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mt { margin-top: 16px; }
:focus-visible { outline: none; box-shadow: 0 0 0 3.5px var(--accent-soft), 0 0 0 1px var(--accent); border-radius: var(--r-control); }

/* ---------- Barra superior (translúcida) ---------- */
.topbar { position: sticky; top: 0; z-index: 50; color-scheme: dark;
  --label: rgba(255,255,255,.88); --label-2: rgba(255,255,255,.55); --label-3: rgba(255,255,255,.25);
  --window: #1E1E1E; --control: #3A3A3C; --fill: rgba(255,255,255,.06); --fill-2: rgba(255,255,255,.12);
  --separator: rgba(255,255,255,.10); --hover: rgba(255,255,255,.08); --accent: #0A84FF; --accent-soft: rgba(10, 132, 255, .22); --red: #FF453A;
  --shadow-pop: 0 10px 38px rgba(0,0,0,.5), 0 0 0 .5px rgba(255,255,255,.14); --shadow-control: 0 0 0 .5px rgba(255,255,255,.12), 0 1px 1px rgba(0,0,0,.3);
  --logo-filtro: none;
  background: rgba(14, 14, 16, .94); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: .5px solid rgba(255, 255, 255, .08); color: var(--label); }
.topbar-in { display: flex; align-items: stretch; gap: 22px; padding: 0 20px; min-height: 56px; }
.marca { display: flex; align-items: center; }
.marca:hover { text-decoration: none; }
.logo-barra { display: block; width: 54px; height: auto; filter: var(--logo-filtro); }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-link { display: flex; align-items: center; gap: 4px; color: var(--label); font: 500 14px var(--font); white-space: nowrap; border: 0;
  background: none; padding: 6px 11px; border-radius: var(--r-control); cursor: pointer; }
.nav-link:hover, .nav-item.abierto > .nav-link { background: var(--hover); text-decoration: none; }
.nav-item.actual > .nav-link { background: var(--fill-2); font-weight: 600; }
.nav-flecha { width: 12px; height: 12px; fill: none; stroke: var(--label-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.acciones-top { display: flex; align-items: center; gap: 6px; position: relative; }
.icono-btn { position: relative; width: 32px; height: 32px; border-radius: var(--r-control); display: grid; place-items: center;
  border: 0; background: transparent; color: var(--label-2); cursor: pointer; }
.icono-btn:hover { background: var(--hover); color: var(--label); text-decoration: none; }
.icono-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icono-btn .badge { position: absolute; top: 1px; right: 0; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 9px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }
.menu-movil { display: none; }

/* Menús desplegables (con íconos azules) */
.desplegable { display: none; position: absolute; z-index: 70; top: calc(100% + 4px); left: 0; background: var(--window);
  border-radius: var(--r-card); box-shadow: var(--shadow-pop); padding: 5px; min-width: 230px; }
.nav-item.abierto .desplegable, .usuario.abierto .desplegable { display: block; }
.nav-item .desplegable::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }  /* puente para el hover */
.desplegable a, .desplegable form button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 7px 10px;
  border-radius: 5px; color: var(--label); font: var(--fs-body) var(--font); background: none; border: 0; cursor: pointer; }
.desplegable a svg { width: 16px; height: 16px; flex: none; color: var(--accent); fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.desplegable a:hover, .desplegable form button:hover { background: var(--accent); color: #fff; text-decoration: none; }
.desplegable a:hover svg { color: #fff; }
.desplegable a.actual { font-weight: 600; background: var(--fill-2); }
.desplegable a.actual:hover { background: var(--accent); }
.desplegable form { margin: 0; }
.desplegable .info { display: flex; flex-direction: column; padding: 6px 10px 8px; border-bottom: .5px solid var(--separator); margin-bottom: 4px; }
.desplegable .info small { font-size: var(--fs-caption); color: var(--label-2); }

/* Cuenta */
.usuario { position: relative; }
.usuario-btn { display: flex; align-items: center; background: none; border: 0; cursor: pointer; padding: 3px; border-radius: 50%; }
.usuario-btn:hover .avatar, .usuario.abierto .avatar { box-shadow: 0 0 0 3px var(--accent-soft); }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 12px;
  color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, white), var(--accent)); }
.usuario .desplegable { left: auto; right: 0; min-width: 240px; }
.tema-selector { padding: 6px 10px 8px; border-bottom: .5px solid var(--separator); margin-bottom: 4px; }
.tema-etq { display: block; font-size: var(--fs-caption); font-weight: 600; color: var(--label-2); margin-bottom: 5px; }

/* Submenú: franja blanca bajo la barra negra, pestañas con ícono en ficha y subrayado azul */
.subnav-wrap { position: sticky; top: 56px; z-index: 40; background: color-mix(in srgb, var(--window) 88%, transparent);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: .5px solid var(--separator);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .02), 0 6px 16px -12px rgba(0, 0, 0, .18); }
.subnav-in { max-width: 1500px; margin: 0 auto; padding: 0 28px; display: flex; align-items: stretch; gap: 18px; min-height: 52px; }
.subnav-seccion { display: flex; align-items: center; padding-right: 18px; margin: 12px 0; border-right: .5px solid var(--separator);
  font: 700 var(--fs-title3)/1 var(--font-display); letter-spacing: -0.01em; color: var(--label); white-space: nowrap; }
.subnav { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { position: relative; display: flex; align-items: center; gap: 9px; padding: 0 12px; color: var(--label-15); font-weight: 500;
  white-space: nowrap; text-decoration: none; transition: color .15s; }
.subnav a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -.5px; height: 2.5px; border-radius: 3px 3px 0 0;
  background: var(--accent); transform: scaleX(0); transition: transform .2s ease; }
.subnav a:hover { color: var(--label); text-decoration: none; }
.subnav a:hover .sn-ico { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.subnav a.actual { color: var(--label); font-weight: 600; }
.subnav a.actual::after { transform: scaleX(1); }
.sn-ico { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft);
  color: var(--accent); transition: background .15s, color .15s, box-shadow .15s; }
.sn-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.subnav a.actual .sn-ico { background: linear-gradient(180deg, #2b8cff, var(--accent)); color: #fff; box-shadow: 0 2px 6px rgba(0, 122, 255, .35); }
.subnav a:focus-visible { box-shadow: none; }
.subnav a:focus-visible .sn-ico { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
@media (max-width: 680px) {
  .subnav-in { padding: 0 12px; gap: 10px; }
  .subnav-seccion { display: none; }
  .subnav a { padding: 0 8px; }
}

/* Control segmentado (tema, pestañas) */
.seg { display: inline-flex; background: var(--fill); border-radius: 7px; padding: 2px; gap: 2px; }
.seg button { font: 500 var(--fs-body)/1 var(--font); color: var(--label); background: transparent; border: 0; border-radius: 6px;
  height: 26px; padding: 0 12px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--control); box-shadow: var(--shadow-control); }

/* ---------- Contenido ---------- */
.contenido { padding: 24px 28px 64px; max-width: 1500px; width: 100%; margin: 0 auto; }
body:not(:has(.topbar)) .contenido { padding-top: 32px; }
.encabezado { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.encabezado .sub { color: var(--label-2); margin-top: 4px; }
.botones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tarjeta { background: var(--window); border: .5px solid var(--separator); border-radius: var(--r-card); padding: 18px;
  box-shadow: 0 .5px 1.5px rgba(0, 0, 0, .04); }
.tarjeta + .tarjeta { margin-top: 16px; }
.rejilla > .tarjeta + .tarjeta { margin-top: 0; }
.tarjeta h2 { font-size: var(--fs-title3); }
.rejilla { display: grid; gap: 16px; }
.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.r-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .r3, .r4, .r-2-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .r2, .r3, .r4, .r-2-1 { grid-template-columns: 1fr; } .contenido { padding: 16px; } }

/* Indicadores */
.kpi { background: var(--window); border: .5px solid var(--separator); border-radius: var(--r-card); padding: 14px 16px; }
.kpi .etq { font-size: var(--fs-caption); font-weight: 600; color: var(--label-2); letter-spacing: .02em; }
.kpi .valor { font: 700 var(--fs-large)/1.15 var(--font-display); margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .det { color: var(--label-2); font-size: 12px; margin-top: 3px; }

/* ---------- Botones: un solo sistema para toda la plataforma ----------
   Altura 34 (chico 28), radio 8, ícono 15. Secundario blanco con borde fino; principal azul con relieve suave;
   los de color (verde, ámbar) mantienen la misma forma. */
.btn { --b-bg: var(--control); --b-tx: var(--label); --b-bd: rgba(0, 0, 0, .12); --b-sh: 0 1px 2px rgba(0, 0, 0, .06);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  font: 500 13.5px/1 var(--font); letter-spacing: -0.005em; color: var(--b-tx); background: var(--b-bg);
  border: 1px solid var(--b-bd); border-radius: 8px; box-shadow: var(--b-sh); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s, filter .15s; -webkit-user-select: none; user-select: none; }
.btn:hover { background: color-mix(in srgb, var(--b-bg) 94%, #000); border-color: rgba(0, 0, 0, .2); text-decoration: none; color: var(--b-tx); }
.btn:active { transform: translateY(.5px) scale(.985); box-shadow: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3.5px var(--accent-soft), 0 0 0 1px var(--accent); }
.btn .ico, .btn > svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn .ico { opacity: .75; }

/* Principal (azul) */
.btn-primario, .btn-cta { --b-tx: #fff; --b-bd: color-mix(in srgb, var(--accent) 80%, #000);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px color-mix(in srgb, var(--accent) 45%, transparent); font-weight: 600; }
.btn-primario:hover, .btn-cta:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 90%, #fff), color-mix(in srgb, var(--accent) 92%, #000));
  border-color: color-mix(in srgb, var(--accent) 70%, #000); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 3px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primario .ico, .btn-cta .ico { opacity: 1; }
/* Éxito (verde) y advertencia (ámbar): misma forma, otro color */
.btn-verde { --b-tx: #fff; --b-bd: color-mix(in srgb, var(--green) 75%, #000);
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 85%, #fff), color-mix(in srgb, var(--green) 92%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px color-mix(in srgb, var(--green) 45%, transparent); font-weight: 600; }
.btn-verde:hover { filter: brightness(.96); background: linear-gradient(180deg, color-mix(in srgb, var(--green) 85%, #fff), color-mix(in srgb, var(--green) 85%, #000)); }
.btn-ambar { --b-tx: #fff; --b-bd: color-mix(in srgb, var(--orange) 75%, #000);
  background: linear-gradient(180deg, color-mix(in srgb, var(--orange) 85%, #fff), var(--orange));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px color-mix(in srgb, var(--orange) 45%, transparent); font-weight: 600; }
.btn-ambar:hover { filter: brightness(.96); background: linear-gradient(180deg, color-mix(in srgb, var(--orange) 85%, #fff), color-mix(in srgb, var(--orange) 90%, #000)); }
/* Destructivo: blanco con texto rojo; se tiñe al pasar */
.btn-peligro { --b-tx: var(--t-red); --b-bd: color-mix(in srgb, var(--red) 30%, transparent); }
.btn-peligro:hover { background: var(--s-red); border-color: color-mix(in srgb, var(--red) 50%, transparent); }
/* Acento suave (agregar, guardar borrador): blanco con texto azul */
.btn-agregar, .btn-borrador { --b-tx: var(--accent); font-weight: 600; }
.btn-sec { }   /* alias del secundario por defecto */
.btn-chico { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.btn-chico .ico { width: 13px; height: 13px; }
.btn-icono { width: 34px; padding: 0; }
.btn-chico.btn-icono { width: 28px; }
.btn-icono .ico circle { fill: currentColor; stroke: none; }
.btn-fantasma { --b-bg: transparent; --b-bd: transparent; --b-sh: none; color: var(--label-2); }
.btn-fantasma:hover { background: var(--hover); border-color: transparent; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: grayscale(.2); transform: none; pointer-events: none; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
label.btn { cursor: pointer; }
.btn-enlace { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: 500 var(--fs-body) var(--font); text-align: left; }
.btn-enlace:hover { text-decoration: underline; }
.btn-enlace.fuerte { font-weight: 600; }
.acciones-cot { gap: 8px; }
.acciones-cot > form { display: contents; }
.acciones-cot .btn-cta { margin-left: 4px; }
.botones { gap: 8px; }

:root[data-theme="dark"] .btn, .topbar .btn { --b-bd: rgba(255, 255, 255, .14); --b-sh: 0 1px 2px rgba(0, 0, 0, .4); }
:root[data-theme="dark"] .btn:hover, .topbar .btn:hover { background: color-mix(in srgb, var(--b-bg) 88%, #fff); border-color: rgba(255, 255, 255, .22); }

/* ---------- Tablas ---------- */
.tabla-wrap { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tabla th { font-size: var(--fs-caption); font-weight: 600; color: var(--label-2); text-align: left; padding: 8px 10px;
  border-bottom: .5px solid var(--separator); white-space: nowrap; }
.tabla td { padding: 8px 10px; vertical-align: middle; color: var(--label); }
.tabla tbody tr:nth-child(even) td { background: var(--fill); }
.tabla tbody tr:hover td { background: var(--accent-soft); }
.tabla td.num, .tabla th.num { text-align: right; white-space: nowrap; }
.tabla tfoot td { font-weight: 600; border-top: .5px solid var(--separator); }
.tabla td a { color: var(--label); font-weight: 600; }
.tabla td a:hover { color: var(--accent); text-decoration: none; }
.tabla td .tenue { font-size: 12px; }
.vacio { text-align: center; color: var(--label-2); padding: 30px 10px !important; }
.tarjeta:has(> .tabla-wrap:first-child), .tarjeta.tabla-wrap { padding: 0; overflow: hidden; }
.tarjeta > .tabla-wrap:first-child .tabla th:first-child, .tarjeta.tabla-wrap .tabla th:first-child,
.tarjeta > .tabla-wrap:first-child .tabla td:first-child, .tarjeta.tabla-wrap .tabla td:first-child { padding-left: 16px; }
.tarjeta > .tabla-wrap:first-child .tabla th:last-child, .tarjeta.tabla-wrap .tabla th:last-child,
.tarjeta > .tabla-wrap:first-child .tabla td:last-child, .tarjeta.tabla-wrap .tabla td:last-child { padding-right: 16px; }
.tarjeta > .tabla-wrap:first-child .tabla th { padding-top: 10px; }
.tarjeta > .paginacion { padding: 0 16px 12px; }
tr.fila-clic { cursor: default; }
tr.fila-clic:hover td { background: var(--accent-soft); }
.tabla tr.fila-sin-guardar td { background: var(--s-orange) !important; }
.celda-edit { min-width: 120px; }
.celda-edit.desc { min-width: 220px; }
#items .tabla td.celda-edit.desc { min-width: 320px; }
#items .tabla td.celda-edit.desc input { width: 100%; }
.tabla-vendedores td { vertical-align: middle; }
.acciones-fila { width: 1%; white-space: nowrap; text-align: right; }
.icono-accion { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-control); background: var(--control);
  box-shadow: var(--shadow-control); color: var(--label-2); }
.icono-accion svg { width: 15px; height: 15px; }
.icono-accion:hover { color: var(--accent); text-decoration: none; }

/* ---------- Estados (siempre con texto, nunca solo color) ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-caption); font-weight: 600; padding: 2px 8px;
  border-radius: 999px; background: var(--fill); color: var(--label-2); white-space: nowrap; line-height: 1.5; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip.verde { color: var(--t-green); background: var(--s-green); }
.chip.azul { color: var(--t-blue); background: var(--s-blue); }
.chip.ambar { color: var(--t-orange); background: var(--s-orange); }
.chip.rojo { color: var(--t-red); background: var(--s-red); }
.chip.gris { color: var(--label-2); background: var(--fill); }

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; }
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo.ancho { grid-column: 1 / -1; }
.campo label, .etq-campo { font-size: 12px; font-weight: 500; color: var(--label-15); }
.etq-campo { display: block; margin-bottom: 6px; }
.campo .ayuda { font-size: var(--fs-caption); color: var(--label-2); }
.campo .error, .errores { color: var(--t-red); font-size: 12px; }
.errores { background: var(--s-red); border-radius: var(--r-card); padding: 10px 12px; margin-bottom: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search],
input[type=tel], input[type=url], input:not([type]), select, textarea {
  width: 100%; font: var(--fs-body)/1.3 var(--font); color: var(--label); background: var(--control); border: 0; border-radius: var(--r-control);
  padding: 7px 10px; min-height: 34px; border-radius: 8px; box-shadow: var(--shadow-control); min-width: 0; }
select { padding-right: 26px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 5 3-3 3 3M2 9l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; }
select[multiple] { background-image: none; padding-right: 9px; }
input::placeholder, textarea::placeholder { color: var(--label-3); }
input[type=search] { background-color: var(--fill); box-shadow: none; padding-left: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23888' stroke-width='1.6'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='m9.5 9.5 3 3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 9px center; }
input:focus, select:focus, textarea:focus, input[type=search]:focus { outline: none; box-shadow: 0 0 0 3.5px var(--accent-soft), 0 0 0 1px var(--accent); }
input[type=date] { color-scheme: inherit; }
textarea { resize: vertical; line-height: 1.45; min-height: 64px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 15px; height: 15px; }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filtros .campo { min-width: 150px; }
.filtros .campo.grande { min-width: 240px; flex: 1; }
.tarjeta.filtros { background: var(--window); }
.acciones-form { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
ul.lista-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.seccion-form { margin: 22px 0 10px; padding-bottom: 6px; border-bottom: .5px solid var(--separator); color: var(--label-2);
  font-size: var(--fs-caption); font-weight: 600; letter-spacing: .02em; }
.nit-dv { display: flex; gap: 8px; align-items: stretch; }
.nit-dv input { flex: 1; }
.nit-dv .dv { display: grid; place-items: center; min-width: 52px; padding: 0 10px; background: var(--fill-2); color: var(--label);
  border-radius: var(--r-control); font-weight: 600; font-variant-numeric: tabular-nums; }
.campo.solo-natural.oculto-natural { display: none; }
.campo.autollenado input, .campo.autollenado select { box-shadow: 0 0 0 1px var(--green), 0 0 0 3.5px var(--s-green); }
.comision-form { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.comision-form input[type=number] { width: 90px; text-align: right; }

/* ---------- Mensajes y avisos ---------- */
.mensajes { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.mensajes li { padding: 9px 12px 9px 14px; border-radius: var(--r-card); background: var(--fill); color: var(--label);
  border-left: 3px solid var(--label-3); }
.mensajes .success { background: var(--s-green); border-left-color: var(--green); }
.mensajes .error { background: var(--s-red); border-left-color: var(--red); }
.mensajes .warning { background: var(--s-orange); border-left-color: var(--orange); }
.mensajes .info { background: var(--s-blue); border-left-color: var(--accent); }
.aviso { border-radius: var(--r-card); padding: 10px 14px; background: var(--s-orange); color: var(--label); margin-bottom: 14px; }
.aviso ul { margin: 6px 0 0; padding-left: 18px; }
.aviso-suave { background: var(--fill); }
.aviso-sin-guardar { color: var(--t-orange); font-size: 12px; font-weight: 600; align-self: center; }
.aviso-sobreventa .form-sobreventa { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.aviso-sobreventa .form-sobreventa label { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }

.paginacion { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--label-2); }

/* Pestañas internas (filtros de una lista): control segmentado a la altura de los botones */
.pestanas { display: inline-flex; flex-wrap: wrap; background: var(--fill); border-radius: 9px; padding: 3px; gap: 2px; margin-bottom: 16px; }
.pestanas a, .pestanas button { font: 500 13px/1 var(--font); color: var(--label-15); background: transparent; border: 0; height: 28px;
  border-radius: 7px; padding: 0 12px; cursor: pointer; display: inline-flex; align-items: center; transition: background .15s, color .15s; }
.pestanas a:hover, .pestanas button:hover { text-decoration: none; background: var(--hover); color: var(--label); }
.pestanas a.actual, .pestanas button.actual { background: var(--control); color: var(--label); font-weight: 600; box-shadow: var(--shadow-control); }
.pestanas .cuenta { display: inline-block; min-width: 20px; padding: 2px 6px; margin-left: 6px; border-radius: 9px; background: var(--fill-2);
  color: var(--label-2); font-size: var(--fs-caption); font-weight: 600; text-align: center; line-height: 1.2; }
.pestanas a.actual .cuenta { background: var(--accent); color: #fff; }

/* ---------- Gráficos (SVG) ---------- */
.grafico-barras { width: 100%; display: block; }
.barras { display: grid; gap: 10px; }
.barra-fila { display: grid; grid-template-columns: minmax(110px, 200px) 1fr auto; gap: 10px; align-items: center; }
.barra-fila .nom { font-size: 12px; color: var(--label-15); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-fila .val { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }
.barra-svg { width: 100%; height: 12px; display: block; }
.barra-svg .fondo { fill: var(--fill-2); }
.barra-svg .relleno { fill: var(--accent); }
.barra-svg .meta { stroke: var(--label); stroke-width: 2; }
.barra-svg rect.relleno:hover { opacity: .85; }
.columnas { width: 100%; height: 220px; display: block; }
.columnas .col { fill: var(--accent); }
.columnas .col:hover { opacity: .85; }
.columnas .eje { stroke: var(--separator); stroke-width: 1; }
.columnas text { font-size: 11px; fill: var(--label-2); font-family: var(--font); }

.timeline { width: 100%; height: 20px; display: block; border-radius: 4px; }
.timeline-alta { height: 26px; }
.timeline .fondo { fill: var(--s-green); }
.timeline .seg-OCUPADO { fill: var(--red); }
.timeline .seg-RESERVADO { fill: var(--orange); }
.timeline .seg-BLOQUEADO { fill: var(--label-3); }
.timeline .rango { fill: none; stroke: var(--label); stroke-width: 1.5; stroke-dasharray: 3 2; }
.timeline .mes { stroke: var(--window); stroke-width: 1.5; }
.timeline .hoy { stroke: var(--accent); stroke-width: 2; }
.timeline rect[class^="seg-"]:hover { opacity: .8; }
.escala { position: relative; height: 16px; font-size: 11px; color: var(--label-2); }
.escala svg { width: 100%; height: 16px; display: block; overflow: visible; }
.escala text { font-size: 10.5px; fill: var(--label-2); font-family: var(--font); }
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--label-15); align-items: center; }
.leyenda i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.leyenda .l-libre { background: var(--s-green); box-shadow: inset 0 0 0 1px var(--verde-borde); }
.leyenda .l-ocupado { background: var(--red); }
.leyenda .l-reservado { background: var(--orange); }
.leyenda .l-bloqueado { background: var(--label-3); }
.timeline-col { min-width: 300px; width: 34%; }
.medidor-col { min-width: 120px; }
.slots-grid { width: 100%; display: block; }
.slots-grid .c-libre { fill: var(--s-green); }
.slots-grid .c-OCUPADO { fill: var(--red); }
.slots-grid .c-RESERVADO { fill: var(--orange); }
.slots-grid .c-BLOQUEADO { fill: var(--label-3); }
.slots-grid rect:hover { stroke: var(--label); stroke-width: 1.5; }
.slots-grid text { font-size: 10.5px; fill: var(--label-2); font-family: var(--font); }
.slots-grid .hoy { fill: var(--accent-soft); }
.medidor { width: 100%; height: 8px; display: block; border-radius: 4px; }
.medidor .fondo { fill: var(--s-green); }
.medidor .usado { fill: var(--red); }

/* ---------- Detalle de documento ---------- */
.ficha { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; }
.ficha dt { color: var(--label-2); }
.ficha dd { margin: 0; }
.totales { margin-left: auto; min-width: 280px; }
.totales div { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: tabular-nums; }
.totales .total { border-top: .5px solid var(--separator); font: 700 var(--fs-title3) var(--font-display); }
details.bloque { background: var(--window); border: .5px solid var(--separator); border-radius: var(--r-card); }
details.bloque + details.bloque { margin-top: 10px; }
details.bloque summary { padding: 12px 16px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; color: var(--label); }
details.bloque summary::after { content: "+"; color: var(--label-2); font-weight: 400; }
details.bloque[open] summary::after { content: "–"; }
details.bloque .cuerpo { padding: 0 16px 16px; }
details.bloque.resaltar { box-shadow: 0 0 0 3px var(--accent-soft); }
.resultado-api { max-height: 260px; overflow: auto; border-radius: var(--r-card); margin-top: 8px; background: var(--window); box-shadow: var(--shadow-control); }
.resultado-api button { display: block; width: 100%; text-align: left; border: 0; border-bottom: .5px solid var(--separator); padding: 8px 10px;
  background: transparent; color: var(--label); cursor: pointer; font: var(--fs-body) var(--font); }
.resultado-api button:hover, .resultado-api button.sel { background: var(--accent-soft); }
.calc { background: var(--fill); border-radius: var(--r-card); padding: 10px 12px; font-size: 12px; color: var(--label-15); }
.calc b { color: var(--label); }
.calc .error { color: var(--t-red); margin-top: 4px; }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { padding: 9px 0; border-bottom: .5px solid var(--separator); display: flex; justify-content: space-between; gap: 10px; }
.lista-simple li:last-child { border-bottom: 0; }
.permisos-grupo { background: var(--fill); border-radius: var(--r-card); padding: 12px 14px; }
.permisos-grupo h3 { font-size: var(--fs-caption); color: var(--label-2); letter-spacing: .02em; }
.firma-preview { max-height: 60px; background: #fff; border-radius: var(--r-control); padding: 4px; }

/* ---------- Diálogos ---------- */
dialog { border: 0; border-radius: var(--r-window); padding: 22px; background: var(--window); color: var(--label); box-shadow: var(--shadow-window);
  max-width: 520px; width: calc(100% - 32px); }
dialog::backdrop { background: var(--velo); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
dialog h2 { font-size: var(--fs-title2); }
dialog.dialogo-ancho { max-width: 720px; }
dialog .form-grid { grid-template-columns: 1fr; }
dialog.dialogo-agregar { max-width: 820px; padding: 0; }
.dialogo-agregar .da-cabeza { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: .5px solid var(--separator);
  position: sticky; top: 0; background: var(--toolbar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); z-index: 2; }
.dialogo-agregar .da-cabeza h2 { margin: 0; font-size: var(--fs-title3); }
.da-cerrar { border: 0; background: var(--fill); font-size: 18px; line-height: 1; cursor: pointer; color: var(--label-2); width: 24px; height: 24px;
  border-radius: 50%; display: grid; place-items: center; }
.da-cerrar:hover { background: var(--fill-2); color: var(--label); }
.dialogo-agregar .da-tipos, .dialogo-agregar .panel-item { padding: 18px 20px 20px; }
.dialogo-agregar .da-tipos > p { margin: 0 0 12px; }
.dialogo-agregar .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dialogo-agregar .form-grid .campo.ancho { grid-column: 1 / -1; }
@media (max-width: 680px) { .dialogo-agregar .form-grid { grid-template-columns: 1fr; } }

/* ---------- Asistente (salvavidas) ---------- */
#btn-ayuda { width: auto; height: 30px; padding: 0 10px 0 6px; gap: 6px; border-radius: 15px; display: flex; align-items: center; color: var(--label); }
#btn-ayuda .salvavidas { width: 20px; height: 20px; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); stroke: none; }
#btn-ayuda .sv-aro { stroke: #fff; }
#btn-ayuda .sv-franjas { stroke: var(--red); }
#btn-ayuda .sv-borde { stroke: #0b0b0c; opacity: .55; }
#btn-ayuda:hover .salvavidas { transform: rotate(45deg) scale(1.06); }
.btn-ayuda-texto { font-size: var(--fs-body); font-weight: 600; }
#btn-ayuda.activo { background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
@media (prefers-reduced-motion: reduce) { #btn-ayuda .salvavidas { transition: none; } }
.pista-ayuda { position: absolute; top: calc(100% + 10px); right: 40px; width: 270px; background: var(--window); color: var(--label);
  border-radius: var(--r-card); padding: 12px 14px; box-shadow: var(--shadow-pop); font-size: var(--fs-body); line-height: 1.45; z-index: 60; }
.pista-ayuda .btn { margin-top: 8px; display: block; }

body.modo-ayuda .contenido { cursor: help; }
body.modo-ayuda .ayuda-hover { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; background-color: var(--accent-soft); }
.guia-pagina { display: none !important; }

.panel-asistente { position: fixed; z-index: 45; top: 56px; right: 0; bottom: 0; width: 360px; background: var(--window);
  border-left: .5px solid var(--separator); box-shadow: -10px 0 30px rgba(0, 0, 0, .08); display: flex; flex-direction: column; }
.pa-cabeza { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: .5px solid var(--separator); background: var(--toolbar); }
.pa-titulo { font-weight: 700; font-size: var(--fs-body); margin-right: auto; }
.pa-cabeza button { background: var(--fill); border: 0; color: var(--label-2); border-radius: 50%; width: 22px; height: 22px; cursor: pointer;
  font: 600 14px/1 var(--font); display: grid; place-items: center; }
.pa-cabeza button:hover { background: var(--fill-2); color: var(--label); }
.pa-cuerpo { overflow-y: auto; padding: 4px 16px 20px; flex: 1; }
.panel-asistente.minimizado { bottom: auto; }
.panel-asistente.minimizado .pa-cuerpo { display: none; }
.pa-seccion { padding: 14px 0; border-bottom: .5px solid var(--separator); }
.pa-seccion:last-child { border-bottom: 0; }
.pa-seccion h3 { font-size: var(--fs-caption); color: var(--label-2); margin: 0 0 8px; letter-spacing: .02em; }
.pa-guia { line-height: 1.55; color: var(--label-15); }
.pa-guia b { color: var(--label); }
.pa-recorrido { width: 100%; }
.pa-nota { font-size: 12px; color: var(--label-2); margin: 6px 0 0; }
.pa-buscar { margin-bottom: 8px; }
.pa-lista { list-style: none; margin: 0; padding: 0; counter-reset: pa; }
.pa-lista li { counter-increment: pa; }
.pa-lista button { display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; width: 100%; text-align: left; background: none; border: 0;
  border-radius: var(--r-control); padding: 7px 6px; cursor: pointer; font: inherit; color: var(--label-15); font-size: 12px; line-height: 1.4; }
.pa-lista button::before { content: counter(pa); grid-row: span 2; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-weight: 700; font-size: var(--fs-caption); display: flex; align-items: center; justify-content: center; }
.pa-lista button b { color: var(--label); font-size: var(--fs-body); }
.pa-lista button:hover { background: var(--hover); }
.pa-vacio { color: var(--label-2); }
.pa-como ul { margin: 0 0 10px; padding-left: 18px; line-height: 1.5; color: var(--label-15); }
.pa-muestra { display: inline-block; width: 22px; height: 12px; border: 2px solid var(--accent); background: var(--accent-soft); border-radius: 3px; vertical-align: middle; }
@media (min-width: 1200px) { body.modo-ayuda:has(.panel-asistente:not(.minimizado)) .contenido,
  body.modo-ayuda:has(.panel-asistente:not(.minimizado)) .subnav-wrap { padding-right: 388px; } }

#ayuda-tip { position: fixed; z-index: 1000; max-width: 320px; background: var(--tip); color: #f5f5f7; border-radius: var(--r-card);
  padding: 9px 12px; font-size: 12px; line-height: 1.45; box-shadow: var(--shadow-pop); pointer-events: none; display: none;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
#ayuda-tip .t { display: block; font-weight: 700; color: #fff; margin-bottom: 3px; font-size: var(--fs-body); }
#ayuda-tip .pie { display: block; margin-top: 6px; color: #64d2ff; }
#ayuda-foco { position: fixed; z-index: 990; pointer-events: none; border-radius: 8px; border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5); transition: all .25s ease; }
#ayuda-paso { position: fixed; z-index: 1001; width: min(340px, calc(100vw - 16px)); background: var(--window); color: var(--label);
  border-radius: var(--r-window); padding: 14px 16px; box-shadow: var(--shadow-window); }
#ayuda-paso .num { display: block; font-size: var(--fs-caption); font-weight: 700; color: var(--accent); letter-spacing: .02em; }
#ayuda-paso b { display: block; font-size: var(--fs-title3); margin-top: 2px; }
#ayuda-paso p { margin: 6px 0 12px; line-height: 1.5; color: var(--label-15); }
#ayuda-paso .acciones { display: flex; gap: 6px; flex-wrap: wrap; }
#ayuda-paso .btn-fantasma { margin-left: auto; }
@media (prefers-reduced-motion: reduce) { #ayuda-foco { transition: none; } }

/* ---------- Login (fondo fotográfico, vidrio oscuro) ---------- */
body.login { min-height: 100vh; min-height: 100dvh; background-color: #07090d;
  background-image: linear-gradient(90deg, rgba(5, 7, 12, 0) 35%, rgba(5, 7, 12, .55) 100%), url("../img/login-fondo.f3beb1b8e456.jpg");
  background-size: cover; background-position: center; background-repeat: no-repeat; background-attachment: fixed; }
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: flex-end; padding: 24px clamp(16px, 7vw, 120px); }
.tarjeta-login { width: 100%; max-width: 300px; border-radius: 14px; padding: 24px 22px 22px; color: #fff; background: rgba(20, 22, 28, .62);
  border: .5px solid rgba(255, 255, 255, .26); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.tarjeta-login .logo-login { display: block; width: 98px; height: auto; margin: 0 auto; }
.tarjeta-login .logo-login img { mix-blend-mode: screen; }
.tarjeta-login h1 { text-align: center; font-weight: 500; font-size: 1.35rem; margin: 8px 0 18px; }
.tarjeta-login label.etq { display: block; font-size: 12px; margin-bottom: 5px; color: #f0f0f0; }
.campo-login { position: relative; margin-bottom: 13px; }
.campo-login input { width: 100%; height: 34px; background: rgba(0, 0, 0, .22); border: 0; box-shadow: 0 0 0 .5px rgba(255, 255, 255, .55);
  border-radius: 7px; color: #fff; font-size: 13px; padding: 0 36px 0 34px; font-family: var(--font); }
.campo-login input::placeholder { color: rgba(255, 255, 255, .5); }
.campo-login input:focus { outline: none; box-shadow: 0 0 0 1px #fff, 0 0 0 4px rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .3); }
.campo-login .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: #ddd; }
.campo-login.clave input { padding-left: 12px; letter-spacing: .12em; }
.ver-clave { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #ddd; cursor: pointer;
  width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border-radius: 5px; }
.ver-clave:hover { background: rgba(255, 255, 255, .1); }
.ver-clave svg { width: 16px; height: 16px; }
.login-opciones { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; margin: 0 0 17px; }
.login-opciones label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: #e6e6e6; }
.login-opciones input { width: 13px; height: 13px; accent-color: #fff; margin: 0; }
.login-opciones a { color: #e6e6e6; text-decoration: underline; }
.btn-ingresar { width: 100%; height: 34px; border-radius: 8px; border: 0; background: #fff; color: #111; font: 600 13px var(--font); cursor: pointer; }
.btn-ingresar:hover { background: #e9e9e9; }
.login-error { background: rgba(255, 59, 48, .25); box-shadow: inset 0 0 0 .5px rgba(255, 120, 120, .6); color: #ffe1e1; border-radius: 7px;
  padding: 7px 9px; font-size: 12px; margin-bottom: 12px; }
.login-info { background: rgba(255, 255, 255, .12); border-radius: 7px; padding: 7px 9px; font-size: 12px; margin-bottom: 12px; }
@media (max-width: 820px) {
  body.login { background-image: linear-gradient(rgba(5, 7, 12, .35), rgba(5, 7, 12, .55)), url("../img/login-fondo-movil.51b5320e44ca.jpg"); background-attachment: scroll; }
  .login-wrap { justify-content: center; }
}
@media (max-width: 480px) { .tarjeta-login { max-width: 340px; } .campo-login input, .btn-ingresar { height: 42px; font-size: 16px; } }
@media (max-height: 640px) {
  .tarjeta-login { padding-top: 16px; padding-bottom: 16px; }
  .tarjeta-login h1 { margin: 4px 0 10px; }
  .campo-login { margin-bottom: 9px; }
}

/* Páginas simples (recuperar clave, errores) */
.caja-simple { max-width: 440px; margin: 60px auto; }
.logo-recorte { display: inline-block; width: 78px; height: 44px; overflow: hidden; position: relative; border-radius: var(--r-control); background: #000; }
.logo-recorte img { position: absolute; width: 110px; max-width: none; left: -16px; top: -33px; }

/* ---------- Clientes y RUT ---------- */
.rut-zona { position: relative; display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 18px; border-radius: var(--r-card);
  border: 1.5px dashed var(--label-3); background: var(--fill); transition: background .15s, border-color .15s; }
.rut-zona.arrastrando { background: var(--accent-soft); border-color: var(--accent); }
.rut-zona.leyendo { opacity: .7; pointer-events: none; }
.rut-zona.listo { border-style: solid; border-color: var(--verde-borde); background: var(--s-green); }
.rut-zona.error { border-color: var(--red); background: var(--s-red); }
.rut-ico { width: 32px; height: 32px; color: var(--accent); flex: none; }
.rut-texto { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rut-texto b { font-size: var(--fs-title3); }
.rut-texto span { color: var(--label-2); }
.rut-zona input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rut-zona label.btn { cursor: pointer; }
.rut-avisos { margin: -6px 0 16px; padding: 10px 14px 10px 30px; background: var(--s-orange); border-radius: var(--r-card); font-size: 12px; }
@media (max-width: 680px) { .rut-zona { flex-wrap: wrap; } .rut-zona label.btn { width: 100%; justify-content: center; } }
.modo-rut .cuerpo-cliente { display: none; }
.modo-rut .rut-zona { padding: 34px 26px; }
.solo-modo-rut { display: none; margin: 0; }
.modo-rut .solo-modo-rut { display: block; }
.cuerpo-cliente.aparece { animation: aparece .35s ease-out; }
@keyframes aparece { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cuerpo-cliente.aparece { animation: none; } }

/* Buscador interactivo (clientes) */
.buscador { position: relative; }
.buscador-lista { position: absolute; z-index: 45; top: calc(100% + 4px); left: 0; right: 0; min-width: 300px; max-height: 340px; overflow: auto;
  margin: 0; padding: 5px; list-style: none; background: var(--window); border-radius: var(--r-card); box-shadow: var(--shadow-pop); }
.buscador-lista li[role=option] { padding: 7px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; border-radius: 5px; }
.buscador-lista li[role=option] b { font-weight: 600; }
.buscador-lista li[role=option] span { font-size: 12px; color: var(--label-2); }
.buscador-lista li[role=option]:hover, .buscador-lista li.activo { background: var(--accent); color: #fff; }
.buscador-lista li[role=option]:hover span, .buscador-lista li.activo span { color: rgba(255, 255, 255, .8); }
.buscador-lista .vacio-busqueda { padding: 10px 12px; color: var(--label-2); }
.buscador-lista .crear { border-top: .5px solid var(--separator); margin-top: 4px; padding-top: 4px; }
.buscador-lista .crear a { display: block; padding: 7px 10px; font-weight: 600; border-radius: 5px; }
.buscador-lista .crear a:hover { background: var(--hover); text-decoration: none; }

/* ---------- Fechas, pasos y glosario ---------- */
.bloque-fechas { background: var(--fill); border-radius: var(--r-card); padding: 14px 16px; }
.bloque-fechas h3 { margin-bottom: 2px; }
.bloque-fechas > p.tenue { margin: 0 0 12px; font-size: 12px; }
.bloque-fechas .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.resumen-fecha { margin-top: 10px; padding: 8px 12px; background: var(--accent-soft); border-radius: var(--r-control); font-size: 12px; }
.resumen-fecha:empty { display: none; }
.resumen-fecha.alerta { background: var(--s-orange); }
@media (max-width: 680px) { .bloque-fechas .form-grid { grid-template-columns: 1fr; } }
.flujo { list-style: none; counter-reset: paso; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.flujo li { counter-increment: paso; padding: 14px; background: var(--fill); border-radius: var(--r-card); display: flex; flex-direction: column; gap: 4px; }
.flujo li::before { content: counter(paso); font-weight: 700; color: var(--accent); }
.flujo li span { color: var(--label-15); font-size: 12px; }
.glosario { margin: 0; display: grid; gap: 4px 0; }
.glosario dt { font-weight: 600; margin-top: 10px; }
.glosario dd { margin: 0; color: var(--label-15); }
@media (max-width: 1000px) { .flujo { grid-template-columns: 1fr; } }
.pasos { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pasos li { padding: 10px 14px; background: var(--fill); border-radius: var(--r-card); display: flex; flex-direction: column; }
.pasos li span { font-size: 12px; color: var(--label-2); }
.pasos li.actual { background: var(--accent-soft); }
.pasos li.actual b { color: var(--accent); }
@media (max-width: 680px) { .pasos { grid-template-columns: 1fr; } }
.como-usar { background: var(--window); border: .5px solid var(--separator); border-radius: var(--r-card); margin-bottom: 16px; }
.como-usar summary { padding: 10px 16px; cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.como-usar summary::-webkit-details-marker { display: none; }
.como-usar summary::after { content: "Ocultar"; margin-left: auto; font-weight: 400; font-size: 12px; color: var(--label-2); }
.como-usar:not([open]) summary::after { content: "Mostrar"; }
.como-usar-ico { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; }
.como-usar-cuerpo { padding: 0 16px 14px 42px; color: var(--label-15); }
.como-usar-cuerpo ol, .como-usar-cuerpo ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* ---------- Imágenes y firmas ---------- */
.firma-correo-preview { max-height: 46px; max-width: 170px; border-radius: var(--r-control); background: #fff; }
.firma-correo-grande { max-width: 460px; width: 100%; border-radius: var(--r-control); margin-top: 6px; }
.imagen-campo { display: flex; flex-direction: column; gap: 8px; }
.imagen-titulo { font-size: 12px; font-weight: 500; color: var(--label-15); }
.miniatura { position: relative; overflow: hidden; display: grid; place-items: center; border-radius: var(--r-card);
  background: #fff repeating-conic-gradient(#f2f2f4 0% 25%, #fff 0% 50%) 50% / 16px 16px; box-shadow: var(--shadow-control); padding: 10px; }
.miniatura.firma-manual { height: 120px; }
.miniatura.firma-correo { height: 150px; }
.miniatura img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; }
.sin-imagen { color: #888; font-size: 12px; }
.imagen-acciones { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.imagen-acciones input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.imagen-acciones label.btn { cursor: pointer; }
.imagen-campo .ayuda { font-size: var(--fs-caption); color: var(--label-2); }
.imagen-campo .error { color: var(--t-red); font-size: 12px; }
.firmas-mini { display: grid; gap: 4px; width: 190px; }
.firma-mini { position: relative; overflow: hidden; display: grid; place-items: center; height: 34px; border-radius: 5px; background: #fff;
  box-shadow: var(--shadow-control); padding: 2px 4px; }
.firma-mini img { position: absolute; inset: 2px 4px; width: calc(100% - 8px); height: calc(100% - 4px); object-fit: contain; }
.firma-mini em { font-style: normal; font-size: var(--fs-caption); color: var(--t-orange); }

/* ---------- Cotización ---------- */
.cab-cot .botones { align-items: center; }
.volver { display: inline-block; margin-bottom: 6px; font-size: 12px; color: var(--accent); }
.volver-tipos { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font: 12px var(--font); }
.titulo-panel { margin: 6px 0 14px; font-size: var(--fs-title2); }

.menu-mas { position: relative; }
.menu-mas > summary { list-style: none; cursor: pointer; }
.menu-mas > summary::-webkit-details-marker { display: none; }
.menu-mas[open] > summary { filter: brightness(.94); }
.menu-mas-lista { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 260px; background: var(--window);
  border-radius: var(--r-card); box-shadow: var(--shadow-pop); padding: 5px; display: flex; flex-direction: column; }
.menu-mas-lista a, .menu-mas-lista button { display: block; width: 100%; text-align: left; padding: 6px 10px; border: 0; background: none;
  border-radius: 5px; font: var(--fs-body) var(--font); color: var(--label); cursor: pointer; }
.menu-mas-lista a:hover, .menu-mas-lista button:hover { background: var(--accent); color: #fff; text-decoration: none; }
.menu-mas-lista .peligro { color: var(--red); }
.menu-mas-lista .peligro:hover { background: var(--red); color: #fff; }
.menu-mas-lista form { margin: 0; }

.pasos-cot { list-style: none; display: flex; gap: 6px; margin: 0 0 16px; padding: 3px; background: var(--fill); border-radius: 9px; }
.pasos-cot li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--label-2); padding: 6px 10px; border-radius: 7px; }
.pasos-cot li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-caption); font-weight: 700;
  background: var(--fill-2); color: var(--label-2); flex: none; }
.pasos-cot li.actual { color: var(--label); font-weight: 600; background: var(--control); box-shadow: var(--shadow-control); }
.pasos-cot li.actual span { background: var(--accent); color: #fff; }
.pasos-cot li.hecho { color: var(--t-green); }
.pasos-cot li.hecho span { background: var(--green); color: #fff; font-size: 0; }
.pasos-cot li.hecho span::after { content: "✓"; font-size: var(--fs-caption); }

.siguiente-paso { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 14px 16px; background: var(--window);
  border: .5px solid var(--separator); border-radius: var(--r-card); box-shadow: inset 3px 0 0 var(--green); }
.sp-ico { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--s-green); color: var(--t-green); display: grid; place-items: center; }
.sp-ico .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sp-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sp-texto > b { font-size: var(--fs-title3); }
.sp-texto > span { color: var(--label-15); line-height: 1.45; }
.sp-acciones { display: flex; gap: 8px; align-items: center; flex: none; }
.sp-acciones form { display: contents; }
@media (max-width: 900px) {
  .siguiente-paso { flex-wrap: wrap; }
  .sp-acciones { width: 100%; }
  .sp-acciones .btn { flex: 1; justify-content: center; }
}

.franja-datos { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 32px; padding: 16px 18px; position: relative; }
.franja-datos .fd { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.franja-datos .fd span { font-size: var(--fs-caption); font-weight: 600; color: var(--label-2); }
.franja-datos .fd b { font-size: 14px; font-weight: 600; }
.franja-datos .fd small { font-size: var(--fs-caption); color: var(--label-2); }
.franja-datos .fd-total b { font: 700 var(--fs-title2) var(--font-display); font-variant-numeric: tabular-nums; }
.franja-datos .fd-mas { flex-basis: 100%; }
.franja-datos .fd-mas summary { cursor: pointer; color: var(--label-2); width: max-content; }
.franja-datos .fd-mas .ficha { margin-top: 10px; }
.franja-datos .fd-editar { position: absolute; top: 14px; right: 16px; font-weight: 600; }

.encabezado-items { margin-bottom: 10px; }
.encabezado-items h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.cuenta-items { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--fill-2); color: var(--label-2); font-size: var(--fs-caption); font-weight: 700; }
.sin-items { line-height: 1.7; }
.vacio-items { padding: 8px 0 4px; }
.vacio-items > p { margin: 0 0 14px; color: var(--label-15); }
.tipos-item { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tipo-item { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 16px; border: 0; border-radius: var(--r-card);
  background: var(--control); box-shadow: var(--shadow-control); cursor: pointer; font: inherit; color: var(--label-15); line-height: 1.45;
  transition: box-shadow .15s, transform .15s; }
.tipo-item b { color: var(--label); font-size: var(--fs-title3); }
.tipo-item:hover { box-shadow: 0 0 0 1px var(--accent), 0 4px 14px rgba(0, 0, 0, .08); }
.ti-ico { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.ti-ico svg { width: 20px; height: 20px; }
@media (max-width: 680px) { .tipos-item { grid-template-columns: 1fr; } .tipo-item { flex-direction: row; flex-wrap: wrap; } }

.fechas-item { background: var(--fill); border-radius: var(--r-card); padding: 9px 12px; margin-bottom: 14px; }
.fechas-item summary { cursor: pointer; list-style: none; }
.fechas-item summary::-webkit-details-marker { display: none; }
.fechas-item .fi-cambiar { float: right; color: var(--accent); font-weight: 600; }
.fechas-item[open] .fi-cambiar { visibility: hidden; }
.fechas-item .form-grid { margin-top: 10px; }
@media (max-width: 680px) { .fechas-item .fi-cambiar { float: none; display: block; margin-top: 4px; } }

/* Selector de espacios y pantallas */
.selector-cabecera { margin: 10px 0 6px; font-size: 12px; }
.lista-espacios { max-height: 340px; overflow: auto; border-radius: var(--r-card); background: var(--window); box-shadow: var(--shadow-control); }
.opcion-espacio { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 9px 12px; background: transparent;
  border: 0; border-bottom: .5px solid var(--separator); cursor: pointer; font: inherit; color: inherit; }
.opcion-espacio:last-child { border-bottom: 0; }
.opcion-espacio:hover, .opcion-espacio:focus-visible { background: var(--accent-soft); box-shadow: none; border-radius: 0; }
.op-izq { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.op-titulo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.op-titulo .chip { font-weight: 500; }
.op-sitio { font-size: 12px; color: var(--label-15); }
.op-ubicacion { font-size: 12px; color: var(--label-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.op-der { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; white-space: nowrap; }
.op-der .tenue { font-size: var(--fs-caption); }
.lista-vacia { padding: 14px; color: var(--label-2); }
.lista-vacia.error { color: var(--t-red); }
.opcion-grupo { border-bottom: .5px solid var(--separator); }
.grupo-cabecera { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px 4px; }
.grupo-acciones { display: flex; gap: 8px; padding: 2px 12px 10px; flex-wrap: wrap; }
.grupo-unidades { border-top: .5px solid var(--separator); max-height: 260px; overflow: auto; background: var(--fill); }
.grupo-unidades .opcion-espacio { padding-left: 24px; }
.espacio-elegido { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 10px 0 4px; padding: 12px 14px;
  border-radius: var(--r-card); background: var(--s-green); box-shadow: inset 3px 0 0 var(--green); }
.elegido-info { min-width: 0; }
.elegido-etq { display: block; font-size: var(--fs-caption); font-weight: 600; color: var(--t-green); margin-bottom: 2px; }
.elegido-info .chip { margin-left: 4px; }
.elegido-nota { margin-top: 6px; font-size: 12px; color: var(--t-orange); }
.elegido-cantidad { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.elegido-cantidad label { font-weight: 600; font-size: 12px; }
.elegido-cantidad input { width: 90px; }
#aviso-elegir.error { color: var(--t-red); }
.total-item { margin-top: 10px; padding: 9px 12px; background: var(--accent-soft); border-radius: var(--r-control); }

/* Producción / otro cobro */
.panel-intro { margin: 0 0 12px; color: var(--label-2); }
.grid-libre { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
.grid-libre .c3 { grid-column: span 3; }
.grid-libre .c2 { grid-column: span 2; }
.grid-libre input, .grid-libre select { width: 100%; }
.total-libre { justify-content: flex-end; }
.total-libre .etq { font-size: 12px; font-weight: 500; color: var(--label-15); }
.total-libre b { font: 700 var(--fs-title3) var(--font-display); font-variant-numeric: tabular-nums; min-height: 30px; display: flex; align-items: center; }
.boton-libre .btn { width: 100%; }
@media (max-width: 1250px) { .grid-libre { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-libre .c3 { grid-column: 1 / -1; } }
@media (max-width: 480px) { .grid-libre { grid-template-columns: 1fr; } }

/* Secciones plegables y adjuntos */
details.plegable { padding: 0; }
details.plegable > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
details.plegable > summary::-webkit-details-marker { display: none; }
details.plegable .pl-flecha { margin-left: auto; transition: transform .2s; color: var(--label-2); }
details.plegable[open] .pl-flecha { transform: rotate(180deg); }
details.plegable > .rejilla { padding: 0 18px 18px; }
.sub-tarjeta { background: var(--fill); border: 0; box-shadow: none; }
.sub-tarjeta h2 { font-size: var(--fs-title3); }
.lista-adjuntos { list-style: none; margin: 0 0 14px; padding: 0; }
.lista-adjuntos li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: .5px solid var(--separator); flex-wrap: wrap; }
.lista-adjuntos li > a { font-weight: 600; color: var(--label); }
.lista-adjuntos li > .tenue { font-size: 12px; flex: 1; }
.ext { display: inline-grid; place-items: center; width: 38px; height: 24px; border-radius: 5px; font-size: 10px; font-weight: 700; color: #fff; background: #8e8e93; }
.ext-pdf { background: var(--red); } .ext-docx { background: var(--blue); } .ext-xlsx { background: var(--green); }
.ext-pptx { background: var(--orange); } .ext-png, .ext-jpg, .ext-jpeg { background: var(--purple); }
.zona-adjuntos, .zona-archivo { position: relative; border: 1.5px dashed var(--label-3); border-radius: var(--r-card); background: var(--fill);
  padding: 16px; transition: background .15s, border-color .15s; }
.zona-adjuntos { text-align: center; }
.zona-adjuntos.arrastrando, .zona-archivo:hover, .zona-archivo.arrastrando { background: var(--accent-soft); border-color: var(--accent); }
.zona-adjuntos input[type=file], .zona-archivo input[type=file] { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.zona-adjuntos label { display: flex; flex-direction: column; gap: 3px; color: var(--accent); pointer-events: none; }
.zona-adjuntos label span { color: var(--label-2); font-size: 12px; }
.zona-adjuntos .elegidos { margin-top: 8px; }
.zona-adjuntos button { position: relative; margin-top: 8px; }
.zona-archivo.lista { border-style: solid; border-color: var(--verde-borde); background: var(--s-green); }
.zona-archivo.error { border-color: var(--red); background: var(--s-red); }
.zona-archivo label { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: center; pointer-events: none; margin: 0; }
.zona-archivo .zf-ico { grid-row: span 2; width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.zona-archivo.lista .zf-ico { stroke: var(--t-green); }
.zona-archivo b { font-size: var(--fs-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zona-archivo span { font-size: 12px; color: var(--label-2); }
.archivo-factura { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-card);
  background: var(--control); box-shadow: var(--shadow-control); color: inherit; }
.archivo-factura:hover { text-decoration: none; box-shadow: 0 0 0 1px var(--accent); }
.af-ico { flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--s-red); color: var(--t-red); display: grid; place-items: center; }
.af-ico .ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.af-txt { display: flex; flex-direction: column; min-width: 0; }
.af-txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-txt small { font-size: var(--fs-caption); color: var(--label-2); }

/* Cotización (otras vistas) */
.fila-cotizacion { align-items: stretch; }
.agregar-items h2 { margin-bottom: 4px; }
.agregar-items .form-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.resumen-cot { margin-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: .5px solid var(--separator); }
.resumen-cot div { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px 0 0; }
.resumen-cot span { font-size: var(--fs-caption); color: var(--label-2); }
.resumen-cot b { font-variant-numeric: tabular-nums; }
.resumen-cot .total b { font-size: var(--fs-title3); }
@media (max-width: 680px) { .resumen-cot { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Celular y tableta ---------- */
@media (max-width: 1100px) {
  .topbar-in { flex-wrap: wrap; gap: 10px; padding: 0 12px; }
  .marca { order: 1; padding: 12px 0; }
  .acciones-top { order: 2; margin-left: auto; }
  .menu-movil { display: grid; order: 3; }
  .nav { order: 4; flex-basis: 100%; display: none; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 10px; }
  body.menu-abierto .nav { display: flex; }
  .nav-item { flex-direction: column; align-items: stretch; }
  .nav-link { padding: 10px 8px; font-size: 15px; width: 100%; justify-content: space-between; }
  .nav-item .desplegable { position: static; box-shadow: none; background: var(--fill); margin: 2px 0 6px; }
  .panel-asistente { top: auto; left: 0; width: auto; max-height: 60vh; border-left: 0; border-top: .5px solid var(--separator);
    border-radius: 14px 14px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .15); }
  .panel-asistente.minimizado { bottom: 0; }
  .btn-ayuda-texto { display: none; }
  #btn-ayuda { width: 32px; padding: 0; justify-content: center; border-radius: 50%; }
  .pista-ayuda { right: 0; }
}
@media (max-width: 680px) { .subnav-wrap { padding: 12px 16px 0; } .subnav a { padding: 6px 9px; } }
@media (max-width: 680px) {
  .barra-fila { grid-template-columns: 1fr auto; }
  .barra-fila .barra-svg { grid-column: 1 / -1; grid-row: 2; }
  .encabezado .botones { width: 100%; }
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search],
  input[type=tel], input[type=url], input:not([type]), select, textarea { font-size: 16px; }  /* evita el zoom de iOS */
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  .topbar, .subnav-wrap, .botones, .panel-asistente, #ayuda-paso, #ayuda-foco { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Calendario mensual del espacio (estilo Outlook / Teams) ---------- */
.cal { display: grid; grid-template-columns: 220px minmax(0, 1fr); padding: 0; overflow: hidden; }
.cal-lateral { border-right: .5px solid var(--separator); background: color-mix(in srgb, var(--under) 60%, var(--window)); padding: 16px 14px;
  display: flex; flex-direction: column; gap: 18px; }
.cal-etq { display: block; font-size: var(--fs-caption); font-weight: 600; color: var(--label-2); letter-spacing: .02em; margin-bottom: 6px; }
.cal-meses { display: flex; flex-direction: column; gap: 1px; }
.cal-mes { display: grid; grid-template-columns: 44px 1fr 34px; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; color: var(--label);
  font-size: 12.5px; text-decoration: none; }
.cal-mes:hover { background: var(--hover); text-decoration: none; }
.cal-mes.actual { background: var(--accent); color: #fff; }
.cal-mes small { font-size: 10px; opacity: .7; }
.cm-barra svg { display: block; width: 100%; height: 4px; }
.cm-fondo { fill: var(--fill-2); }
.cm-uso { fill: var(--accent); }
.cal-mes.actual .cm-fondo { fill: rgba(255, 255, 255, .3); }
.cal-mes.actual .cm-uso { fill: #fff; }
.cm-pct { text-align: right; font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--label-2); }
.cal-mes.actual .cm-pct { color: rgba(255, 255, 255, .85); }
.cal-leyenda, .cal-festivos { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--label-15); }
.cal-leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.cal-leyenda i.ev-OCUPADO { background: var(--red); }
.cal-leyenda i.ev-RESERVADO { background: var(--orange); }
.cal-leyenda i.ev-BLOQUEADO { background: #8e8e93; }
.cal-leyenda i.l-festivo { background: var(--s-red); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 40%, transparent); }

.cal-principal { min-width: 0; display: flex; flex-direction: column; }
.cal-barra { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: .5px solid var(--separator); }
.cal-titulo { margin: 0 0 0 8px; font-size: var(--fs-title2); }
.cal-cuenta { margin-left: auto; font-size: 12px; }
.cal-cab { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: .5px solid var(--separator); }
.cal-cab span { padding: 7px 10px; font-size: var(--fs-caption); font-weight: 600; color: var(--label-2); }
.cal-cab span.finde { color: var(--label-3); }
.cal-mes-grilla { display: flex; flex-direction: column; }
.cal-semana { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 32px repeat(3, auto) 1fr; row-gap: 5px; min-height: 112px; border-bottom: .5px solid var(--separator); padding-bottom: 8px; }
.cal-semana:last-child { border-bottom: 0; }
.cal-dia { grid-row: 1 / -1; padding: 6px 8px; border-right: .5px solid var(--separator); display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-bottom: -8px; }
.cal-dia.c7 { border-right: 0; }
.cal-dia.finde { background: color-mix(in srgb, var(--fill) 55%, transparent); }
.cal-dia.fuera .cd-num { color: var(--label-3); }
.cd-num { flex: none; font-size: 12.5px; font-weight: 500; color: var(--label); min-width: 24px; height: 22px; line-height: 22px; padding: 0 6px; border-radius: 11px; text-align: center; }
.cal-dia.hoy { background: var(--accent-soft); }
.cal-dia.hoy .cd-num { background: var(--accent); color: #fff; font-weight: 700; }
.cal-dia.festivo { background: color-mix(in srgb, var(--red) 5%, transparent); }
.cal-dia.festivo .cd-num { color: var(--t-red); font-weight: 700; }
.cal-dia.hoy.festivo .cd-num { color: #fff; }
.cd-cab { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cd-festivo { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 10.5px; font-weight: 600; color: var(--t-red); }
.cd-festivo > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ico-festivo { width: 18px; height: 18px; flex: none; display: block; }
.cd-festivo .ico-festivo { width: 20px; height: 20px; padding: 2px; border-radius: 6px; background: var(--window);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .06); }
.cal-dia.festivo:hover .ico-festivo { transform: scale(1.12) rotate(-4deg); transition: transform .2s cubic-bezier(.3, 1.5, .5, 1); }
.cf-item { display: flex; align-items: center; gap: 9px; }
.cf-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--window);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .06); }
.cf-ico .ico-festivo { width: 20px; height: 20px; }
.cf-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.cf-txt b { color: var(--t-red); font-size: 11px; }
.cd-mas { margin-top: auto; font-size: 11px; font-weight: 600; color: var(--label-2); }
.c1 { grid-column-start: 1; } .c2 { grid-column-start: 2; } .c3 { grid-column-start: 3; } .c4 { grid-column-start: 4; }
.c5 { grid-column-start: 5; } .c6 { grid-column-start: 6; } .c7 { grid-column-start: 7; }
.cal-ev.s1 { grid-column-end: span 1; } .cal-ev.s2 { grid-column-end: span 2; } .cal-ev.s3 { grid-column-end: span 3; }
.cal-ev.s4 { grid-column-end: span 4; } .cal-ev.s5 { grid-column-end: span 5; } .cal-ev.s6 { grid-column-end: span 6; } .cal-ev.s7 { grid-column-end: span 7; }
.cal-ev.f1 { grid-row: 2; } .cal-ev.f2 { grid-row: 3; } .cal-ev.f3 { grid-row: 4; }
/* Barras de agendamiento: cinta con color del estado; punta de flecha cuando sigue en otra semana */
.cal-ev { --ev: #8e8e93; position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; margin: 0 5px; padding: 0 11px; min-width: 0;
  height: 30px; border-radius: 7px; font-size: 12.5px; line-height: 1; text-decoration: none; overflow: hidden; white-space: nowrap;
  color: color-mix(in srgb, var(--ev) 62%, #1d1d1f); background: color-mix(in srgb, var(--ev) 24%, var(--window));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ev) 45%, transparent), 0 1px 2px color-mix(in srgb, var(--ev) 20%, transparent);
  transition: filter .12s, box-shadow .12s, transform .12s; }
.cal-ev.ev-OCUPADO { --ev: var(--red); }
.cal-ev.ev-RESERVADO { --ev: var(--orange); }
.cal-ev.ev-BLOQUEADO { --ev: #8e8e93; background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, .045) 6px 12px); }
.ev-punto { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ev); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ev) 25%, transparent); }
.cal-ev b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-ev small { flex: none; font-size: 11.5px; font-weight: 600; opacity: .8; }
.cal-ev .ev-fechas { margin-left: auto; padding-left: 8px; opacity: .7; }
a.cal-ev:hover { text-decoration: none; filter: saturate(1.15); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ev) 55%, transparent), 0 3px 10px -3px color-mix(in srgb, var(--ev) 50%, transparent); }
.cal-ev.sigue-antes { margin-left: 0; padding-left: 16px; border-top-left-radius: 0; border-bottom-left-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%); }
.cal-ev.sigue-antes .ev-punto { display: none; }
.cal-ev.sigue-despues { margin-right: 0; padding-right: 16px; border-top-right-radius: 0; border-bottom-right-radius: 0;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%); }
.cal-ev.sigue-antes.sigue-despues { clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%, 10px 50%); }
@media (max-width: 900px) {
  .cal { grid-template-columns: 1fr; }
  .cal-lateral { border-right: 0; border-bottom: .5px solid var(--separator); }
  .cal-meses { flex-direction: row; overflow-x: auto; gap: 4px; }
  .cal-mes { grid-template-columns: auto; padding: 6px 10px; }
  .cal-mes .cm-barra, .cal-mes .cm-pct { display: none; }
  .cd-festivo { display: none; }
  .cal-ev small { display: none; }
  .cal-ev { padding: 0 6px; }
}

/* «Cómo usar esta página»: solo con el asistente (salvavidas) encendido */
.como-usar { display: none; }
body.modo-ayuda .como-usar { display: block; }

/* ---------- Rejilla de pantalla: elegir celdas para cotizar ---------- */
.rejilla-ayuda { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 12.5px; color: var(--label-15); }
.rejilla-ayuda .ico { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.rejilla-seleccionable .slots-grid { -webkit-user-select: none; user-select: none; }
.slots-grid rect.elegible { cursor: pointer; touch-action: none; transition: fill .1s; }
.slots-grid rect.elegible:hover { fill: color-mix(in srgb, var(--accent) 22%, var(--window)); stroke: var(--accent); stroke-width: 1.5; }
.slots-grid rect.elegible:focus-visible { outline: none; stroke: var(--accent); stroke-width: 2.5; }
.slots-grid rect.sel, .slots-grid rect.sel:hover { fill: var(--accent); stroke: color-mix(in srgb, var(--accent) 70%, #000); stroke-width: 1; }
.rejilla-seleccionable.arrastrando, .rejilla-seleccionable.arrastrando * { cursor: crosshair !important; }
.barra-seleccion { position: fixed; z-index: 60; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 18px;
  padding: 10px 10px 10px 14px; background: var(--window); border-radius: 14px; box-shadow: var(--shadow-window); max-width: calc(100vw - 24px);
  animation: sube .22s ease-out; }
@keyframes sube { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.bs-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bs-cuenta { flex: none; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 16px; background: var(--accent); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.bs-info > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.bs-info small { color: var(--label-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-acciones { display: flex; gap: 8px; flex: none; }
@media (max-width: 680px) { .barra-seleccion { left: 12px; right: 12px; transform: none; flex-wrap: wrap; } @keyframes sube { from { opacity: 0; } to { opacity: 1; } } }
@media (prefers-reduced-motion: reduce) { .barra-seleccion { animation: none; } }
