[hidden] { display: none !important; }
:root {
  --bg: #08111f;
  --panel: #101c2d;
  --panel-2: #14243a;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f6f8fb;
  --muted: #92a3b8;
  --accent: #30d5c8;
  --accent-2: #5b8cff;
  --danger: #ff6b6b;
  --ok: #43e07b;
  --warning: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, Segoe UI, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top left, rgba(48, 213, 200, 0.18), transparent 32%), radial-gradient(circle at top right, rgba(91, 140, 255, 0.22), transparent 28%), var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 480px); padding: 34px; border: 1px solid var(--border); border-radius: 28px; background: rgba(16, 28, 45, 0.90); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.brand-mark { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06111f; font-weight: 900; font-size: 28px; }
.small-mark { width: 42px; height: 42px; border-radius: 14px; font-size: 20px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; font-size: 12px; margin: 18px 0 8px; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.04em; }
h2 { margin: 0; font-size: 20px; }
h3 { margin: 0; }
.login-copy, .muted { color: var(--muted); line-height: 1.55; }
.login-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 8px; padding: 8px; border-radius: 18px; border: 1px solid var(--border); background: rgba(255,255,255,0.05); }
.switch-btn { border: 0; border-radius: 14px; padding: 12px 14px; background: transparent; color: var(--muted); font-weight: 900; }
.switch-btn.active { color: #04101e; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
label { display: block; margin: 20px 0 8px; color: var(--muted); font-weight: 800; }
input, select, textarea { width: 100%; border: 1px solid var(--border); color: var(--text); background: rgba(255, 255, 255, 0.06); border-radius: 16px; padding: 14px 16px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: rgba(48, 213, 200, 0.8); box-shadow: 0 0 0 4px rgba(48, 213, 200, 0.12); }
textarea { resize: vertical; min-height: 96px; }
.token-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.primary, .ghost, .action-btn { border-radius: 16px; padding: 13px 18px; font-weight: 900; }
.primary { border: 0; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04101e; box-shadow: 0 14px 36px rgba(48, 213, 200, 0.18); }
.ghost { color: var(--text); background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); }
.action-btn { border: 1px solid var(--border); background: rgba(255,255,255,0.08); color: var(--text); padding: 9px 12px; font-size: 13px; }
.action-btn.danger { color: #ffd6d6; border-color: rgba(255,107,107,.35); }
.action-btn.ok { color: #d8ffe5; border-color: rgba(67,224,123,.35); }
.action-btn.info { color: #d8fff9; border-color: rgba(48,213,200,.35); }
.full { width: 100%; margin-top: 18px; }
.small { padding: 12px 14px; }
.error-text, .alert { color: #ffe5e5; background: rgba(255, 107, 107, 0.14); border: 1px solid rgba(255, 107, 107, 0.32); border-radius: 16px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.alert[data-mode="ok"] { color: #d8ffe5; background: rgba(67, 224, 123, 0.12); border-color: rgba(67, 224, 123, 0.32); }
.login-status { color: #d8fff9; background: rgba(48, 213, 200, 0.10); border: 1px solid rgba(48, 213, 200, 0.28); border-radius: 16px; padding: 12px 14px; margin: 14px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.debug-btn { margin-top: 10px; }
button:disabled { opacity: 0.65; cursor: wait; }
.version-stamp { margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.login-shell.is-hidden { display: none !important; }
.app-shell.is-visible { display: grid !important; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px; border-right: 1px solid var(--border); background: rgba(8, 17, 31, 0.72); backdrop-filter: blur(18px); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.sidebar-brand strong { display: block; }
.sidebar-brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
nav { display: grid; gap: 8px; }
.nav-item { width: 100%; text-align: left; color: var(--muted); border: 1px solid transparent; background: transparent; border-radius: 16px; padding: 13px 14px; display: flex; justify-content: space-between; align-items: center; }
.nav-item span { font-size: 11px; color: var(--warning); }
.nav-item.active, .nav-item:hover { color: var(--text); background: rgba(255,255,255,0.08); border-color: var(--border); }
.logout { width: calc(100% - 48px); position: absolute; bottom: 24px; left: 24px; }
.content { padding: 30px; max-width: 1360px; width: 100%; }
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 24px; }
.topbar .eyebrow { margin-top: 0; }
.topbar-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.status-pill, .soft-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 8px 12px; border: 1px solid var(--border); color: var(--muted); background: rgba(255,255,255,0.06); font-weight: 900; font-size: 12px; }
.status-pill.ok { color: var(--ok); border-color: rgba(67,224,123,0.3); }
.status-pill.loading { color: var(--warning); border-color: rgba(255,209,102,0.32); }
.status-pill.error { color: var(--danger); border-color: rgba(255,107,107,0.32); }
.grid { display: grid; gap: 18px; }
.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
.stat-card, .panel-card { background: linear-gradient(180deg, rgba(20,36,58,0.92), rgba(16,28,45,0.92)); border: 1px solid var(--border); border-radius: 24px; padding: 20px; box-shadow: 0 16px 50px rgba(0,0,0,0.18); }
.stat-card span { color: var(--muted); display: block; font-weight: 900; }
.stat-card strong { display: block; font-size: clamp(24px, 3vw, 42px); margin: 8px 0; letter-spacing: -0.04em; word-break: break-word; }
.stat-card small { color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-actions, .form-actions, .table-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.breakdown { display: grid; gap: 10px; }
.breakdown-row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding: 10px 0; color: var(--muted); }
.breakdown-row strong { color: var(--text); text-align: right; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
td { color: #dbe6f5; vertical-align: middle; }
.empty-cell { color: var(--muted); text-align: center; }
.alert { margin-bottom: 18px; }
.view-section[hidden] { display: none !important; }
.compact { margin: 8px 0 0; }
.stack-mobile { align-items: flex-start; }
.filters { display: grid; grid-template-columns: minmax(260px, 1fr) 180px auto auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.inline-field { margin: 0; color: var(--muted); font-weight: 900; }
.inline-field input, .inline-field select { margin-top: 8px; }
.badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--border); font-size: 12px; font-weight: 900; }
.badge.active { color: var(--ok); border-color: rgba(67,224,123,.32); }
.badge.suspended, .badge.revoked { color: var(--danger); border-color: rgba(255,107,107,.32); }
.nested-card { border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.045); border-radius: 22px; padding: 18px; margin: 14px 0 20px; }
.create-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.create-grid label { margin: 0; }
.full-span { grid-column: 1 / -1; }
.check-line { display: flex; gap: 10px; align-items: center; }
.check-line input { width: auto; }
.credit-preview { color: #d8fff9; background: rgba(48, 213, 200, 0.08); border: 1px solid rgba(48, 213, 200, 0.26); border-radius: 16px; padding: 14px 16px; }
.mini-head { margin-top: 20px; }
.next-card { margin-top: 18px; }
.reseller-cards .stat-card:nth-child(1) strong { color: var(--ok); }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .logout { position: static; width: 100%; margin-top: 18px; }
  .cards, .two-cols { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
  .filters, .create-grid { grid-template-columns: 1fr; }
}


/* Panel 036C.1: aislamiento visual estricto por rol */
body.role-reseller .admin-only,
.app-shell.role-reseller .admin-only,
body.role-admin .reseller-only,
.app-shell.role-admin .reseller-only {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.role-reseller .reseller-only,
.app-shell.role-reseller .reseller-only,
body.role-admin .admin-only,
.app-shell.role-admin .admin-only {
  visibility: visible;
}


/* Panel 036D: emisión de licencias revendedor */
.result-card {
  border: 1px solid rgba(67, 224, 123, 0.34);
  border-radius: 22px;
  padding: 18px;
  margin-top: 16px;
  background: rgba(67, 224, 123, 0.10);
}

.result-card[hidden] {
  display: none !important;
}

.result-card h3 {
  margin: 12px 0 6px;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0.04em;
  word-break: break-word;
}

.mini-head {
  margin-top: 24px;
}

.warning-preview {
  border-color: rgba(255, 210, 77, 0.45) !important;
  background: rgba(255, 210, 77, 0.12) !important;
}

.danger-preview {
  border-color: rgba(255, 107, 107, 0.45) !important;
  background: rgba(255, 107, 107, 0.12) !important;
}


/* Panel 036E: Mis dispositivos revendedor */
.compact-stats {
  margin: 18px 0;
}

.filters-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin: 18px 0 24px;
}

.filters-row label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.filter-actions {
  margin: 0;
}

.mono-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

@media (max-width: 920px) {
  .filters-row {
    grid-template-columns: 1fr;
  }
}


/* Panel 036F: activación por MAC / ID */
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.result-grid div {
  border: 1px solid rgba(163, 188, 226, 0.18);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
}

.result-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.result-grid strong {
  display: block;
  word-break: break-word;
}

@media (max-width: 720px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
}


/* Panel 036F.2: aislamiento de credenciales en login */
.login-form[hidden],
.login-form[aria-hidden="true"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* Panel 036G: activación directa admin */
.admin-view .credit-preview {
  border-color: rgba(87, 198, 255, 0.30);
}

.admin-view .result-card {
  border-color: rgba(87, 198, 255, 0.36);
  background: rgba(87, 198, 255, 0.10);
}


/* Panel 037: listados administrativos */
.admin-list-card {
  margin-top: 22px;
}

.admin-filters-row {
  grid-template-columns: minmax(130px, 170px) minmax(130px, 170px) minmax(150px, 190px) minmax(220px, 1fr) auto;
}

.origin-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid rgba(163, 188, 226, 0.22);
  background: rgba(255,255,255,0.05);
  font-weight: 900;
  font-size: 12px;
}

.origin-pill.admin_direct {
  border-color: rgba(87, 198, 255, 0.38);
}

.origin-pill.reseller {
  border-color: rgba(67, 224, 123, 0.38);
}

@media (max-width: 1120px) {
  .admin-filters-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .admin-filters-row {
    grid-template-columns: 1fr;
  }
}


/* Panel 037A: archivado seguro y controles */
.badge.archived,
.badge.revoked,
.badge.suspended {
  border-color: rgba(255, 213, 105, 0.38);
}

.action-btn.warn {
  border-color: rgba(255, 213, 105, 0.42);
}

.safe-policy-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}


/* Panel 037B: apartado independiente de revendedores archivados */
.safe-policy-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  margin: 18px 0;
  border: 1px solid rgba(255, 213, 105, 0.26);
  border-radius: 18px;
  background: rgba(255, 213, 105, 0.08);
  color: var(--text);
}

.safe-policy-box span {
  color: var(--muted);
}

.archived-reseller-filters {
  grid-template-columns: minmax(260px, 1fr) auto;
}

@media (max-width: 720px) {
  .safe-policy-box {
    display: block;
  }

  .archived-reseller-filters {
    grid-template-columns: 1fr;
  }
}


/* Panel 038: puente de activación de app */
.app-bridge-note {
  border-color: rgba(67, 224, 123, 0.28);
  background: rgba(67, 224, 123, 0.08);
}

.app-bridge-result.authorized {
  border-color: rgba(67, 224, 123, 0.38);
  background: rgba(67, 224, 123, 0.08);
}

.app-bridge-result.denied {
  border-color: rgba(255, 107, 107, 0.38);
  background: rgba(255, 107, 107, 0.08);
}


/* Panel 038A: registro de activaciones + diagnóstico */
.diagnostic-card {
  margin-top: 22px;
}

.app-bridge-result.authorized {
  border-color: rgba(67, 224, 123, 0.40);
}

.app-bridge-result.denied {
  border-color: rgba(255, 99, 99, 0.40);
}

.mono-cell.wrap {
  white-space: normal;
  word-break: break-word;
}

.activation-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


/* Panel 039: contrato final de integración app */
.app-contract-note {
  word-break: break-word;
}

.code-panel {
  overflow: auto;
  max-height: 360px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(163, 188, 226, 0.18);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}


/* Panel 041: solicitudes de activación */
.request-status.pending {
  border-color: rgba(255, 213, 105, 0.42);
}

.request-status.in_review {
  border-color: rgba(79, 213, 255, 0.42);
}

.request-status.completed {
  border-color: rgba(67, 224, 123, 0.42);
}

.request-status.cancelled,
.request-status.ignored {
  border-color: rgba(255, 99, 99, 0.42);
}

.activation-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


/* Panel 041: solicitudes con plan deseado */
.plan-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(79, 213, 255, 0.28);
  background: rgba(79, 213, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
}


/* Panel 042: solicitudes propias de revendedor */
.reseller-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reseller-request-source {
  margin-bottom: 12px;
}


/* Panel 043: codigo publico vendedor + badges */
.notification-card {
  margin-top: 18px;
}

.seller-code-card strong,
.public-seller-code {
  letter-spacing: 0.08em;
}

.mini-copy-btn {
  margin-top: 10px;
  width: max-content;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(163, 188, 226, 0.22);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.nav-item span.has-pending {
  color: #43e07b;
  font-weight: 900;
}


/* Panel 044: renovaciones y extensiones */
.renewal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-btn.renew {
  border-color: rgba(67, 224, 123, 0.45);
}


/* Panel 044B: selector de plan antes de renovar */
.renewal-actions,
.table-actions {
  align-items: center;
}

.renewal-plan-select {
  min-width: 190px;
  max-width: 260px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(163, 188, 226, 0.28);
  background: rgba(10, 23, 41, 0.96);
  color: var(--text);
  padding: 0 10px;
  font-weight: 700;
}

.renewal-plan-select:focus {
  outline: 2px solid rgba(79, 213, 255, 0.45);
  outline-offset: 2px;
}


/* Panel 045: auditoría visual admin */
.audit-action-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  max-width: 260px;
  overflow-wrap: anywhere;
}

.audit-summary {
  max-width: 360px;
  overflow-wrap: anywhere;
}

.audit-detail-panel {
  margin-top: 18px;
}

.audit-json {
  max-height: 460px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.audit-ref {
  font-weight: 800;
}


/* =========================================================
   MiteV MCP 047 — UI fiel al concepto + escalado seguro
   ========================================================= */
:root {
  --mitev-cyan: #19dcff;
  --mitev-blue: #2387ff;
  --mitev-violet: #6a43ff;
  --mitev-magenta: #ef27ff;
  --mitev-green: #20eda0;
  --mitev-yellow: #ffd24a;
  --mitev-red: #ff557d;
  --mitev-bg: #020713;
  --mitev-panel: rgba(7, 20, 48, .90);
  --mitev-panel-2: rgba(9, 27, 60, .82);
  --mitev-border: rgba(45, 145, 255, .32);
  --mitev-text: #f6f9ff;
  --mitev-muted: #91a8cb;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--mitev-bg); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--mitev-text);
  background:
    radial-gradient(ellipse at 86% 9%, rgba(35, 93, 255, .28) 0, transparent 35%),
    radial-gradient(ellipse at 61% 24%, rgba(223, 31, 255, .11) 0, transparent 28%),
    radial-gradient(ellipse at 12% 60%, rgba(0, 175, 255, .10) 0, transparent 34%),
    linear-gradient(145deg, #020712 0%, #05112a 52%, #020612 100%);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .7;
  background-image:
    radial-gradient(circle at 13% 17%, rgba(255,255,255,.85) 0 1px, transparent 1.4px),
    radial-gradient(circle at 74% 16%, rgba(76,218,255,.8) 0 1px, transparent 1.4px),
    radial-gradient(circle at 87% 66%, rgba(232,74,255,.82) 0 1px, transparent 1.4px),
    radial-gradient(circle at 36% 79%, rgba(255,255,255,.55) 0 1px, transparent 1.5px);
  background-size: 180px 180px, 270px 270px, 235px 235px, 330px 330px;
}

/* LOGIN — two-column layout inspired by approved mockup */
.portal-login {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 64px);
  isolation: isolate;
  overflow: hidden;
}
.portal-login::after {
  content: '';
  position: absolute;
  left: -8vw;
  bottom: -28vw;
  width: min(72vw, 980px);
  aspect-ratio: 1;
  border-radius: 50%;
  z-index: -1;
  border: 2px solid rgba(35, 197, 255, .58);
  background: radial-gradient(circle at 55% 28%, rgba(34, 135, 255, .28), rgba(3,8,24,.92) 62%);
  box-shadow: 0 0 85px rgba(28, 111, 255, .42), inset 0 0 75px rgba(225, 41, 255, .14);
}
.portal-login::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(127deg, transparent 42%, rgba(33, 174, 255, .36) 42.25%, transparent 42.7%),
    linear-gradient(151deg, transparent 52%, rgba(233, 38, 255, .28) 52.25%, transparent 52.6%);
  opacity: .8;
}
.login-layout {
  width: min(1480px, 96vw);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .78fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.login-hero { min-width: 0; padding: 22px 0; }
.hero-kicker, .eyebrow {
  color: var(--mitev-cyan);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .19em;
  font-size: 12px;
}
.hero-accent { width: 68px; height: 3px; margin: 16px 0 34px; border-radius: 99px; background: linear-gradient(90deg, var(--mitev-magenta), var(--mitev-cyan)); box-shadow: 0 0 16px rgba(45, 209, 255, .5); }
.hero-title {
  margin: 0;
  max-width: 650px;
  color: #fff;
  font-size: clamp(3rem, 5vw, 5.7rem);
  line-height: .96;
  letter-spacing: -.04em;
  text-shadow: 0 12px 36px rgba(0,0,0,.35);
}
.hero-title span { color: var(--mitev-cyan); }
.hero-title em { font-style: normal; background: linear-gradient(90deg, #5ca3ff, var(--mitev-magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy { max-width: 560px; margin: 24px 0 30px; color: #b6c7e4; font-size: clamp(16px, 1.4vw, 21px); letter-spacing: .06em; text-transform: uppercase; }
.login-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); max-width: 660px; gap: 12px; }
.login-feature-grid article { padding: 16px 14px; border-left: 1px solid rgba(83, 143, 230, .28); background: linear-gradient(90deg, rgba(9,31,65,.55), transparent); }
.login-feature-grid strong { display: block; color: #fff; font-size: 13px; letter-spacing: .05em; }
.login-feature-grid span { display: block; margin-top: 6px; color: var(--mitev-muted); font-size: 12px; }

.login-panel.login-card {
  width: 100%;
  max-width: 590px;
  margin: 0;
  justify-self: end;
  padding: clamp(28px, 3vw, 46px);
  border-radius: 28px;
  border: 1px solid rgba(38, 209, 255, .72);
  background: linear-gradient(155deg, rgba(7, 27, 63, .96), rgba(3, 11, 31, .94));
  box-shadow: 0 0 0 1px rgba(236, 38, 255, .19), 0 0 55px rgba(27, 160, 255, .24), 0 32px 90px rgba(0,0,0,.46);
  backdrop-filter: blur(22px);
  overflow: hidden;
}
.brand-logo { display: block; object-fit: contain; object-position: center; }
.login-logo {
  width: 150px;
  height: 150px;
  max-width: 150px;
  max-height: 150px;
  margin: 0 auto 8px;
  filter: drop-shadow(0 0 12px rgba(31,213,255,.42)) drop-shadow(0 0 14px rgba(231,35,255,.32));
}
.login-panel .eyebrow { text-align: center; margin: 8px 0 10px; }
.login-panel h1 { margin: 0; text-align: center; font-size: clamp(2.35rem, 4vw, 3.55rem); letter-spacing: -.045em; color: #fff; }
.login-panel h1 span { background: linear-gradient(90deg, var(--mitev-cyan), var(--mitev-magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-copy { max-width: 480px; margin: 12px auto 28px; text-align: center; color: var(--mitev-muted); line-height: 1.55; }
.secure-login-form { display: grid; gap: 10px; }
.secure-login-form label { margin: 0; color: #dbe8ff; font-size: 13px; font-weight: 800; }
.secure-login-form input { height: 54px; border-radius: 14px; background: rgba(4, 16, 41, .92); border: 1px solid rgba(91, 149, 239, .52); color: #fff; box-shadow: inset 0 1px rgba(255,255,255,.02); }
.secure-login-form input:focus { border-color: var(--mitev-cyan); box-shadow: 0 0 0 3px rgba(25,220,255,.10), 0 0 20px rgba(25,220,255,.12); }
.token-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.reveal-btn { min-width: 62px; border-radius: 14px; }
.login-submit { min-height: 56px; margin-top: 8px; border-radius: 14px; font-size: 15px; }
.connection-test { margin-top: 12px; min-height: 48px; }
.login-security-line { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 18px; padding-top: 18px; margin-top: 22px; border-top: 1px solid rgba(92,146,226,.24); color: #8fa6c9; font-size: 11px; }
.login-security-line span::before { content: '•'; margin-right: 8px; color: var(--mitev-magenta); }
.version-stamp { text-align: center; color: #6f87aa; font-size: 11px; margin: 14px 0 0; }
.login-status, .error-text { margin-top: 14px; }

/* APPLICATION SHELL */
.app-shell.mitev-app-frame {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 252px minmax(0,1fr);
  background: transparent;
  width: 100%;
  max-width: none;
}
.sidebar.sidebar-nav-shell {
  position: sticky;
  top: 0;
  height: 100dvh;
  min-width: 0;
  padding: 18px 14px 86px;
  overflow-y: auto;
  border-right: 1px solid rgba(45,145,255,.29);
  background: linear-gradient(180deg, rgba(3,15,36,.98), rgba(2,8,24,.97));
  box-shadow: 18px 0 60px rgba(0,0,0,.28);
}
.sidebar-brand { display: grid; place-items: center; gap: 5px; text-align: center; padding: 6px 8px 18px; margin-bottom: 12px; border-bottom: 1px solid rgba(67,137,238,.18); }
.sidebar-logo {
  width: 96px;
  height: 96px;
  max-width: 96px;
  max-height: 96px;
  flex: 0 0 96px;
  margin: 0 auto;
  filter: drop-shadow(0 0 10px rgba(25,220,255,.36)) drop-shadow(0 0 11px rgba(239,39,255,.28));
}
.sidebar-brand strong { font-size: 15px; letter-spacing: .03em; color: #fff; }
.sidebar-brand span { max-width: 170px; color: #8199bd; font-size: 11px; }
#mainNav { display: grid; gap: 5px; }
.nav-item {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid transparent;
  color: #a9bedc;
  background: transparent;
  transition: .16s ease;
}
.nav-item:hover { color:#fff; background:rgba(22,74,140,.24); border-color:rgba(47,169,255,.20); }
.nav-item.active { color:#fff; background:linear-gradient(90deg,rgba(0,182,255,.24),rgba(181,31,255,.31)); border-color:rgba(43,203,255,.58); box-shadow: inset 3px 0 var(--mitev-cyan), 0 0 18px rgba(109,42,255,.17); }
.nav-item span { color: var(--mitev-yellow); font-size: 10px; }
.logout { position: fixed; left: 18px; bottom: 18px; width: 216px; }

.content { min-width: 0; max-width: none; width: 100%; padding: 18px clamp(18px, 2.4vw, 34px) 42px; overflow: hidden; }
.topbar.top-command-bar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  min-height: 114px;
  padding: 18px 0 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(67,137,238,.18);
}
.topbar.top-command-bar::after { content:''; position:absolute; top:-80px; right:-40px; width:min(44vw,650px); height:210px; pointer-events:none; background:radial-gradient(ellipse at 65% 35%,rgba(41,106,255,.30),transparent 68%); }
.topbar h1 { margin: 7px 0 4px; font-size: clamp(2rem,3.2vw,3.15rem); letter-spacing:-.04em; color:#fff; }
.topbar-actions { position:relative; z-index:2; display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.eyebrow { color:var(--mitev-cyan); }
.status-pill, .soft-pill { background:rgba(18,48,88,.72); border:1px solid rgba(83,151,243,.28); }
.status-pill.ok { color:#4dffb5; background:rgba(14,85,62,.33); border-color:rgba(40,234,156,.35); }

.grid { min-width: 0; }
.cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.two-cols { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.stat-card, .panel-card, .nested-card {
  min-width: 0;
  border-radius: 18px;
  border: 1px solid rgba(45,145,255,.31);
  background: linear-gradient(145deg, rgba(13,36,76,.88), rgba(6,20,49,.88));
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 16px 46px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
}
.stat-card { position: relative; overflow: hidden; padding: 18px; }
.stat-card::before { content:''; position:absolute; inset:0 0 auto; height:2px; background:linear-gradient(90deg,var(--mitev-cyan),var(--mitev-violet),var(--mitev-magenta)); opacity:.72; }
.stat-card strong { color:#fff; font-size:clamp(28px,3vw,40px); text-shadow:0 0 18px rgba(29,187,255,.15); }
.panel-card { padding: 18px; }
.section-head { min-width: 0; }
.section-head > * { min-width: 0; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; border-radius: 13px; }
table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; }
thead th { position: sticky; top: 0; z-index: 1; background:#0b2c58; color:#abd0ff; }
tbody tr:hover { background:rgba(30,88,158,.18); }
input, select, textarea { background:rgba(7,25,55,.93); border-color:rgba(75,139,225,.42); color:#f5f9ff; border-radius:11px; }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--mitev-cyan); box-shadow:0 0 0 3px rgba(25,220,255,.09); }
.primary { background:linear-gradient(100deg,var(--mitev-cyan),var(--mitev-blue) 48%,var(--mitev-magenta)); color:#04101d; border:0; box-shadow:0 0 22px rgba(25,191,255,.20); font-weight:900; }
.primary:hover { filter:brightness(1.06); transform:translateY(-1px); }
.ghost { background:rgba(14,35,67,.78); border-color:rgba(95,148,221,.31); color:#f1f6ff; }
.action-btn { border-radius:8px; }
.badge.active, .badge.completed { color:#35ffb1; border-color:rgba(38,238,158,.42); background:rgba(16,94,68,.35); }
.badge.pending { color:#ffd45f; border-color:rgba(255,199,55,.42); background:rgba(97,72,14,.34); }
.badge.suspended, .badge.revoked, .badge.expired { color:#ff829a; border-color:rgba(255,91,118,.40); background:rgba(96,28,45,.34); }
.alert { border-radius:12px; backdrop-filter:blur(12px); }

/* Clients module preserved and aligned */
.clients-panel .client-stat-grid { margin:18px 0 22px; }
.client-detail { margin-top:22px; }
.client-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.client-detail h4 { margin:0 0 10px; color:var(--mitev-cyan); }

@media (max-width: 1100px) {
  .login-layout { grid-template-columns: 1fr; width:min(760px,94vw); gap:24px; }
  .login-hero { text-align:center; padding-top:10px; }
  .hero-accent { margin-left:auto; margin-right:auto; }
  .hero-title { max-width:none; font-size:clamp(2.6rem,8vw,4.7rem); }
  .hero-copy { margin-left:auto; margin-right:auto; }
  .login-feature-grid { margin:0 auto; }
  .login-panel.login-card { justify-self:center; max-width:590px; }
  .portal-login::after { width:900px; left:-350px; bottom:-650px; opacity:.55; }
}
@media (max-width: 900px) {
  .app-shell.mitev-app-frame { grid-template-columns: 1fr; }
  .sidebar.sidebar-nav-shell { position:relative; height:auto; padding-bottom:18px; }
  .sidebar-brand { grid-template-columns:auto 1fr; justify-items:start; text-align:left; }
  .sidebar-logo { width:72px; height:72px; max-width:72px; max-height:72px; }
  #mainNav { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .logout { position:static; width:100%; margin-top:12px; }
  .content { padding:14px 14px 34px; }
  .topbar.top-command-bar { min-height:auto; flex-direction:column; }
  .topbar-actions { justify-content:flex-start; }
}
@media (max-width: 640px) {
  .portal-login { padding:18px 12px; }
  .login-layout { width:100%; }
  .login-feature-grid { grid-template-columns:1fr; }
  .login-feature-grid article { border-left:0; border-top:1px solid rgba(83,143,230,.24); }
  .login-panel.login-card { padding:24px 18px; border-radius:22px; }
  .login-logo { width:126px; height:126px; max-width:126px; max-height:126px; }
  .token-row { grid-template-columns:1fr; }
  .reveal-btn { width:100%; }
  #mainNav { grid-template-columns:1fr; }
  .cards, .two-cols, .create-grid, .filters-row, .admin-filters-row { grid-template-columns:1fr !important; }
  .client-detail-grid { grid-template-columns:1fr; }
  .topbar h1 { font-size:2rem; }
}

/* MCP 048 - Gestión 360 de clientes (base preservada) */
.client-360 { display:grid; gap:18px; }
.client-360-summary { grid-template-columns:repeat(4,minmax(0,1fr)); margin:0; }
.client-mini-card strong { font-size:clamp(1.25rem,2.1vw,2rem); }
.client-management-bar { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:16px 18px; border:1px solid rgba(94,203,255,.24); border-radius:16px; background:linear-gradient(135deg,rgba(8,33,74,.72),rgba(44,16,88,.38)); }
.client-management-bar p { margin:0; }
.client-detail-block { border:1px solid rgba(73,160,255,.18); border-radius:18px; padding:16px; background:rgba(4,20,48,.46); }
.client-detail-block h4 { margin:0 0 12px; }
.client-history table td:first-child { white-space:nowrap; }
.client-renew-actions { min-width:280px; align-items:center; }
.client-renew-actions .renewal-plan-select { min-width:160px; flex:1 1 160px; }
.danger-outline { color:#ffd6df; border-color:rgba(255,79,126,.44)!important; background:rgba(111,20,49,.22)!important; }
.badge.archived { color:#d8b4ff; border-color:rgba(199,111,255,.42); background:rgba(83,32,115,.34); }
.badge.no_active_license { color:#ffce7a; border-color:rgba(255,184,76,.42); background:rgba(100,65,16,.32); }

@media (max-width: 1180px) {
  .client-360-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .client-360-summary { grid-template-columns:1fr; }
  .client-management-bar { align-items:stretch; flex-direction:column; }
  .client-renew-actions { min-width:0; flex-direction:column; align-items:stretch; }
}


/* MCP 049 — Centro de notificaciones */
.notification-bell{position:relative;display:inline-grid;place-items:center;width:42px;height:42px;border:1px solid rgba(66,210,255,.35);border-radius:14px;background:rgba(8,31,72,.72);color:#fff;font-size:18px;cursor:pointer;box-shadow:inset 0 0 18px rgba(17,122,255,.08)}
.notification-bell:hover{border-color:rgba(222,51,255,.72);box-shadow:0 0 20px rgba(100,82,255,.25)}
.notification-badge{position:absolute;right:-5px;top:-7px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;display:grid;place-items:center;background:linear-gradient(135deg,#ff315f,#e529ff);color:#fff;font-size:11px;font-weight:900;border:2px solid #061326}
.notification-list{display:grid;gap:12px;margin-top:18px}
.notification-item{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:14px;align-items:center;padding:16px;border:1px solid rgba(79,159,255,.25);border-radius:18px;background:linear-gradient(135deg,rgba(7,29,67,.92),rgba(10,38,83,.72));transition:.2s ease}
.notification-item.is-unread{box-shadow:inset 3px 0 0 #21d9ff,0 8px 28px rgba(0,0,0,.12)}
.notification-item.is-read{opacity:.76}
.notification-item.severity-danger{border-color:rgba(255,70,110,.42)}
.notification-item.severity-warning{border-color:rgba(255,196,66,.42)}
.notification-item.severity-info{border-color:rgba(33,217,255,.34)}
.notification-icon{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;font-weight:900;background:rgba(33,217,255,.12);border:1px solid rgba(33,217,255,.4)}
.severity-danger .notification-icon{color:#ff6687;background:rgba(255,56,103,.10);border-color:rgba(255,56,103,.48)}
.severity-warning .notification-icon{color:#ffd15b;background:rgba(255,190,45,.10);border-color:rgba(255,190,45,.48)}
.notification-copy{min-width:0}.notification-copy h3{margin:4px 0 5px;font-size:16px}.notification-copy p{margin:0;color:var(--muted,#9fb0cb);line-height:1.45}
.notification-meta{display:flex;gap:8px;flex-wrap:wrap;font-size:11px;color:var(--muted,#9fb0cb);text-transform:uppercase;letter-spacing:.06em}.notification-type{color:#4de7ff;font-weight:800}
.notification-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.notification-actions .small{white-space:nowrap}
.notification-filter-grid{grid-template-columns:minmax(180px,260px) minmax(180px,260px) minmax(180px,1fr);align-items:end;margin-top:18px}.notification-check{min-height:44px;align-items:center}
.notification-stats{margin-top:18px}
@media (max-width:900px){.notification-item{grid-template-columns:42px 1fr}.notification-actions{grid-column:1/-1;justify-content:flex-start;padding-left:56px}.notification-filter-grid{grid-template-columns:1fr}.notification-bell{width:38px;height:38px}}
@media (max-width:560px){.notification-item{grid-template-columns:1fr}.notification-icon{display:none}.notification-actions{padding-left:0}.notification-actions button{flex:1 1 140px}}

/* MCP 053 - acciones administrativas fuertes */
.admin-critical-action {
  font-weight: 950;
}
.client-device-actions {
  flex-wrap: wrap;
  gap: 8px;
}


/* MCP 055: diagnóstico de producción Mercado Pago */
.payment-mode-pill.ok,
.soft-pill.ok { background: rgba(34, 197, 94, 0.16); color: #166534; border-color: rgba(34, 197, 94, 0.35); }
.payment-mode-pill.warn,
.soft-pill.warn { background: rgba(245, 158, 11, 0.18); color: #92400e; border-color: rgba(245, 158, 11, 0.38); }
.payment-mode-pill.danger,
.soft-pill.danger { background: rgba(239, 68, 68, 0.16); color: #991b1b; border-color: rgba(239, 68, 68, 0.35); }
.compact-cards { margin: 18px 0; }
.payment-mode-card { border: 1px solid rgba(37, 99, 235, 0.16); }
.payment-warning-box { margin: 14px 0 18px; }
.payment-stat-card strong { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }
.badge.ok { background: rgba(34, 197, 94, 0.14); color: #166534; }
.badge.warn { background: rgba(245, 158, 11, 0.16); color: #92400e; }
.badge.danger { background: rgba(239, 68, 68, 0.14); color: #991b1b; }

/* ============================================================
   MCP 055 HOTFIX1 - Sidebar nav/logout layout fix
   Evita que "Producción MP" quede escondido debajo de "Cerrar sesión".
   El menú ocupa el espacio disponible y el botón de cerrar sesión queda
   dentro del flujo visual, no encima del último elemento.
   ============================================================ */
.app-shell.mitev-app-frame .sidebar.sidebar-nav-shell {
  display: flex !important;
  flex-direction: column !important;
  height: 100dvh !important;
  padding: 18px 14px 18px !important;
  overflow: hidden !important;
}

.app-shell.mitev-app-frame .sidebar.sidebar-nav-shell #mainNav {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 4px !important;
  padding-bottom: 12px !important;
  scrollbar-gutter: stable;
}

.app-shell.mitev-app-frame .sidebar.sidebar-nav-shell > .logout {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  flex: 0 0 auto !important;
  margin: 12px 0 0 !important;
  z-index: 2 !important;
}

.app-shell.mitev-app-frame .sidebar.sidebar-nav-shell .nav-item[data-section="paymentProduction"] {
  margin-bottom: 4px !important;
}


/* MCP 058 - Transferencia de membresía */
.action-btn.transfer-action {
  border-color: rgba(53, 211, 255, .72);
  background: linear-gradient(135deg, rgba(31, 191, 239, .18), rgba(167, 66, 255, .18));
  color: #dffaff;
}
.action-btn.transfer-action:hover,
.action-btn.transfer-action:focus-visible {
  border-color: #46e6ff;
  box-shadow: 0 0 0 2px rgba(70, 230, 255, .16), 0 0 22px rgba(89, 87, 255, .22);
}

/* MiteV Portal Comercial 1.0.26 */
.commercial-summary-cards { margin-top: 18px; }
.commercial-stat { position: relative; overflow: hidden; }
.commercial-stat::after { content: ""; position: absolute; inset: auto -32px -42px auto; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(71,205,255,.18), rgba(123,84,255,.04) 58%, transparent 72%); pointer-events:none; }


/* ============================================================
   MiteV Portal 1.0.26.1 - UX de navegación, tablas y perfiles
   ============================================================ */
#mainNav { display:block !important; }
.nav-group-label {
  margin: 16px 10px 6px;
  padding: 0 5px;
  color: rgba(151, 177, 218, .72);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav-group-label:first-child { margin-top: 4px; }
.nav-item {
  justify-content: flex-start !important;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px !important;
  border-radius: 12px !important;
  margin: 2px 0;
}
.nav-item .nav-icon {
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(70, 171, 255, .20);
  background: rgba(26, 77, 137, .20);
  color: #72ddff;
  font-size: 11px;
  font-weight: 900;
}
.nav-item .nav-text { color: inherit; font-size: 13px; font-weight: 750; flex: 1 1 auto; }
.nav-item .nav-badge {
  margin-left: auto;
  min-width: 22px;
  padding: 3px 7px;
  text-align: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(126, 72, 255, .30);
  border: 1px solid rgba(96, 210, 255, .25);
  font-size: 10px;
}
.nav-item.active .nav-icon { color:#fff; border-color:rgba(76,224,255,.55); background:linear-gradient(135deg,rgba(0,194,255,.28),rgba(174,39,255,.28)); }

.compact-table-wrap { border:1px solid rgba(57,139,236,.22); background:rgba(4,20,48,.26); }
.portal-compact-table { min-width: 980px; table-layout: auto; }
.portal-compact-table th { white-space: nowrap; padding: 11px 12px; font-size: 11px; letter-spacing:.045em; text-transform:uppercase; }
.portal-compact-table td { vertical-align: top; padding: 12px; line-height:1.28; }
.portal-compact-table .cell-primary { display:block; color:#f6f9ff; font-weight:850; margin-bottom:5px; }
.portal-compact-table .cell-secondary { display:block; color:#8fa8cb; font-size:11px; line-height:1.35; }
.portal-compact-table .mono-cell { font-size:11px; word-break:break-all; }
.portal-compact-table .device-id-text { max-width:290px; }
.portal-compact-table .badge { display:inline-flex; margin-top:5px; }
.compact-actions { gap:6px !important; align-items:stretch !important; max-width:245px; }
.compact-actions .action-btn { min-height:34px; padding:7px 10px; white-space:nowrap; }
.compact-actions .compact-select, .compact-actions .renewal-plan-select { min-width:145px; max-width:210px; height:34px; padding:4px 8px; }

.profile-device-search { display:grid; grid-template-columns:minmax(320px,1fr) auto; gap:14px; align-items:end; margin:18px 0 10px; }
.profile-device-search label { display:grid; gap:7px; color:#bdd2ef; font-size:12px; font-weight:800; }
.profile-device-search input { width:100%; min-height:46px; }
.profile-policy-box { margin:10px 0 18px; }
.profile-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
.profile-inline-actions { display:flex; gap:7px; flex-wrap:wrap; align-items:center; }
.profile-inline-select { min-width:112px; height:36px; padding:5px 8px; }
.mini-copy-btn { margin-top:7px; padding:4px 8px; border-radius:8px; border:1px solid rgba(77,199,255,.28); background:rgba(20,82,136,.20); color:#bceeff; font-size:10px; font-weight:800; cursor:pointer; }
.mini-copy-btn:hover { border-color:rgba(77,229,255,.65); color:#fff; }
.profile-count { color:#62f1ff !important; }

@media (min-width: 1180px) {
  .admin-license-table th:nth-child(1), .admin-license-table td:nth-child(1) { width:22%; }
  .admin-license-table th:nth-child(2), .admin-license-table td:nth-child(2) { width:15%; }
  .admin-license-table th:nth-child(7), .admin-license-table td:nth-child(7) { width:20%; }
  .admin-device-table th:nth-child(1), .admin-device-table td:nth-child(1) { width:25%; }
  .admin-device-table th:nth-child(7), .admin-device-table td:nth-child(7) { width:18%; }
}
@media (max-width: 900px) {
  .nav-group-label { grid-column:1/-1; margin-top:12px; }
  #mainNav { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:4px; }
  .profile-device-search { grid-template-columns:1fr; }
  .profile-stats { grid-template-columns:1fr; }
}
@media (max-width: 640px) {
  #mainNav { grid-template-columns:1fr !important; }
  .portal-compact-table { min-width:840px; }
}


/* =========================================================
   MiteV Portal 1.0.26.2 - UX COMPACTA OPERATIVA
   ========================================================= */
.mitev-app-frame { grid-template-columns: 214px minmax(0,1fr); }
.sidebar-nav-shell { width:214px; padding:12px 12px 10px; }
.sidebar-brand { padding:6px 6px 12px; gap:9px; }
.sidebar-logo { width:64px !important; height:64px !important; }
.sidebar-brand strong { font-size:14px; }
.sidebar-brand span { font-size:10px; }
#mainNav { gap:3px; }
.nav-group-label { margin:9px 8px 4px; font-size:9px; letter-spacing:.15em; }
.nav-item { min-height:36px; padding:7px 9px; border-radius:9px; font-size:12px; gap:8px; }
.nav-icon { width:20px; height:20px; min-width:20px; font-size:10px; }
.nav-item-emphasis { border-color:rgba(37,205,255,.38); background:rgba(0,170,255,.07); }
.nav-more { margin-top:7px; }
.nav-more > summary { list-style:none; cursor:pointer; display:flex; align-items:center; gap:8px; min-height:35px; padding:7px 9px; border:1px solid rgba(91,139,212,.20); border-radius:9px; color:#9fb4d3; font-size:11px; font-weight:800; }
.nav-more > summary::-webkit-details-marker { display:none; }
.nav-more[open] > summary { color:#fff; border-color:rgba(0,210,255,.35); background:rgba(18,73,135,.18); }
.nav-more-items { padding:5px 0 0 5px; }
.nav-subgroup-label { color:#6f88ad; font-size:8px; letter-spacing:.14em; text-transform:uppercase; padding:7px 7px 3px; font-weight:800; }

.content { min-width:0; padding:16px 18px 28px; }
.panel-card { padding:15px; }
.section-head { gap:10px; margin-bottom:12px; }
.stats-grid.compact-stats, .client-stat-grid { gap:9px; }
.stat-card { min-height:84px; padding:12px 14px; }
.filters-row { gap:9px; margin:12px 0; }
.filters-row label { min-width:130px; font-size:11px; }
.filters-row input, .filters-row select { min-height:38px; padding:8px 10px; font-size:12px; }

.table-wrap { overflow-x:auto; }
.compact-table-wrap { overflow-x:auto; border-radius:12px; }
.portal-compact-table { width:100%; min-width:0; table-layout:fixed; font-size:11.5px; }
.portal-compact-table th { padding:9px 9px; font-size:9.5px; letter-spacing:.05em; white-space:normal; line-height:1.15; }
.portal-compact-table td { padding:9px; line-height:1.22; vertical-align:middle; overflow-wrap:anywhere; word-break:normal; }
.portal-compact-table .cell-primary { margin-bottom:3px; font-size:11.5px; line-height:1.25; }
.portal-compact-table .cell-secondary { font-size:10px; line-height:1.25; }
.portal-compact-table .cell-tertiary { display:block; color:#6f88ad; font-size:9.5px; line-height:1.2; margin-top:2px; }
.portal-compact-table .mono-cell { font-size:10px; word-break:break-all; }
.portal-compact-table .device-id-text { max-width:none; }
.portal-compact-table .badge { margin-top:2px; font-size:9px; padding:4px 7px; }
.mini-copy-btn { margin-top:4px; padding:3px 7px; min-height:25px; font-size:9px; }
.compact-actions { max-width:none; gap:5px !important; flex-wrap:wrap; }
.compact-actions .action-btn { min-height:30px; padding:5px 8px; font-size:10px; }

/* exact desktop column balance */
.admin-client-table th:nth-child(1), .admin-client-table td:nth-child(1) { width:19%; }
.admin-client-table th:nth-child(2), .admin-client-table td:nth-child(2) { width:18%; }
.admin-client-table th:nth-child(3), .admin-client-table td:nth-child(3) { width:23%; }
.admin-client-table th:nth-child(4), .admin-client-table td:nth-child(4) { width:12%; }
.admin-client-table th:nth-child(5), .admin-client-table td:nth-child(5) { width:17%; }
.admin-client-table th:nth-child(6), .admin-client-table td:nth-child(6) { width:11%; }
.reseller-client-table th:nth-child(1), .reseller-client-table td:nth-child(1) { width:20%; }
.reseller-client-table th:nth-child(2), .reseller-client-table td:nth-child(2) { width:19%; }
.reseller-client-table th:nth-child(3), .reseller-client-table td:nth-child(3) { width:25%; }
.reseller-client-table th:nth-child(4), .reseller-client-table td:nth-child(4) { width:11%; }
.reseller-client-table th:nth-child(5), .reseller-client-table td:nth-child(5) { width:16%; }
.reseller-client-table th:nth-child(6), .reseller-client-table td:nth-child(6) { width:9%; }
.admin-license-table th:nth-child(1), .admin-license-table td:nth-child(1), .reseller-license-table th:nth-child(1), .reseller-license-table td:nth-child(1) { width:22%; }
.admin-license-table th:nth-child(2), .admin-license-table td:nth-child(2), .reseller-license-table th:nth-child(3), .reseller-license-table td:nth-child(3) { width:14%; }
.admin-license-table th:nth-child(3), .admin-license-table td:nth-child(3), .reseller-license-table th:nth-child(2), .reseller-license-table td:nth-child(2) { width:25%; }
.admin-license-table th:nth-child(4), .admin-license-table td:nth-child(4), .reseller-license-table th:nth-child(4), .reseller-license-table td:nth-child(4) { width:12%; }
.admin-license-table th:nth-child(5), .admin-license-table td:nth-child(5), .reseller-license-table th:nth-child(5), .reseller-license-table td:nth-child(5) { width:17%; }
.admin-license-table th:nth-child(6), .admin-license-table td:nth-child(6), .reseller-license-table th:nth-child(6), .reseller-license-table td:nth-child(6) { width:10%; }
.admin-device-table th:nth-child(1), .admin-device-table td:nth-child(1), .reseller-device-table th:nth-child(1), .reseller-device-table td:nth-child(1) { width:25%; }
.admin-device-table th:nth-child(2), .admin-device-table td:nth-child(2), .reseller-device-table th:nth-child(2), .reseller-device-table td:nth-child(2) { width:22%; }
.admin-device-table th:nth-child(3), .admin-device-table td:nth-child(3), .reseller-device-table th:nth-child(3), .reseller-device-table td:nth-child(3) { width:15%; }
.admin-device-table th:nth-child(4), .admin-device-table td:nth-child(4), .reseller-device-table th:nth-child(4), .reseller-device-table td:nth-child(4) { width:10%; }
.admin-device-table th:nth-child(5), .admin-device-table td:nth-child(5), .reseller-device-table th:nth-child(5), .reseller-device-table td:nth-child(5) { width:18%; }
.admin-device-table th:nth-child(6), .admin-device-table td:nth-child(6), .reseller-device-table th:nth-child(6), .reseller-device-table td:nth-child(6) { width:10%; }
.profiles-device-table th:nth-child(1), .profiles-device-table td:nth-child(1) { width:26%; }
.profiles-device-table th:nth-child(2), .profiles-device-table td:nth-child(2) { width:22%; }
.profiles-device-table th:nth-child(3), .profiles-device-table td:nth-child(3) { width:10%; }
.profiles-device-table th:nth-child(4), .profiles-device-table td:nth-child(4) { width:12%; }
.profiles-device-table th:nth-child(5), .profiles-device-table td:nth-child(5) { width:18%; }
.profiles-device-table th:nth-child(6), .profiles-device-table td:nth-child(6) { width:12%; }

.row-action-menu { position:relative; display:inline-block; }
.row-action-menu > summary { list-style:none; cursor:pointer; user-select:none; }
.row-action-menu > summary::-webkit-details-marker { display:none; }
.row-action-menu-panel { position:static; min-width:150px; margin-top:5px; padding:7px; display:flex; flex-direction:column; gap:5px; border:1px solid rgba(77,151,244,.38); border-radius:10px; background:#071a38; box-shadow:0 10px 22px rgba(0,0,0,.28); }
.row-action-menu-panel .action-btn, .row-action-menu-panel select { width:100%; min-height:32px; font-size:10px; }
.row-action-menu[open] > summary { border-color:#20ccff; color:#fff; }

@media (min-width: 1280px) {
  .compact-table-wrap { overflow-x:hidden; }
}
@media (max-width: 1279px) {
  .mitev-app-frame { grid-template-columns:190px minmax(0,1fr); }
  .sidebar-nav-shell { width:190px; }
  .portal-compact-table { min-width:900px; }
}
@media (max-width: 900px) {
  .portal-compact-table { min-width:820px; }
}

.client-detail table { font-size:11px; }
.client-detail th, .client-detail td { padding:8px 9px; }


/* MiteV MCP 1.0.26.3 - detalle inline y recarga rápida por vendedor */
.inline-client-detail-row > td {
  padding: 0 8px 12px !important;
  background: rgba(2, 12, 32, .72);
}
.inline-client-detail {
  margin: 8px 0 4px !important;
  border-color: rgba(0, 210, 255, .42);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .2);
}
.inline-detail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(5, 26, 61, .98), rgba(5, 26, 61, .92));
  padding-bottom: 10px;
}
tr.inline-detail-open {
  outline: 1px solid rgba(0, 210, 255, .42);
  background: rgba(16, 66, 119, .18);
}
#creditResellerSearch {
  min-width: 230px;
}
@media (max-width: 980px) {
  #creditResellerSearch { min-width: 0; width: 100%; }
}
