/* Wall-e Inbox — Design system (fase 0)
   Tokens: see DESIGN_SYSTEM.md
   Plus Jakarta Sans · Lucide icons · dense ops UI */

:root {
  /* Brand */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-soft: #EFF6FF;
  --primary-ink: #1E3A8A;

  --accent: #EA580C;
  --accent-hover: #C2410C;
  --accent-soft: #FFF7ED;
  --accent-ink: #9A3412;

  /* Surfaces */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-3: #E2E8F0;

  /* Text */
  --ink: #0F172A;
  --ink-secondary: #334155;
  --muted: #64748B;
  --muted-2: #94A3B8;

  /* Borders & focus */
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
  --focus-ring-accent: 0 0 0 3px rgba(234, 88, 12, 0.3);

  /* Semantic status */
  --status-recibido-bg: #F1F5F9;
  --status-recibido-fg: #475569;
  --status-cola-bg: #FEF3C7;
  --status-cola-fg: #92400E;
  --status-proceso-bg: #DBEAFE;
  --status-proceso-fg: #1E40AF;
  --status-listo-bg: #DCFCE7;
  --status-listo-fg: #166534;
  --status-revision-bg: #FFEDD5;
  --status-revision-fg: #9A3412;
  --status-error-bg: #FEE2E2;
  --status-error-fg: #991B1B;
  --status-archivado-bg: #F1F5F9;
  --status-archivado-fg: #64748B;

  /* Actors (flow map) */
  --auto: #0F766E;
  --auto-soft: #CCFBF1;
  --odoo: #7C3AED;
  --odoo-soft: #F3E8FF;
  --humano: #B45309;
  --humano-soft: #FFF7ED;

  /* Layout */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --nav-h: 56px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font: var(--text-base)/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, .btn {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}
pre {
  font-family: var(--mono);
  font-size: var(--text-sm);
  background: var(--surface-2);
  padding: var(--space-3);
  border-radius: var(--radius);
  overflow: auto;
  border: 1px solid var(--border);
}

/* Focus visibility (a11y) */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
a:focus-visible,
button:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.tab:focus-visible,
.action-card:focus-visible,
.flow-card:focus-visible,
.dropzone:focus-visible,
.icon-btn:focus-visible,
input:focus-visible {
  box-shadow: var(--focus-ring);
}

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

/* ---- Topbar (dense, no glass) ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); padding: 0 var(--space-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: var(--space-3); min-width: 160px;
}
.brand:focus-visible { border-radius: var(--radius); }
.brand-mark {
  width: 32px; height: 32px; border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--primary);
  color: white;
  flex-shrink: 0;
}
.brand-mark i, .brand-mark svg { width: 18px; height: 18px; }
.brand-text strong { display: block; font-size: var(--text-sm); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.brand-text span { font-size: var(--text-xs); color: var(--muted); font-weight: 500; }

.nav {
  display: flex; align-items: center; gap: 2px;
  flex-wrap: wrap; justify-content: center;
}
.nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius);
  color: var(--muted); font-size: var(--text-sm); font-weight: 600;
}
.nav a i, .nav a svg { width: 15px; height: 15px; opacity: 0.85; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active {
  background: var(--primary-soft); color: var(--primary-ink);
}
.nav a.active i, .nav a.active svg { opacity: 1; color: var(--primary); }

.top-actions { display: flex; align-items: center; gap: var(--space-2); }
.badge-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-ink);
  font-size: var(--text-xs); font-weight: 700;
}
.badge-pill.muted { background: var(--surface-2); color: var(--muted); }
.badge-pill.api { background: #DBEAFE; color: #1D4ED8; }
.badge-pill.ok { background: #DCFCE7; color: #166534; }
.badge-pill.warn { background: #FEF3C7; color: #92400E; }
.badge-pill i, .badge-pill svg { width: 12px; height: 12px; }

.main {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: var(--space-5) 0 var(--space-8);
  flex: 1;
}

/* ---- Hero (compact) ---- */
.hero {
  display: grid; gap: 6px;
  margin-bottom: var(--space-5);
}
.eyebrow {
  font: 600 var(--text-xs)/1 var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, var(--text-2xl));
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.hero p {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: var(--text-md);
}

/* ---- Section labels (persona grouping) ---- */
.section-label {
  display: flex; align-items: center; gap: var(--space-2);
  margin: var(--space-5) 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.section-label:first-of-type { margin-top: 0; }
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-label i, .section-label svg { width: 14px; height: 14px; }

/* ---- Action cards (dense) ---- */
.grid-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}
.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: var(--space-2);
  transition: border-color .12s ease, box-shadow .12s ease;
  min-height: 148px;
}
.action-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.action-card:focus-visible {
  border-color: var(--primary);
}
.action-icon {
  width: 36px; height: 36px; border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.action-icon i, .action-icon svg { width: 18px; height: 18px; }
.action-icon.accent { background: var(--accent-soft); color: var(--accent); }
.action-icon.muted { background: var(--surface-2); color: var(--muted); }
.action-card h3 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.action-card p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  flex: 1;
  line-height: 1.4;
}
.action-meta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  margin-top: 2px;
}
.flow-chip {
  font: 600 var(--text-xs)/1 var(--mono);
  padding: 3px 6px; border-radius: 4px;
  background: var(--surface-2); color: var(--muted);
  display: inline-flex; align-items: center; gap: 3px;
}
.flow-chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.cta-link {
  font-size: var(--text-sm); font-weight: 700; color: var(--primary);
  display: inline-flex; align-items: center; gap: 4px;
}
.cta-link i, .cta-link svg { width: 14px; height: 14px; }

