/* ==========================================================================
   Doppi Hub · prototipo visual
   Layout: barra lateral azul noche + cabecera fija + contenido en rejilla.
   Paleta y tipografías tomadas de branding/colores.png, web/hello/styles.css
   y web/shopify-theme-live/assets/custom.css (sin modificar los originales).
   ========================================================================== */
/* Tipografías de la marca, alojadas en local (licencia SIL OFL): Fredoka para titulares
   (la del tema de Shopify) y Nunito para texto (tienda y newsletter). */
@font-face { font-family: "Fredoka"; src: url("../assets/fuentes/fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../assets/fuentes/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
:root {
  /* Paleta oficial (guía de marca) */
  --azul-noche: #07131D;
  --dorado: #F7AA42;
  --naranja: #CB6908;
  --coral: #FC785D;
  --crema: #F8D9B5;
  --blanco: #FFFFFF;
  --gris-calido: #665A57;
  --topo: #B9A89C;
  /* Complementos ya usados en el tema de Shopify */
  --page: #FEF7F0;
  --band: #FCEBD6;
  --coral-soft: #FED9CF;
  --dorado-soft: #FDE3BD;
  --navy-card: #12283A;
  --navy-text: #E7D9C9;
  --salvia: #C3CCAE;
  --salvia-soft: #E6EBDB;

  /* Tokens de interfaz */
  --bg: var(--page);
  --surface: var(--blanco);
  --surface-2: #FBF3EA;
  --line: #EEDFCF;
  --line-strong: #E0CBB6;
  --fg: var(--azul-noche);
  --fg-2: var(--gris-calido);
  --fg-3: #8C7E78;
  --accent: var(--coral);
  --accent-ink: #A8401F;        /* coral oscurecido para texto sobre blanco (AA) */
  --warn-ink: #8A4703;          /* naranja oscurecido para texto (AA) */
  --ok-ink: #4C5A36;
  --danger: #C2412D;
  --danger-soft: #FBE1DB;
  --focus: #F7AA42;

  --font-heading: "Fredoka", "Baloo 2", ui-rounded, system-ui, sans-serif;
  --font-body: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-xl: 22px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow-1: 0 1px 2px rgba(7, 19, 29, .05), 0 4px 14px -6px rgba(7, 19, 29, .10);
  --shadow-2: 0 24px 60px -20px rgba(7, 19, 29, .30);
  --sidebar-w: 256px;
  --header-h: 68px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; margin: 0; line-height: 1.2; text-wrap: balance; letter-spacing: -.005em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-2); }
.small { font-size: .85rem; }
.small svg, .m svg { width: 15px; height: 15px; vertical-align: -3px; }
.eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100%; background: linear-gradient(to right, var(--azul-noche) var(--sidebar-w), var(--bg) var(--sidebar-w)); }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  background: var(--azul-noche); color: var(--navy-text);
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px calc(16px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  overflow-y: auto; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
.brand-logo { width: 54px; height: auto; background: var(--crema); border-radius: 14px; padding: 6px 5px; }
.brand-name { font-family: var(--font-heading); font-weight: 600; font-size: 1.25rem; color: var(--blanco); line-height: 1.05; }
.brand-name small { display: block; font-family: var(--font-body); font-weight: 700; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dorado); margin-top: 3px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8FA0AE; padding: 14px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--navy-text); text-decoration: none; font-weight: 700; font-size: .93rem;
  transition: background .15s, color .15s;
}
.nav-link svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: var(--blanco); }
.nav-link[aria-current="page"] { background: var(--navy-card); color: var(--blanco); box-shadow: inset 3px 0 0 var(--dorado); }
.nav-link[aria-current="page"] svg { color: var(--dorado); opacity: 1; }
.nav-count { margin-left: auto; background: var(--coral); color: var(--azul-noche); font-size: .72rem; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 10px; }
.sidebar-foot .who { min-width: 0; }
.sidebar-foot strong { display: block; color: var(--blanco); font-size: .9rem; }
.sidebar-foot span { font-size: .78rem; color: #8FA0AE; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
  padding-block: 0; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px));
  background: rgba(254, 247, 240, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.icon-btn.menu-btn { display: none; }
.search { flex: 1; max-width: 420px; position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--fg-3); }
.search input { width: 100%; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px 0 38px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.demo-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--dorado-soft); color: var(--warn-ink); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.demo-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--naranja); }

