/* =========================================================
   Portal Bokder · estilos compartidos (maqueta)
   ========================================================= */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #0c0187;
  --font: #060a2e;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f3f5fa;
  --side: #0b0f2e;
  --side-2: #11173d;
  --ok-bg: #e8f7ee;
  --ok-fg: #15803d;
  --warn-bg: #fff4e5;
  --warn-fg: #b45309;
  --font-ui: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Mono', Consolas, monospace;
  --side-w: 252px;
  --side-w-min: 78px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-ui); background: var(--bg); color: var(--font);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-ui); }
svg { display: block; }

/* =========================================================
   Estructura
   ========================================================= */
.app-shell { display: flex; min-height: 100vh; }

/* =========================================================
   Menú lateral
   ========================================================= */
.sidebar {
  position: sticky; top: 0; height: 100vh; flex: 0 0 var(--side-w); width: var(--side-w);
  background: var(--side); color: #cbd5e1;
  display: flex; flex-direction: column; z-index: 30;
  transition: width .18s ease, flex-basis .18s ease;
}
.sidebar-head {
  display: flex; align-items: center; justify-content: center;
  height: 64px; flex-shrink: 0; padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo-full { height: 28px; width: auto; }
.logo-mini {
  display: none; width: 34px; height: 34px; border-radius: 9px;
  align-items: center; justify-content: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff; font-size: 17px; font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.collapse-btn {
  position: absolute; top: 74px; right: -13px; z-index: 5;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; color: #334155; border: 1px solid #d6deea;
  box-shadow: 0 2px 6px rgba(15,23,42,.16); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s, background .15s;
}
.collapse-btn:hover { background: #f1f5f9; }
.collapse-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.navscroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 10px 8px; }
.navscroll::-webkit-scrollbar { width: 8px; }
.navscroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 8px; }

.navblock { margin-bottom: 14px; }
.navgroup {
  font-size: 9.5px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  color: #7c89b0; padding: 6px 12px 7px; white-space: nowrap;
}
.navlist { display: flex; flex-direction: column; gap: 2px; }
.navitem {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px; color: #aab6d0;
  font-size: 12.5px; font-weight: 600; line-height: 1.25;
  transition: background .12s, color .12s; position: relative;
}
.navitem:hover { background: rgba(255,255,255,.06); color: #fff; }
.navitem[aria-disabled="true"] { cursor: default; }
.navitem.active { background: rgba(255,255,255,.1); color: #fff; }
.navitem.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  border-radius: 0 3px 3px 0; background: #60a5fa;
}
.ni { display: flex; align-items: center; justify-content: center; width: 20px; flex-shrink: 0; }
.ni svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soon-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #fbbf24;
  margin-left: auto; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(251,191,36,.12);
}
.sidebar-foot {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 10.5px; color: #6f7c9f; white-space: nowrap;
}
.sidebar-foot .power { display: flex; align-items: center; }
.sidebar-foot .power svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.sidebar-foot .txt { overflow: hidden; text-overflow: ellipsis; }
button.power {
  background: none; border: 0; color: inherit; padding: 0; cursor: pointer;
}
button.power:hover { color: #fff; }

/* Colapsado */
body.collapsed .sidebar { flex-basis: var(--side-w-min); width: var(--side-w-min); }
body.collapsed .logo-full { display: none; }
body.collapsed .logo-mini { display: flex; }
body.collapsed .collapse-btn { transform: rotate(180deg); }
body.collapsed .navgroup { display: none; }
body.collapsed .nl,
body.collapsed .soon-dot,
body.collapsed .sidebar-foot .txt { display: none; }
body.collapsed .navitem { justify-content: center; padding: 10px 0; }
body.collapsed .navitem.active::before { top: 8px; bottom: 8px; }
body.collapsed .navlist { gap: 4px; }
body.collapsed .sidebar-foot { justify-content: center; padding: 12px 0; }
body.collapsed .navscroll { padding-left: 8px; padding-right: 8px; }

/* =========================================================
   Columna principal
   ========================================================= */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px; flex-shrink: 0; display: flex; align-items: center; gap: 14px;
  padding: 0 26px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.hamburger {
  display: none; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: #334155;
  cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0;
}
.hamburger svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.page-title { font-size: 15.5px; font-weight: 750; color: #10163a; letter-spacing: -.1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.preview { display: flex; align-items: center; gap: 7px; }
.preview > span {
  font-size: 9.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #94a3b8;
}
.preview select {
  font-family: var(--font-ui); font-size: 12px; font-weight: 650; color: #1e293b;
  background: #f8fafc; border: 1px solid #dbe3ee; border-radius: 7px;
  padding: 6px 8px; cursor: pointer; outline: none; max-width: 220px;
}
.preview select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.demo-flag {
  font-size: 9px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  color: #b45309; background: #fffbeb; border: 1px solid #fde68a;
  padding: 3px 6px; border-radius: 5px; white-space: nowrap;
}
.userbox { display: flex; align-items: center; gap: 9px; padding-left: 15px; border-left: 1px solid var(--line); }
.userbox .avatar {
  width: 34px; height: 34px; border-radius: 50%; order: 0;
  background: linear-gradient(135deg, var(--secondary), var(--primary)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800; flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta b { font-size: 12px; font-weight: 700; color: #1e293b; white-space: nowrap; }
.user-meta span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* =========================================================
   Contenido
   ========================================================= */
.content { padding: 26px 30px 34px; flex: 1; width: 100%; max-width: 1240px; }
.hero { display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-title { flex: 1; min-width: 280px; }
.eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; }
.hero-title h2 { font-size: 24px; font-weight: 800; letter-spacing: -.3px; color: #10163a; }
.hero-title p { margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.55; max-width: 620px; }
.hero-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search { position: relative; }
.search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: #94a3b8; stroke-width: 2; stroke-linecap: round;
}
.search input {
  width: 240px; padding: 9px 12px 9px 35px; border: 1px solid #cbd5e1; border-radius: 9px;
  font-size: 13px; background: #fff; color: #1f2937; font-family: var(--font-ui);
}
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.count-pill {
  font-size: 11.5px; font-weight: 700; color: var(--secondary);
  background: #eef2ff; border: 1px solid #dbe4ff; border-radius: 999px;
  padding: 6px 12px; white-space: nowrap;
}

/* Secciones y tarjetas */
.group { margin-bottom: 24px; }
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.group-head h3 { font-size: 11px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; color: #64748b; }
.group-head .rule { height: 1px; background: #dbe3ee; flex: 1; }
.group-head .num { font-size: 10.5px; font-weight: 700; color: #94a3b8; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.app {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: 13px; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.app.activa:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15,23,42,.12); border-color: #c9d5ea; }
.app::before { content: ''; display: block; height: 4px; background: var(--accent); opacity: .9; }
.app.futu { opacity: .82; }
.app.futu::before { opacity: .45; }
.app-body { padding: 16px 17px 14px; display: flex; flex-direction: column; flex: 1; }
.app-top { display: flex; align-items: flex-start; gap: 11px; }
.app-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 12%, white); color: var(--accent);
}
.app-icon svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-name { font-size: 14.5px; font-weight: 780; color: #10163a; letter-spacing: -.15px; line-height: 1.2; }
.app-sub { font-size: 11px; font-weight: 650; color: var(--accent); margin-top: 3px; letter-spacing: .15px; }
.app-desc { font-size: 11.5px; color: #4b5563; line-height: 1.5; margin: 10px 0 12px; }
.app-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.tag {
  font-size: 9px; font-weight: 800; letter-spacing: .45px; text-transform: uppercase;
  padding: 3px 7px; border-radius: 5px; white-space: nowrap;
}
.tag.live { background: var(--ok-bg); color: var(--ok-fg); }
.tag.local { background: #eef2ff; color: #3730a3; }
.tag.shared { background: #f1f5f9; color: #475569; }
.tag.warn { background: var(--warn-bg); color: var(--warn-fg); }
.tag.read { background: #f0f9ff; color: #0369a1; }
.app-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 17px; border-top: 1px solid #eef1f6; background: #fcfdff;
}
.app-url { font-family: var(--font-mono); font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.open {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 7px;
  font-size: 11.5px; font-weight: 700; color: #fff; background: var(--accent); flex-shrink: 0;
  transition: filter .15s;
}
.open:hover { filter: brightness(.93); }
.open svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.soon {
  font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: #94a3b8; background: #f1f5f9; border: 1px solid #e2e8f0;
  padding: 6px 9px; border-radius: 7px; flex-shrink: 0;
}

/* Tarjeta: quitar del panel central */
.app { position: relative; }
.app-remove {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px;
  border: 1px solid #dbe3ee; background: rgba(255,255,255,.95); color: #64748b;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; z-index: 2;
}
.app-remove:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.app-remove svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Drag & drop panel central */
#aplicaciones.drop-active {
  outline: 2px dashed #86b7ff; outline-offset: 6px; border-radius: 14px;
  background: rgba(15,118,110,.03); min-height: 140px;
}
.drop-hint {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 28px 18px; border: 2px dashed #c7d2e5; border-radius: 13px; background: #fff;
  color: #64748b; font-size: 13px; font-weight: 600; text-align: center;
}
.drop-hint svg { width: 20px; height: 20px; stroke: #0f766e; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.drop-hint b { color: #334155; }
.navitem[draggable="true"] { cursor: grab; }
.navitem[draggable="true"]:active { cursor: grabbing; }
.navitem.dragging { opacity: .45; }
.navitem.in-central .ni::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 7px; height: 7px; background: #22c55e; border-radius: 50%; border: 2px solid var(--secondary); }
.navitem .ni { position: relative; }
body.collapsed .navitem.in-central .ni::after { right: -1px; bottom: -1px; }

/* Aviso de accesos */
.access-note {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; background: #fff; border: 1px dashed #c7d2e5; border-radius: 11px;
  font-size: 12px; color: #475569;
}
.access-note b { color: var(--secondary); }
.access-note .lock { width: 15px; height: 15px; stroke: #64748b; fill: none; stroke-width: 2; flex-shrink: 0; }
.access-note a { margin-left: auto; font-weight: 700; color: var(--primary); white-space: nowrap; }
.access-note a:hover { text-decoration: underline; }

/* =========================================================
   Matriz de accesos
   ========================================================= */
.matrix-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; margin-top: 18px; }
.card-head { padding: 16px 19px 13px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 13px; font-weight: 780; color: #10163a; }
.card-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 760px; }
thead th {
  text-align: left; padding: 10px 14px; background: #f8fafc; color: #475569;
  font-size: 10px; font-weight: 800; letter-spacing: .55px; text-transform: uppercase;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
thead th.rol { text-align: center; }
tbody td { padding: 10px 14px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
tbody tr:hover { background: #f9fbff; }
tbody tr:last-child td { border-bottom: 0; }
.app-name-t { font-weight: 700; color: #10163a; }
.app-sub-t { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.cell { text-align: center; }
.lvl { display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: .45px; text-transform: uppercase; padding: 3px 8px; border-radius: 5px; white-space: nowrap; }
.lvl.admin { background: #fff4e5; color: #b45309; }
.lvl.operar { background: #eef2ff; color: #3730a3; }
.lvl.ver { background: #f0f9ff; color: #0369a1; }
.lvl.none { color: #cbd5e1; font-weight: 700; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 11px 19px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }

.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 18px; }
.rol-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.rol-card h4 { font-size: 12.5px; font-weight: 780; color: #10163a; display: flex; align-items: center; gap: 8px; }
.rol-card h4 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.rol-card p { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 6px; }
.rol-card ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.rol-card li { font-size: 11px; color: #475569; padding-left: 12px; position: relative; }
.rol-card li::before { content: ''; position: absolute; left: 0; top: 5px; width: 4px; height: 4px; border-radius: 50%; background: #cbd5e1; }

.model { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 18px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.panel h4 { font-size: 12.5px; font-weight: 780; color: #10163a; margin-bottom: 8px; }
.panel p { font-size: 12px; color: #4b5563; line-height: 1.6; }
.panel code { font-family: var(--font-mono); font-size: 11px; background: #f1f5f9; border-radius: 4px; padding: 1px 5px; color: #334155; }
.formula { margin-top: 9px; padding: 9px 11px; border-radius: 8px; background: #f8fafc; border: 1px dashed #cbd5e1; font-size: 11.5px; color: #334155; }
.note {
  display: flex; gap: 10px; margin-top: 16px; padding: 13px 15px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  font-size: 12px; color: #854d0e; line-height: 1.55;
}
.note b { color: #713f12; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .roles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%);
    width: var(--side-w) !important; flex-basis: var(--side-w) !important;
    transition: transform .2s ease; box-shadow: 12px 0 30px rgba(0,0,0,.22);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.collapsed .sidebar { width: var(--side-w) !important; }
  body.collapsed .logo-full { display: block; }
  body.collapsed .logo-mini { display: none; }
  body.collapsed .navgroup,
  body.collapsed .nl,
  body.collapsed .sidebar-foot .txt { display: block; }
  body.collapsed .navitem { justify-content: flex-start; padding: 9px 12px; }
  body.collapsed .sidebar-foot { justify-content: space-between; padding: 12px 18px; }
  body.collapsed .navscroll { padding: 14px 10px 8px; }
  .collapse-btn { display: none; }
  .hamburger { display: flex; }
  .content { padding: 20px 18px 30px; }
  .overlay {
    display: none; position: fixed; inset: 0; background: rgba(6,10,46,.45);
    z-index: 25; backdrop-filter: blur(1px);
  }
  body.nav-open .overlay { display: block; }
  .user-meta { display: none; }
  .userbox { padding-left: 10px; }
}
@media (max-width: 680px) {
  .grid { grid-template-columns: 1fr; }
  .roles { grid-template-columns: 1fr; }
  .model { grid-template-columns: 1fr; }
  .hero-title h2 { font-size: 20px; }
  .preview > span, .demo-flag { display: none; }
  .preview select { max-width: 150px; }
  .search input { width: 100%; }
  .hero-tools { width: 100%; }
  .search { flex: 1; }
  .topbar { padding: 0 14px; gap: 8px; }
  .page-title { font-size: 14px; }
}

/* =========================================================
   Inicio de sesión
   ========================================================= */
.login-body { display: block; background: #0b0f2e; }
.login-shell { display: flex; min-height: 100vh; }

.login-brand {
  flex: 0 0 46%; max-width: 620px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 42px 46px; color: #fff;
  background: radial-gradient(120% 120% at 0% 0%, #1b2a7a 0%, #0b0f2e 55%, #070a20 100%);
}
.login-brand::before,
.login-brand::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.login-brand::before {
  width: 420px; height: 420px; right: -160px; top: -140px;
  background: radial-gradient(circle, rgba(37,99,235,.36), transparent 68%);
}
.login-brand::after {
  width: 360px; height: 360px; left: -120px; bottom: -150px;
  background: radial-gradient(circle, rgba(124,58,237,.24), transparent 68%);
}
.login-brand > * { position: relative; z-index: 1; }
.login-brand img { height: 34px; width: auto; }
.login-brand .lb-mid { max-width: 420px; }
.login-brand .lb-eyebrow {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  color: #93c5fd; margin-bottom: 12px;
}
.login-brand h1 { font-size: 32px; line-height: 1.15; font-weight: 800; letter-spacing: -.5px; }
.login-brand .lb-desc { margin-top: 14px; font-size: 13.5px; line-height: 1.65; color: rgba(255,255,255,.68); max-width: 380px; }
.login-brand .lb-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.login-brand .lb-tag {
  font-size: 10px; font-weight: 800; letter-spacing: .45px; text-transform: uppercase;
  padding: 5px 9px; border-radius: 6px; color: #dbeafe;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
}
.login-brand .lb-foot { font-size: 11px; color: rgba(255,255,255,.42); display: flex; gap: 8px; align-items: center; }
.login-brand .lb-foot .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

.login-main {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center;
  padding: 32px 24px; background: var(--bg);
}
.login-shell { width: 100%; }
.login-card {
  width: 100%; max-width: 404px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 32px 30px 26px;
  box-shadow: 0 22px 55px rgba(15,23,42,.1);
}
.login-logo-sm { display: none; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.login-logo-sm b { font-size: 18px; color: var(--secondary); letter-spacing: -.2px; }
.login-card h2 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; color: #10163a; }
.login-sub { margin-top: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.login-field { margin-top: 17px; }
.login-field label {
  display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .55px;
  text-transform: uppercase; color: #64748b; margin-bottom: 6px;
}
.login-input {
  width: 100%; padding: 11px 13px; border: 1px solid #cbd5e1; border-radius: 9px;
  font-size: 13.5px; font-family: var(--font-ui); color: #1f2937; background: #fff;
}
.login-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.pw-wrap { position: relative; }
.pw-wrap .login-input { padding-right: 66px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: #eef2f9; color: #334155; font-size: 10.5px; font-weight: 700;
  padding: 5px 9px; border-radius: 6px; cursor: pointer;
}
.pw-toggle:hover { background: #e2e8f0; }

.login-error {
  display: none; margin-top: 15px; padding: 10px 12px; border-radius: 8px;
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  font-size: 12px; line-height: 1.45;
}
.login-error.show { display: block; }
.btn-login {
  width: 100%; margin-top: 19px; padding: 12px; border: 0; border-radius: 9px;
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 12px rgba(37,99,235,.28); transition: background .15s;
}
.btn-login:hover { background: var(--primary-dark); }
.btn-login:active { transform: translateY(1px); }

.login-help { margin-top: 16px; text-align: center; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.login-help a { color: var(--primary); font-weight: 650; word-break: break-word; }
.login-note {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #eef1f6;
  text-align: center; font-size: 10.5px; color: #94a3b8; line-height: 1.5;
}

@media (max-width: 900px) {
  .login-brand { display: none; }
  .login-shell { display: block; }
  .login-main { display: block; min-height: 100vh; padding: 40px 20px; }
  .login-card { margin: 0 auto; }
  .login-logo-sm { display: flex; }
  .login-main { background: #fff; }
  .login-body { background: #fff; overflow-x: hidden; }
  .login-card { border: 0; box-shadow: none; padding: 10px 4px 0; max-width: 380px; }
}

.demo-cred { border-top: 1px solid #eef1f6; padding-top: 10px; }
.demo-cred summary {
  font-size: 11px; font-weight: 700; color: #64748b; cursor: pointer;
  list-style: none; text-align: center;
}
.demo-cred summary::-webkit-details-marker { display: none; }
.demo-cred summary:hover { color: var(--primary); }
.demo-cred[open] summary { margin-bottom: 8px; }
.demo-cred-list { display: flex; flex-direction: column; gap: 6px; }
.demo-cred-list > div {
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 9px; border-radius: 7px; background: #f8fafc; border: 1px solid #eef1f6;
}
.demo-cred-list b { font-size: 11px; color: #1e293b; }
.demo-cred-list span { font-family: var(--font-mono); font-size: 10.5px; color: #64748b; }

/* Usuario y salida en la barra superior */
.userbox .logout {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid #dbe3ee; background: #fff; color: #475569;
  font-size: 11px; font-weight: 700; padding: 6px 9px; border-radius: 7px;
  cursor: pointer; flex-shrink: 0; margin-left: 2px;
}
.userbox .logout:hover { background: #f8fafc; color: #b91c1c; border-color: #fecaca; }
.userbox .logout svg {
  width: 13px; height: 13px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round;
}
@media (max-width: 680px) {
  .userbox .logout span { display: none; }
  .userbox .logout { padding: 6px; }
}

/* Etiqueta de perfiles previstos (no activos) */
.lvl.prev {
  background: #f8fafc; color: #64748b; border: 1px solid #eef1f6;
  font-size: 9.5px; letter-spacing: .3px; font-weight: 700;
}
