/*
 * Portal Optium — tema sobre Tabler 1.0 (public/vendor/tabler).
 * Archivo independiente de application.css: lo cargan los layouts hub y application_devise.
 * Estilo claro como optium.cl (blanco y gris cálido, azul marino solo como acento).
 * El modo oscuro usa neutros grafito, no azules.
 */


:root {
  --o-orange: #f04e24; --o-orange-600: #d63e18; --o-navy: #12273b; --o-steel-400: #8fb1c4;
  --font-body: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --ok: #1e9e62; --bad: #c92a2a;

  --bg: #f8f8f7; --surface: #ffffff; --sunken: #f1f0ef; --fg: #12273b; --body: #2b2b2b; --muted: #615f5c; --faint: #6f6d6a; --line: #e1e0e0;
  --sb-fg: #444240; --sb-muted: #6f6d6a; --sb-sec: #1f5f8b; --sb-active-bg: #fef1ed; --sb-active-fg: #b23211;
  --chip-pbi-bg: #eef2f6; --chip-pbi-fg: #18394f; --chip-off-bg: #f1f0ef; --chip-off-fg: #615f5c;
  --link: #c63714; --link-rgb: 198,55,20; --tile-2: #12273b; --accent-text: #c63714;
}
[data-bs-theme="dark"] {
  --bg: #121212; --surface: #1c1c1c; --sunken: #171717; --fg: #f1f0ef; --body: #e1e0e0; --muted: #a8a6a3; --faint: #8a8885; --line: #2e2e2e;
  --sb-fg: #cbc9c7; --sb-muted: #8a8885; --sb-sec: #8fb1c4; --sb-active-bg: rgba(240,78,36,.14); --sb-active-fg: #f79a7e;
  --chip-pbi-bg: #262a2e; --chip-pbi-fg: #cddfe9; --chip-off-bg: #262626; --chip-off-fg: #a8a6a3;
  --link: #f79a7e; --link-rgb: 247,154,126; --tile-2: #3c5a6a; --accent-text: #f2683f; --ok: #4fc48a; --bad: #ff8787;
  color-scheme: dark;
}

/* Tabler → marca Optium */
:root, [data-bs-theme="light"], [data-bs-theme="dark"] {
  --tblr-primary: #f04e24; --tblr-primary-rgb: 240,78,36; --tblr-primary-darken: #d63e18; --tblr-primary-fg: #ffffff;
  --tblr-primary-lt: rgba(240,78,36,.1); --tblr-primary-lt-rgb: 240,78,36;
  --tblr-link-color: var(--link); --tblr-link-hover-color: var(--link);
  --tblr-link-color-rgb: var(--link-rgb); --tblr-link-hover-color-rgb: var(--link-rgb);
  --tblr-font-sans-serif: "Outfit", "Segoe UI", system-ui, sans-serif;
  --tblr-body-bg: var(--bg); --tblr-body-color: var(--body); --tblr-emphasis-color: var(--fg);
  --tblr-bg-surface: var(--surface); --tblr-bg-surface-secondary: var(--sunken); --tblr-bg-surface-tertiary: var(--sunken); --tblr-bg-surface-dark: var(--sunken);
  --tblr-bg-forms: var(--surface); --tblr-secondary-bg: var(--sunken); --tblr-tertiary-bg: var(--sunken); --tblr-active-bg: var(--sunken);
  --tblr-secondary: var(--muted); --tblr-secondary-color: var(--muted); --tblr-muted: var(--muted);
  --tblr-border-color: var(--line); --tblr-border-color-translucent: var(--line);
  --tblr-border-radius: 10px; --tblr-border-radius-lg: 14px; --tblr-border-radius-sm: 6px; --tblr-body-font-size: 1rem;
}

body { background: var(--bg); color: var(--body); font-family: var(--font-body); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--font-body); font-size: .6875rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }
h1, h2, h3, h4 { color: var(--fg); letter-spacing: -.01em; }
.btn { font-weight: 600; }
.btn:active { transform: translateY(1px); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(240,78,36,.28); }
:focus-visible { outline: 2px solid var(--o-orange); outline-offset: 2px; }
.ico { width: 18px; height: 18px; }
/* Espacio reservado para los íconos antes de que Lucide los dibuje: el texto no «salta» */
i[data-lucide] { display: inline-block; width: 18px; height: 18px; vertical-align: middle; flex-shrink: 0; }
.kind i[data-lucide], .chip i[data-lucide], .rcard .meta i[data-lucide] { width: 14px; height: 14px; }
.form-check-input[type="checkbox"] { border-radius: 5px; }
.topbar .avatar, .sb-user .avatar { width: 34px; height: 34px; font-size: .75rem; flex-shrink: 0; }
.logo-light { display: block; } .logo-dark { display: none; }
[data-bs-theme="dark"] .logo-light { display: none; } [data-bs-theme="dark"] .logo-dark { display: block; }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 32px 28px; box-shadow: 0 4px 12px rgba(13,29,45,.06); }
.login-card h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.login-card .logo-light, .login-card .logo-dark { height: 34px; width: auto; margin: 0 auto 24px; }
.login-card .eyebrow { margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: .875rem; margin: 6px 0 0; }
.login-doors { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; }
.login-doors a { text-align: center; padding: 8px 10px; border-radius: 7px; font-size: .875rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.login-doors a:hover { color: var(--fg); text-decoration: none; }
.login-doors a[aria-current="page"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(13,29,45,.12); }
.login-foot { font-family: var(--font-body); font-size: .72rem; color: var(--faint); margin: 0; }
.input-icon-addon svg { width: 18px; height: 18px; }
@media (max-width: 480px) { .login-card { padding: 24px 20px; } }

/* Estructura del portal */
.app { display: flex; min-height: 100vh; }
.sb { width: 260px; flex-shrink: 0; background: var(--surface); color: var(--sb-fg); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sb-logo { padding: 12px 10px 8px 22px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb-logo img { height: 28px; width: auto; }
.sb-collapse { width: 32px; height: 32px; color: var(--sb-muted); }
.sb-collapse svg { width: 18px; height: 18px; }
/* Títulos de sección del menú (Plataformas, Servicios, Administración…) en azul, para que destaquen */
.sb-sec { padding: 12px 24px 4px; font-family: var(--font-body); font-weight: 700; font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sb-sec); }
.sb-nav { display: flex; flex-direction: column; gap: 1px; padding: 0 12px; }
/* Sección Administración contraíble (cerrada por defecto) */
.sb-sec-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.sb-sec-toggle:hover { color: var(--fg); }
.sb-sec-toggle .chev { width: 15px; height: 15px; flex-shrink: 0; transition: transform .15s; transform: rotate(-90deg); }
.sb-sec-toggle[aria-expanded="true"] .chev { transform: none; }
html:not(.sb-admin-open) .sb-admin:not(.here) { display: none; }
.sb-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 6px 12px; border-radius: 10px; color: var(--sb-fg); font-size: .9375rem; font-weight: 500; text-decoration: none; }
.sb-link:hover { background: var(--sunken); color: var(--fg); text-decoration: none; }
.sb-link.active { background: var(--sb-active-bg); color: var(--sb-active-fg); font-weight: 600; }
.sb-link.active::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; background: var(--o-orange); border-radius: 0 3px 3px 0; }
.sb-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sb-link .count { margin-left: auto; font-family: var(--font-mono); font-size: .6875rem; color: var(--sb-muted); }
.sb-link.disabled { opacity: .65; cursor: default; }
.sb-link.disabled:hover { background: none; color: var(--sb-fg); }
.sb-user { margin-top: auto; border-top: 1px solid var(--line); padding: 10px 20px; display: flex; gap: 10px; align-items: center; }
.sb-user .name { color: var(--fg); font-weight: 600; font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .role { font-size: .72rem; color: var(--sb-muted); }
.avatar-o { background: var(--o-orange); color: #fff; font-weight: 600; }
.sb-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 52px; flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 10; }
.topbar .search { flex: 1; max-width: 480px; margin: 0; }
.icon-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--fg); cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { background: var(--sunken); }
.icon-btn svg { width: 19px; height: 19px; }
.sb-toggle { display: none; }
/* Todo el ancho disponible (sin franja vacía en pantallas anchas); el límite evita líneas eternas en monitores muy grandes */
.content { padding: 28px 32px 48px; width: 100%; max-width: 1920px; }