/* ---- Panels ---- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-5);
}
.panel + .panel { margin-top: var(--space-3); }
.panel h2 {
  margin: 0 0 6px;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.panel .lede { margin: 0 0 var(--space-4); color: var(--muted); font-size: var(--text-sm); }

.two-col {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: var(--space-3);
}
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .topbar { padding: 8px 12px; height: auto; flex-wrap: wrap; }
  .brand { min-width: 0; }
  .nav { order: 3; width: 100%; justify-content: flex-start; }
}

/* ---- Buttons ---- */
.btn-primary, .btn-secondary, .btn-ghost, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  font-weight: 650; font-size: var(--text-sm);
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn-primary i, .btn-primary svg,
.btn-secondary i, .btn-secondary svg,
.btn-ghost i, .btn-ghost svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--primary); color: white;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled, .btn-primary.is-disabled,
.btn-secondary:disabled, .btn-secondary.is-disabled {
  opacity: 0.5; cursor: not-allowed;
}
.btn-secondary {
  background: var(--accent-soft); color: var(--accent-ink);
}
.btn-secondary:hover { background: #FFEDD5; }
.btn-ghost {
  border: 1px solid var(--border); color: var(--ink-secondary); background: var(--surface);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn {
  padding: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius);
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn i, .icon-btn svg { width: 16px; height: 16px; }

/* ---- Dropzone ---- */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  padding: var(--space-8) var(--space-5);
  text-align: center;
  color: var(--muted);
  transition: border-color .12s ease, background .12s ease;
}
.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.dropzone .dz-icon {
  width: 40px; height: 40px; margin: 0 auto var(--space-3);
  border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
}
.dropzone .dz-icon i, .dropzone .dz-icon svg { width: 20px; height: 20px; }
.dropzone strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: var(--text-md); font-weight: 700; }
.dropzone .hint { font-size: var(--text-xs); margin-top: var(--space-3); color: var(--muted-2); }

.file-list {
  margin-top: var(--space-3);
  display: grid; gap: var(--space-2);
}
.file-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
}
.file-row .file-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  flex-shrink: 0;
}
.file-row .file-icon i, .file-row .file-icon svg { width: 14px; height: 14px; }
.file-row .file-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .file-meta { color: var(--muted); font-size: var(--text-xs); font-family: var(--mono); }

