/* Portal comercial HVAC LATAM.
   Paleta tomada del logo (azul y gris) y del equipo que vendemos: lámina de aluminio de fondo,
   azul profundo de los serpentines y un solo acento cobre, el de la tubería de refrigerante.
   Tipografía Barlow: la misma familia en ancho normal para leer y condensada para cifras y títulos,
   como las placas de datos de los equipos. */
:root {
  --azul: #1e64b4; --azul-hover: #17528f; --azul-tinte: #e3edf8;
  --profundo: #0e2a4a; --profundo-2: #163b63;
  --fondo: #eef1f5; --lamina: #ffffff; --linea: #d9dee6; --linea-suave: #e8ecf1;
  --texto: #232830; --tenue: #5f6670;
  --cobre: #b4652a; --cobre-tinte: #f6e9de;
  --ok: #1d7a4e; --ok-tinte: #e2f3ea; --aviso: #8a5a00; --aviso-tinte: #fbf0d9; --mal: #b3261e; --mal-tinte: #fbe6e4;
  --radio: 6px; --radio-grande: 10px;
  --sombra: 0 1px 2px rgba(14, 42, 74, .06), 0 4px 16px rgba(14, 42, 74, .06);
  --texto-base: "Barlow", system-ui, "Segoe UI", sans-serif;
  --texto-placa: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --azul: #5b9ae0; --azul-hover: #7cb0ea; --azul-tinte: #18304d;
    --profundo: #0b1d33; --profundo-2: #12304f;
    --fondo: #0f1620; --lamina: #17202c; --linea: #2b3644; --linea-suave: #222c39;
    --texto: #e4e8ee; --tenue: #9aa4b1;
    --cobre: #e08a4c; --cobre-tinte: #3a2616;
    --ok: #63c993; --ok-tinte: #13301f; --aviso: #e9b45a; --aviso-tinte: #33270f; --mal: #f08a80; --mal-tinte: #3b1916;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.5 var(--texto-base); background: var(--fondo); color: var(--texto); }
a { color: var(--azul); text-underline-offset: 2px; }
a:hover { color: var(--azul-hover); }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--texto-placa); font-weight: 600; line-height: 1.15; letter-spacing: .005em; margin: 0; }
h1 { font-size: 2rem; }
h2 { font-size: 1.3rem; margin-bottom: 12px; }
h3 { font-size: 1.1rem; }
.muted { color: var(--tenue); } .small { font-size: .85rem; } .pre { white-space: pre-line; }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
code { font-size: .78rem; word-break: break-all; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 72px; }

/* ---------- Barra superior ----------
   Dos renglones: logo y usuario arriba, menú abajo a todo lo ancho. Así caben todos los menús
   asignados (Dirección ve 9) y los que se agreguen; si no caben, bajan a otro renglón, nunca se esconden. */
.top { background: var(--lamina); border-bottom: 1px solid var(--linea); position: sticky; top: 0; z-index: 10; }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: grid;
  grid-template-columns: auto 1fr; grid-template-areas: "brand who" "nav nav"; align-items: center; column-gap: 20px; }
