/* ================================================================
   Panel Zebra — alineado al Design System de Zebra (Virtual Stripes 26)
   Reglas críticas:
     ZR-05 monocromático: negro #0A0A0A + blanco + rampa ink.
           Amarillo SOLO en demos de video, NUNCA en chrome.
     ZR-09 Inter (texto) + JetBrains Mono (eyebrows/labels).
     ZR-10 Headings semibold (600). Cifras 700.
     ZR-14 Borde hairline 1px en todos los estados; activo = cambia el
           color del borde, NUNCA engrosar.
   Los tokens del DS viven en assets/zebra-ds/tokens.css y se importan
   abajo. Acá sólo agregamos los tokens propios del panel (spacing,
   radios web, semánticos), aliasando hacia los del DS donde aplica.
   ================================================================ */

@import url('../assets/zebra-ds/tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Rampa ink (escala neutra) — para grises consistentes con el DS */
  --ink-50:   #F5F5F5;
  --ink-100:  #E5E5E5;
  --ink-200:  #D4D4D4;
  --ink-300:  #A3A3A3;
  --ink-400:  #737373;
  --ink-500:  #525252;
  --ink-700:  #262626;
  --ink-900:  #171717;

  /* Aliases para legibilidad — todos derivan de los tokens del DS, con
     FALLBACK hex defensivo por si tokens.css no carga (cache, 404, etc).
     Si tokens.css carga, gana el var() del DS; si no, el hex literal. */
  --ink:           var(--text,        #0A0A0A);
  --ink-soft:      var(--ink-700,     #262626);
  --ink-mute:      var(--text-muted,  #737373);
  --line:          var(--ink-100,     #E5E5E5);
  --line-soft:     var(--ink-50,      #F5F5F5);
  --paper:         var(--bg,          #FFFFFF);
  --paper-bright:  var(--surface,     #FFFFFF);
  --paper-deep:    var(--surface-2,   #F9FAFB);

  /* Acento del panel = accent del DS (negro en light). Mantengo nombres
     legacy para no romper componentes existentes. */
  --accent:        var(--text,        #0A0A0A);
  --accent-soft:   var(--ink-300,     #A3A3A3);
  --accent-bg:     var(--ink-50,      #F5F5F5);

  /* Radios y sombras del DS con fallback por si tokens.css no carga */
  --r-chip-fb:     6px;
  --r-input-fb:    10px;
  --r-btn-fb:      10px;
  --r-card-fb:     12px;

  /* Semánticos — sin amarillo. Status colors mantenidos por necesidad
     funcional (verde=success, ámbar=warning, rojo=danger). */
  --success:       #2C8C4F;
  --success-bg:    #E8F3EC;
  --warning:       #D9921E;
  --warning-bg:    #FBF1D9;
  --danger:        #B3261E;
  --danger-bg:     #FCE4E1;

  /* Tipografía — Inter (texto) + JetBrains Mono (eyebrows/datos) */
  --font-display:  'Inter', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, monospace;

  /* Espaciado base */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  /* Radios — alineados a la escala DS con fallback. */
  --radius-sm:     var(--r-chip,   6px);
  --radius:        var(--r-input,  10px);
  --radius-lg:     var(--r-card,   12px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}

a:hover { color: var(--ink-soft); }

/* Headings: semibold (600) por ZR-10, NO uppercase (que era una decisión
   estética del panel original, no del DS). Mantenemos jerarquía de tamaños. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-4) 0;
  color: var(--ink);
}

h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
}

p { margin: 0 0 var(--space-4) 0; }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-feature-settings: "tnum", "zero";
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Cifras / stat = 700 (ZR-10) */
.num.stat { font-weight: 700; }

/* ================================================================
   Layout
   ================================================================ */

:root {
  --nav-ancho: 216px;
  --nav-ancho-min: 62px;   /* riel de iconos */
}

.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* La navegación es una barra lateral fija: el contenido se corre a su
     derecha. Antes era un header fijo de 72px arriba. */
  padding-left: var(--nav-ancho);
  transition: padding-left .16s ease;
}
body.nav-min .layout { padding-left: var(--nav-ancho-min); }

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  width: 100%;
}

main {
  flex: 1;
  padding: var(--space-7) 0 var(--space-8);
}

/* ================================================================
   Header / Nav
   ================================================================ */

.site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.site-header .shell {
  display: flex;
  align-items: center;
  height: 72px;
  gap: var(--space-6);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

/* Brand wordmark: SVG real del DS, color via currentColor (hereda --ink).
   ZR-11: nunca distorsionar; fijar altura, ancho auto. */
.brand-logo {
  display: block;
  height: 22px;
  width: auto;
  color: var(--ink);
}

/* Fallback en caso de cargar el wordmark como texto (no debería pasar
   con el SVG inline en nav.js). */
.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}

.brand-tagline {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  border-left: 1px solid var(--line);
  padding-left: var(--space-3);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: var(--space-5);
  margin-left: auto;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0;
  padding: 6px 0;
  border-radius: 0;
  position: relative;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--ink); }

/* Activo = subrayado hairline en negro (ZR-14: cambio de color, sin
   engrosar líneas). NO uso fondo amarillo (ZR-05 prohíbe amarillo en chrome). */
.nav-links a.active {
  color: var(--ink);
  font-weight: 600;
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--ink);
}

/* ================================================================
   Page header (hero of each page)
   ================================================================ */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-6);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-7);
  border-bottom: 1px solid var(--line);
}

/* Sin barra de color a la izquierda del título — ZR-05 monocromático.
   La jerarquía la dan tamaño + peso, no un adorno cromático. */
.page-head > div:first-child {
  position: relative;
  padding-left: 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  margin-bottom: var(--space-3);
  display: block;
}

.page-head .actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.lede {
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 56ch;
  margin-top: var(--space-3);
}

/* ================================================================
   Buttons
   ================================================================ */

/* Botón primario: monocromático (ZR-05). Negro sólido. Hover invierte
   a outline. Borde hairline 1px en todos los estados (ZR-14). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.18s cubic-bezier(.16,1,.3,1);
  border-radius: var(--r-btn, 10px);
  white-space: nowrap;
}

.btn:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink);
}

/* Foco fino (ZR-18): anillo de 1px adicional, sin engrosar el borde */
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px rgba(10,10,10,.08);
}

.btn.btn-secondary {
  background: var(--paper);
  border-color: var(--ink);
  color: var(--ink);
}

.btn.btn-secondary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-mute);
  padding: 8px 14px;
  font-weight: 500;
}

.btn.btn-ghost:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.btn.btn-danger {
  border-color: var(--danger);
  background: transparent;
  color: var(--danger);
}

.btn.btn-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--paper-bright);
}