.mock-toast {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid #FDBA74;
  color: var(--accent-ink);
  font-size: var(--text-sm);
  display: none;
  align-items: flex-start; gap: var(--space-2);
}
.mock-toast.show { display: flex; }
.mock-toast i, .mock-toast svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.mock-toast.ok {
  background: var(--status-listo-bg);
  border-color: #86EFAC;
  color: var(--status-listo-fg);
}

/* ---- F2-04 classify hint banner ---- */
.hint-banner {
  display: none;
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--primary-soft);
  border: 1px solid #BFDBFE;
  color: var(--primary-ink);
  font-size: var(--text-sm);
  align-items: flex-start;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.hint-banner.show { display: flex; }
.hint-banner-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: #fff;
  color: var(--primary);
  flex-shrink: 0;
}
.hint-banner-icon i, .hint-banner-icon svg { width: 16px; height: 16px; }
.hint-banner-body { flex: 1; min-width: 160px; }
.hint-banner-body strong { display: block; margin-bottom: 2px; }
.hint-banner-body p { margin: 0; color: inherit; opacity: 0.92; }
.hint-banner-meta { margin-top: 4px !important; font-size: var(--text-xs); opacity: 0.85; }
.hint-banner-actions {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  align-items: center;
}
.hint-banner.is-ok {
  background: var(--status-listo-bg);
  border-color: #86EFAC;
  color: var(--status-listo-fg);
}
.hint-banner.is-ok .hint-banner-icon { color: var(--status-listo-fg); }
.hint-banner.is-mismatch,
.hint-banner.is-warn {
  background: #FEF3C7;
  border-color: #FCD34D;
  color: #92400E;
}
.hint-banner.is-mismatch .hint-banner-icon,
.hint-banner.is-warn .hint-banner-icon { color: #B45309; }
.hint-banner.is-soft {
  background: var(--accent-soft);
  border-color: #FDBA74;
  color: var(--accent-ink);
}
.hint-banner.is-muted {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--muted);
}
.hint-banner.is-kept {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--ink);
}


/* ---- Status badges ---- */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.status-badge i, .status-badge svg { width: 12px; height: 12px; }
.status-badge.recibido { background: var(--status-recibido-bg); color: var(--status-recibido-fg); }
.status-badge.en_cola { background: var(--status-cola-bg); color: var(--status-cola-fg); }
.status-badge.en_proceso { background: var(--status-proceso-bg); color: var(--status-proceso-fg); }
.status-badge.listo { background: var(--status-listo-bg); color: var(--status-listo-fg); }
.status-badge.REQUIERE_REVISION { background: var(--status-revision-bg); color: var(--status-revision-fg); }
.status-badge.error { background: var(--status-error-bg); color: var(--status-error-fg); }
.status-badge.archivado { background: var(--status-archivado-bg); color: var(--status-archivado-fg); }

.status-legend {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.status-legend span.label {
  font-size: var(--text-xs); font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  align-self: center; margin-right: 4px;
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  margin-bottom: var(--space-4);
}
.empty-state .empty-icon {
  width: 48px; height: 48px; margin: 0 auto var(--space-3);
  border-radius: var(--radius-lg);
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.empty-state .empty-icon i, .empty-state .empty-icon svg { width: 22px; height: 22px; }
.empty-state h3 { margin: 0 0 6px; color: var(--ink); font-size: var(--text-md); font-weight: 700; }
.empty-state p { margin: 0; font-size: var(--text-sm); max-width: 360px; margin-inline: auto; }

/* ---- Tabs ---- */
.tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: var(--space-4);
}
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
  font-size: var(--text-sm); font-weight: 600;
}
.tab:hover { border-color: var(--border-strong); color: var(--ink); }
.tab.active {
  background: var(--primary); color: white; border-color: var(--primary);
}
.tab.active .flow-chip {
  background: rgba(255,255,255,0.2); color: white;
}

