/* Carga del equipo · identidad Refineria (Work Sans, deep blue #323E48 y gama de marca).
   Mismo sistema visual que el prototipo «Carga del equipo en Odoo»: barra de app deep blue, tarjetas blancas
   y tablas de línea fina. Sigue el modo claro u oscuro del sistema. */
@font-face { font-family: 'Work Sans'; font-weight: 400; font-display: swap; src: url('/marca/WorkSans-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Work Sans'; font-weight: 500; font-display: swap; src: url('/marca/WorkSans-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Work Sans'; font-weight: 600; font-display: swap; src: url('/marca/WorkSans-SemiBold.ttf') format('truetype'); }

:root {
  --bg: #F3F6F7; --surface: #FFFFFF; --ink: #323E48; --ink-soft: #56636D; --line: #DCE3E6; --track: #E7ECEE;
  --accent: #B6DCE1; --barra: #323E48; --barra-ink: #FFFFFF;
  --ok: #99E6D8; --warn: #F5F0A2; --bad: #FEAEBB; --med: #6FCFEB;
  --font: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --ancho: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #323E48; --barra: #1B2227; color-scheme: dark;
} }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
p { margin: 0; max-width: 72ch; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.in { max-width: var(--ancho); margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.eyebrow { font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; }
.nota { color: var(--ink-soft); font-size: .85rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sobre-fondo { color: #FFFFFF; } :root:not([data-theme="light"]) .sobre-fondo .nota, :root:not([data-theme="light"]) .sobre-fondo .eyebrow { color: #B6DCE1; } }

/* Barra de la aplicación */
.barra-app { background: var(--barra); color: var(--barra-ink); }
.barra-app .in { display: flex; align-items: center; gap: 10px 20px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.logo { display: block; width: 150px; height: auto; }
.app { font-weight: 600; white-space: nowrap; border-left: 1px solid rgba(255,255,255,.3); padding-left: 18px; }
.barra-der { display: flex; gap: 12px; align-items: center; margin-left: auto; flex-wrap: wrap; font-size: .85rem; }
.barra-app select { font: inherit; background: transparent; color: var(--barra-ink); border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 4px 10px; }
.barra-app select option { color: #323E48; }
.usuario { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.av { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #323E48; display: grid; place-items: center; font-size: .72rem; font-weight: 600; }
.barra-app a { color: var(--barra-ink); }

/* Contenido */
main { padding-top: 26px; padding-bottom: 64px; display: grid; gap: 22px; }
.cabecera { display: flex; justify-content: space-between; align-items: end; gap: 12px 24px; flex-wrap: wrap; }
.cabecera .titulo { display: grid; gap: 6px; }
.acciones { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tarjeta { background: var(--surface); color: #323E48; border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 14px; min-width: 0; color-scheme: light; }
.tarjeta .nota { color: #56636D; }
.aviso { background: var(--warn); color: #323E48; border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.aviso.error { background: var(--bad); }

.btn { font: inherit; font-size: .85rem; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; background: var(--surface); color: #323E48; border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #323E48; }
.btn.oscuro { background: #323E48; color: #FFFFFF; border-color: #323E48; }
.btn:disabled { opacity: .5; cursor: wait; }
input[type=email] { font: inherit; font-size: .85rem; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; min-width: 240px; background: var(--surface); color: #323E48; }
:focus-visible { outline: 3px solid var(--med); outline-offset: 2px; }

/* Pestañas de departamento */
.pestanas { display: flex; gap: 6px; flex-wrap: wrap; }
.pestanas button { font: inherit; font-size: .9rem; background: transparent; color: inherit; border: 1px solid transparent; border-radius: 999px; padding: 7px 16px; cursor: pointer; }
.pestanas button:hover { border-color: var(--line); }
.pestanas button[aria-selected="true"] { background: var(--accent); color: #323E48; font-weight: 500; }

/* Cifras */
.cifras { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.cifra { background: var(--surface); color: #323E48; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; }
.cifra b { font-size: 1.7rem; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cifra span { font-size: .8rem; color: #56636D; }

/* Tablas */
.tabla { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 500; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: #56636D; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.num, th.num { text-align: right; white-space: nowrap; }
td .sub { display: block; font-size: .8rem; color: #56636D; }
tr.clic { cursor: pointer; }
tr.clic:hover td { background: #F3F6F7; }
tr.detalle td { background: #F3F6F7; }
td b { font-weight: 600; }

.pill { display: inline-block; font-size: .74rem; font-weight: 500; padding: 3px 10px; border-radius: 999px; color: #323E48; background: var(--line); white-space: nowrap; margin: 1px 4px 1px 0; }
.pill.margen { background: var(--ok); }
.pill.ajustado { background: var(--warn); }
.pill.saturado, .pill.retraso { background: var(--bad); }
.pill.borde { background: transparent; border: 1px solid var(--line); }
.pill.sin-tarea { background: var(--warn); }

/* Barras: avance con marca vertical de «dónde deberías ir hoy» */
.avance { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.pista { position: relative; flex: 1; height: 10px; background: var(--track); border-radius: 999px; }
.pista .lleno { position: absolute; left: 0; top: 0; bottom: 0; background: #323E48; border-radius: 999px; }
.pista .lleno.retraso { background: #FEAEBB; }
.pista .lleno.saturado { background: #FEAEBB; }
.pista .lleno.ajustado { background: #F5F0A2; }
.pista .lleno.margen { background: #99E6D8; }
.pista .marca { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #323E48; }
.avance .valor { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: .85rem; min-width: 84px; text-align: right; }

.dos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); align-items: start; }
.vacio { color: #56636D; font-size: .9rem; padding: 6px 0; }
footer { font-size: .8rem; }
footer p { max-width: 100ch; }

/* Página de entrada */
.entrada { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.entrada .tarjeta { max-width: 460px; width: 100%; padding: 32px; gap: 18px; }
.entrada .logo { width: 180px; }
.ms { display: inline-flex; gap: 10px; align-items: center; justify-content: center; font-size: .95rem; padding: 11px 20px; }
.ms i { display: grid; grid-template-columns: 8px 8px; gap: 2px; }
.ms i span { width: 8px; height: 8px; background: #FFFFFF; }

@media (max-width: 640px) {
  .app { border-left: 0; padding-left: 0; }
  .barra-der { margin-left: 0; }
  input[type=email] { min-width: 0; width: 100%; }
}