.brand { grid-area: brand; display: flex; align-items: center; height: 56px; }
.brand img { height: 28px; width: auto; }
@media (prefers-color-scheme: dark) { .brand { background: #fff; padding: 6px 10px; border-radius: var(--radio); height: auto; margin: 9px 0; } .brand img { height: 22px; } }
.top nav { grid-area: nav; display: flex; flex-wrap: wrap; gap: 0 2px; min-width: 0; border-top: 1px solid var(--linea-suave); margin: 0 -8px; }
.top nav a {
  display: flex; align-items: center; height: 44px; padding: 0 12px; white-space: nowrap; text-decoration: none;
  color: var(--tenue); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.top nav a:hover { color: var(--texto); }
.top nav a[aria-current="page"] { color: var(--texto); border-bottom-color: var(--azul); }
.top nav .count { margin-left: 6px; background: var(--cobre); color: #fff; font-size: .72rem; font-weight: 600; border-radius: 99px; padding: 1px 7px; }
.who { grid-area: who; justify-self: end; display: flex; align-items: center; gap: 10px; }
.who-text { display: flex; flex-direction: column; text-align: right; line-height: 1.2; }
.who-text b { font-weight: 600; font-size: .9rem; } .who-text span { font-size: .78rem; color: var(--tenue); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--profundo); color: #fff;
  font: 600 .9rem var(--texto-placa); letter-spacing: .04em; }
.who .link { font-size: .85rem; color: var(--tenue); }
@media (max-width: 860px) {
  .top-inner { padding: 0 14px; }
  .top nav a { height: 40px; padding: 0 10px; font-size: .95rem; }
  .who-text { display: none; }
}
}

/* ---------- Botones y formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 .95rem var(--texto-base);
  padding: 9px 16px; border-radius: var(--radio); border: 1px solid var(--linea); background: var(--lamina);
  color: var(--texto); cursor: pointer; text-decoration: none; min-height: 40px;
}
.btn:hover { border-color: var(--azul); color: var(--azul); }
.btn.primary { background: var(--azul); border-color: var(--azul); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--azul-hover); border-color: var(--azul-hover); color: #fff; }
.btn.small { padding: 4px 12px; font-size: .85rem; min-height: 32px; }
.btn.wide { display: flex; width: 100%; margin-top: 10px; }
.btn.big { min-height: 48px; font-size: 1.02rem; padding: 12px 22px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--azul); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

label { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; font-weight: 500; color: var(--tenue); margin-bottom: 12px; }
label.check { flex-direction: row; align-items: center; }
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--texto); background: var(--lamina); border: 1px solid var(--linea);
  border-radius: var(--radio); padding: 9px 11px; min-width: 0; min-height: 40px;
}
input:focus, select:focus, textarea:focus { border-color: var(--azul); outline: 3px solid var(--azul-tinte); outline-offset: 0; }
input.qty { width: 76px; text-align: right; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; align-items: end; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; } .filters input { flex: 1; min-width: 200px; }

/* ---------- Superficies ---------- */
.card { background: var(--lamina); border: 1px solid var(--linea); border-radius: var(--radio-grande); padding: 20px; margin-bottom: 20px; }
.card > h2:first-child { margin-top: -2px; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.grid-quote { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid-quote { grid-template-columns: 1fr; } }
.scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--linea-suave); vertical-align: top; }
th { font-size: .82rem; color: var(--tenue); font-weight: 600; border-bottom-color: var(--linea); }
tbody tr:hover td { background: color-mix(in srgb, var(--azul-tinte) 45%, transparent); }
tr.total td { font-weight: 700; font-size: 1.05rem; } tr.sep td { border-top: 2px solid var(--linea); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { padding: 10px 0; border-bottom: 1px solid var(--linea-suave); display: flex; gap: 10px; align-items: baseline; }
.rows li:last-child { border-bottom: 0; } .right { margin-left: auto; text-align: right; white-space: nowrap; }

.tag { font-style: normal; font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--fondo); color: var(--tenue); white-space: nowrap; }
.tag.por_aprobar { background: var(--aviso-tinte); color: var(--aviso); }
.tag.aprobada { background: var(--azul-tinte); color: var(--azul); }
.tag.enviada { background: var(--azul-tinte); color: var(--azul); }
.tag.ganada { background: var(--ok-tinte); color: var(--ok); }
.tag.perdida { background: var(--mal-tinte); color: var(--mal); }
.src { font-style: normal; font-size: .75rem; font-weight: 600; color: var(--tenue); min-width: 52px; display: inline-block; }
.src.zoho { color: var(--aviso); } .src.trello { color: var(--azul); } .src.portal { color: var(--ok); }
.alert { background: var(--aviso-tinte); color: var(--aviso); padding: 12px 14px; border-radius: var(--radio); }
.ok { background: var(--ok-tinte); color: var(--ok); padding: 12px 14px; border-radius: var(--radio); }
.hits { list-style: none; padding: 0; margin: -6px 0 12px; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--lamina); }
.hits li { padding: 8px 12px; border-bottom: 1px solid var(--linea-suave); } .hits li:last-child { border-bottom: 0; }