/* ---- Table (bandeja) ---- */
.table-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-3); margin-bottom: var(--space-3);
}
.table-toolbar h2 { margin: 0; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.inbox-table {
  width: 100%; border-collapse: collapse; font-size: var(--text-sm);
}
.inbox-table th, .inbox-table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.inbox-table th {
  color: var(--muted); font-weight: 700; font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: .04em;
  background: var(--surface-2);
  white-space: nowrap;
}
.inbox-table tbody tr:last-child td { border-bottom: none; }
.inbox-table tbody tr:hover td { background: var(--bg); }
.inbox-table .folio {
  font-family: var(--mono); font-size: var(--text-xs); font-weight: 600; color: var(--ink-secondary);
}
.inbox-table .demo-row td { opacity: 0.55; }
.inbox-table .demo-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  color: var(--muted-2); letter-spacing: 0.04em;
}

/* ---- Login ---- */
.login-card {
  max-width: 400px; margin: var(--space-8) auto;
  text-align: center;
}
.login-card .logo-lg {
  width: 48px; height: 48px; border-radius: var(--radius-lg);
  margin: 0 auto var(--space-4);
  display: grid; place-items: center;
  background: var(--primary);
  color: white;
}
.login-card .logo-lg i, .login-card .logo-lg svg { width: 24px; height: 24px; }
.field {
  text-align: left; margin: var(--space-3) 0;
}
.field label {
  display: block; font-size: var(--text-sm); font-weight: 600; margin-bottom: 5px; color: var(--ink-secondary);
}
.field input {
  width: 100%; padding: 9px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: white; font: inherit;
  color: var(--ink);
}
.field input:disabled { background: var(--surface-2); color: var(--muted-2); }
.field input:focus-visible { border-color: var(--primary); }

/* ---- Flow map ---- */
.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}
.flow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
  min-height: 168px;
  transition: border-color .12s ease;
}
.flow-card:hover { border-color: var(--border-strong); }
.flow-id {
  font: 700 var(--text-xs)/1 var(--mono); color: var(--accent); 
  display: inline-flex; align-items: center; gap: 4px;
}
.flow-card h3 { margin: 0; font-size: var(--text-md); font-weight: 700; letter-spacing: -0.01em; }
.flow-card p { margin: 0; color: var(--muted); font-size: var(--text-sm); flex: 1; }
.boundary {
  display: grid; gap: 4px;
  font-size: var(--text-xs); color: var(--muted);
  padding-top: var(--space-2); border-top: 1px solid var(--border);
}
.boundary strong { color: var(--ink-secondary); font-weight: 650; }

.timeline {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--space-3);
  position: relative;
  padding-bottom: var(--space-4);
}
.timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px; top: 28px; bottom: 0;
  width: 2px; background: var(--border);
}
.dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 var(--text-xs)/1 var(--mono);
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
  z-index: 1;
}
.step-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}
.step-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.step-id { font: 600 var(--text-xs)/1 var(--mono); color: var(--muted); }
.step-label { font-weight: 700; font-size: var(--text-md); }
.actor {
  font: 700 10px/1 var(--mono);
  padding: 3px 7px; border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.actor.AUTO { background: var(--auto-soft); color: var(--auto); }
.actor.ODOO { background: var(--odoo-soft); color: var(--odoo); }
.actor.HUMANO { background: var(--humano-soft); color: var(--humano); }
.kind-tag {
  font-size: 10px; color: var(--muted); font-weight: 600;
  padding: 2px 6px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border);
}
.step-detail { font-size: var(--text-sm); color: var(--muted); margin: 0; }
.step-meta {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  margin-top: var(--space-2); font-size: var(--text-xs); color: var(--muted);
}

.branch-list { display: grid; gap: var(--space-2); margin-top: 6px; }
.branch-item {
  border-left: 3px solid var(--humano);
  background: var(--humano-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-3) var(--space-4);
}
.branch-item h4 { margin: 0 0 4px; font-size: var(--text-sm); font-weight: 700; }
.branch-item p { margin: 0; font-size: var(--text-sm); color: var(--muted); }