.btn.btn-sm {
  padding: 7px 16px;
  font-size: 12px;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ================================================================
   Forms
   ================================================================ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5) var(--space-5);
  margin-bottom: var(--space-6);
}

.form-grid .full { grid-column: 1 / -1; }

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.field-help {
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="search"],
select,
textarea {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper-bright);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: white;
}

textarea {
  resize: vertical;
  min-height: 96px;
  font-family: var(--font-body);
}

.field input.mono,
.field select.mono { font-family: var(--font-mono); font-size: 14px; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%231A1815'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.checkbox-row label {
  font-size: 14px;
  cursor: pointer;
}

/* ================================================================
   Cards / Sections
   ================================================================ */

.section {
  margin-bottom: var(--space-7);
}

.section + .section {
  padding-top: var(--space-7);
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
}

/* Barra amarilla a la izquierda del título de la sección */
.section-title {
  position: relative;
  padding-left: 16px;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 5px;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}

/* Card: hairline + sombra escala sm del DS. ZR-08: si la card vive
   sobre fondo blanco, el contenedor debe poner --paper-deep o el card
   se "disuelve" (sólo se ve el hairline). */
.card {
  background: var(--paper-bright);
  border: 1px solid var(--border);
  border-radius: var(--r-card, 12px);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(10,10,10,.08));
}

.card.card-tight { padding: var(--space-4); }

/* ================================================================
   Tables
   ================================================================ */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-bright);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th, table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}

table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table tr:last-child td { border-bottom: none; }

table tbody tr {
  transition: background 0.1s;
}

table tbody tr:hover {
  background: var(--paper-deep);
}

table .num,
table .col-num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  color: var(--ink-mute);
  background: var(--paper-bright);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}

.empty-state h3 {
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: var(--space-3);
}

