/* Siigo Multiempresa · consola administrativa.
   Layout y densidad heredados de la consola Loggro (reference/loggro-ui);
   color, tipografía y logotipo según el Manual de Imagen Corporativa v1.0. */

@font-face { font-family: 'Montserrat'; src: url('/admin/fonts/montserrat-600.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('/admin/fonts/montserrat-700.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('/admin/fonts/montserrat-800.ttf') format('truetype'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Open Sans'; src: url('/admin/fonts/open-sans-400.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Open Sans'; src: url('/admin/fonts/open-sans-500.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Open Sans'; src: url('/admin/fonts/open-sans-600.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Open Sans'; src: url('/admin/fonts/open-sans-700.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/admin/fonts/jetbrains-mono-400.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* Primarios del manual */
  --primary: #1e4682;
  --primary-dark: #143c78;
  --primary-deep: #0e2c5c;
  --primary-mid: #5b7bae;
  --primary-light: #a8c4e8;
  --primary-soft: #edf2f9;
  --signal: #466450;
  --signal-dark: #3c5544;
  --signal-mid: #7a9883;
  --signal-light: #c5d4c9;
  --signal-soft: #eef3ef;
  /* Neutros del manual */
  --surface: #ffffff;
  --paper: #fafbfc;
  --line: #e0e5ec;
  --line-strong: #cbd3de;
  --ink: #2c2c2c;
  --ink-soft: #555555;
  --ink-muted: #6b7380;
  /* Estados funcionales */
  --warning: #8a5300;
  --warning-soft: #fff4df;
  --warning-line: #f0d6a8;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --danger-line: #f1c2bd;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(30, 70, 130, 0.08);
  --font-title: 'Montserrat', 'Open Sans', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Open Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.55; text-rendering: optimizeLegibility; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-title); color: var(--ink); letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(30, 70, 130, 0.35);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

.skip-link {
  position: fixed; z-index: 100; top: 12px; left: 12px; padding: 10px 14px; border-radius: 8px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  transform: translateY(-180%); transition: transform 150ms ease;
}
.skip-link:focus { transform: translateY(0); }

.eyebrow { margin: 0; color: var(--primary); font-family: var(--font-body); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.mono, code, pre { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }

/* ---------- Botones ---------- */
button { cursor: pointer; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.button:hover:not(:disabled) { border-color: var(--primary-mid); background: var(--primary-soft); }
.button--primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.button--primary:hover:not(:disabled) { border-color: var(--primary-dark); background: var(--primary-dark); color: #fff; }
.button--quiet { border-color: transparent; background: transparent; color: var(--primary); }
.button--quiet:hover:not(:disabled) { border-color: var(--line); background: var(--primary-soft); }
.button--outline { background: var(--surface); color: var(--ink); }
.button--full { width: 100%; }

.row-action {
  min-height: 32px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.row-action:hover:not(:disabled) { border-color: var(--primary-mid); background: var(--primary-soft); }
.row-action--primary { border-color: #b9c9e2; background: var(--primary-soft); color: var(--primary-dark); }
.row-action--primary:hover:not(:disabled) { border-color: var(--primary-mid); background: #e0e9f6; }
.row-action--danger { border-color: var(--danger-line); color: var(--danger); }
.row-action--danger:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-soft); }

.link-button { padding: 2px 0; border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--primary-dark); }

/* ---------- Formularios ---------- */
label { display: block; }
.stack-form { display: grid; gap: 16px; }
.stack-form label > span:first-child,
.field-label { display: block; margin-bottom: 6px; color: #3f4a5a; font-size: 12px; font-weight: 600; }
input:not([type='checkbox']), select, textarea {
  display: block; width: 100%; min-height: 42px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 14px;
}
select { padding-right: 32px; }
input:not([type='checkbox']):focus, select:focus, textarea:focus { border-color: var(--primary-mid); box-shadow: 0 0 0 3px rgba(30, 70, 130, 0.12); outline: 0; }
input::placeholder { color: #8a93a0; }
input[type='checkbox'] { width: 17px; height: 17px; margin: 0; flex: 0 0 17px; accent-color: var(--primary); }
textarea { padding: 11px 12px; font-family: var(--font-mono); font-size: 12px; min-height: 140px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.help { margin: 6px 0 0; color: var(--ink-muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.form-error, .error { min-height: 0; margin: 0; color: var(--danger); font-size: 12px; }
.form-error:empty { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.check-row { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.check-label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; cursor: pointer; }
.check-label:has(input:disabled) { cursor: not-allowed; color: var(--ink-muted); }
.check-label--locked { color: var(--ink-soft); font-weight: 600; }

/* ---------- Acceso (patrón auth-layer Loggro) ---------- */
.auth-layer { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr); min-height: 100vh; background: var(--surface); }
.auth-showcase { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 64px clamp(40px, 6vw, 96px); background: var(--primary); color: #fff; }
.auth-showcase-content { max-width: 540px; }
.auth-showcase-kicker { color: var(--primary-light); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; }
.auth-showcase h1 { margin-top: 14px; color: #fff; font-size: clamp(32px, 3.4vw, 44px); font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; }
.auth-showcase-content > p:not(.auth-showcase-kicker) { margin-top: 16px; max-width: 470px; color: #dbe5f3; font-size: 14px; line-height: 1.65; }
.auth-feature-list { display: grid; gap: 12px; margin: 34px 0 0; padding: 0; list-style: none; }
.auth-feature-list li { display: flex; align-items: center; gap: 12px; color: #eef3f9; font-size: 13px; }
.auth-feature-list span { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 7px; color: var(--primary-light); font-size: 10px; font-weight: 700; }
.auth-showcase-footer { position: absolute; bottom: 30px; left: clamp(40px, 6vw, 96px); color: var(--primary-light); font-size: 10px; letter-spacing: 0.12em; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--surface); }
.auth-card { width: min(100%, 392px); }
.auth-logo { display: block; width: 210px; height: auto; margin-bottom: 36px; }
.auth-card h2 { margin-top: 8px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.auth-copy { margin: 10px 0 26px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.auth-card .button--full { min-height: 46px; margin-top: 4px; font-size: 14px; }
.auth-assurance { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 22px; color: var(--ink-muted); font-size: 12px; }

/* ---------- Estructura ---------- */
.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 22px 16px 18px;
  border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto;
}
.brand { display: grid; gap: 8px; padding: 4px 10px 18px; border-bottom: 1px solid var(--line); }
.brand-logo { display: block; width: 172px; height: auto; }
.brand-product { color: var(--ink-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; }
.nav-label { margin: 22px 10px 8px; color: var(--ink-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; }
.primary-nav { display: grid; gap: 3px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 10px;
  border: 0; border-radius: 7px; background: transparent; color: #4a5361; font-size: 13px; font-weight: 600; text-align: left;
  transition: background 150ms ease, color 150ms ease;
}
.nav-item::before { content: ''; position: absolute; top: 10px; bottom: 10px; left: -16px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.nav-item:hover { background: var(--paper); color: var(--ink); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item.active::before { background: var(--primary); }
.nav-icon {
  display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: var(--surface); color: var(--ink-muted); font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
}
.nav-item.active .nav-icon { border-color: var(--primary); background: var(--primary); color: #fff; }
.sidebar-note { display: flex; align-items: flex-start; gap: 10px; margin-top: auto; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.sidebar-note strong { display: block; font-size: 12px; }
.sidebar-note small { display: block; margin-top: 3px; color: var(--ink-muted); font-size: 11px; line-height: 1.45; }
.source-link { display: block; margin-top: 10px; padding: 6px 10px; color: var(--primary); font-size: 12px; font-weight: 600; }

.status-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 5px; border-radius: 50%; background: #9aa3ad; box-shadow: 0 0 0 4px rgba(154, 163, 173, 0.16); }
.status-dot--safe { background: var(--signal); box-shadow: 0 0 0 4px rgba(70, 100, 80, 0.16); }
.auth-assurance .status-dot { margin-top: 0; }

.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 68px; padding: 10px clamp(24px, 3.4vw, 48px); border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px);
}
.topbar-title { min-width: 0; }
.topbar-title strong { display: block; margin-top: 2px; font-family: var(--font-title); font-size: 16px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.runtime-chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink-soft); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.runtime-chip:empty { display: none; }
.runtime-chip--locked { border-color: var(--signal-light); background: var(--signal-soft); color: var(--signal-dark); }
.session-user { max-width: 200px; margin: 0 4px; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 32px clamp(24px, 3.4vw, 48px) 56px; }
main:focus { outline: 0; }
.app-footer { display: flex; justify-content: space-between; gap: 16px; padding: 16px clamp(24px, 3.4vw, 48px); border-top: 1px solid var(--line); background: var(--surface); color: var(--ink-muted); font-size: 10px; letter-spacing: 0.08em; }

/* ---------- Encabezados de sección ---------- */
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading > div:first-child { max-width: 760px; }
.section-heading h2 { margin: 6px 0 6px; font-size: clamp(24px, 2.4vw, 30px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.section-heading p:not(.eyebrow) { color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.section-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; }

/* ---------- Avisos ---------- */
.safety-banner { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 20px; padding: 16px 18px; border: 1px solid #c9d6ea; border-radius: 8px; background: var(--primary-soft); }
.safety-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; }
.safety-banner strong { display: block; font-size: 13px; }
.safety-banner p { margin-top: 3px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.safety-banner--locked { border-color: var(--signal-light); border-left: 4px solid var(--signal); background: var(--signal-soft); }
.safety-banner--locked .safety-mark { background: var(--signal); }
.safety-banner--locked strong { color: var(--signal-dark); }

.notice { margin-bottom: 20px; padding: 12px 16px; border: 1px solid var(--signal-light); border-left: 4px solid var(--signal); border-radius: 8px; background: var(--signal-soft); color: var(--signal-dark); font-size: 13px; }
.notice.error { border-color: var(--danger-line); border-left-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

.callout { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--primary-mid); border-radius: 8px; background: var(--surface); color: var(--ink-soft); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.callout strong { color: var(--ink); }
.callout--warning { border-left-color: #c98a1a; background: var(--warning-soft); border-color: var(--warning-line); color: #5f4100; }
.callout--locked { border-color: var(--line); border-left-color: var(--primary); background: var(--primary-soft); color: var(--ink); }
.callout--locked strong { color: var(--primary); }
.contract-fields summary { color: var(--primary); font-weight: 600; cursor: pointer; }
.contract-fields .code-block { margin: 12px 0 8px; }

/* ---------- Resumen ---------- */
.hero-card {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: var(--radius); background: var(--surface);
}
.hero-status { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.hero-card h3 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; letter-spacing: -0.02em; }
.hero-card p:not(.eyebrow) { max-width: 640px; margin-top: 10px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.pulse { width: 12px; height: 12px; flex: 0 0 12px; border-radius: 50%; background: #9aa3ad; box-shadow: 0 0 0 6px rgba(154, 163, 173, 0.16); }
.pulse.is-up { background: var(--signal); box-shadow: 0 0 0 6px rgba(70, 100, 80, 0.16); }
.pulse.is-locked { background: var(--signal); box-shadow: 0 0 0 6px rgba(70, 100, 80, 0.14); }
.hero-meta { display: grid; gap: 0; min-width: 230px; margin: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.hero-meta div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--line); }
.hero-meta div:first-child { border-top: 0; }
.hero-meta dt { color: var(--ink-muted); font-size: 11px; }
.hero-meta dd { margin: 0; font-size: 12px; font-weight: 600; text-align: right; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.metric-card { min-height: 122px; padding: 20px 22px; border-right: 1px solid var(--line); }
.metric-card:last-child { border-right: 0; }
.metric-label { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.metric-value { display: block; margin-top: 12px; color: var(--primary); font-family: var(--font-title); font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.metric-detail { display: block; margin-top: 8px; color: var(--ink-muted); font-size: 11px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------- Paneles y tablas ---------- */
.panel { margin-bottom: 16px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.panel--flush { padding: 0; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel--flush .panel-heading { margin: 0; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-heading h3 { margin-top: 4px; font-size: 17px; font-weight: 700; }

.step-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.step { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 4px; }
.step-number { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border: 1px solid #c9d6ea; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700; }
.step h4 { margin: 3px 0 3px; font-size: 14px; font-weight: 600; }
.step p { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }

.toolbar { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.search-field { flex: 1 1 280px; max-width: 520px; }
.search-field input { min-height: 42px; }
.toolbar select { width: auto; min-width: 180px; }
.summary-chip { display: inline-flex; align-items: baseline; gap: 6px; min-height: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-soft); font-size: 12px; }
.summary-chip strong { color: var(--primary); font-family: var(--font-title); font-size: 18px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.data-table th { padding: 11px 18px; border-bottom: 1px solid var(--line); background: var(--paper); color: var(--ink-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 14px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr:hover td { background: #f7f9fc; }
.data-table td strong { display: block; font-size: 13px; font-weight: 600; }
.data-table td small { display: block; margin-top: 3px; color: var(--ink-muted); font-size: 11px; }
.data-table td code { font-size: 12px; overflow-wrap: anywhere; }
.data-table tr.is-locked td { background: var(--paper); }
.data-table tr.is-locked td:first-child { box-shadow: inset 3px 0 0 var(--line-strong); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.count-note { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--paper); color: var(--ink-muted); font-size: 12px; }

.empty-state { margin: 18px; padding: 44px 20px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--ink-soft); text-align: center; }
.empty-state strong { display: block; color: var(--ink); font-family: var(--font-title); font-size: 16px; font-weight: 600; }
.empty-state p { max-width: 440px; margin: 6px auto 0; font-size: 13px; }

/* ---------- Distintivos ---------- */
.badge {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px;
  background: var(--signal-soft); color: var(--signal-dark); font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
.badge.gray, .badge.neutral { background: #eef1f5; color: #4f5866; }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.locked { border: 1px solid var(--line); background: var(--primary-soft); color: var(--primary); }

.method { display: inline-grid; place-items: center; min-width: 52px; min-height: 22px; padding: 0 6px; border-radius: 5px; font-family: var(--font-mono); font-size: 10px; font-weight: 400; letter-spacing: 0.04em; }
.method.GET { background: var(--primary-soft); color: var(--primary-dark); }
.method.POST { background: var(--signal-soft); color: var(--signal-dark); }
.method.PUT, .method.PATCH { background: #fff4df; color: var(--warning); }
.method.DELETE { background: var(--danger-soft); color: var(--danger); }

code { padding: 2px 6px; border-radius: 5px; background: var(--primary-soft); color: var(--primary-dark); font-size: 0.9em; }

/* ---------- Diálogos (workspace-dialog Loggro) ---------- */
.workspace-dialog {
  width: min(720px, calc(100vw - 32px)); max-height: min(880px, calc(100vh - 32px)); margin: auto; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink);
  box-shadow: 0 28px 90px rgba(14, 44, 92, 0.24); overflow: hidden;
}
.workspace-dialog[open] { display: flex; flex-direction: column; }
.workspace-dialog::backdrop { background: rgba(14, 44, 92, 0.45); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 26px 18px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin-top: 5px; font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.dialog-close { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.dialog-close:hover { border-color: var(--line-strong); background: var(--paper); color: var(--ink); }
.dialog-body { min-height: 0; padding: 22px 26px 24px; overflow-y: auto; }
.dialog-body > p + p { margin-top: 10px; }
.dialog-context { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 13px; }
.dialog-context strong { display: inline; }
.details-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; overflow-wrap: anywhere; }
.operation-path { font-size: 13px; overflow-wrap: anywhere; }
.section-title { margin: 22px 0 10px; color: var(--ink-muted); font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.stack-form .section-title { margin: 6px 0 0; }

.permission-tools { display: flex; gap: 16px; }
.permission-groups { display: grid; gap: 8px; max-height: 340px; padding: 10px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.permission-groups details { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.permission-groups summary { padding: 10px 12px; color: var(--primary-dark); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.permission-option { align-items: flex-start; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.permission-option:hover { background: var(--primary-soft); }
.permission-option input { margin-top: 3px; }
.permission-option .badge { min-height: 20px; margin-left: 4px; font-size: 9px; }

.code-block { margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: #f5f7fa; color: #1f2a3a; font-family: var(--font-mono); font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; max-height: 370px; overflow: auto; }
.secret-card { margin-bottom: 14px; padding: 16px 18px; border: 1px solid var(--signal-light); border-left: 4px solid var(--signal); border-radius: 8px; background: var(--signal-soft); }
.secret-card p:not(.eyebrow) { margin-top: 6px; color: var(--ink-soft); font-size: 13px; }
.secret-card .eyebrow { color: var(--signal-dark); }
.code-block.secret { border-color: var(--primary-light); background: var(--primary-soft); color: var(--primary-deep); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card:nth-child(2) { border-right: 0; }
  .metric-card:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .auth-layer { grid-template-columns: 1fr; }
  .auth-showcase { display: none; }
  .auth-panel { min-height: 100vh; padding: 36px 24px; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 14px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .brand { grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 0 0 12px; border-bottom: 0; }
  .brand-logo { width: 140px; }
  .brand-product { text-align: right; }
  .nav-label, .sidebar-note, .source-link, .nav-icon { display: none; }
  .primary-nav { display: flex; gap: 2px; margin: 0 -16px; padding: 0 12px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: none; }
  .nav-item { width: auto; flex: 0 0 auto; min-height: 46px; padding: 0 12px; border-radius: 0; white-space: nowrap; }
  .nav-item::before { display: none; }
  .nav-item.active { background: transparent; box-shadow: inset 0 -3px var(--primary); }
  .topbar { position: static; min-height: 0; padding: 12px 16px; }
  .topbar-title .eyebrow { display: none; }
  .session-user { display: none; }
  main { padding: 22px 16px 44px; }
  .section-heading { flex-direction: column; align-items: stretch; gap: 14px; }
  .hero-card { flex-direction: column; align-items: stretch; }
  .hero-meta { min-width: 0; }
  .app-footer { padding: 14px 16px; }
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-field { max-width: none; flex-basis: auto; }
  .toolbar select { width: 100%; }
  .summary-chip { align-self: flex-start; }
  .section-actions .button { flex: 1 1 auto; }

  /* Tablas como tarjetas apiladas */
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { padding: 12px 16px; border-top: 1px solid var(--line); }
  .data-table tbody tr:first-child { border-top: 0; }
  .data-table td { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 10px; row-gap: 3px; align-items: start; padding: 5px 0; border-top: 0; }
  .data-table td::before { content: attr(data-label); grid-column: 1; grid-row: 1; color: var(--ink-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 3px; }
  .data-table td > * { grid-column: 2; }
  .data-table td small { margin-top: 0; }
  .data-table tbody tr:hover td { background: transparent; }
  .data-table tr.is-locked { box-shadow: inset 3px 0 0 var(--line-strong); background: var(--paper); }
  .data-table tr.is-locked td, .data-table tr.is-locked td:first-child { background: transparent; box-shadow: none; }
  .data-table td > .badge { justify-self: start; }
  .data-table td > .row-action { justify-self: start; }
  .actions { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .topbar-actions .button { flex: 1 1 auto; min-height: 38px; }
  .runtime-chip { flex: 1 0 100%; justify-content: center; white-space: normal; text-align: center; }
  .metric-card { min-height: 0; padding: 16px; }
  .metric-value { font-size: 26px; }
  .auth-panel { align-items: flex-start; padding: 40px 22px; }
  .auth-logo { width: 180px; margin-bottom: 30px; }
  .auth-card h2 { font-size: 26px; }
  .workspace-dialog { width: calc(100vw - 12px); max-height: calc(100vh - 12px); border-radius: 10px; }
  .dialog-heading, .dialog-body { padding-right: 16px; padding-left: 16px; }
  .dialog-heading h2 { font-size: 19px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .app-footer { flex-direction: column; gap: 4px; font-size: 9px; }
  .brand-product { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.user-companies { border: 1px solid var(--border, #dfe4ea); border-radius: 8px; padding: 16px; display: grid; gap: 12px; max-height: 260px; overflow: auto; }
.user-companies legend { font-weight: 700; padding: 0 6px; }
.user-companies[hidden], .nav-item[hidden] { display: none; }