.stats {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  margin: 0 0 var(--space-4);
}
.stat {
  padding: 8px 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  font-size: var(--text-sm);
  box-shadow: var(--shadow);
}
.stat strong { display: block; font-size: var(--text-lg); letter-spacing: -0.02em; font-weight: 700; }

.footer-note {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--text-sm);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
}
.footer-note a { color: var(--primary); font-weight: 650; }

.hidden { display: none !important; }
.view { animation: fade .15s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3);
}
.panel-header h2 { margin: 0; }

.actions-row {
  margin-top: var(--space-4);
  display: flex; gap: var(--space-2); flex-wrap: wrap;
}

@media (max-width: 640px) {
  .main { width: calc(100% - 24px); padding-top: var(--space-4); }
  .nav a { padding: 6px 8px; font-size: 12px; }
  .nav a span.nav-label { display: none; }
}

/* ---- Role switcher (segmented) ---- */
.role-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.role-switcher button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  font: 600 var(--text-xs)/1.2 var(--font);
  cursor: pointer;
  white-space: nowrap;
}
.role-switcher button i,
.role-switcher button svg { width: 13px; height: 13px; opacity: 0.85; }
.role-switcher button:hover { color: var(--ink); background: var(--surface); }
.role-switcher button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--primary-ink);
  box-shadow: var(--shadow);
}
.role-switcher button[aria-pressed="true"] i,
.role-switcher button[aria-pressed="true"] svg { opacity: 1; color: var(--primary); }
.role-switcher button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.nav a[hidden],
.nav a.is-hidden { display: none !important; }

/* ---- Confirmación panel ---- */
.confirm-panel {
  max-width: 520px;
  margin: 0 auto;
}
.confirm-success {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--status-listo-bg, #DCFCE7);
  color: var(--status-listo-fg, #166534);
  margin-bottom: var(--space-4);
}
.confirm-success .confirm-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  background: #fff;
  flex-shrink: 0;
}
.confirm-success .confirm-icon i,
.confirm-success .confirm-icon svg { width: 22px; height: 22px; color: #166534; }
.confirm-success h2 {
  margin: 0 0 4px;
  font-size: var(--text-lg);
  font-weight: 700;
  color: #166534;
}
.confirm-success p { margin: 0; font-size: var(--text-sm); color: #166534; opacity: 0.9; }

.confirm-meta {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.confirm-row:last-child { border-bottom: 0; }
.confirm-row .label {
  color: var(--muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.confirm-row .label i,
.confirm-row .label svg { width: 14px; height: 14px; }
.confirm-row .value {
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}
.confirm-row .value.folio {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: var(--text-md);
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  .role-switcher button .role-label { display: none; }
  .role-switcher button { padding: 6px 8px; }
}


/* ---- F2-01 detalle + F2-03 filtros ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.folio-link {
  color: inherit;
  text-decoration: none;
}
.folio-link:hover .folio { color: var(--primary); text-decoration: underline; }
.folio-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }
a.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
}
.filter-select-label select {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  max-width: 180px;
}
.filter-select-label select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.detail-panel .section-mini {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-panel .section-mini i,
.detail-panel .section-mini svg { width: 14px; height: 14px; }
.detail-actions {
  margin: 8px 0 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.status-actions { flex-wrap: wrap; gap: 8px; }
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid #FECACA;
  background: #FEF2F2;
  color: #B91C1C;
  cursor: pointer;
}
.btn-danger:hover { background: #FEE2E2; }
.btn-danger:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-danger i, .btn-danger svg { width: 16px; height: 16px; }
.btn-danger:disabled { opacity: 0.55; cursor: not-allowed; }
.event-timeline .dot {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  display: grid;
  place-items: center;
}
.event-timeline .dot i,
.event-timeline .dot svg { width: 10px; height: 10px; }