/* ================================================================
   Badges / Status
   ================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-body);
  border-radius: 100px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge.badge-success { background: var(--success-bg); color: var(--success); }
.badge.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge.badge-accent  { background: var(--ink); color: var(--paper); }

.badge.no-dot::before { display: none; }

/* ================================================================
   Stats grid
   ================================================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-7);
}

.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--paper-bright);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}

.stat:hover::before { transform: scaleX(1); }

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  margin-bottom: var(--space-3);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 300;
  font-variation-settings: "opsz" 144;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.025em;
}

.stat-meta {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: var(--space-3);
}

.stat .num { font-family: var(--font-display); }

/* ================================================================
   Modals
   ================================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--paper-bright);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  padding: var(--space-5);
  border-bottom: 1px solid var(--line);
}

.modal-body { padding: var(--space-5); }

.modal-foot {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--line);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  background: var(--paper);
}

/* ================================================================
   Toasts
   ================================================================ */

.toast-zone {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: 300;
  max-width: 400px;
}

.toast {
  background: var(--ink);
  color: var(--paper-bright);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: toastIn 0.25s ease-out;
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(10,10,10,.12));
}

.toast.toast-success { background: var(--success); }
.toast.toast-error   { background: var(--danger); }
.toast.toast-warn    { background: var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ================================================================
   Progress bar
   ================================================================ */

.progress {
  width: 100%;
  height: 4px;
  background: var(--paper-deep);
  border-radius: 100px;
  overflow: hidden;
  margin-top: var(--space-2);
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease-out;
}

/* ================================================================
   Loaders
   ================================================================ */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--paper-deep);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading {
  text-align: center;
  padding: var(--space-7);
  color: var(--ink-mute);
}

/* ================================================================
   Detail key/value lists
   ================================================================ */

.kv-list {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-3) var(--space-5);
}

.kv-list dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  padding-top: 4px;
}

.kv-list dd {
  margin: 0;
  color: var(--ink);
}

/* ================================================================
   Notice / Banner
   ================================================================ */

.notice {
  border: 1px solid var(--warning);
  background: var(--warning-bg);
  border-left-width: 4px;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius);
  margin-bottom: var(--space-5);
  font-size: 14px;
  color: var(--ink-soft);
}

.notice.notice-danger { border-color: var(--danger); background: var(--danger-bg); }
.notice.notice-info   { border-color: var(--ink-soft); background: var(--paper-deep); }

.notice strong { color: var(--ink); font-weight: 600; }

/* ================================================================
   Sheet tab mapper component
   ================================================================ */

.sheet-mapper {
  display: grid;
  grid-template-columns: 200px 1fr 110px;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line-soft);
}

.sheet-mapper:last-child { border-bottom: none; }

.sheet-mapper-label {
  font-weight: 500;
  font-size: 14px;
}

.sheet-mapper-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
}

/* ================================================================
   Diff between md preview and raw
   ================================================================ */

.brief-preview {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 14;
  font-size: 16px;
  line-height: 1.6;
  max-width: 70ch;
  color: var(--ink);
}

.brief-preview h1, .brief-preview h2, .brief-preview h3 {
  margin-top: var(--space-7);
}

.brief-preview h1 { font-size: 32px; }
.brief-preview h2 { font-size: 24px; }
.brief-preview h3 { font-size: 18px; }

.brief-preview code {
  background: var(--paper-deep);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.brief-preview pre {
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-4);
  overflow-x: auto;
  border-radius: var(--radius);
  font-size: 12px;
}

.brief-preview table {
  font-family: var(--font-body);
  font-size: 13px;
  margin: var(--space-4) 0;
}

/* ================================================================
   Footer
   ================================================================ */

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-5) 0;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  background: var(--paper-bright);
}

