/* =====================================================================
   AGEON · Estilos
   ===================================================================== */
:root {
  /* AGEON: tinta + verde neón */
  --brand: #00874A;        /* verde legible sobre blanco (enlaces, foco, bordes activos) */
  --brand-600: #006B3A;
  --brand-50: #E8FBF0;
  --accent: #39FF88;       /* verde neón (botón principal, detalles sobre oscuro) */
  --accent-hover: #22EC74;
  --accent-soft: #39FF88;
  --green: #00A651;        /* verde de marca para gráficos e iconos */
  --navy: #0E0C1D;         /* tinta */
  --ink-2: #17142C;

  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --text: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --ring: rgba(0, 166, 81, .28);

  --ok: #059669;   --ok-bg: #ECFDF5;
  --ko: #DC2626;   --ko-bg: #FEF2F2;
  --warn: #B45309; --warn-bg: #FFFBEB;
  --info: #0369A1; --info-bg: #F0F9FF;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --sidebar-w: 248px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-50: rgba(57, 255, 136, .10);
    --brand: #39FF88;
    --bg: #0B0A17;
    --surface: #141226;
    --surface-2: #0E0C1D;
    --text: #E2E8F0;
    --muted: #94A3B8;
    --border: #2A2645;
    --ring: rgba(57, 255, 136, .25);
    --ok-bg: rgba(5, 150, 105, .15);
    --ko-bg: rgba(220, 38, 38, .15);
    --warn-bg: rgba(180, 83, 9, .18);
    --info-bg: rgba(3, 105, 161, .18);
    --ok: #34D399; --ko: #F87171; --warn: #FBBF24; --info: #38BDF8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { 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); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) { a { color: var(--accent-soft); } }
h1, h2, h3 { line-height: 1.25; margin: 0; }
code { font-family: var(--mono); font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.ico { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------- Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 14px/1.2 var(--font); cursor: pointer; text-decoration: none !important;
  background: var(--surface); color: var(--text); transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn-primary { background: var(--accent); color: var(--navy) !important; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 0 4px rgba(57, 255, 136, .18); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text) !important; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--ko); color: #fff !important; }
.btn-danger:hover { filter: brightness(.92); }
.btn-danger-ghost { background: transparent; border-color: var(--border); color: var(--ko) !important; }
.btn-danger-ghost:hover { background: var(--ko-bg); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; color: var(--text); padding: 6px; border-radius: 8px; cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--surface-2); }

/* --------------------------------------------------------- Formularios */
.form { display: flex; flex-direction: column; gap: 16px; }
.form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: contents; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field-row label { font-weight: 600; font-size: 13.5px; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search],
input[type=date], input[type=number], input:not([type]), select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: 15px/1.3 var(--font); color: var(--text); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; margin: 0; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.check.inline { align-items: center; }
.check.inline input { margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-gap { margin-bottom: 20px; }
.input-pass { position: relative; }
.input-pass input { padding-right: 44px; }
.pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.pass-toggle:hover { color: var(--text); }
.strength { height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; background: var(--ko); transition: width .2s, background .2s; }
.link-sm { font-size: 13px; }

/* -------------------------------------------------------------- Alertas */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert .ico { margin-top: 1px; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-error { background: var(--ko-bg); color: var(--ko); border-color: color-mix(in srgb, var(--ko) 25%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

/* --------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge-lg { padding: 5px 12px; font-size: 13px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-ko { background: var(--ko-bg); color: var(--ko); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* =====================================================================
   Pantallas de acceso
   ===================================================================== */
.auth { display: grid; grid-template-columns: minmax(320px, 44%) 1fr; min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden; color: #E8E6F5; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 520px at -10% 110%, rgba(57, 255, 136, .20), transparent 60%),
              radial-gradient(700px 460px at 110% -10%, rgba(0, 166, 81, .22), transparent 60%),
              #0E0C1D;
}
.auth-brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12;
  background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
}
.auth-logo { width: 200px; height: auto; position: relative; z-index: 1; }
.auth-claim { position: relative; z-index: 1; max-width: 420px; }
.auth-claim h2 { font-size: 34px; color: #fff; letter-spacing: -.5px; margin-bottom: 14px; }
.auth-claim p { font-size: 16px; color: #B9B6CF; margin: 0; }
.auth-claim em { font-style: normal; color: var(--accent); text-shadow: 0 0 18px rgba(57, 255, 136, .45); }
.auth-brand small { position: relative; z-index: 1; color: #8F8BAA; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-logo-mobile { display: none; width: 170px; margin-bottom: 28px; }
.auth-title { font-size: 26px; letter-spacing: -.3px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin: 0 0 24px; }
.auth-alt { margin-top: 22px; text-align: center; color: var(--muted); font-size: 14px; }
.auth-message { text-align: center; }
.auth-message-icon { width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); background: var(--navy); box-shadow: 0 0 24px rgba(57, 255, 136, .25); }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-logo-mobile { display: block; }
  .auth-main { align-items: flex-start; padding-top: 48px; }
}

/* =====================================================================
   Aplicación
   ===================================================================== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: linear-gradient(180deg, #0E0C1D, #121027 70%, #141128);
  color: #B9B6CF; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo { display: block; padding: 22px 20px 18px; }
.sidebar-logo img { width: 140px; height: auto; display: block; }
.nav { display: flex; flex-direction: column; padding: 4px 12px 20px; gap: 2px; flex: 1; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: #77729A; padding: 18px 10px 6px; font-weight: 700; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: #B9B6CF !important; font-size: 14px; text-decoration: none !important; }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff !important; }
.nav-link.active { background: rgba(57, 255, 136, .10); color: #fff !important; box-shadow: inset 3px 0 0 var(--accent-soft); }
.nav-link.active .ico { color: var(--accent); filter: drop-shadow(0 0 6px rgba(57, 255, 136, .6)); }
.sidebar-foot { padding: 14px 22px; font-size: 12px; color: #4F4A6E; }
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar-spacer { flex: 1; }
.centro-select { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.centro-select select { width: auto; min-width: 200px; padding: 7px 10px; font-weight: 600; }
.centro-select.static span { color: var(--text); font-weight: 600; }
.only-mobile { display: none; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: 10px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--navy); background: var(--accent); }
.user-name { display: flex; flex-direction: column; font-size: 14px; font-weight: 600; line-height: 1.2; }
.user-name small { color: var(--brand); font-weight: 600; font-size: 11px; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; }
.user-dropdown a, .user-dropdown button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border-radius: 8px; font: 14px var(--font); color: var(--text) !important; background: none; border: 0; cursor: pointer; text-decoration: none !important; text-align: left; }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--surface-2); }
.user-dropdown form { margin: 0; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }

.content { padding: 28px 28px 48px; max-width: 1280px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; letter-spacing: -.3px; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; }
.head-actions form { margin: 0; }
.back { font-size: 13px; color: var(--muted) !important; display: inline-block; margin-bottom: 6px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; min-width: 0; }
.card-narrow { max-width: 560px; }
.card-title { font-size: 16px; margin-bottom: 16px; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-title-row .card-title { margin: 0; }
.card-title-row form { margin: 0; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-main > .card { margin-bottom: 0; }
.grid-main { margin-bottom: 20px; }

/* Estadísticas */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text) !important; text-decoration: none !important; position: relative; }
a.stat:hover { border-color: var(--brand); }
.stat-icon { position: absolute; right: 16px; top: 16px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
@media (prefers-color-scheme: dark) { .stat-icon { color: var(--accent-soft); } }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat-value.ok { color: var(--ok); } .stat-value.ko { color: var(--ko); }
.stat-label { color: var(--muted); font-size: 13.5px; }
.stats-inline { margin: 18px 0 0; }
.stats-inline .stat { box-shadow: none; background: var(--surface-2); padding: 12px 16px; }
.stats-inline .stat-value { font-size: 22px; }

/* Mosaicos de apartados */
.tiles-group { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 6px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text) !important; text-decoration: none !important; font-weight: 600; font-size: 14px; }
.tile:hover { border-color: var(--brand); background: var(--brand-50); }
.tile small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.tile-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: var(--navy); flex: none; }

/* Línea de tiempo */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.timeline li > div { display: flex; flex-direction: column; min-width: 0; }
.timeline small { font-size: 12px; }
.list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.list-plain li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Tablas */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td form { margin: 0; display: inline; }
.table-compact td { padding: 9px 12px; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--surface-2); }
.ua { color: var(--muted); font-size: 12.5px; max-width: 280px; }
.diff-old { color: var(--ko); background: var(--ko-bg); font-family: var(--mono); font-size: 13px; word-break: break-all; }
.diff-new { color: var(--ok); background: var(--ok-bg); font-family: var(--mono); font-size: 13px; word-break: break-all; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; padding: 8px 10px; font-size: 14px; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; }
.toolbar .search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search input { width: 100%; padding-left: 32px; }
.toolbar label.inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.toolbar-form { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted) !important; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; white-space: nowrap; }
.tab.active { color: var(--brand) !important; border-color: var(--brand); }
.tab .count { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; flex-wrap: wrap; }
.pagination div { display: flex; gap: 8px; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .ico { opacity: .5; }

.dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.actions-list { display: flex; flex-direction: column; gap: 8px; }
.actions-list form { margin: 0; }
.actions-list .btn { justify-content: flex-start; }

/* Matriz de permisos */
.levels-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.levels-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lv, .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lv-0 { background: var(--border); } .lv-1 { background: #38BDF8; } .lv-2 { background: #6366F1; } .lv-3 { background: #059669; }
.dot { border-radius: 50%; } .dot-ok { background: var(--green); } .dot-ko { background: var(--ko); }
.set-all { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.matrix { display: flex; flex-direction: column; }
.matrix-group { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 16px 0 8px; }
.matrix-group:first-child { padding-top: 0; }
.matrix-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.matrix-mod { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; padding: 3px; background: var(--surface-2); gap: 2px; }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: block; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.seg-opt input:checked + span { color: #fff; }
.lv-opt-0 input:checked + span { background: #64748B; }
.lv-opt-1 input:checked + span { background: #0284C7; }
.lv-opt-2 input:checked + span { background: #4F46E5; }
.lv-opt-3 input:checked + span { background: #059669; }
fieldset:disabled .seg-opt { cursor: default; }

/* Gráfico de barras */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; margin-top: 20px; padding-bottom: 22px; overflow-x: auto; }
.bar-col { flex: 1 0 18px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar { width: 100%; max-width: 28px; min-height: 2px; background: var(--green); border-radius: 4px 4px 0 0; display: flex; flex-direction: column; overflow: hidden; }
.bar-ko { display: block; width: 100%; background: var(--ko); }
.bar-col small { position: absolute; bottom: -20px; font-size: 10px; color: var(--muted); white-space: nowrap; }

/* Error */
.error-page { text-align: center; padding: 60px 20px; }
.error-code { font-size: 72px; font-weight: 800; letter-spacing: -2px; background: linear-gradient(135deg, var(--green), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { margin: 6px 0 10px; }
.error-page p { color: var(--muted); margin: 0 0 24px; }

/* --------------------------------------------------------- Responsive */
@media (max-width: 1024px) {
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(14, 12, 29, .6); }
  .only-mobile { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 40px; }
  .user-name { display: none; }
  .centro-select select { min-width: 0; max-width: 46vw; }
}
@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .seg-opt span { padding: 6px 8px; font-size: 12px; }
  .page-head h1 { font-size: 22px; }
}

/* Bloqueo por agente */
.badge-block { background: var(--ko); color: #fff; gap: 4px; }
.row-off td { opacity: .55; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack > .card { margin-bottom: 0; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.chip { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 13.5px; }
.chip:hover { border-color: var(--brand); }
.chip input { margin-top: 3px; accent-color: var(--brand); flex: none; }
.chip small { display: block; color: var(--muted); font-size: 12px; }
.chip:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.ua-cell { font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; max-width: 560px; }
.ua-inline { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.inline-setting { margin: 0; }
.grid-gap > .card { margin-bottom: 0; }
@media (prefers-color-scheme: dark) { .tile-icon, .auth-message-icon { box-shadow: inset 0 0 0 1px #2A2645; } }
