/* ================================================================
   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
   ================================================================ */

.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.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: sticky;
  top: 0;
  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);
}