.role-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.role-switch button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-weight: 700; font-size: .84rem; cursor: pointer; color: var(--fg-2); }
.role-switch button[aria-pressed="true"] { background: var(--azul-noche); color: var(--blanco); }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; position: relative; color: var(--fg); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); border: 2px solid var(--surface); }

.content {
  padding-block: 28px 56px;
  padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 24px;
  max-width: 1440px; width: 100%;
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--fg-2); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: .84rem; color: var(--fg-3); margin-bottom: 6px; }
.crumbs a { text-decoration: none; font-weight: 700; color: var(--fg-2); }
.crumbs a:hover { color: var(--accent-ink); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 800; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .08s, background .15s, box-shadow .15s;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--azul-noche); color: var(--blanco); }
.btn-primary:hover { background: #142636; }
.btn-accent { background: var(--coral); color: var(--azul-noche); }
.btn-accent:hover { background: #FD8C75; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--fg); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-quiet { background: transparent; color: var(--fg-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--fg); }
.btn-danger { background: var(--surface); border-color: #EBB6AA; color: var(--danger); }
.btn-ok { background: var(--salvia); color: var(--azul-noche); }
.btn-sm { height: 32px; padding: 0 11px; font-size: .82rem; border-radius: 10px; }
.btn-xl { height: 64px; padding: 0 28px; font-size: 1.08rem; border-radius: 18px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Tarjetas y rejillas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-head .link { font-size: .85rem; font-weight: 800; color: var(--accent-ink); text-decoration: none; }
.card-body { padding: 16px 20px 20px; }
.grid { display: grid; gap: 18px; }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.g-k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.g-2e { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.kpi { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: .84rem; font-weight: 700; color: var(--fg-2); }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--fg); }
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-value { font-family: var(--font-heading); font-weight: 600; font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: .8rem; color: var(--fg-2); display: flex; align-items: center; gap: 6px; }
.trend-up { color: var(--ok-ink); font-weight: 800; }
.trend-down { color: var(--danger); font-weight: 800; }
.kpi.tone-coral .kpi-icon { background: var(--coral-soft); color: var(--accent-ink); }
.kpi.tone-dorado .kpi-icon { background: var(--dorado-soft); color: var(--warn-ink); }
.kpi.tone-danger .kpi-icon { background: var(--danger-soft); color: var(--danger); }
.kpi.tone-salvia .kpi-icon { background: var(--salvia-soft); color: var(--ok-ink); }
.kpi.tone-navy { background: var(--azul-noche); border-color: var(--azul-noche); color: var(--blanco); }
.kpi.tone-navy .kpi-label, .kpi.tone-navy .kpi-foot { color: var(--navy-text); }
.kpi.tone-navy .kpi-icon { background: var(--navy-card); color: var(--dorado); }
.kpi.tone-navy .trend-up { color: var(--salvia); }

/* ---------- Estados (chips) ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: .76rem; font-weight: 800; white-space: nowrap; background: var(--surface-2); color: var(--fg-2); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.plain::before { display: none; }
.s-nuevo { background: #E4ECF3; color: #1F4766; }
.s-pendiente { background: var(--dorado-soft); color: var(--warn-ink); }
.s-preparacion { background: #FCE7D6; color: #8A4703; }
.s-empaquetado, .s-ok, .s-aprobada, .s-activa { background: var(--salvia-soft); color: var(--ok-ink); }
.s-enviado { background: #E5E1F0; color: #4A3F73; }
.s-retrasado, .s-incidencia, .s-rechazada, .s-critico { background: var(--danger-soft); color: var(--danger); }
.s-borrador, .s-finalizada, .s-neutral { background: #EEE9E5; color: var(--gris-calido); }
.s-enviada, .s-prevista { background: #E4ECF3; color: #1F4766; }
.s-revision, .s-propuesta, .s-bajo { background: var(--dorado-soft); color: var(--warn-ink); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 800; }
.prio i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.prio-urgente i { background: var(--danger); }
.prio-alta i { background: var(--coral); }
.prio-normal i { background: var(--dorado); }
.prio-baja i { background: var(--topo); }
.tag-perso { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 800; color: var(--accent-ink); }
.tag-perso svg { width: 15px; height: 15px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FFFBF6; }
.tbl tr.row-alert td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.tbl tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--dorado); }
.tbl .strong { font-weight: 800; }
.tbl a.rowlink { font-weight: 800; text-decoration: none; }
.tbl a.rowlink:hover { color: var(--accent-ink); text-decoration: underline; }
.tbl .r { text-align: right; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.toolbar .search { max-width: 300px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: .84rem; font-weight: 700; cursor: pointer; color: var(--fg-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(7, 19, 29, .12); }
.seg button .c { font-size: .74rem; color: var(--fg-3); margin-left: 4px; }
.select { height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; font-weight: 700; font-size: .86rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 14px 12px; font-weight: 800; font-size: .9rem; color: var(--fg-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--coral); }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .76rem; font-weight: 800; flex: none; background: var(--crema); color: var(--azul-noche); }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.person { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.thumb { width: 44px; height: 44px; border-radius: 10px; background: var(--band); display: grid; place-items: center; flex: none; }
.thumb img { width: 30px; height: 30px; }
.species { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.species img { width: 24px; height: 24px; background: var(--surface-2); border-radius: 7px; padding: 2px; }

/* ---------- Listas ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 800; }
.list-item .m { font-size: .82rem; color: var(--fg-2); }
.li-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); }
.li-icon svg { width: 17px; height: 17px; }
.time { font-size: .78rem; color: var(--fg-3); white-space: nowrap; }

.alert-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.alert-row + .alert-row { margin-top: 8px; }
.alert-row.crit { background: var(--danger-soft); }
.alert-row.warn { background: var(--dorado-soft); }
.alert-row .grow { flex: 1; min-width: 0; }
.alert-row svg { width: 18px; height: 18px; flex: none; }

.bar { height: 8px; border-radius: 99px; background: #F1E6DA; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--dorado); }
.bar.crit > span { background: var(--danger); }
.bar.warn > span { background: var(--coral); }
.bar.ok > span { background: #9FAE82; }

.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--band); border: 1px dashed var(--line-strong); font-size: .88rem; color: var(--fg-2); }
.note svg { width: 18px; height: 18px; flex: none; color: var(--naranja); margin-top: 2px; }
.note strong { color: var(--fg); }

/* ---------- Gráficos SVG ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font-body); font-size: 11px; fill: var(--fg-3); }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--fg-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: 112px minmax(0, 1fr) 64px; gap: 12px; align-items: center; font-size: .88rem; }
.hbar .lbl { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.hbar .lbl img { width: 24px; height: 24px; }
.hbar .val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.hbar .bar { height: 12px; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 800; font-size: .84rem; }
.field .hint { font-size: .78rem; color: var(--fg-3); }
.input, .textarea, .field select { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); padding: 10px 12px; min-height: 44px; }
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .textarea:focus, .field select:focus { outline: 3px solid rgba(247, 170, 66, .45); outline-offset: 0; border-color: var(--dorado); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.check input { width: 18px; height: 18px; accent-color: var(--azul-noche); }

/* ---------- Modal y toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(7, 19, 29, .45); z-index: 80; display: grid; place-items: center; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px)); }
.modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-2); width: min(640px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toast-zone { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--azul-noche); color: var(--blanco); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-2); font-weight: 700; font-size: .9rem; display: flex; gap: 10px; align-items: center; max-width: 380px; animation: toast-in .2s ease-out; }
.toast svg { width: 18px; height: 18px; color: var(--dorado); flex: none; }
.toast small { display: block; font-weight: 600; color: var(--navy-text); font-size: .78rem; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Login ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.login-art { background: var(--azul-noche); color: var(--navy-text); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .blob { position: absolute; border-radius: 50%; }
.login-art .b1 { width: 380px; height: 380px; background: var(--dorado); opacity: .14; right: -120px; top: -110px; }
.login-art .b2 { width: 260px; height: 260px; background: var(--coral); opacity: .16; left: -90px; bottom: -80px; }
.login-art .iso { width: min(340px, 70%); background: var(--crema); border-radius: 28px; padding: 22px 26px; position: relative; }
.login-art h2 { font-size: 2.2rem; color: var(--blanco); max-width: 14ch; position: relative; }
.login-art h2 em { font-style: normal; color: var(--dorado); }
.login-art p { max-width: 42ch; position: relative; }
.login-art ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.login-art li { background: var(--navy-card); padding: 6px 12px; border-radius: 99px; font-size: .82rem; font-weight: 700; }
.login-claim { display: flex; flex-direction: column; gap: 14px; position: relative; }
.login-foot { position: relative; color: #8FA0AE; }
.login-error { padding: 12px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 700; font-size: .9rem; }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 92px; }
.pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--fg-2); font-weight: 800; font-size: .8rem; cursor: pointer; }
.pass-toggle:hover { color: var(--fg); }
.btn-login { height: 48px; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 48px max(24px, env(safe-area-inset-right, 0px)) 48px max(24px, env(safe-area-inset-left, 0px)); }
.login-box { width: min(420px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.login-box .logo { width: 150px; }
.login-box h1 { font-size: 1.9rem; }
.demo-roles { display: grid; gap: 10px; }
.demo-role { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }
.demo-role:hover { border-color: var(--dorado); background: #FFFBF5; }
.demo-role .li-icon { background: var(--band); }
.demo-role strong { display: block; }
.demo-role span { font-size: .82rem; color: var(--fg-2); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--fg-3); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Empleado (tablet first) ---------- */
.emp-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--azul-noche); color: var(--blanco); border-radius: var(--r-xl); padding: 26px 28px; }
.emp-hero h1 { font-size: 2rem; }
.emp-hero p { color: var(--navy-text); }
.emp-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.emp-kpi { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-height: 132px; text-decoration: none; }
.emp-kpi .v { font-family: var(--font-heading); font-size: 2.6rem; font-weight: 600; line-height: 1; }
.emp-kpi .l { font-weight: 800; color: var(--fg-2); }
.emp-kpi.urg { background: var(--danger-soft); border-color: #F2C1B6; }
.emp-kpi.urg .v { color: var(--danger); }
.emp-kpi.done { background: var(--salvia-soft); border-color: #D6DEC5; }
.job { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.job + .job { margin-top: 12px; }
.job.urgent { border-color: #F2C1B6; box-shadow: inset 5px 0 0 var(--danger); }
.job .num-big { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 600; }
.job .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .9rem; color: var(--fg-2); margin-top: 4px; }
.job .meta span { display: inline-flex; align-items: center; gap: 5px; }
.job .meta svg { width: 16px; height: 16px; }

/* Flujo de preparación */
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 800; font-size: .84rem; color: var(--fg-2); }
.step b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .8rem; }
.step.done { color: var(--ok-ink); }
.step.done b { background: var(--salvia); color: var(--azul-noche); }
.step.now { border-color: var(--dorado); color: var(--fg); }
.step.now b { background: var(--dorado); color: var(--azul-noche); }
.pick { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); cursor: pointer; user-select: none; }
.pick + .pick { margin-top: 10px; }
.pick .box { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--line-strong); display: grid; place-items: center; background: var(--surface); }
.pick .box svg { width: 20px; height: 20px; opacity: 0; color: var(--azul-noche); }
.pick.on { background: #F5F8EF; border-color: #CFD8BC; }
.pick.on .box { background: var(--salvia); border-color: var(--salvia); }
.pick.on .box svg { opacity: 1; }
.pick .qty { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 600; min-width: 64px; text-align: right; }
.pick .qty small { font-family: var(--font-body); font-size: .74rem; color: var(--fg-3); display: block; font-weight: 700; }
.pick .name { font-weight: 800; font-size: 1.02rem; }
.pick .sku { font-size: .8rem; color: var(--fg-3); }
.perso-box { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--coral-soft); color: #6E2A14; font-size: .9rem; }
.perso-box strong { font-family: var(--font-heading); font-size: 1.15rem; color: var(--azul-noche); font-weight: 600; }
.progress-ring { display: flex; align-items: center; gap: 14px; }

/* Kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--surface-2); border-radius: var(--r-lg); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; font-weight: 800; }
.col-head .n { font-size: .8rem; color: var(--fg-3); background: var(--surface); border-radius: 99px; padding: 1px 9px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; }
.kcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.kcard .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Calendario */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-dow { padding: 10px 10px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 118px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day .d { font-size: .82rem; font-weight: 800; color: var(--fg-2); }
.cal-day.other { background: #FCF8F3; }
.cal-day.other .d { color: #C9BBB0; }
.cal-day.today .d { background: var(--azul-noche); color: var(--blanco); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.ev { display: block; font-size: .74rem; font-weight: 800; padding: 3px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; text-align: left; cursor: pointer; width: 100%; }
.t-stories { background: #FDE3BD; color: #7A3E02; }
.t-reels { background: #FED9CF; color: #8E3418; }
.t-post { background: #E4ECF3; color: #1F4766; }
.t-carrusel { background: #EFE3F3; color: #5A2F69; }
.t-tiktok { background: #07131D; color: #FFFFFF; }
.t-newsletter { background: #F8D9B5; color: #5A3A1A; }
.week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 12px; overflow-x: auto; padding: 16px 20px 20px; }
.week-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.week-col .wd { font-weight: 800; padding-bottom: 8px; border-bottom: 2px solid var(--line); display: flex; justify-content: space-between; }
.week-col .wd.today { border-color: var(--coral); }
.wcard { border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); background: var(--surface); }
.wcard .ttype { align-self: flex-start; }

/* Ideas y campañas */
.idea { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; text-align: left; }
.idea:hover { border-color: var(--line-strong); }
.idea .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.idea p { color: var(--fg-2); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.idea .foot { display: flex; gap: 14px; align-items: center; font-size: .8rem; color: var(--fg-3); flex-wrap: wrap; }
.idea .foot span { display: inline-flex; gap: 5px; align-items: center; }
.idea .foot svg { width: 15px; height: 15px; }
.comment { display: flex; gap: 10px; }
.comment + .comment { margin-top: 12px; }
.comment .bubble { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: .9rem; flex: 1; }
.comment .bubble b { display: block; font-size: .82rem; }
.camp { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.camp .contents { display: flex; gap: 6px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; font-size: .88rem; }
.kv dt { color: var(--fg-3); font-weight: 700; }
.kv dd { margin: 0; font-weight: 700; }

/* Restringido */
.blocked { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.blocked .li-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--danger-soft); color: var(--danger); }
.blocked .li-icon svg { width: 30px; height: 30px; }

/* Productos */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.prod { overflow: hidden; }
.prod .ph { aspect-ratio: 4 / 3; background: var(--band); display: grid; place-items: center; max-width: 100%; }
.prod .ph img { width: 42%; }
.prod .pb { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }

/* Permisos */
.perm td, .perm th { text-align: center; }
.perm td:first-child, .perm th:first-child { text-align: left; }
.yes { color: var(--ok-ink); font-weight: 800; }
.no { color: #C9BBB0; font-weight: 800; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .22s ease; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-2); }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(7, 19, 29, .4); z-index: 35; }
  .icon-btn.menu-btn { display: inline-grid; }
  .emp-kpi { min-height: 116px; padding: 16px; }
  .emp-kpi .v { font-size: 2.2rem; }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { padding: 32px; gap: 22px; }
  .login-art h2 { font-size: 1.7rem; }
  .board { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 8px; }
  .topbar .search, .demo-pill, [data-act="avisos"] { display: none; }
  .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 48px; }
  .g-2e, .g-3, .form-row { grid-template-columns: minmax(0, 1fr); }
  .emp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emp-kpi:last-child { grid-column: span 2; }
  .g-k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job { grid-template-columns: minmax(0, 1fr); }
  .job > .li-icon { display: none; }
  .pick { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pick .thumb { display: none; }
  .hbar { grid-template-columns: 92px minmax(0, 1fr) 52px; }
  .role-switch button { padding: 6px 8px; font-size: .78rem; }
  .login-art .iso { display: none; }
  .cal-day { min-height: 76px; padding: 4px; }
  .cal-day .ev { font-size: 0; height: 8px; padding: 0; }
  h1 { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
