/* ==========================================================================
   MyEfacts v2 — hoja de estilos (sin dependencias externas)
   Colores derivados del logotipo: azul tinta, cian y verde.
   ========================================================================== */
:root {
  --ink: #3b3f5c;
  --ink-2: #2d3049;
  --primary: #3b3f5c;
  --primary-hover: #2d3049;
  --accent: #0e9bbd;
  --accent-soft: #e3f5fa;
  --ok: #15803d;      --ok-soft: #e4f6ea;
  --warn: #b45309;    --warn-soft: #fff3dc;
  --danger: #c0392b;  --danger-soft: #fdeceb;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --zebra: #eff2f9;
  --border: #e3e6ee;
  --text: #1f2437;
  --muted: #6b7288;
  --shadow: 0 1px 2px rgba(31, 36, 55, .06), 0 4px 16px rgba(31, 36, 55, .05);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 264px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #5b63a8; --primary-hover: #6f77c2;
    --accent: #3cc3e2; --accent-soft: #123846;
    --ok: #4ade80; --ok-soft: #12301f;
    --warn: #fbbf24; --warn-soft: #3a2a0c;
    --danger: #f87171; --danger-soft: #3b1717;
    --bg: #12141f; --surface: #1b1e2e; --surface-2: #20243a; --zebra: #232842; --border: #2c3150;
    --text: #e7e9f3; --muted: #9aa1bd;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25);
  }
  .brand img, .auth-logo { background: #fff; border-radius: 10px; padding: 6px 10px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.spacer { flex: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Iconos */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
.ico.sm { width: 14px; height: 14px; vertical-align: -2px; }
.ico.lg { width: 26px; height: 26px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; text-decoration: none !important; line-height: 1.2; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--danger-soft); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 12px 18px; font-size: 16px; }
.btn-block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-ghost.is-loading::after { border-color: var(--border); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.is-locked, .icon-btn:disabled { opacity: .3; cursor: not-allowed; background: transparent; }
.icon-btn.act-danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.act-ok:hover { background: var(--ok-soft); color: var(--ok); }
.icon-btn.act-accent:hover { background: var(--accent-soft); color: var(--accent); }

/* Formularios */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field > label, .field.inline > label { font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; min-width: 0; }
input:disabled { background: var(--surface-2); color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.inline input { width: auto; }
.input-group { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-group input { border: 0; box-shadow: none !important; background: transparent; }
.input-group .icon-btn { margin-right: 3px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: 1 / -1; }

/* Alertas */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

/* ------------------------------------------------------------------ Layout app */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--border); z-index: 30; }
.brand { display: block; padding: 4px 8px 16px; }
.brand img { width: 100%; height: auto; }
.nav { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 500; text-decoration: none !important; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.user-meta { min-width: 0; display: grid; }
.user-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.user-meta small { color: var(--muted); font-size: 12px; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 18px 28px 0; }
.page-title { font-size: 22px; font-weight: 700; }
.content { padding: 18px 28px 24px; flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.content > #page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.content > #page > .card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.content > #page > .card > #tabla { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.foot { padding: 14px 28px; color: var(--muted); font-size: 12px; }
.only-mobile { display: none; }
.scrim { display: none; }
.crumbs { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }

/* Tarjetas / panel */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.welcome { margin-bottom: 18px; }
.welcome h2 { font-size: 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tile { display: grid; gap: 6px; align-content: start; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.tile-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 6px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* Barra de herramientas y tabla */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.toolbar-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; }
.table-wrap { overflow: auto; flex: 1; min-height: 0; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 11px 12px; white-space: nowrap; border-bottom: 1px solid var(--border); }
.grid th.sortable { cursor: pointer; user-select: none; }
.grid th.sortable:hover { color: var(--text); }
.grid th .sort { display: inline-block; margin-left: 4px; opacity: .45; }
.grid th.sorted .sort { opacity: 1; color: var(--accent); }
.grid td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.grid tbody tr:nth-child(even) { background: var(--zebra); }
.grid tbody tr:hover { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.dense .grid td { padding: 5px 12px; }
.dense .grid th { padding: 9px 12px; }
.dense .grid .acts .icon-btn { width: 28px; height: 28px; }
.field.inline select { width: auto; padding-right: 28px; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .ctr { text-align: center; }
.grid .acts { white-space: nowrap; text-align: right; }
.grid .acts .icon-btn { width: 32px; height: 32px; }
.grid-foot { position: sticky; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager button { min-width: 32px; height: 32px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; color: var(--text); cursor: pointer; font: inherit; }
.pager button:hover:not(:disabled) { border-color: var(--accent); }
.pager button.is-current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager button:disabled { opacity: .4; cursor: default; }
.skeleton td > span { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Insignias */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
button.badge { border: 0; cursor: pointer; font-family: inherit; }

/* Modales (<dialog>) */
dialog.modal { border: 0; padding: 0; border-radius: 16px; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 24px); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(10, 12, 25, .35); }
dialog.modal.modal-sm { width: min(440px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(15, 18, 35, .55); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-form { display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 20px; overflow: auto; display: grid; gap: 16px; }
.modal-body.grid-2 { grid-template-columns: 1fr 1fr; }
.modal-foot { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }

/* Avisos emergentes */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 100; max-width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--ink-2); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.28); animation: pop .2s ease-out; font-size: 14px; }
.toast.ok { border-left: 4px solid #22c55e; }
.toast.error { border-left: 4px solid #f87171; }
.toast.info { border-left: 4px solid var(--accent); }
.toast.warn { border-left: 4px solid #fbbf24; }

/* Confirmación */
.confirm-msg { margin: 0; white-space: pre-line; }

/* ------------------------------------------------------------------ Acceso */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(1200px 600px at 10% 0%, #4a4f7a 0%, transparent 60%), linear-gradient(160deg, #3b3f5c, #23263b); color: #fff; display: grid; place-items: center; padding: 48px; }
.hero-inner { max-width: 460px; position: relative; z-index: 2; }
.hero-fx { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1.4px); background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 78%); mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 78%); }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: orb-drift 18s ease-in-out infinite alternate; }
.orb-1 { width: 380px; height: 380px; background: #2bb6d6; top: -90px; left: -80px; opacity: .32; }
.orb-2 { width: 320px; height: 320px; background: #22c58a; bottom: -80px; right: -60px; opacity: .28; animation-duration: 22s; animation-delay: -6s; }
.orb-3 { width: 260px; height: 260px; background: #7c6cf0; top: 45%; left: 55%; opacity: .26; animation-duration: 26s; animation-delay: -12s; }
@keyframes orb-drift { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,-40px) scale(1.12); } 100% { transform: translate(-40px,50px) scale(.95); } }
.hero-inner { display: flex; align-items: center; gap: 16px; max-width: none; }
.hp { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.hero-mark { width: 64px; height: auto; flex: none; margin: 0; filter: drop-shadow(0 8px 16px rgba(0,0,0,.35)); animation: mark-float 7s ease-in-out infinite; }
.auth-hero h2 { font-size: 30px; white-space: nowrap; }
.iso { position: absolute; right: 8%; bottom: 3%; width: 190px; height: 190px; perspective: 900px; opacity: .85; }
.layer { position: absolute; inset: 0; border-radius: 22px; border: 2px solid rgba(255,255,255,.55);
  transform: rotateX(62deg) rotateZ(45deg); animation: layer-float 7s ease-in-out infinite; backdrop-filter: blur(1px); }
.layer.l1 { border-color: rgba(95,211,234,.85); background: rgba(95,211,234,.08); animation-delay: 0s; }
.layer.l2 { border-color: rgba(52,211,153,.8); background: rgba(52,211,153,.07); animation-delay: -2.3s; }
.layer.l3 { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.05); animation-delay: -4.6s; }
@keyframes layer-float {
  0%, 100% { transform: translateY(var(--y, 0)) rotateX(62deg) rotateZ(45deg); }
  50% { transform: translateY(calc(var(--y, 0px) - 18px)) rotateX(62deg) rotateZ(45deg); } }
.layer.l1 { --y: 0px; } .layer.l2 { --y: -34px; } .layer.l3 { --y: -68px; }
@keyframes mark-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) { .orb, .hero-mark, .layer { animation: none; } }
.hero-badge { display: inline-grid; place-items: center; width: 104px; height: 104px; margin-bottom: 28px; background: #fff; border-radius: 28px; box-shadow: 0 12px 32px rgba(0, 0, 0, .3); }
.hero-badge img { width: 72px; height: auto; }
.auth-hero h2 { font-size: 30px; line-height: 1.15; margin: 0; white-space: nowrap; }
.auth-hero p { color: #c9cde6; margin: 0 0 24px; font-size: 16px; }
.auth-hero ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-hero li { display: flex; gap: 10px; align-items: center; color: #e4e7f7; }
.auth-hero .ico { color: #5fd3ea; }
.auth-panel { display: grid; place-items: center; align-content: center; gap: 18px; padding: 32px 20px; background: var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 32px; }
.auth-logo { width: 220px; margin: 0 auto 22px; }
.auth-title { font-size: 24px; }
.auth-sub { color: var(--muted); margin: 6px 0 20px; }
.auth-foot { color: var(--muted); font-size: 12px; margin: 0; }
.error-page { text-align: center; padding: 48px 12px; display: grid; gap: 10px; justify-items: center; }
.error-code { font-size: 72px; font-weight: 800; color: var(--accent); line-height: 1; }

/* ------------------------------------------------------------------ Visor CPE */
body.visor { display: flex; flex-direction: column; height: 100vh; background: var(--surface-2); }
.visor-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.visor-title { display: flex; align-items: center; gap: 8px; }
.visor-actions { display: flex; gap: 8px; }
.visor-frame { flex: 1; width: 100%; border: 0; }

/* ------------------------------------------------------------------ Responsivo */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 18, 35, .5); z-index: 20; }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 14px 16px 0; }
  .content { padding: 14px 16px 24px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
/* Teléfonos: la lista pasa a tarjetas apiladas y la página se desplaza completa */
@media (max-width: 700px) {
  .content { padding: 12px 12px 20px; }
  .content > #page, .content > #page > .card, .content > #page > .card > #tabla { display: block; flex: none; }
  .table-wrap { overflow: visible; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
  .toolbar .spacer { display: none; }
  .toolbar .search, .toolbar .toolbar-actions, .toolbar > .field.inline:only-of-type { grid-column: 1 / -1; }
  .toolbar .field.inline { min-width: 0; }
  .toolbar .field.inline input, .toolbar .field.inline select { width: 100%; min-width: 0; flex: 1; }
  .toolbar > .btn { justify-content: center; }
  .toolbar .toolbar-actions { margin-left: 0; width: 100%; }
  .grid, .grid tbody { display: block; }
  .grid thead { display: none; }
  .grid tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .grid td { display: block; padding: 2px 0; border: 0; text-align: left !important; min-width: 0; overflow-wrap: anywhere; }
  .grid td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .grid td.wide { grid-column: 1 / -1; order: -1; }
  .grid td[colspan] { grid-column: 1 / -1; }
  .grid td.acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; padding-top: 6px; border-top: 1px dashed var(--border); margin-top: 4px; }
  .grid td.acts::before { display: none; }
  .grid .acts .icon-btn { width: 40px; height: 40px; }
  .grid tr.skeleton td::before { display: none; }
  .grid-foot { position: static; border-radius: 0 0 var(--radius) var(--radius); }
  .dense .grid tbody tr { padding: 8px 14px; }
  .dense .grid td { padding: 1px 0; }
}
@media (max-width: 560px) {
  .grid-2, .modal-body.grid-2 { grid-template-columns: 1fr; }
  .toolbar-actions { margin-left: 0; width: 100%; }
  .toolbar-actions .btn { flex: 1; }
  .search { max-width: none; }
}

/* ------------------------------------------------------------------ Impresión */
@media print {
  .sidebar, .topbar .only-mobile, .toolbar, .grid-foot, .toasts, .foot, .crumbs, .acts, th.no-print, td.no-print { display: none !important; }
  .shell, .main { display: block; height: auto; overflow: visible; }
  .content, .content > #page, .content > #page > .card, .content > #page > .card > #tabla { display: block; overflow: visible; }
  .table-wrap { overflow: visible; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 0; }
  .content { padding: 0; }
  .grid th { position: static; background: #eee !important; color: #000; }
  .badge { border: 1px solid #999; background: none !important; color: #000 !important; }
}

/* Ajustes de tabla */
.grid .nowrap { white-space: nowrap; }
.grid small { font-size: 12px; }

/* Estado de certificado / formatos en la lista de empresas */
.icon-btn.ico-cert { color: #c026d3; }
.icon-btn.ico-fmt  { color: #ea8a00; }
.icon-btn.ico-none { color: color-mix(in srgb, var(--muted) 45%, transparent); }
.icon-btn.ico-cert:hover { background: #fae8ff; }
.icon-btn.ico-fmt:hover  { background: #fff1d6; }