/* Encabezados y paneles */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 1.75rem; font-weight: 700; margin: 6px 0 4px; }
.page-head .sub { color: var(--muted); font-size: .875rem; max-width: 640px; }
.sec-title { font-size: .9375rem; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; color: var(--fg); }
.sec-title svg { width: 17px; height: 17px; color: var(--faint); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { display: flex; gap: 14px; align-items: center; }
.stat .v { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .l { font-size: .8125rem; color: var(--muted); }
.tile { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--o-orange); flex-shrink: 0; }
.tile.alt { background: var(--tile-2); }
.tile svg { width: 20px; height: 20px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.table-o { width: 100%; font-size: .8438rem; }
.table-o th { font-family: var(--font-body); font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.table-o td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-o tr:last-child td { border-bottom: 0; }

/* Catálogo */
.grid-r { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s, border-color .2s; min-width: 0; }
.rcard:hover { box-shadow: 0 4px 12px rgba(13,29,45,.08); border-color: var(--o-steel-400); transform: translateY(-1px); }
.rcard .body { padding: 13px 14px 11px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.rcard .top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rcard h3 { font-size: 1rem; font-weight: 700; margin: 0; line-height: 1.3; }
.rcard h3 a { color: inherit; }
.rcard .desc { color: var(--muted); font-size: .8438rem; line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .75rem; color: var(--faint); margin-top: auto; padding-top: 2px; }
.rcard .meta span { display: inline-flex; gap: 5px; align-items: center; }
.rcard .meta svg { width: 14px; height: 14px; }
.rcard .foot { border-top: 1px solid var(--line); padding: 6px 10px 6px 16px; display: flex; align-items: center; gap: 4px; }
.rcard .open { font-weight: 600; font-size: .8438rem; color: var(--link); display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.rcard .open:hover { text-decoration: none; }
.rcard .open svg { width: 16px; height: 16px; transition: transform .15s; }
.rcard:hover .open svg { transform: translateX(3px); }
.rcard .foot .icon-btn { width: 32px; height: 32px; color: var(--faint); }
.rcard .foot .icon-btn svg { width: 16px; height: 16px; }
.kind { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: .72rem; font-weight: 600; }
.kind svg { width: 13px; height: 13px; }
.kind.pbi { background: var(--chip-pbi-bg); color: var(--chip-pbi-fg); }
.kind.off { background: var(--chip-off-bg); color: var(--chip-off-fg); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 999px; padding: 5px 14px; font-size: .8125rem; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.chip:hover { text-decoration: none; border-color: var(--o-steel-400); color: var(--fg); }
.chip svg { width: 14px; height: 14px; }
.chip[aria-current="page"] { background: var(--fg); border-color: var(--fg); color: var(--surface); }
.fav { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--faint); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.fav:hover { background: var(--sunken); }
.fav svg { width: 18px; height: 18px; }
.fav[aria-pressed="true"], .fav-btn[aria-pressed="true"] svg, .fav-ico[aria-pressed="true"] { color: #e8a53a !important; }
.fav[aria-pressed="true"] svg, .fav-btn[aria-pressed="true"] svg, .fav-ico[aria-pressed="true"] svg { fill: currentColor; }
.recent { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.recent a { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; color: var(--fg); min-width: 0; }
.recent a:hover { border-color: var(--o-steel-400); text-decoration: none; }
.recent .t { font-weight: 600; font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent .w { font-size: .72rem; color: var(--faint); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent svg { width: 18px; height: 18px; color: var(--faint); flex-shrink: 0; }
.kind.int { background: #12273b; color: #fff; }
[data-bs-theme="dark"] .kind.int { background: #e1e0e0; color: #12273b; }
.rcard .areas-l { font-size: .72rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.rcard .areas-l span { border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.filters .form-select { width: auto; min-width: 200px; }
.area-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.area-pick label { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 10px; font-size: .8125rem; display: inline-flex; gap: 7px; align-items: center; cursor: pointer; background: var(--surface); margin: 0; }
.area-pick label:has(input:checked) { border-color: var(--o-orange); background: var(--sb-active-bg); color: var(--sb-active-fg); font-weight: 600; }
.area-pick input { accent-color: var(--o-orange); }
.area-pick label.off { opacity: .45; cursor: not-allowed; border-style: dashed; }
#users-data td:nth-child(3), #users-data td:nth-child(5), .table-o .kind { white-space: nowrap; }
.table-o .areas-l { display: inline-flex; flex-wrap: wrap; gap: 4px; font-size: .72rem; color: var(--muted); }
.table-o .areas-l span { border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; }
.area-pick svg { width: 15px; height: 15px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); margin: 0; }
.icon-pick label:has(input:checked) { border-color: var(--o-orange); background: var(--sb-active-bg); color: var(--sb-active-fg); }
.icon-pick label:has(input:focus-visible) { outline: 2px solid var(--o-orange); outline-offset: 2px; }
.icon-pick svg { width: 18px; height: 18px; }
.empty { border: 1px dashed var(--line); border-radius: 14px; padding: 36px 20px; text-align: center; color: var(--muted); grid-column: 1 / -1; }
.pager { margin-top: 20px; }
.pager .pagination { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0; }
.pager .pagination li > a, .pager .pagination li > span { display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: .8125rem; }
.pager .pagination li.active > a, .pager .pagination li.active > span { background: var(--fg); border-color: var(--fg); color: var(--surface); }
.pager .pagination li.disabled > a, .pager .pagination li.disabled > span { opacity: .5; }

/* Visor */
.crumbs { display: flex; gap: 6px; align-items: center; font-size: .8125rem; color: var(--faint); margin-bottom: 10px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs svg { width: 14px; height: 14px; }
.crumbs .crumb-back { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.reload-link { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; font: inherit; font-size: .8125rem; color: var(--muted); cursor: pointer; }
.reload-link:hover { color: var(--fg); text-decoration: underline; }
.reload-link svg { width: 13px; height: 13px; }
.v-head { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-start; margin-bottom: 16px; }
.v-head h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 6px; }
.v-head .line { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: .8125rem; }
.v-head .line svg { width: 14px; height: 14px; }
.v-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.v-actions .btn svg { width: 17px; height: 17px; margin-right: 6px; }
.frame { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; height: max(560px, calc(100vh - 230px)); }
.frame:fullscreen { border-radius: 0; height: 100vh; border: 0; }
.frame #reportContainer { position: absolute; inset: 0; }
.frame #reportContainer iframe { width: 100%; height: 100%; border: 0; }
.offcanvas { --tblr-offcanvas-width: 380px; background: var(--surface); color: var(--body); }
.meta-list { margin: 0; }
.meta-list > div { padding: 11px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; }
.meta-list dt { font-weight: 500; color: var(--muted); font-size: .8125rem; }
.meta-list dd { margin: 0; font-size: .875rem; color: var(--fg); overflow-wrap: anywhere; }
/* Historial de versiones del reporte HTML (panel «Actualizar datos») */
.version-list { list-style: none; margin: 0; padding: 0; }
.version-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.version-list .version-actions { margin-left: auto; display: inline-flex; gap: 4px; }

/* Administración: listado + formulario lateral */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; max-width: 1100px; }
.tips-list { padding-left: 18px; margin: 0 0 12px; font-size: .8438rem; line-height: 1.6; color: var(--body); }
.tips-list li { margin-bottom: 8px; }
.kind.ok { background: #e8f6ef; color: #12653f; }
[data-bs-theme="dark"] .kind.ok { background: #16301f; color: #7fd4a7; }
.row-actions { display: inline-flex; gap: 2px; justify-content: flex-end; }
.row-actions .icon-btn { width: 32px; height: 32px; color: var(--faint); }
.row-actions .icon-btn svg { width: 16px; height: 16px; }
.form-label.required::after { color: var(--o-orange); }

/* DataTables (integración Bootstrap 4) sobre Tabler */
.dataTables_wrapper { font-size: .8438rem; }
.dataTables_wrapper .row { --tblr-gutter-x: 0; align-items: center; row-gap: 10px; margin-bottom: 8px; }
.dataTables_wrapper .row:last-child { margin: 12px 0 0; }
.dataTables_length label, .dataTables_filter label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.dataTables_length select { width: auto; display: inline-block; padding-right: 2rem; }
.dataTables_filter { display: flex; justify-content: flex-end; }
.dataTables_filter input { width: 220px; max-width: 100%; }
.dataTables_info { color: var(--faint); font-family: var(--font-body); font-size: .72rem; }
.dataTables_paginate { display: flex; justify-content: flex-end; }
.dataTables_paginate .pagination { margin: 0; gap: 4px; }
.dataTables_paginate .page-link { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); padding: 0 8px; }
.dataTables_paginate .page-item.active .page-link { background: var(--fg); border-color: var(--fg); color: var(--surface); }
.dataTables_paginate .page-item.disabled .page-link { opacity: .45; }
.dataTables_processing { position: absolute; top: 40%; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; color: var(--muted); }
.dataTables_wrapper { position: relative; overflow-x: auto; }
table.dataTable th.sorting, table.dataTable th.sorting_asc, table.dataTable th.sorting_desc { cursor: pointer; white-space: nowrap; }
table.dataTable th.sorting_asc::after { content: " ↑"; color: var(--o-orange); }
table.dataTable th.sorting_desc::after { content: " ↓"; color: var(--o-orange); }
table.dataTable td { word-break: break-word; }

/* Inicio del portal */
.hero { background: var(--o-navy); color: #fff; border-radius: 14px; padding: 28px 30px; position: relative; overflow: hidden; display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: flex-end; margin-bottom: 26px; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 120% at 100% 0%, rgba(240,78,36,.24), transparent 55%); }
.hero > * { position: relative; }
.hero h1 { color: #fff; font-size: clamp(1.6rem, calc(1.2rem + 1.4vw), 2.1rem); font-weight: 700; margin: 8px 0 6px; }
.hero p { color: #b0ccda; margin: 0; max-width: 620px; }
.hero .eyebrow { color: #f47351; }
.hero .acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.btn-ghost-light { color: #fff; border: 1px solid rgba(255,255,255,.28); background: transparent; }
.btn-ghost-light:hover { background: rgba(255,255,255,.08); color: #fff; }
.home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.sec-title .more { margin-left: auto; font-size: .8125rem; font-weight: 600; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; }
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.area-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; color: var(--body); transition: border-color .2s, box-shadow .2s, transform .2s; }
.area-card:hover { border-color: var(--o-steel-400); box-shadow: 0 4px 12px rgba(13,29,45,.08); transform: translateY(-1px); text-decoration: none; color: var(--body); }
.area-card h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.area-card p { font-size: .8125rem; color: var(--muted); margin: 0; line-height: 1.5; }
.area-card .stat { font-family: var(--font-body); font-size: .72rem; color: var(--faint); margin-top: auto; }
.feed { display: flex; flex-direction: column; }
.feed .it { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed .it:first-child { padding-top: 0; }
.feed .it:last-child { border-bottom: 0; padding-bottom: 0; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--o-orange); margin-top: 7px; flex-shrink: 0; }
.feed .dot.n { background: var(--o-steel-400); }
.feed .t { font-size: .8438rem; font-weight: 600; color: var(--fg); }
.feed .t a { color: inherit; }
.feed .w { font-size: .72rem; color: var(--faint); margin-top: 2px; }
.recent svg.is-fav { color: #e8a53a; fill: currentColor; }

/* Página de área */
.area-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; }
.area-head .area-tile { width: 52px; height: 52px; border-radius: 12px; }
.area-head .area-tile svg { width: 26px; height: 26px; }
.area-head h1 { font-size: 1.75rem; font-weight: 700; margin: 4px 0; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.app-wrap { position: relative; min-width: 0; }
.app-card { display: flex; gap: 12px; align-items: flex-start; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--fg); transition: border-color .2s, box-shadow .2s; }
.app-card:hover { border-color: var(--o-steel-400); box-shadow: 0 4px 12px rgba(13,29,45,.08); text-decoration: none; color: var(--fg); }
.app-card .tile { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--sb-active-bg); color: var(--sb-active-fg); }
.app-card .tile svg { width: 19px; height: 19px; }
.app-card .body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
/* Los botones (favorito, editar) van arriba a la derecha: solo el título les deja espacio, así la
   descripción y las etiquetas usan todo el ancho y no se cortan */
.app-card .t { font-weight: 600; line-height: 1.3; padding-right: 66px; min-height: 26px; }
.app-card .kind { max-width: 100%; display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-card .d { font-size: .8125rem; color: var(--muted); line-height: 1.45; }
.app-card .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.app-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; }
.app-tools .icon-btn { width: 32px; height: 32px; color: var(--faint); }
.app-tools .icon-btn svg { width: 16px; height: 16px; }
.sb-space { display: block; margin: 2px 12px 0; font-family: var(--font-body); font-weight: 600; font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sb-muted); }
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lk-wrap { position: relative; min-width: 0; }
.lk { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--fg); min-width: 0; padding-right: 84px; }
.lk:hover { border-color: var(--o-steel-400); text-decoration: none; color: var(--fg); }
.lk .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--sunken); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lk .ic svg { width: 18px; height: 18px; }
.lk .t { font-weight: 600; font-size: .8438rem; }
.lk .s { font-size: .72rem; color: var(--faint); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-tools { position: absolute; top: 12px; right: 8px; display: flex; gap: 2px; }
.lk-tools .icon-btn { width: 32px; height: 32px; color: var(--faint); }
.lk-tools .icon-btn svg { width: 16px; height: 16px; }

/* Guía de publicación */
/* Índice de contenido a la izquierda */
.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.guide > .toc { order: -1; }
.doc { max-width: 800px; min-width: 0; }
.doc h1 { font-size: 1.9rem; font-weight: 700; margin: 8px 0 10px; }
.doc .lead { font-size: 1.0625rem; color: var(--muted); line-height: 1.6; margin: 0; }
.doc h2 { font-size: 1.25rem; font-weight: 700; margin: 36px 0 12px; display: flex; gap: 12px; align-items: center; scroll-margin-top: 80px; }
.doc h2 .num { font-family: var(--font-mono); font-size: .8rem; width: 30px; height: 30px; border-radius: 8px; background: var(--o-orange); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc h3 { font-size: 1rem; font-weight: 700; margin: 22px 0 8px; }
.doc p, .doc li { line-height: 1.65; }
.doc li { margin-bottom: 6px; }
.doc .tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; background: var(--surface); }
.doc table { width: 100%; border-collapse: collapse; font-size: .8438rem; min-width: 520px; }
.doc th { text-align: left; font-family: var(--font-body); font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 14px; background: var(--sunken); border-bottom: 1px solid var(--line); }
.doc td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc tr:last-child td { border-bottom: 0; }
.doc code, .doc .url { font-family: var(--font-mono); font-size: .78rem; background: var(--sunken); border-radius: 6px; padding: 1px 6px; color: var(--fg); overflow-wrap: anywhere; }
.doc .url { display: block; padding: 10px 12px; margin: 10px 0; line-height: 1.6; white-space: pre-wrap; }
.doc .url mark { background: rgba(240,78,36,.16); color: inherit; padding: 0 2px; border-radius: 3px; }
.callout { background: #fdf4e3; border-left: 3px solid #e8a53a; border-radius: 0 10px 10px 0; padding: 12px 14px; font-size: .8438rem; color: #2b2b2b; margin: 12px 0; }
[data-bs-theme="dark"] .callout { background: #2a2418; color: var(--body); }
.tip { background: var(--sunken); border-radius: 10px; padding: 12px 14px; font-size: .8438rem; display: flex; gap: 10px; align-items: flex-start; }
.tip svg { color: var(--o-orange); flex-shrink: 0; margin-top: 2px; }
.checklist { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; cursor: pointer; }
.checklist input { margin-top: 4px; accent-color: var(--o-orange); width: 16px; height: 16px; flex-shrink: 0; }
.toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.toc a { font-size: .8125rem; color: var(--muted); padding: 5px 10px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--fg); border-left-color: var(--o-orange); text-decoration: none; }
@media (max-width: 1100px) {
  .home-grid, .guide { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 575px) { .hero { padding: 22px 20px; } }

/* Reportes HTML */
.kind.html { background: #fef1ed; color: #b23211; }
[data-bs-theme="dark"] .kind.html { background: #34201a; color: #f79a7e; }

/* Enlaces a Claude */
.kind.claude { background: #f4eefc; color: #5b3aa8; }
[data-bs-theme="dark"] .kind.claude { background: #261c38; color: #c3a9f5; }
.claude-viewer { max-width: 560px; margin: 48px auto; padding: 32px; text-align: center; }
.claude-viewer-ico { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 12px; margin-bottom: 14px; background: #f4eefc; color: #5b3aa8; }
[data-bs-theme="dark"] .claude-viewer-ico { background: #261c38; color: #c3a9f5; }
.claude-viewer .btn svg { width: 16px; height: 16px; margin-right: 6px; }
.frame .html-report { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.typepick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.typepick label { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; cursor: pointer; background: var(--surface); margin: 0; }
.typepick label:has(input:checked) { border-color: var(--o-orange); background: var(--sb-active-bg); }
.typepick input { margin-top: 3px; accent-color: var(--o-orange); }
.typepick b { display: block; color: var(--fg); }
.typepick span span { font-size: .8125rem; color: var(--muted); }
fieldset[hidden] { display: none; }

/* Barra lateral reducida (solo íconos, escritorio) */
.sb { transition: width .2s; }
.logo-mark { display: none; height: 30px; width: 30px; }
@media (min-width: 992px) {
  html.sb-collapsed .sb { width: 72px; }
  html.sb-collapsed .sb-logo { padding: 14px 0 8px; flex-direction: column; justify-content: center; }
  html.sb-collapsed .sb-logo .logo-light, html.sb-collapsed .sb-logo .logo-dark { display: none !important; }
  html.sb-collapsed .sb-logo .logo-mark { display: block; }
  html.sb-collapsed .sb-space { display: none; }
  html.sb-collapsed .sb-sec { font-size: 0; padding: 0; margin: 12px 16px 8px; border-top: 1px solid var(--line); }
  html.sb-collapsed .sb-nav { padding: 0 10px; }
  html.sb-collapsed .sb-sec-toggle { width: auto; justify-content: center; padding: 8px 0 0; }
  html.sb-collapsed .sb-sec-toggle > span { display: none; }
  html.sb-collapsed .sb-link { justify-content: center; padding: 10px 0; }
  html.sb-collapsed .sb-link > span { display: none; }
  html.sb-collapsed .sb-link.active::before { left: -10px; }
  html.sb-collapsed .sb-user { justify-content: center; padding: 14px 0; }
  html.sb-collapsed .sb-user > div { display: none; }
}
@media (max-width: 991px) { .sb-collapse { display: none; } }

/* Prompt de Claude en la guía HTML */
.prompt-box { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; }
.prompt-box pre { margin: 0; padding: 16px 18px; padding-top: 48px; white-space: pre-wrap; font-family: var(--font-mono); font-size: .78rem; line-height: 1.6; color: var(--fg); background: none; max-height: 420px; overflow: auto; }
.prompt-copy { position: absolute; top: 10px; right: 10px; }

.token-new { border: 1px solid var(--o-orange); background: var(--sb-active-bg); border-radius: 10px; padding: 12px 14px; }
.token-value { font-family: var(--font-mono); font-size: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; color: var(--fg); }
.token-steps { padding-left: 18px; margin: 0; font-size: .8438rem; line-height: 1.5; }
.token-steps li { margin-bottom: 10px; }
.token-steps .token-value { flex: 1; min-width: 0; }

/* Avisos */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast-o { background: var(--fg); color: var(--surface); border-radius: 12px; padding: 12px 16px; font-size: .875rem; font-weight: 500; box-shadow: 0 12px 28px rgba(13,29,45,.18); display: flex; gap: 10px; align-items: center; transition: opacity .3s; }
.toast-o svg { width: 18px; height: 18px; color: var(--o-orange); flex-shrink: 0; }
.toast-o.hide { opacity: 0; }

/* Versión del portal (pie de la barra lateral) */
.sb-ver { padding: 0 20px 8px; font-size: .66rem; color: var(--sb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Catálogo: pestañas de servicios y, con uno elegido, sus etiquetas y organizaciones */
.catalog { display: block; }
.catalog-main { min-width: 0; }
.svc-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 12px; scrollbar-width: thin; }
.svc-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); font-size: .875rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.svc-tab:hover { border-color: var(--o-steel-400); color: var(--fg); text-decoration: none; }
.svc-tab svg { width: 17px; height: 17px; color: var(--faint); }
.svc-tab .n { font-family: var(--font-mono); font-size: .72rem; font-weight: 500; color: var(--faint); background: var(--sunken); border-radius: 999px; padding: 1px 7px; }
.svc-tab[aria-current="page"] { background: var(--sb-active-bg); border-color: var(--o-orange); color: var(--sb-active-fg); box-shadow: inset 0 -2px 0 var(--o-orange); }
.svc-tab[aria-current="page"] svg { color: var(--o-orange); }
.svc-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.chip-sm { padding: 3px 11px; font-size: .78rem; }
.chip .n { font-family: var(--font-mono); font-size: .7rem; opacity: .7; }
.org-pick { display: flex; gap: 6px; align-items: center; }
.org-pick .form-select { min-width: 220px; }
.rcard .tags-l { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; font-size: .72rem; }
.rcard .tags-l span { display: inline-flex; align-items: center; gap: 3px; background: var(--sunken); color: var(--muted); border-radius: 999px; padding: 1px 8px; }
.rcard .tags-l svg { width: 11px; height: 11px; }
.tag-admin { display: flex; flex-direction: column; gap: 6px; }
.tag-admin .row-t { display: flex; align-items: center; gap: 6px; }
.tag-admin .n { font-size: .75rem; color: var(--faint); min-width: 24px; text-align: right; }
.tag-pick .tag-area { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.tag-pick .tag-area-name { display: flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 600; margin-bottom: 6px; }
.tag-pick .tag-area-name svg { width: 15px; height: 15px; color: var(--faint); }
.tag-opts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-opt { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .8125rem; cursor: pointer; margin: 0; }
.tag-opt input { margin: 0; }
.tag-opt:has(input:checked) { background: var(--sb-active-bg); border-color: var(--o-orange); }
.tag-opts .tag-new { width: auto; flex: 1; min-width: 200px; }
.view-pick { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--surface); }
.view-pick .icon-btn { width: 32px; height: 30px; border-radius: 8px; color: var(--faint); }
.view-pick .icon-btn svg { width: 16px; height: 16px; }
.view-pick .icon-btn[aria-pressed="true"] { background: var(--sunken); color: var(--fg); }

/* Portada de las tarjetas */
.rcard .cover { border-radius: 14px 14px 0 0; overflow: hidden; display: flex; align-items: center; justify-content: center; aspect-ratio: 2 / 1; background: var(--sunken); border-bottom: 1px solid var(--line); color: var(--line); }
.rcard .cover img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.rcard .cover svg { width: 36px; height: 36px; }
.cover-drop { border: 1.5px dashed var(--line); border-radius: 12px; background: var(--sunken); min-height: 120px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cover-drop.over { border-color: var(--o-orange); background: var(--sb-active-bg); }
.cover-drop img { max-width: 100%; max-height: 260px; display: block; }
.cover-drop img[hidden] { display: none; }
.cover-msg { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .8438rem; padding: 16px; }
.cover-msg svg { width: 18px; height: 18px; color: var(--faint); }
.claude-cover { display: block; margin: -32px -32px 24px; border-bottom: 1px solid var(--line); background: var(--sunken); }
.claude-cover img { width: 100%; max-height: 320px; object-fit: cover; object-position: top center; display: block; border-radius: 14px 14px 0 0; }

/* Catálogo en lista: una fila por reporte (mismo HTML de las tarjetas) */
.list-r { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list-r > .empty { border: 0; }
.list-r .rcard { flex-direction: row; align-items: center; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.list-r .rcard:last-child { border-bottom: 0; }
.list-r .rcard:hover { transform: none; box-shadow: none; background: var(--sunken); }
.list-r .rcard .cover, .list-r .rcard .desc, .list-r .rcard .areas-l, .list-r .rcard .tags-l { display: none; }
.list-r .rcard .body { flex-direction: row; align-items: center; gap: 12px; padding: 10px 8px 10px 16px; min-width: 0; }
.list-r .rcard h3 { order: 1; flex: 1 1 auto; min-width: 0; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-r .rcard .top { order: 0; flex-wrap: nowrap; flex-shrink: 0; }
.list-r .rcard .top .fav { order: -1; margin-left: 0; }
.list-r .rcard .meta { order: 2; margin: 0; padding: 0; flex-wrap: nowrap; white-space: nowrap; flex-shrink: 0; }
.list-r .rcard .foot { border-top: 0; padding: 0 12px 0 0; flex-shrink: 0; }
.list-r .rcard .foot .open { font-size: 0; gap: 0; }
.list-r .rcard .foot .open svg { width: 18px; height: 18px; }

/* Accesos del servicio: edición en modal y modo «Ordenar» */
.sec-title .sec-actions { margin-left: auto; display: inline-flex; gap: 16px; }
.sec-title .sec-actions .more { margin-left: 0; }
.sort-hint { font-size: .8125rem; color: var(--muted); margin: -4px 0 12px; }
.lk-sort { display: none; position: absolute; top: 12px; right: 8px; gap: 2px; align-items: center; }
.lk-sort .grip { color: var(--faint); display: inline-flex; cursor: grab; }
.lk-sort .grip svg, .lk-sort .icon-btn svg { width: 16px; height: 16px; }
.lk-sort .icon-btn { width: 32px; height: 32px; color: var(--faint); }
.sort-ctl { display: none; }
.sorting .sort-off { display: none; }
.sorting .sort-ctl { display: inline-flex; align-items: center; gap: 2px; }
.sort-ctl .grip { color: var(--faint); display: inline-flex; cursor: grab; }
.sort-ctl .icon-btn { width: 32px; height: 32px; color: var(--faint); }
.sort-ctl svg { width: 16px; height: 16px; }
tbody.sorting tr { cursor: grab; }
tbody.sorting tr:first-child [data-move="-1"], tbody.sorting tr:last-child [data-move="1"] { visibility: hidden; }
.dragging { opacity: .45; }
.sortable-table td svg { width: 17px; height: 17px; color: var(--faint); }
.links.sorting .lk-sort { display: flex; }
.links.sorting .lk-wrap { cursor: grab; }
.links.sorting .lk { border-style: dashed; padding-right: 110px; }
.links.sorting .lk-wrap:first-child [data-move="-1"], .links.sorting .lk-wrap:last-child [data-move="1"] { visibility: hidden; }
.link-modal .modal-title { font-size: 1.0625rem; font-weight: 700; }

@media (max-width: 767px) {
  .list-r .rcard .meta, .list-r .rcard .top .kind { display: none; }
}

@media (max-width: 1100px) {
  .dash-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 991px) {
  .sb { position: fixed; z-index: 1040; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .app.sb-open .sb { transform: none; }
  .app.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(13,29,45,.55); z-index: 1030; }
  .sb-toggle { display: inline-flex; }
  .content { padding: 20px 16px 36px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 575px) {
  .v-actions { margin-left: 0; }
  .v-actions .lbl { display: none; }
  .v-actions .btn svg { margin-right: 0; }
  .meta-list > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* Ayuda, al final de la barra lateral (sobre el usuario) */
.sb-help { margin-top: auto; padding-top: 8px; padding-bottom: 8px; }
.sb-help + .sb-user { margin-top: 0; }
/* Pestañas de las guías */
.guide-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 28px; }
.guide-tabs a { display: inline-flex; gap: 8px; align-items: center; padding: 7px 14px 7px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg); transition: border-color .15s, box-shadow .15s; }
.guide-tabs a:hover { border-color: var(--o-steel-400); text-decoration: none; color: var(--fg); }
.guide-tabs a[aria-current="page"] { border-color: var(--o-orange); background: var(--sb-active-bg); }
.guide-tabs .gi { width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--sunken); flex-shrink: 0; }
.guide-tabs a[aria-current="page"] .gi { background: var(--o-orange); color: #fff; }
.guide-tabs .gi svg { width: 15px; height: 15px; }
.guide-tabs .gt { font-weight: 600; font-size: .875rem; }
.guide-tabs .gb { font-size: .625rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-text); margin-left: 6px; }
/* Catálogo en modo «Ordenar» */
.rcard .foot > .sort-off { display: contents; }
.sorting .rcard .foot > .sort-off, .sorting .rcard .fav { display: none; }
.list-r.sorting .rcard { cursor: grab; }
.list-r.sorting .rcard:first-child [data-move="-1"], .list-r.sorting .rcard:last-child [data-move="1"] { visibility: hidden; }
/* Ayuda */
.faq { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.faq summary { cursor: pointer; padding: 13px 0; font-weight: 600; color: var(--fg); list-style: none; display: flex; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--faint); font-weight: 400; font-size: 1.2rem; }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 0 14px; color: var(--body); font-size: .875rem; }
.faq details > div p:last-child, .faq details > div ul:last-child { margin-bottom: 0; }
.help-contact { display: flex; gap: 14px; align-items: center; }
/* «Ver como»: selector en la barra superior y franja de aviso */
.view-as { min-width: 300px; }
.view-as-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 24px; background: linear-gradient(var(--sb-active-bg), var(--sb-active-bg)), var(--surface); border-bottom: 1px solid var(--line); color: var(--fg); font-size: .875rem; position: sticky; top: 52px; z-index: 9; box-shadow: 0 2px 6px rgba(16, 24, 40, .06); }
.view-as-bar .ico { width: 18px; height: 18px; color: var(--o-orange); flex-shrink: 0; }
@media (max-width: 991px) { .view-as-bar { padding: 10px 16px; } }
/* Logo de la organización (Inicio de sus usuarios y administración): sobre fondo blanco, se vea como se vea el logo */
.org-logo { background: #fff; border-radius: 12px; padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; height: 72px; max-width: 220px; flex-shrink: 0; }
.org-logo img { max-height: 52px; max-width: 192px; width: auto; height: auto; object-fit: contain; }
.org-logo-sm { height: 56px; max-width: 160px; border: 1px solid var(--line); }
.org-logo-sm img { max-height: 36px; max-width: 132px; }
/* Plataforma UBM */
.ubm-links .lk { padding-right: 14px; }
.lk .d { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* Guías: esquema del portal y ejemplos de pedidos a Claude */
.schema { margin: 8px 0 18px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.schema svg { width: 100%; height: auto; display: block; }
.schema .sc-box { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.schema .sc-main { stroke: var(--o-orange); stroke-width: 2; }
.schema .sc-t { fill: var(--fg); font-size: 15px; font-weight: 700; }
.schema .sc-d { fill: var(--muted); font-size: 11.5px; }
.schema .sc-line { fill: none; stroke: var(--faint); stroke-width: 1.5; }
.schema .sc-dash { stroke-dasharray: 5 4; }
.schema .sc-head { fill: var(--faint); }
.schema .sc-lbl { fill: var(--muted); font-size: 11.5px; font-style: italic; }
.schema figcaption { font-size: .8125rem; color: var(--muted); margin-top: 10px; }
.ex-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 6px; }
.ex { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; background: var(--sunken); font-size: .875rem; }
.ex svg { width: 16px; height: 16px; color: var(--o-orange); flex-shrink: 0; margin-top: 2px; }

/* Visita guiada del Inicio (layouts/hub/_tour, optium.js): sobre el menú lateral móvil y los avisos */
.tour-layer { position: fixed; inset: 0; z-index: 2100; }
.tour-spot { position: fixed; z-index: 2101; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(13,29,45,.55); pointer-events: none; transition: top .25s, left .25s, width .25s, height .25s; }
.tour-spot.has-target { outline: 2px solid var(--o-orange); outline-offset: 2px; }
[data-bs-theme="dark"] .tour-spot { box-shadow: 0 0 0 9999px rgba(0,0,0,.65); }
.tour-card { position: fixed; z-index: 2102; width: min(340px, calc(100vw - 32px)); background: var(--surface); color: var(--body); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px 14px; box-shadow: 0 16px 40px rgba(13,29,45,.25); transition: top .25s, left .25s; }
.tour-card h3 { font-size: 1.0625rem; font-weight: 700; margin: 6px 0; }
.tour-card p { margin: 0 0 14px; font-size: .9rem; }
.tour-count { font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
.tour-actions { display: flex; align-items: center; gap: 6px; }
.tour-skip { padding-left: 0; padding-right: 0; color: var(--muted); }

/* 3.0.0 — secciones contraíbles de la página de servicio */
.sec-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 20px; }
.sec-nav .more { font-size: .8125rem; font-weight: 600; color: var(--link); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.sec-nav .chip[aria-pressed="false"] { opacity: .6; }
.sec-all { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 9px; margin-right: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: .8125rem; font-weight: 600; cursor: pointer; transition: color .15s, border-color .15s; }
.sec-all:hover { color: var(--fg); border-color: var(--o-steel-400); }
.sec-all svg { width: 15px; height: 15px; }
.sec-all[aria-expanded="true"] .i-expand, .sec-all[aria-expanded="false"] .i-collapse { display: none; }
.sec-all span { display: inline-flex; }
.sec-toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 2px 4px 2px 0; margin: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 6px; }
.sec-toggle .chev { width: 16px; height: 16px; transition: transform .15s; }
.sec.is-closed .sec-toggle .chev { transform: rotate(-90deg); }
.sec.is-closed { margin-bottom: 12px !important; }
/* Página de servicio: «Solo esta vista», «Agregar…» y «Ordenar» junto al título, no al extremo derecho */
.sec > .sec-title .sec-actions { margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line); gap: 14px; }
@media (max-width: 575.98px) { .sec > .sec-title .sec-actions { margin-left: 0; padding-left: 0; border-left: 0; } }
.sec.is-closed > .sec-title { margin-bottom: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sec.is-closed .sec-title [data-sec-only], .sec.is-closed .sec-title .sec-open-only { display: none; }
.lk { padding-right: 80px; }

/* Aplicación abierta, bajo su servicio en el menú */
.sb-sub { display: flex; align-items: center; gap: 8px; margin: 1px 0 2px 34px; padding: 4px 10px; border-left: 2px solid var(--o-orange); color: var(--sb-active-fg); font-size: .8438rem; font-weight: 500; text-decoration: none; }
.sb-sub svg { width: 15px; height: 15px; flex: none; }
.sb-sub span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-sub:hover { text-decoration: none; color: var(--sb-active-fg); }
html.sb-collapsed .sb-sub { display: none; }

/* Accesibilidad: saltar al contenido, foco en el menú y objetivos táctiles */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 3000; background: var(--fg); color: var(--surface); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; color: var(--surface); text-decoration: none; }
.sb-link:focus-visible, .chip:focus-visible, .sec-toggle:focus-visible { outline: 2px solid var(--o-orange); outline-offset: 2px; }
@media (pointer: coarse) {
  .icon-btn, .fav { min-width: 40px; min-height: 40px; }
  .sb-link { padding-top: 9px; padding-bottom: 9px; }
}

/* Celular */
@media (max-width: 575px) {
  .content { padding: 16px 12px 32px; }
  .page-head h1 { font-size: 1.4rem; }
  .page-head > .d-flex { margin-left: 0 !important; width: 100%; flex-wrap: wrap; }
  .area-head { flex-wrap: wrap; }
  .area-head .btn { margin-left: 0 !important; }
  .grid-r, .apps, .links, .areas { grid-template-columns: minmax(0, 1fr); }
  .filters { flex-wrap: wrap; }
  .filters .view-pick { margin-left: 0 !important; }
  .sec-title { flex-wrap: wrap; }
  .sec-title .sec-actions { width: 100%; margin-left: 0; }
  .hero h1 { font-size: 1.45rem; }
  .table-o { display: block; overflow-x: auto; }
  .modal-dialog { margin: 8px; }
}

/* Formulario de aplicación: lista de organizaciones con casillas y buscador */
.app-modal .modal-body { overflow-x: hidden; }
.app-modal .form-control, .app-modal .form-select, .app-modal .input-group { max-width: 100%; min-width: 0; }
.check-list { border: 1px solid var(--line); border-radius: 10px; max-height: 220px; overflow-y: auto; padding: 4px 0; background: var(--surface); }
.check-list label { display: flex; align-items: center; gap: 10px; padding: 6px 12px; margin: 0; cursor: pointer; font-size: .875rem; }
.check-list label:hover { background: var(--sunken); }
.check-list label[hidden] { display: none; }
.check-list .muted { color: var(--faint); font-size: .78rem; margin-left: auto; }
.check-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.check-tools .form-control { flex: 1; }

/* Alta de usuario: tipo de cuenta */
.acct-type { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 4px; }
.acct-type label { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 10px; border-radius: 7px; font-size: .875rem; font-weight: 600; color: var(--muted); cursor: pointer; margin: 0; }
.acct-type input { position: absolute; opacity: 0; pointer-events: none; }
.acct-type input:checked + label { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(13,29,45,.12); }
.acct-type input:focus-visible + label { outline: 2px solid var(--o-orange); outline-offset: 2px; }
.acct-type svg { width: 16px; height: 16px; }

/* Barra superior compacta: ruta de la página, cuenta solo con avatar */
.tb-crumbs { margin: 0; flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.tb-crumbs > span:last-child { overflow: hidden; text-overflow: ellipsis; color: var(--fg); font-weight: 500; }
.tb-crumbs a { flex-shrink: 0; }
.tb-account { border: 0; background: none; padding: 2px; border-radius: 50%; display: inline-flex; cursor: pointer; }
.tb-account:hover .avatar, .tb-account:focus-visible .avatar, .tb-account[aria-expanded=true] .avatar { box-shadow: 0 0 0 3px var(--line); }
.topbar .avatar { width: 32px; height: 32px; }
.tb-who { padding: 8px 16px 4px; max-width: 300px; }
.tb-who .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 575px) {
  .tb-crumbs > :not(:first-child) { display: none; }
}

/* Avatares: ícono o iniciales sobre un color elegido en Mi perfil */
.avatar svg { width: 58%; height: 58%; }
.avatar.av-naranja { background: #f04e24; } .avatar.av-marino { background: #12273b; } .avatar.av-acero { background: #3c6e8f; }
.avatar.av-verde { background: #1e8a57; } .avatar.av-morado { background: #6b4fa3; } .avatar.av-ambar { background: #b8700a; }
.avatar.av-grafito { background: #4a4846; }
[data-bs-theme="dark"] .avatar.av-marino { background: #2f5878; }
.av-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.av-opt { position: relative; cursor: pointer; margin: 0; }
.av-opt input { position: absolute; opacity: 0; pointer-events: none; }
.av-ico, .av-sw { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--fg); background: var(--surface); font-size: .8125rem; font-weight: 600; }
.av-ico svg { width: 20px; height: 20px; }
.av-sw { border-radius: 50%; border: 0; }
.av-sw.av-naranja { background: #f04e24; } .av-sw.av-marino { background: #12273b; } .av-sw.av-acero { background: #3c6e8f; }
.av-sw.av-verde { background: #1e8a57; } .av-sw.av-morado { background: #6b4fa3; } .av-sw.av-ambar { background: #b8700a; } .av-sw.av-grafito { background: #4a4846; }
.av-opt:hover .av-ico { background: var(--sunken); }
.av-opt input:checked + .av-ico { border-color: var(--o-orange); box-shadow: 0 0 0 2px var(--o-orange); }
.av-opt input:checked + .av-sw { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--o-orange); }
.av-opt input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }

/* Monitoreo de Plataforma UBM (UbmMonitor): luz por enlace y resumen */
.mon { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--muted); }
.mon .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.mon-ok .dot { background: var(--ok); }
.mon-warning .dot { background: #e8a53a; }
.mon-down .dot { background: var(--bad); box-shadow: 0 0 0 3px rgba(201,42,42,.18); }
.mon-down { color: var(--bad); font-weight: 600; }
.lk .mon { margin-top: 2px; }
.mon-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 18px; }
.mon-summary .mon { font-size: .8125rem; }

/* Modo enfoque del visor: sin menú lateral ni barra superior; el reporte ocupa la ventana bajo una franja mínima */
.focus-bar { display: none; }
html.focus-mode .sb, html.focus-mode .sb-backdrop, html.focus-mode .topbar, html.focus-mode .view-as-bar, html.focus-mode .v-head { display: none !important; }
html.focus-mode .focus-bar { display: flex; align-items: center; gap: 14px; position: fixed; top: 0; left: 0; right: 0; height: 44px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 30; font-size: .875rem; }
html.focus-mode .focus-bar .focus-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; flex-shrink: 0; }
html.focus-mode .focus-bar .focus-back svg { width: 16px; height: 16px; }
html.focus-mode .focus-bar .focus-title { flex: 1; min-width: 0; color: var(--fg); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.focus-mode .focus-bar .btn svg { width: 15px; height: 15px; }
html.focus-mode .frame:not(:fullscreen) { position: fixed; top: 44px; left: 0; right: 0; bottom: 0; height: auto; border: 0; border-radius: 0; z-index: 20; }
html.focus-mode body { overflow: hidden; }
@media (max-width: 575px) { html.focus-mode .focus-bar .focus-back span { display: none; } }
.frame .report-error { position: absolute; inset: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.frame .report-error[hidden] { display: none; }
.frame #reportClientError { inset: 0; background: var(--surface); z-index: 2; }
.frame .report-loading { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; color: var(--muted); font-size: .875rem; pointer-events: none; z-index: 1; }

/* Avisos de error: fijos hasta cerrarlos, con color propio. Y el error dentro de una ventana reabierta */
.toast-o.err { background: #8f1d1d; color: #fff; align-items: flex-start; }
.toast-o.err svg { color: #ffd8d2; margin-top: 1px; }
.toast-x { border: 0; background: none; color: inherit; padding: 0; margin-left: auto; cursor: pointer; opacity: .8; line-height: 0; flex-shrink: 0; }
.toast-x:hover, .toast-x:focus-visible { opacity: 1; }
.toast-x svg { width: 16px; height: 16px; color: #fff; }
.modal-error { border: 1px solid var(--bad); border-left-width: 4px; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; color: var(--fg); font-size: .875rem; background: rgba(201,42,42,.07); }

/* Estados: colores propios, distintos de los de tipo de reporte */
.kind.warn { background: #fdf3dc; color: #7a4d00; }
[data-bs-theme="dark"] .kind.warn { background: #33280f; color: #f0c268; }
.kind.bad { background: #fde8e8; color: #9b1c1c; }
[data-bs-theme="dark"] .kind.bad { background: #3a1818; color: #ff9c9c; }

/* Franja del modo enfoque: acciones del reporte a mano */
html.focus-mode .focus-bar .icon-btn { width: 34px; height: 34px; }
html.focus-mode .focus-bar .icon-btn[aria-pressed="true"] svg { fill: #e8a53a; color: #e8a53a; }
html.focus-mode .focus-bar .focus-actions { display: flex; align-items: center; gap: 2px; }

/* Menú móvil cerrado: fuera del orden de tabulación y del lector de pantalla */
@media (max-width: 991px) {
  .sb { visibility: hidden; transition: transform .2s, visibility 0s .2s; }
  .app.sb-open .sb { visibility: visible; transition: transform .2s; }
}
/* Celular: en el visor el buscador no cabe junto a la ruta */
@media (max-width: 575px) { .topbar .tb-crumbs ~ .search { display: none; } }
/* Pantallas táctiles: enlaces de acción, chips y paginación con al menos 40 px de alto */
@media (pointer: coarse) {
  .more, .reload-link { min-height: 40px; display: inline-flex; align-items: center; }
  .chip, .chip-sm { min-height: 40px; }
  .pager .pagination li > a, .pager .pagination li > span { min-width: 40px; height: 40px; }
  .dataTables_paginate .pagination .page-link { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
}
.chart-msg { color: var(--muted); font-size: .875rem; text-align: center; padding: 24px 0; }