.site-footer .shell {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ================================================================
   Utilities
   ================================================================ */

.hidden { display: none !important; }
.flex   { display: flex; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.between{ justify-content: space-between; }
.center { align-items: center; }
.right  { text-align: right; }
.muted  { color: var(--ink-mute); }
.soft   { color: var(--ink-soft); }
.italic { font-style: italic; }
.tabular{ font-variant-numeric: tabular-nums; }

.spacer-3 { height: var(--space-3); }
.spacer-5 { height: var(--space-5); }
.spacer-7 { height: var(--space-7); }

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 768px) {
  .shell { padding: 0 var(--space-4); }
  h1 { font-size: 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head .actions { width: 100%; }
  .nav-links { gap: var(--space-4); }
  .nav-links a { font-size: 12px; }
  .brand-tagline { display: none; }
  .kv-list { grid-template-columns: 1fr; gap: var(--space-1); }
  .kv-list dd { margin-bottom: var(--space-3); }
  .sheet-mapper { grid-template-columns: 1fr; }
  main { padding: var(--space-5) 0 var(--space-7); }
}

/* ================================================================
   Tabs (navegación por departamento)
   ================================================================ */

.tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--line);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.tab-btn {
  background: transparent;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-mute);
  padding: 12px 22px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  position: relative;
  transition: color 0.15s, background 0.15s;
}
.tab-btn:hover {
  background: var(--paper-deep);
  color: var(--ink);
}
.tab-btn.active {
  color: var(--ink);
  background: var(--paper-bright);
}
/* Active = hairline negro (1px), nunca engrosar (ZR-14). */
.tab-btn.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 1px;
  background: var(--ink);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ================================================================
   Mirror cards (espejos read-only del cliente en ad-account)
   ================================================================ */

/* Espejo read-only: superficie recesada + hairline a la izquierda
   (1px de --ink, no engrosar). Diferencia visual con la card real. */
.mirror-card {
  background: var(--paper-deep);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ink);
  border-radius: var(--r-card, 12px);
  padding: 16px;
}
.mirror-card .mirror-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.mirror-card .mirror-empty {
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
}
.mirror-card h4 {
  margin: 12px 0 4px 0;
  font-size: 13px;
  font-weight: 700;
}
.mirror-card .mirror-text {
  font-size: 13px;
  white-space: pre-wrap;
  color: var(--ink-soft);
}
.mirror-card .mirror-pill {
  display: inline-block;
  background: var(--paper-bright);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  margin: 0 6px 6px 0;
  color: var(--ink-soft);
}
/* Pill activo = invertido (negro sólido con texto blanco) en vez de
   amarillo. ZR-05 monocromático. */
.mirror-card .mirror-pill.active {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  border-color: var(--ink);
}

/* ============================================================
   Globo flotante de tareas (tareas-globo.js)
   Se comporta como los widgets de soporte: burbuja fija abajo a la
   derecha, panel que sube desde ella, y la burbuja alterna a una "×"
   cuando está abierto.
   ============================================================ */

#globo-tareas {
  position: fixed;
  right: 24px;
  bottom: 24px;
  /* Si está la barra de aviso abajo, el globo sube para no encimarse. */
  margin-bottom: var(--aviso-alto, 0px);
  z-index: 900;            /* debajo de los modales, encima del contenido */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

#globo-burbuja {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Las ilustraciones ya vienen recortadas en círculo con fondo
     transparente: la imagen es la burbuja, no va dentro de un botón. */
  background: transparent;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  transition: transform .18s ease, box-shadow .18s ease;
}

.globo-animo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  pointer-events: none;
  transition: opacity .2s ease;
}

/* Rebote corto al cambiar de ánimo: se nota sin distraer. */
@keyframes globo-cambio {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.16) rotate(-4deg); }
  70%  { transform: scale(.96) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
.globo-burbuja--cambio { animation: globo-cambio .45s ease-out; }
#globo-burbuja:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .34);
}
#globo-burbuja:active { transform: scale(.97); }

/* Abierto, la burbuja se vuelve el botón de cerrar — como los widgets de
   soporte, donde el mismo botón abre y cierra. */
.globo-cerrar-icono {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .18s ease;
}
.globo-burbuja--activa .globo-animo { opacity: .35; }
.globo-burbuja--activa .globo-cerrar-icono { opacity: 1; }

.globo-contador {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #d19a00;
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  font-weight: 700;
  box-shadow: 0 0 0 2px #fff;
}
/* Con tareas vencidas el contador pasa a rojo: el número también avisa. */
#globo-burbuja[data-estado="atrasadas"] .globo-contador { background: #c0392b; }

/* Sacudida del recordatorio de fin de día. Corta y una sola vez al día: si
   vibrara en bucle, la gente aprendería a ignorarla. */