/* KPIs heredados (otras pantallas) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--lamina); border: 1px solid var(--linea); border-radius: var(--radio-grande); padding: 14px; display: flex; flex-direction: column; }
.kpi span { color: var(--tenue); font-size: .85rem; } .kpi b { font: 600 1.9rem var(--texto-placa); font-variant-numeric: tabular-nums; } .kpi small { color: var(--tenue); }

/* ---------- Inicio de sesión ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 5fr) 7fr; background: var(--lamina); }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 6vw, 88px); max-width: 620px; }
.login-panel .logo { width: 240px; height: auto; margin-bottom: 56px; }
.login-panel h1 { font-size: clamp(2.4rem, 4vw, 3.3rem); line-height: 1.02; color: var(--profundo); max-width: 12ch; }
.login-panel p.lead { font-size: 1.08rem; color: var(--tenue); margin: 18px 0 32px; max-width: 38ch; }
.login-panel .btn.primary { align-self: flex-start; }
.login-panel .zoho-note { font-size: .85rem; color: var(--tenue); margin-top: 14px; }
.login-panel .dev { margin-top: 36px; padding-top: 20px; border-top: 1px dashed var(--linea); max-width: 360px; }
.login-panel .alert { margin-bottom: 20px; max-width: 420px; }
.login-photo { position: relative; overflow: hidden; background: var(--profundo); }
.login-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 55%; }
.login-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 72px 36px 28px; color: #fff; font-size: .92rem;
  background: linear-gradient(to top, rgba(14, 42, 74, .85), rgba(14, 42, 74, 0));
}
.login-photo figcaption b { display: block; font: 600 1.35rem var(--texto-placa); margin-bottom: 2px; }
@media (prefers-color-scheme: dark) { .login-panel .logo { background: #fff; padding: 10px 14px; border-radius: var(--radio); } .login-panel h1 { color: var(--texto); } }
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; grid-template-rows: 34vh auto; }
  .login-photo { grid-row: 1; } .login-panel { grid-row: 2; padding: 32px 22px 48px; }
  .login-panel .logo { width: 190px; margin-bottom: 28px; }
  .login-photo figcaption { padding: 40px 22px 16px; }
}

/* ---------- Tablero ---------- */
.welcome {
  position: relative; overflow: hidden; background: var(--profundo); color: #fff; border-radius: var(--radio-grande);
  padding: 30px 32px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; justify-content: space-between;
}
.welcome::after { /* las tres corrientes de aire del logo, en grande y casi invisibles */
  content: ""; position: absolute; right: -40px; top: 50%; width: 520px; height: 220px; transform: translateY(-50%);
  background: url("/static/img/corrientes.svg") no-repeat center / contain; opacity: .16; pointer-events: none;
}
.welcome > * { position: relative; z-index: 1; }
.welcome h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.welcome p { margin: 6px 0 0; color: #c9d6e6; max-width: 60ch; }
.welcome p b { color: #fff; font-weight: 600; }
.welcome .controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.welcome select { background: var(--profundo-2); color: #fff; border-color: #2c4f78; }
.welcome .btn.primary { background: #fff; border-color: #fff; color: var(--profundo); }
.welcome .btn.primary:hover { background: var(--azul-tinte); border-color: var(--azul-tinte); color: var(--profundo); }

.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); background: var(--lamina);
  border: 1px solid var(--linea); border-radius: var(--radio-grande); margin-bottom: 20px; }
.gauge { padding: 18px 22px; border-left: 1px solid var(--linea-suave); display: flex; flex-direction: column; gap: 2px; }
.gauge:first-child { border-left: 0; }
.gauge span { font-size: .88rem; color: var(--tenue); font-weight: 500; }
.gauge b { font: 600 2.4rem/1.05 var(--texto-placa); font-variant-numeric: tabular-nums; color: var(--profundo); }
.gauge small { font-size: .85rem; color: var(--tenue); }
.gauge.won b { color: var(--cobre); }
@media (prefers-color-scheme: dark) { .gauge b { color: var(--texto); } }
@media (max-width: 700px) { .gauge { border-left: 0; border-top: 1px solid var(--linea-suave); } .gauge:first-child { border-top: 0; } }

.board { display: grid; grid-template-columns: 8fr 5fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .board { grid-template-columns: 1fr; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.quote-list td:first-child a { font-weight: 600; text-decoration: none; }
.quote-list td.customer { max-width: 260px; }
.quote-list .when { color: var(--tenue); font-size: .85rem; }

.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: grid; grid-template-columns: 6px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--linea-suave); }
.todo li:last-child { border-bottom: 0; }
.todo li::before { content: ""; width: 6px; align-self: stretch; border-radius: 3px; background: var(--azul); }
.todo li.wait::before { background: var(--aviso); }
.todo li b { display: block; font-weight: 600; }
.todo li small { color: var(--tenue); }
.empty { color: var(--tenue); padding: 8px 0; }

.lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.line-tile { display: block; text-decoration: none; color: var(--texto); background: var(--lamina); border: 1px solid var(--linea);
  border-radius: var(--radio-grande); overflow: hidden; }
.line-tile:hover { border-color: var(--azul); color: var(--texto); }
.line-tile figure { margin: 0; aspect-ratio: 4 / 3; background: #fff; display: grid; place-items: center; overflow: hidden; }
.line-tile figure img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.line-tile figure img.photo { object-fit: cover; padding: 0; }
.line-tile div { padding: 12px 16px 14px; border-top: 1px solid var(--linea-suave); }
.line-tile b { display: block; font: 600 1.12rem var(--texto-placa); }
.line-tile small { color: var(--tenue); }

.feed li { font-size: .92rem; }
@media (max-width: 700px) {
  .welcome { padding: 24px 22px; }
  .welcome::after { top: auto; bottom: -70px; right: -60px; transform: none; width: 340px; opacity: .1; }
}

/* ---------- Pantallas internas ---------- */
.page-sub { margin: 6px 0 0; max-width: 70ch; }
.head h1 .tag { font-family: var(--texto-base); font-size: .8rem; vertical-align: middle; margin-left: 6px; }
.form-title { margin: 22px 0 4px; }
.quote-sheet fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.quote-sheet legend { font: 600 1.15rem var(--texto-placa); padding: 0; margin-bottom: 10px; color: var(--profundo); }
@media (prefers-color-scheme: dark) { .quote-sheet legend { color: var(--texto); } }
.quote-sheet .cart td { vertical-align: middle; }
.preview:not(:empty) { border-top: 1px solid var(--linea); padding-top: 14px; margin-top: 4px; }
.preview .totals td { padding: 6px 0; border: 0; }
.preview .totals tr.sep td { border-top: 1px solid var(--linea); padding-top: 10px; }
.preview .totals tr.total td { font: 600 1.35rem var(--texto-placa); color: var(--profundo); }
@media (prefers-color-scheme: dark) { .preview .totals tr.total td { color: var(--texto); } }
.level-note { font-size: .9rem; color: var(--tenue); margin: 10px 0; }
.level-note b { color: var(--texto); }
.catalog td { vertical-align: middle; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 20px; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--linea-suave); }
.facts dt { font-size: .82rem; color: var(--tenue); font-weight: 500; }
.facts dd { margin: 2px 0 0; }
.next-step .alert, .next-step .ok { margin-top: 0; }
.narrow { max-width: 520px; margin: 6vh auto; }
.verify-logo { margin-bottom: 24px; }
.narrow h1 { margin-bottom: 16px; }
td a[href^="/cotizaciones/"] { white-space: nowrap; font-weight: 600; text-decoration: none; }

/* ---------- Catálogos: vista tipo explorador ---------- */
.btn.ghost { border-color: transparent; background: transparent; color: var(--tenue); }
.btn.ghost:hover { color: var(--mal); border-color: var(--mal-tinte); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.explorer { display: grid; grid-template-columns: minmax(220px, 290px) 1fr; background: var(--lamina);
  border: 1px solid var(--linea); border-radius: var(--radio-grande); overflow: hidden; min-height: 420px; }
.ico { width: 20px; height: 20px; flex: none; }
.ico-folder { fill: #e8b54a; }
.ico-folder-open { fill: #f3cd73; }
.ico-file .sheet { fill: #fff; stroke: #9aa4b1; stroke-width: 1.1; }
.ico-file .fold { fill: none; stroke: #9aa4b1; stroke-width: 1.1; }
.ico-file .band { fill: #6b7380; }
.ico-file.pdf .band { fill: #c8372d; } .ico-file.xls .band { fill: #1f7a46; }
.ico-file.doc .band { fill: #2b5fb4; } .ico-file.ppt .band { fill: #c45a1e; }
.ico-file text { fill: #fff; font: 700 4.6px var(--texto-base); }

.tree { background: var(--fondo); border-right: 1px solid var(--linea); padding: 10px 6px; overflow: auto; max-height: 72vh; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { padding-left: 18px; }
.tree a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radio); color: var(--texto);
  text-decoration: none; font-size: .92rem; line-height: 1.25; }
.tree a span { flex: 1; min-width: 0; }
.tree a small { color: var(--tenue); font-size: .78rem; }
.tree a:hover { background: var(--lamina); }
.tree a.current { background: var(--azul-tinte); color: var(--azul); font-weight: 600; }
.tree a.empty { color: var(--tenue); }
.tree-root { font-weight: 600; }

.pane { min-width: 0; display: flex; flex-direction: column; }
.pane-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--linea); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; font-size: .92rem; }
.crumbs li + li::before { content: "›"; color: var(--tenue); margin: 0 4px; }
.crumbs a { text-decoration: none; }
.crumbs span { font-weight: 600; }
.pane-search input { width: 220px; min-height: 36px; padding: 6px 10px; }

.details { width: 100%; border-collapse: collapse; font-size: .93rem; }
.details th { text-align: left; font-weight: 500; font-size: .8rem; color: var(--tenue); padding: 8px 14px; border-bottom: 1px solid var(--linea-suave); }
.details td { padding: 6px 14px; border-bottom: 1px solid var(--linea-suave); vertical-align: middle; }
.details tbody tr:hover { background: var(--fondo); }
.details td:first-child a { display: flex; align-items: center; gap: 10px; color: var(--texto); text-decoration: none; min-height: 40px; }
.details td:first-child a:hover span { color: var(--azul); text-decoration: underline; }
.details td:first-child span { min-width: 0; overflow-wrap: anywhere; }
.details td:first-child small { display: block; color: var(--tenue); font-size: .78rem; }
.details tr.folder td:first-child a { font-weight: 600; }
.details tr.empty td:first-child a { color: var(--tenue); font-weight: 500; }
.details tr.up a { color: var(--tenue); }
.details .thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--linea); flex: none; background: #fff; }
.details .ico-file { width: 26px; height: 26px; margin: 0 7px; }
.details .acts { white-space: nowrap; text-align: right; }
.details .acts form { display: inline; margin: 0; }
.show-sm { display: none !important; }
/* En escritorio el árbol ya muestra las carpetas: la lista de la derecha solo lleva archivos. */
table.only-sm, tr.only-sm { display: none; }
.pane-empty { padding: 28px 16px; }

.upload { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin-top: auto; padding: 14px; border-top: 1px solid var(--linea); background: var(--fondo); }
.upload b { flex-basis: 100%; font: 600 1.05rem var(--texto-placa); }
.upload label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.upload p { flex-basis: 100%; margin: 0; }
.upload-hint { padding: 0 16px 16px; }

@media (max-width: 760px) {
  .explorer { grid-template-columns: 1fr; }
  .tree { display: none; }
  .pane-bar { flex-wrap: wrap; }
  .pane-search, .pane-search input { width: 100%; }
  .hide-sm { display: none; }
  .show-sm { display: block !important; }
  table.only-sm { display: table; } tr.only-sm { display: table-row; }
  .details th { display: none; }
  .details td { padding: 6px 10px; }
}
@media (prefers-color-scheme: dark) {
  .ico-file .sheet { fill: #e9edf2; }
  .tree a.current { color: #fff; }
}

/* ---------- Inventario ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--linea); margin: 0 0 14px; overflow-x: auto; }
.tabs a { padding: 9px 16px; color: var(--tenue); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--texto); }
.tabs a[aria-current] { color: var(--azul); border-bottom-color: var(--azul); }
.stock td { vertical-align: top; }
.stock td.n b { font: 600 1.05rem var(--texto-placa); }
.parts-line { color: var(--tenue); }
.move summary { list-style: none; cursor: pointer; }
.move summary::-webkit-details-marker { display: none; }
.move-form { display: grid; gap: 8px; padding: 12px; margin-top: 6px; min-width: 260px; background: var(--fondo);
  border: 1px solid var(--linea); border-radius: var(--radio); }
.move-form label { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; }
.inline-form { display: flex; align-items: end; gap: 10px; margin-bottom: 10px; }
.inline-form label { flex: 1; }

/* Alta manual de partes en Inventario */
details.new-part > summary { cursor: pointer; font-weight: 600; color: var(--azul); }
details.new-part[open] > summary { margin-bottom: 10px; }
.move-form + .move-form { margin-top: 8px; }
table.comps input { width: 100%; }
table.comps td:last-child { width: 6em; }

/* Oportunidades de Zoho en Inicio */
.pipe { margin-bottom: 8px; }
.pipe .gauges { margin-bottom: 20px; }
.funnel { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.funnel li { display: grid; grid-template-columns: minmax(150px, 1.4fr) 2fr 2.5em 5.5em; align-items: center; gap: 10px; font-size: .9rem; }
.funnel .bar { height: 10px; border-radius: 99px; background: var(--linea-suave); position: relative; overflow: hidden; }
.funnel .bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--azul); border-radius: 99px; }
.funnel li:last-child .bar::before { background: var(--cobre); }
.funnel .n { text-align: right; font-variant-numeric: tabular-nums; }
.funnel .amt { font-weight: 600; }
@media (max-width: 560px) { .funnel li { grid-template-columns: 1fr 2.5em 5.5em; } .funnel .bar { grid-column: 1 / -1; order: 5; } }

/* Movimientos rápidos en Inventario */
.moves .seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 4px 0 14px; background: var(--fondo); border-radius: var(--radio); }
.moves .seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: calc(var(--radio) - 2px); font: inherit; font-weight: 500; color: var(--tenue); cursor: pointer; }
.moves .seg button[aria-selected="true"] { background: var(--lamina); color: var(--texto); box-shadow: 0 1px 2px rgba(15, 30, 50, .12); }
.moves .span-all { grid-column: 1 / -1; margin-top: 0; }
.moves .span-2 { grid-column: span 2; }
@media (max-width: 560px) { .moves .span-2 { grid-column: 1 / -1; } }
td.row-actions { white-space: nowrap; text-align: right; }
td.row-actions .btn + .btn { margin-left: 4px; }
.moves form[hidden] { display: none; }

/* Bodegas y encargados (Admin → Conteo físico) */
.wh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 18px; }
.wh-box { border: 1px solid var(--linea-suave); border-radius: var(--radio); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.wh-box h3 { margin: 0; font-size: 1.05rem; }
.wh-box p { margin: 0; }
.wh-box .checks { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; margin: 6px 0 8px; }
.wh-box .checks label { margin: 0; font-weight: 400; color: var(--texto); gap: 8px; }
.wh-box .btn { align-self: flex-start; }

/* Mantenimiento */
.maint-tabs { flex-wrap: wrap; }
.maint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.maint-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; margin: 0; }
.maint-card:hover { border-color: var(--azul); }
.maint-card h2 { margin: 0; font-size: 1.05rem; }
.maint-card .big { font: 600 2.2rem/1.1 var(--texto-placa); color: var(--profundo); }
.maint-card.warn .big { color: var(--cobre); }
.maint-card p { margin: 0; }
.review-row { border-top: 1px solid var(--linea-suave); padding: 14px 0 6px; }
.review-row:first-of-type { border-top: 0; }
.review-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-bottom: 8px; }
.review-head .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.review-row .actions { align-items: center; margin-top: -4px; }
.review-row label.check { margin: 0; }
table.hier td { vertical-align: top; }
@media (prefers-color-scheme: dark) { .maint-card .big { color: var(--texto); } }

.quote-box { border: 1px dashed var(--linea); border-radius: var(--radio); padding: 8px 14px 2px; margin: 0 0 12px; }
.quote-box.required { border-color: var(--cobre); background: var(--cobre-tinte); }
.quote-box legend { font-size: .85rem; font-weight: 600; padding: 0 6px; color: var(--texto); }
.quote-box .or { margin: -6px 0 6px; }
@media (prefers-color-scheme: dark) { .quote-box.required { background: transparent; } }

/* Confirmación en la página (data-confirm) */
.confirm-box { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--aviso); background: var(--aviso-tinte);
  border-radius: var(--radio); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.confirm-box p { flex: 1 1 100%; margin: 0 0 4px; color: var(--texto); font-weight: 600; }

/* Admin → menús por usuario */
fieldset.menus { grid-column: 1 / -1; border: 1px solid var(--linea); border-radius: var(--radio); padding: 10px 14px 12px; margin: 4px 0; }
fieldset.menus legend { font-weight: 600; padding: 0 6px; }
fieldset.menus label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 5px 0; }
fieldset.menus label.check input { width: auto; margin: 0; }

/* Entrada: dos equipos que se alternan sobre fondo claro (renders con fondo blanco, sin recortar) */
.login-photo.showcase { background: #fff; border-left: 1px solid var(--linea); }
.login-photo.showcase .slide { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  align-items: center; padding: 6vh 6% 140px; opacity: 0; animation: login-fade 16s infinite; }
.login-photo.showcase .slide:nth-child(2) { animation-delay: 8s; }
.login-photo.showcase .slide img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain;
}
.login-photo.showcase figcaption { background: none; color: var(--profundo); padding: 0 40px 36px; }
.login-photo.showcase figcaption b { color: var(--profundo); }
@keyframes login-fade { 0%, 4% { opacity: 0; } 8%, 46% { opacity: 1; } 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .login-photo.showcase .slide { animation: none; }
  .login-photo.showcase .slide:first-child { opacity: 1; }
}
@media (max-width: 860px) { .login-photo.showcase .slide { padding: 16px 16px 64px; } .login-photo.showcase figcaption { padding: 0 22px 14px; } }