@keyframes globo-vibra {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.globo-burbuja--vibra { animation: globo-vibra .45s ease-in-out 4; }

#globo-panel {
  width: 340px;
  max-height: 70vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .2);
  padding: 14px;
  animation: globo-sube .18s ease-out;
}
@keyframes globo-sube {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.globo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.globo-tabs { display: flex; gap: 4px; }
.globo-tab {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 11.5px;
  padding: 5px 7px;
  white-space: nowrap;
  border-radius: 7px;
  color: #6b6b6b;
}
.globo-tab:hover { background: #f7f7f7; }
.globo-tab.activa { background: #f2f2f2; color: #1a1a1a; font-weight: 600; }
.globo-cerrar {
  border: none; background: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: #6b6b6b;
}

.globo-campo { display: block; margin-bottom: 10px; }
.globo-campo > span {
  display: block;
  font-size: 11px;
  color: #6b6b6b;
  margin-bottom: 4px;
}
.globo-campo input,
.globo-campo select,
.globo-campo textarea {
  width: 100%;
  box-sizing: border-box;
}

.globo-vacio { font-size: 12px; color: #6b6b6b; margin: 0; }

.globo-fila { padding: 9px 0; border-top: 1px solid #eee; }
.globo-fila__texto { font-size: 13px; margin-bottom: 6px; }
.globo-fila__acciones { display: flex; gap: 6px; align-items: center; }
.globo-min { width: 76px; }

/* Lo registrado hoy, en la pestaña Tiempos. Reusa .progress/.progress-bar;
   acá sólo se acomoda en una línea y se le da algo más de cuerpo, que a 4px
   no se lee al lado del texto. */
.globo-hoy {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding-top: 9px; border-top: 1px solid #eee;
  font-size: 12px; color: #6b6b6b;
}
.globo-hoy__dia { flex: 0 0 auto; }
.globo-hoy .progress { flex: 1 1 auto; height: 7px; margin-top: 0; background: #e3e3e3; }
.globo-hoy__total { flex: 0 0 auto; white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 520px) {
  #globo-tareas { right: 16px; bottom: 16px; }
  #globo-panel { width: calc(100vw - 32px); }
}

/* Pestaña de pendientes del globo */
.globo-meta {
  font-size: 11px;
  color: #6b6b6b;
  margin-top: 3px;
}
.globo-meta a { color: #6b6b6b; text-decoration: underline; }
.globo-vencida { color: #c0392b; font-weight: 600; }

.globo-fila__texto { display: flex; gap: 7px; align-items: flex-start; }

.globo-rebote {
  margin-top: 7px;
  padding: 8px;
  background: #f7f7f7;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.globo-rebote select,
.globo-rebote textarea { width: 100%; box-sizing: border-box; }

/* Contador dentro de cada pestaña del globo */
.globo-tab__n {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e3e3e3;
  color: #4a4a4a;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
  text-align: center;
}
.globo-tab.activa .globo-tab__n { background: #1a1a1a; color: #fff; }

/* Atajo de minutos seleccionado en el diálogo de tiempo */
[data-rapido].activo {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* Aviso de que el formulario del globo está en modo edición */
.globo-editando {
  font-size: 11px;
  color: #6b6b6b;
  background: #f2f2f2;
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 10px;
}
.globo-editando a { color: #6b6b6b; text-decoration: underline; }

/* Reporte de juntas: la tabla de personas tiene cinco columnas y no cabía en
   la rejilla de tres, donde el texto se encimaba. Va a lo ancho y con scroll
   propio si la pantalla es angosta. */
.horas--personas th,
.horas--personas td { white-space: nowrap; }
.horas-persona {
  white-space: normal !important;
  word-break: break-word;
  max-width: 260px;
}
.horas-grupos .table-wrap,
.section-body > .table-wrap { overflow-x: auto; }

/* Botonera de cada pendiente en el globo */
.globo-fila__botones {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.globo-fila__botones .btn { font-size: 11px; padding: 3px 8px; }

/* Estado del equipo dentro del globo (sólo admins) */
.globo-equipo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #eee;
}
.globo-equipo:first-child { border-top: none; }
.globo-equipo__animo {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
}
.globo-equipo__txt { flex: 1; min-width: 0; }
.globo-equipo__nombre { font-size: 13px; }
.globo-equipo__n {
  font-size: 13px; font-weight: 700; color: #6b6b6b; min-width: 22px; text-align: right;
}

/* Cada persona del equipo es un enlace a sus pendientes */
a.globo-equipo { text-decoration: none; color: inherit; }
a.globo-equipo:hover { background: #f7f7f7; border-radius: 8px; }

/* Seis pestañas no caben en una línea de 340px: que envuelvan. */
.globo-tabs { flex-wrap: wrap; }
#globo-panel { width: 360px; }

/* Ajuste de minutos en el diálogo de tiempo */
.tiempo-ajuste {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tiempo-ajuste input {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}
.tiempo-ajuste .btn { padding: 4px 9px; }

/* ============================================================
   Celebraciones: cumpleaños y aniversarios (celebra.js)
   ============================================================ */

.celebra-fondo {
  position: fixed;
  inset: 0;
  z-index: 1200;              /* por encima de modales: es lo primero del día */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 20, .55);
  backdrop-filter: blur(3px);
  animation: celebra-entra .3s ease-out;
}
.celebra-fondo--fuera { animation: celebra-sale .3s ease-in forwards; }
@keyframes celebra-entra { from { opacity: 0; } to { opacity: 1; } }
@keyframes celebra-sale  { to { opacity: 0; } }

.celebra-confeti {
  position: absolute;
  inset: 0;
  pointer-events: none;       /* el confeti no debe tapar el clic para cerrar */
}

.celebra-caja {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 28px 34px;
  max-width: 460px;
  max-height: 84vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  animation: celebra-sube .4s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes celebra-sube {
  from { transform: translateY(24px) scale(.94); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.celebra-item + .celebra-item {
  margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee;
}
.celebra-img {
  width: 190px; height: 190px; border-radius: 50%;
  animation: celebra-late 1.6s ease-in-out infinite;
}
@keyframes celebra-late {
  0%, 100% { transform: scale(1) rotate(0); }
  25%      { transform: scale(1.05) rotate(-3deg); }
  75%      { transform: scale(1.05) rotate(3deg); }
}
.celebra-titulo { margin: 14px 0 4px; font-size: 22px; line-height: 1.25; }
.celebra-sub { margin: 0; font-size: 14px; color: #6b6b6b; }

.celebra-cerrar {
  position: absolute; top: 10px; right: 14px;
  border: none; background: none; cursor: pointer;
  font-size: 26px; line-height: 1; color: #9b9b9b;
}

/* Aviso de datos faltantes: abajo, en todas las pantallas, clickeable. */
.aviso-datos {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 850;               /* debajo del globo de tareas */
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px 96px 10px 16px;   /* espacio a la derecha para el globo */
  background: #fff6e0;
  border-top: 1px solid #f0d999;
  color: #6b5518;
  font-size: 13px;
  text-decoration: none;
}
.aviso-datos:hover { background: #ffefcc; }
.aviso-datos__cta { font-weight: 600; white-space: nowrap; }

@media (max-width: 600px) {
  .aviso-datos { padding-right: 16px; font-size: 12px; }
  .celebra-img { width: 140px; height: 140px; }
}

/* Datos faltantes en la tabla de usuarios */
.falta {
  font-size: 11px;
  color: #b8860b;
  background: #fff6e0;
  border-radius: 4px;
  padding: 1px 5px;
}
tr.fila-incompleta { background: #fffdf5; }

/* Nota asomada en la lista del globo: dos líneas y el resto en el detalle. */
.globo-nota {
  font-size: 11.5px;
  color: #6b6b6b;
  background: #f7f7f7;
  border-left: 2px solid #ddd;
  border-radius: 4px;
  padding: 4px 7px;
  margin-top: 5px;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.globo-nota:hover { background: #f0f0f0; }
.globo-titulo { color: inherit; text-decoration: none; border-bottom: 1px dotted #bbb; }
.globo-titulo:hover { border-bottom-style: solid; }

/* Detalle de una tarea */
.detalle-bloque { margin-bottom: 16px; }
.detalle-bloque > strong { font-size: 12px; display: block; margin-bottom: 6px; }
.detalle-fila { padding: 7px 0; border-top: 1px solid #eee; }
.detalle-fila__cab { font-size: 12.5px; }
.detalle-fila__cab .muted { float: right; font-size: 11px; }
.detalle-nota {
  font-size: 12.5px;
  color: #4a4a4a;
  background: #f7f7f7;
  border-radius: 6px;
  padding: 7px 9px;
  margin: 4px 0 0;
  white-space: pre-wrap;
}

/* ── Hilo de notas de una tarea (migration 065) ─────────────────────────
   Todo lo que se escribe sobre una tarea vive acá: lo que se anotó al
   crearla, al registrar un rato de trabajo y al rebotarla. */
.notas-hilo { margin-top: 2px; }
.notas-lista { max-height: 260px; overflow-y: auto; }

.nota { padding: 8px 0; border-top: 1px solid #eee; }
.nota:first-child { border-top: none; padding-top: 2px; }

.nota-cab {
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.nota-cab strong { font-size: 12.5px; }

/* La marca dice de dónde salió la nota sin partir el hilo en varias listas. */
.nota-marca {
  font-size: 11px;
  background: var(--paper-deep, #f2f2f2);
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
}
.nota-editada { font-size: 11px; color: #999; font-style: italic; }

.nota-texto {
  font-size: 12.5px;
  color: #4a4a4a;
  white-space: pre-wrap;
  word-break: break-word;
}
.nota-texto textarea, .nota-nueva textarea { width: 100%; font: inherit; }

.nota-acciones { margin-top: 4px; display: flex; gap: 10px; align-items: center; }
/* Acciones discretas: se leen más notas de las que se corrigen. */
.nota-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  text-decoration: underline;
}
.nota-link:hover { color: #333; }

.nota-nueva {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.nota-nueva textarea { flex: 1; }

/* ══ Barra lateral de navegación ═══════════════════════════════════════════
   Eran once entradas planas en una fila horizontal, donde convivían la
   operación del día, la administración de la agencia y las auditorías de
   Meta. En vertical el espacio es gratis y caben los encabezados que dicen
   cuál es cuál; en horizontal no cabían. */
.nav-lat {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--nav-ancho);
  background: var(--paper-deep, #fafafa);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width .16s ease, transform .16s ease;
  overflow: visible;
}
.nav-lat.is-min { width: var(--nav-ancho-min); }

.nav-brand {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 16px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.nav-brand .brand-logo { height: 17px; width: auto; }
/* Colapsada, el logo completo no cabe: se recorta desde la izquierda para que
   quede la Z, que es lo que identifica la marca. */
.nav-lat.is-min .nav-brand { padding: 0; justify-content: flex-start; }
.nav-lat.is-min .nav-brand .brand-logo { height: 15px; margin-left: 14px; }

.nav-cuerpo { flex: 1; overflow-y: auto; padding: 10px 0; }

.nav-grupo { margin-bottom: 14px; }
.nav-grupo__t {
  font-size: 10.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-mute, #8a8a8a);
  margin: 0 0 4px;
  padding: 0 16px;
  white-space: nowrap;
}
/* Colapsada los títulos sobran, pero la línea mantiene la separación entre
   grupos: sin ella los iconos quedan en una tira sin sentido. */
.nav-lat.is-min .nav-grupo__t {
  overflow: hidden;
  height: 1px;
  margin: 0 12px 8px;
  padding: 0;
  color: transparent;
  border-top: 1px solid var(--line);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 16px;
  font-size: 13.5px;
  color: var(--ink, #333);
  text-decoration: none;
  white-space: nowrap;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: rgba(0, 0, 0, .04); }
.nav-item.active {
  background: rgba(0, 0, 0, .05);
  border-left-color: var(--ink, #333);
  font-weight: 600;
}
.nav-ico { width: 19px; height: 19px; flex: 0 0 19px; }

/* Un solo interruptor para todo lo que es texto: así nada se escapa. */
.nav-lat.is-min .nav-txt { display: none; }
.nav-lat.is-min .nav-item { justify-content: center; padding: 9px 0; gap: 0; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-mute, #666);
}
.nav-user__ini {
  width: 26px; height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background: var(--ink, #333);
  color: var(--paper, #fff);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.nav-user__n { overflow: hidden; text-overflow: ellipsis; }
.nav-salir {
  margin-left: auto;
  background: none; border: none; padding: 4px;
  color: var(--ink-mute, #888); cursor: pointer;
}
.nav-salir:hover { color: var(--ink, #333); }
.nav-lat.is-min .nav-user { justify-content: center; padding: 10px 0; }
.nav-lat.is-min .nav-salir { display: none; }   /* no cabe junto al aro */

/* El tirador vive en el borde, no dentro: dentro le robaría una línea al menú
   y en el riel de iconos no habría dónde ponerlo. */
.nav-toggle {
  position: absolute;
  top: 72px; right: -11px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper, #fff);
  color: var(--ink-mute, #777);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.nav-toggle svg { width: 13px; height: 13px; }
.nav-toggle:hover { color: var(--ink, #333); }
.nav-lat.is-min .nav-toggle svg { transform: rotate(180deg); }

.nav-abrir { display: none; }

/* En pantallas chicas la barra se sale del flujo y entra por encima. */
@media (max-width: 860px) {
  .layout, body.nav-min .layout { padding-left: 0; padding-top: 56px; }
  .nav-lat { transform: translateX(-100%); width: var(--nav-ancho); }
  .nav-lat.is-abierta { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.28); }
  .nav-lat.is-min { width: var(--nav-ancho); }        /* en móvil no hay riel */
  .nav-lat.is-min .nav-txt { display: inline; }
  .nav-lat.is-min .nav-item { justify-content: flex-start; padding: 8px 16px; gap: 11px; }
  .nav-toggle { display: none; }
  .nav-abrir {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 10px; left: 10px;
    width: 36px; height: 36px; z-index: 99;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--paper, #fff); color: var(--ink, #333); cursor: pointer;
  }
  .nav-abrir svg { width: 18px; height: 18px; }
}

/* Ratos de trabajo editables en el detalle de la tarea. */
.rato { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rato .detalle-fila__cab { flex: 1; min-width: 0; }
.rato-acciones { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rato-acciones input, .rato-nuevo input { font: inherit; font-size: 12.5px; padding: 3px 6px; }
.rato-acciones .rato-min, .rato-nuevo #rato-min { width: 62px; }
.rato-nuevo {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid #eee;
}

/* Botón para traer las juntas de las agendas (sólo admins). */
.traer-juntas {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; margin: 0 0 16px;
}

/* Las tareas que el globo trae para completar el mínimo: se ven, pero no se
   confunden con lo de esta semana. */
.globo-mas-adelante {
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-mute, #999);
  margin: 10px 0 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.globo-fila--lejos { opacity: .72; }

/* Simulador de arranque de un lanzamiento. */
.sim-filtros { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.sim-filtros .field { margin: 0; }
.sim-filtros input, .sim-filtros select { font: inherit; }

.sim-cabecera {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  border: 1px solid var(--line); border-left-width: 3px;
  border-left-color: #2ecc9b;
  border-radius: 8px; padding: 14px 16px;
}
/* Que no quepa es un resultado válido, no un error: se marca, no se esconde. */
.sim-cabecera--apretado { border-left-color: #e05c4b; }
.sim-fecha { font-size: 21px; font-weight: 700; line-height: 1.2; }
.sim-veredicto { font-size: 13px; }
.sim-corto td { background: rgba(224, 92, 75, .07); }

/* Lista de tareas del simulador: son ~100, así que scrollea en su caja. */
.sim-tareas { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.sim-tareas table { margin: 0; }
.sim-dia td {
  background: var(--paper-deep, #f6f6f6);
  font-size: 11px; font-weight: 700; text-transform: capitalize;
  position: sticky; top: 0;
}

/* La fecha que le tocó a cada renglón del cronograma, al lado de su hora. */
.cron-fecha { font-size: 11.5px; color: var(--ink-mute, #777); white-space: nowrap; }

/* El tramo de una pieza que se produce afuera. */
.cron-externa { font-size: 11px; color: var(--ink-mute, #888); font-style: italic; }

/* Resaltado momentáneo de una tarjeta a la que se llega desde otra pantalla.
   Lo usa "Finalizar" en la lista de tareas: la de aprobar inversión se cierra
   aprobando, así que el botón lleva a la ficha y esto señala dónde. */
.resaltado { animation: resaltar 2.6s ease-out 1; border-radius: inherit; }
@keyframes resaltar {
  0%, 55%  { box-shadow: 0 0 0 3px var(--warning, #D9921E); }
  100%     { box-shadow: 0 0 0 0 rgba(217, 146, 30, 0); }
}
