/* v2.3 - Capa visual minimalista. No contiene reglas de autenticacion.
   Se carga despues de styles.css y mobile.css. Las funciones y los datos
   anteriores se mantienen; el espacio pasa a ser del sistema embebido. */
:root {
  --sidebar: 200px;
  --header: 60px;
  --edge: 8px;
  --content-top: calc(var(--header) + var(--edge) * 2);
}
body:is([data-view="home"],[data-view="modules"],[data-view="favorites"],[data-view="admin"]) { overflow: hidden; }
body::before { background-image: linear-gradient(110deg,rgba(37,43,48,.14),rgba(245,246,248,.14)),url('./assets/fondo.jpg'); }
.shell { height: var(--app-height); min-height: 0; overflow: hidden; }
.topbar {
  top: var(--edge); left: var(--edge); right: var(--edge); height: var(--header); min-height: 0;
  padding: 6px 16px 6px 10px; gap: 14px; border-radius: 12px; flex-wrap: nowrap;
  background: rgba(255,255,255,.97); box-shadow: 0 3px 18px rgba(24,33,44,.05);
}
.mobile-menu { display: inline-flex; width: 38px; height: 38px; }
.brand { width: 120px; margin: 0 20px 0 0; justify-content: flex-start; }
.brand img { width: 110px; height: 47px; object-fit: contain; }
.global-search { margin: 0 auto; max-width: 410px; min-width: 130px; }
.global-search input { height: 36px; min-height: 36px; padding: 8px 38px; font-size: 13px; background: rgba(246,247,249,.85); border-radius: 8px; }
.global-search > .icon { top: 10px; left: 13px; width: 17px; height: 17px; }
.account { margin-left: 16px; }
.account summary { gap: 9px; padding: 2px; }
.account summary .avatar { width: 34px; height: 34px; font-size: 12px; }
.account-name { font-size: 12px; max-width: 140px; }
.account summary > .icon { width: 14px; margin-left: 3px; }
.account-popup { top: calc(100% + 12px); }
/* A single primary heading remains in each workspace, not in the header too. */
.topbar .sr-only { border: 0; }
.sidebar {
  top: var(--content-top); left: var(--edge); bottom: var(--edge); width: var(--sidebar);
  padding: 10px 8px; border-radius: 12px; background: rgba(255,255,255,.97);
  box-shadow: 0 3px 18px rgba(24,33,44,.05); overflow: hidden;
}
.sidebar .nav-button { min-height: 39px; padding: 9px 12px; margin-bottom: 3px; gap: 11px; font-size: 12px; border-radius: 8px; }
.sidebar .nav-button .icon { width: 19px; height: 19px; }
.sidebar .primary-nav { flex-shrink: 0; }
.sidebar .module-nav { min-height: 36px; font-size: 12px; }
.sidebar .module-nav > .nav-external { width: 12px; height: 12px; }
.sidebar-separator { height: 1px; margin: 9px 10px; background: var(--line); flex-shrink: 0; }
.sidebar-accesses { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; overscroll-behavior: contain; }
.sidebar .sidebar-bottom { margin-top: 8px; padding-top: 8px; }
.sidebar .sidebar-bottom .nav-button { min-height: 36px; margin-bottom: 0; padding: 8px 12px; }
.sidebar-empty { padding: 12px; font-size: 11px; }
.workspace,.workspace.workspace-embedded {
  position: fixed; top: var(--content-top); left: calc(var(--sidebar) + var(--edge) * 2); right: var(--edge); bottom: var(--edge);
  height: calc(var(--app-height) - var(--content-top) - var(--edge)); min-height: 0; margin: 0; padding: 0;
}
.workspace::before { display: none; }
.page-inner,.workspace-embedded .page-inner { height: 100%; min-height: 0; max-width: none; margin: 0; display: flex; flex-direction: column; }
.idle-panel,.catalog-panel,.embedded-panel {
  display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; height: 100%;
  border: 1px solid rgba(231,233,236,.96); border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,.96); box-shadow: 0 3px 22px rgba(24,33,44,.04);
}
.idle-panel { backdrop-filter: blur(8px); }
.panel-toolbar,.embedded-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 5px 12px; min-height: 46px; height: 46px; border-bottom: 1px solid var(--line); flex-shrink: 0;
  background: rgba(255,255,255,.75); position: relative;
}
.panel-toolbar::after,.embedded-toolbar::after { content: ''; position: absolute; bottom: -1px; left: 12px; width: 38px; height: 2px; background: var(--brand); }
.panel-toolbar h1 { display: flex; align-items: center; gap: 10px; font-size: 14px; letter-spacing: -.015em; font-weight: 600; min-width: 0; }
.panel-toolbar h1 > .icon { width: 18px; height: 18px; color: #717c8a; }
.panel-toolbar > .icon-button { width: 32px; height: 32px; }
.idle-content { display: flex; flex: 1; min-height: 0; align-items: center; justify-content: center; padding: 24px; }
.workspace-placeholder { display: flex; flex-direction: column; align-items: center; gap: 15px; background: none; border: 0; padding: 18px 25px; border-radius: 14px; color: #788290; font-size: 13px; }
.workspace-placeholder > .icon { width: 75px; height: 75px; stroke-width: .9; color: #bac0c8; }
.workspace-placeholder:hover { color: var(--brand-dark); background: #fff8f0; }
.catalog-body { flex: 1; min-height: 0; overflow: auto; padding: 18px; overscroll-behavior: contain; }
.catalog-count { font-size: 12px; color: var(--muted); }
.menu-toolbar { display: block; margin-bottom: 14px; }
.category-list { gap: 6px; }
.chip { border: 1px solid var(--line); box-shadow: none; background: #f7f8fa; padding: 7px 11px; font-weight: 500; }
.chip.active { background: var(--brand-soft); color: var(--brand-dark); border-color: #f2d7bb; box-shadow: none; }
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 10px; }
.module-card { display: flex; align-items: center; min-width: 0; min-height: 68px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: none; transform: none; }
.module-card:hover { transform: none; border-color: #e9c8a7; box-shadow: 0 2px 8px rgba(25,33,45,.03); }
.card-link { display: flex; align-items: center; flex: 1; min-width: 0; gap: 11px; padding: 14px 10px 14px 14px; }
.card-link > .module-icon { width: 36px; height: 36px; border-radius: 9px; }
.card-link > .module-icon .icon { width: 20px; height: 20px; }
.card-link h2 { font-size: 14px; font-weight: 600; letter-spacing: -.015em; min-width: 0; overflow-wrap: anywhere; }
.card-link > .card-arrow { width: 15px; height: 15px; color: #939ca9; margin-left: auto; }
.module-card .favorite { position: static; width: 34px; height: 36px; margin-right: 8px; background: none; }
.module-card .favorite .icon { width: 16px; height: 16px; }
.module-card .favorite.selected { color: var(--brand-dark); }
.filter-summary { padding: 0 4px 10px; margin: 0; border-radius: 0; background: none; font-size: 12px; }
.empty-state { box-shadow: none; border: 0; padding: 40px 20px; background: transparent; }
.empty-state h2 { font-size: 19px; }
.embedded-heading { width: auto; min-width: 0; gap: 9px; }
.embedded-heading .module-icon { display: flex; width: 28px; height: 28px; border-radius: 7px; }
.embedded-heading .module-icon .icon { width: 17px; height: 17px; }
.embedded-heading h1 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; min-width: 0; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.embedded-actions { display: flex; width: auto; gap: 3px; flex-shrink: 0; }
.embedded-actions .icon-button { width: 32px; height: 32px; min-width: 32px; min-height: 32px; border-radius: 8px; }
.embedded-actions .icon-button .icon { width: 17px; height: 17px; }
.frame-menu { display: none; }
.frame-container { flex: 1; min-height: 0; }
/* Successful iframe load is not proof of access to the external site. Keep
   its status accessible without a second, permanently visible toolbar. */
.frame-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.frame-status.waiting,.frame-status.notice-visible { width: auto; height: auto; max-width: calc(100% - 24px); bottom: 10px; left: 10px; z-index: 2; margin: 0; padding: 7px 12px; clip-path: none; white-space: normal; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.98); box-shadow: 0 2px 12px rgba(24,33,44,.08); color: #576170; font-size: 12px; pointer-events: none; }
.frame-status.notice-visible { background: #fff6e9; border-color: #f0d5b6; color: #704322; }
.frame-help { max-height: min(180px,35vh); }
/* Minimal admin chrome: tables, permissions and safety messages remain. */
body[data-view="admin"] .page-inner { background: rgba(255,255,255,.975); border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.admin-heading { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 5px 12px; min-height: 46px; margin: 0; background: #fff; }
.admin-heading h1 { font-size: 16px; color: var(--ink); text-shadow: none; }
.admin-panel { min-height: 0; flex: 1; display: flex; flex-direction: column; box-shadow: none; border: 0; border-radius: 0; background: transparent; overflow: hidden; }
.admin-tabs { flex-shrink: 0; min-height: 0; padding: 0 14px; gap: 20px; }
.admin-tab { min-height: 44px; font-size: 12px; }
#admin-content { overflow: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }
.admin-toolbar { padding: 14px 18px; }
.admin-toolbar h2 { font-size: 15px; }
.table-foot { padding: 10px 18px; }
/* Login: the supplied logo is the identity; no duplicate title/slogans. */
.login-card { width: min(100%,400px); padding: 34px 34px 28px; border-radius: 18px; }
.login-logo { width: 225px; height: auto; margin: 0 auto 27px; }
.login-form { margin-top: 0; }
.login-submit { margin-top: 20px; }
.login-options { margin: 12px 0 0; }
.login-options + .login-submit { margin-top: 13px; }
.boot-screen { background: rgba(255,255,255,.88); }
/* Fewer fixed bars in mobile: everything remains in header and drawer. */
.mobile-tabbar { display: none !important; }
.workspace-focus .workspace.workspace-embedded { top: var(--edge); left: calc(var(--sidebar) + var(--edge) * 2); right: var(--edge); bottom: var(--edge); margin: 0; padding: 0; height: calc(var(--app-height) - var(--edge) * 2); }
.workspace-focus .sidebar { top: var(--edge); }
.workspace-focus .embedded-panel { border-radius: 12px; }
.workspace-focus .frame-menu { display: inline-flex; }
/* Match the JS breakpoint exactly, including wide touch tablets. */
@media (min-width: 981px) {
  html:not(.compact-device) .sidebar-collapsed { --sidebar: 64px; }
  html:not(.compact-device) .sidebar-collapsed .sidebar { padding: 9px; }
  html:not(.compact-device) .sidebar-collapsed .sidebar .nav-button { justify-content: center; width: 44px; height: 42px; min-height: 42px; padding: 0; gap: 0; }
  html:not(.compact-device) .sidebar-collapsed .sidebar .nav-button > span,.sidebar-collapsed .sidebar .nav-external { display: none; }
  html:not(.compact-device) .sidebar-collapsed .sidebar .sidebar-empty { display: none; }
  html:not(.compact-device) .sidebar-collapsed .sidebar-separator { margin: 8px 0; }
  html:not(.compact-device) .sidebar-collapsed .sidebar .sidebar-bottom { padding-top: 6px; }
}
@media (max-width: 980px), (max-width: 1180px) and (pointer: coarse) {
  :root { --edge: 6px; --sidebar: 320px; --compact-top: calc(56px + var(--safe-top)); --compact-bottom: 0px; --content-top: calc(var(--compact-top) + var(--edge)); }
  .topbar { top: 0; left: 0; right: 0; min-height: 0; height: calc(56px + var(--safe-top)); padding: calc(var(--safe-top) + 4px) max(10px,env(safe-area-inset-right,0px)) 4px max(6px,env(safe-area-inset-left,0px)); gap: 6px; border-radius: 0 0 10px 10px; }
  .mobile-menu,.mobile-search-toggle { width: 44px; height: 44px; }
  .brand { width: auto; margin: 0 auto 0 0; }
  .brand img { width: 99px; height: 44px; }
  .account { margin: 0; }
  .account summary { min-width: 44px; min-height: 44px; padding: 4px; }
  .account-name { display: none; }
  .account summary .avatar { width: 34px; height: 34px; }
  .global-search { display: none; margin: 0; position: absolute; top: calc(100% + 5px); left: 6px; right: 6px; max-width: none; }
  .global-search input { height: 48px; min-height: 48px; font-size: 16px; padding-left: 40px; padding-right: 50px; background: white; }
  .global-search > .icon { top: 15px; left: 13px; width: 18px; height: 18px; }
  .global-search .search-close { top: 2px; right: 3px; }
  .search-open { --compact-top: calc(110px + var(--safe-top)); }
  .search-open .topbar { height: calc(56px + var(--safe-top)); }
  .search-open .global-search { display: block; }
  .sidebar { width: min(320px,calc(100vw - 40px)); top: 0; bottom: 0; left: 0; border-radius: 0 16px 16px 0; padding: max(12px,var(--safe-top)) 12px max(12px,var(--safe-bottom)); background: #fff; overflow: hidden; }
  .drawer-head { margin-bottom: 10px; padding: 0 4px; }
  .drawer-head img { width: 122px; height: 54px; object-fit: contain; }
  .drawer-search { margin-bottom: 10px; }
  .drawer-search input { min-height: 44px; height: 44px; }
  .drawer-search > .icon { top: 13px; }
  .sidebar .nav-button,.sidebar .module-nav { min-height: 44px; font-size: 13px; padding: 9px 12px; }
  .sidebar-accesses { flex: 1; min-height: 0; }
  .sidebar .sidebar-bottom .nav-button { min-height: 44px; }
  .sidebar .sidebar-bottom { margin-top: 6px; padding-top: 6px; }
  .workspace,.workspace.workspace-embedded { top: var(--content-top); left: max(var(--edge),env(safe-area-inset-left,0px)); right: max(var(--edge),env(safe-area-inset-right,0px)); bottom: max(var(--edge),var(--safe-bottom)); margin: 0; padding: 0; height: calc(var(--app-height) - var(--content-top) - max(var(--edge),var(--safe-bottom))); }
  .page-inner { max-width: none; }
  .idle-panel,.catalog-panel,.embedded-panel { border-radius: 9px; }
  .panel-toolbar,.embedded-toolbar { height: 48px; min-height: 48px; padding: 2px 6px 2px 10px; gap: 6px; flex-wrap: nowrap; }
  .panel-toolbar h1 { font-size: 14px; gap: 8px; }
  .panel-toolbar > .icon-button { width: 44px; height: 44px; }
  .catalog-body { padding: 12px; }
  .category-list { padding-bottom: 5px; }
  .chip { font-size: 12px; min-height: 44px; padding: 8px 12px; }
  .modules-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .module-card { min-height: 65px; }
  .card-link { padding: 13px 4px 13px 12px; gap: 10px; }
  .card-link h2 { font-size: 14px; }
  .card-link > .card-arrow { display: none; }
  .module-card .favorite { width: 44px; height: 44px; margin-right: 3px; }
  .module-card .favorite .icon { width: 18px; height: 18px; }
  .embedded-heading { width: auto; min-width: 0; flex: 1; gap: 7px; }
  .embedded-heading .module-icon { display: none; }
  .embedded-heading h1 { font-size: 13px; }
  .embedded-actions { width: auto; display: flex; gap: 0; }
  .embedded-actions .icon-button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .embedded-actions .icon-button .icon { width: 18px; height: 18px; }
  .frame-menu { display: none; }
  .workspace-focus .frame-menu { display: inline-flex; }
  .workspace-focus .workspace.workspace-embedded { top: var(--safe-top); left: env(safe-area-inset-left,0px); right: env(safe-area-inset-right,0px); bottom: var(--safe-bottom); height: calc(var(--app-height) - var(--safe-top) - var(--safe-bottom)); padding: 0; margin: 0; }
  .workspace-focus .embedded-panel { border-radius: 0; border: 0; }
  .workspace-focus .embedded-toolbar { padding-top: 2px; }
  .workspace-focus .sidebar { top: 0; }
  .frame-help { font-size: 12px; }
  .admin-heading { padding: 2px 8px 2px 14px; min-height: 48px; }
  .admin-heading h1 { font-size: 16px; }
  .admin-tabs { padding: 0 12px; gap: 16px; }
  .admin-tab { min-height: 48px; font-size: 12px; }
  .admin-toolbar { padding: 12px; gap: 12px; }
  .admin-toolbar h2 { font-size: 15px; }
  .login-card { width: min(100%,400px); padding: 28px 25px 25px; border-radius: 18px; }
  .login-logo { width: 215px; margin-bottom: 24px; }
  .login-form { margin-top: 0; }
  .login-options { margin: 8px 0 0; }
  .login-options + .login-submit { margin-top: 10px; }
  .toast,.connection-banner { bottom: calc(var(--safe-bottom) + 10px); }
}
@media (max-width: 600px) {
  .modules-grid { grid-template-columns: minmax(0,1fr); }
  .idle-content { padding: 14px; }
  .workspace-placeholder > .icon { width: 60px; height: 60px; }
  .admin-tabs { gap: 14px; }
  .admin-tab { font-size: 11px; }
}
@media (max-height: 500px) and (max-width: 1180px) {
  /* Avoid trapping modules below the drawer header in phone landscape. */
  .compact-device .sidebar { overflow-y: auto; }
  .compact-device .sidebar-accesses { min-height: 130px; flex-shrink: 0; }
  .login-screen { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

.touch-device .embedded-actions .icon-button { min-width: 44px; min-height: 44px; width: 44px; height: 44px; }

/* v2.5.9 - KPIs en el Area de trabajo */
.workspace-home-body { display:flex; flex-direction:column; flex:1; min-height:0; overflow:auto; }
.workspace-toolbar-actions { display:flex; align-items:center; gap:6px; }
.workspace-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; padding:18px 20px 4px; flex-shrink:0; }
.workspace-kpi { appearance:none; text-align:left; min-width:0; border:1px solid #e5e9ef; border-radius:14px; background:#fff; padding:14px 16px; cursor:pointer; box-shadow:0 2px 8px rgba(16,24,40,.045); transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease; color:inherit; }
.workspace-kpi:hover { transform:translateY(-1px); box-shadow:0 6px 18px rgba(16,24,40,.08); border-color:#d7dde5; }
.workspace-kpi-source { display:flex; align-items:center; gap:6px; color:#8a94a3; font-size:10px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.workspace-kpi-source .icon { width:14px; height:14px; color:var(--brand); flex:0 0 auto; }
.workspace-kpi-title { display:block; margin-top:9px; color:var(--muted); font-size:11px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.workspace-kpi strong { display:block; margin-top:5px; font-size:24px; line-height:1.15; color:#20252b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.workspace-kpi small { display:block; margin-top:6px; color:#a62828; font-size:9px; line-height:1.35; }
.workspace-kpi.has-error { border-color:#f0d0d0; background:#fffafa; }
.workspace-kpi-loading { padding:18px 20px 0; color:var(--muted); font-size:11px; }
.workspace-home .idle-content { min-height:220px; }
.kpi-config-row { grid-template-columns:minmax(130px,1.25fr) minmax(130px,1fr) minmax(105px,.8fr) minmax(120px,.9fr) 86px 125px 36px; }
.kpi-workspace { align-self:center; margin-bottom:7px; font-size:10px; white-space:nowrap; }
@media (max-width:900px) { .workspace-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } .kpi-config-row { grid-template-columns:1fr 1fr; } }
@media (max-width:600px) { .workspace-kpis { display:flex; overflow-x:auto; padding:12px 12px 2px; } .workspace-kpi { flex:0 0 180px; } .workspace-kpi strong { font-size:20px; } }


/* v2.6.5 - Login corporativo y loader compacto */
body[data-view="login"]::before {
  background:
    linear-gradient(108deg, rgba(18,27,34,.66) 0%, rgba(18,27,34,.43) 44%, rgba(18,27,34,.18) 100%),
    url('./assets/fondo.jpg') center center/cover no-repeat;
}
.login-screen.login-screen-corporate {
  min-height: 100dvh;
  padding: clamp(22px, 4vw, 54px);
  display: grid;
  place-items: center;
}
.login-shell {
  width: min(1040px, 100%);
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 34px 90px rgba(12,20,29,.30), 0 8px 24px rgba(12,20,29,.12);
  backdrop-filter: blur(18px);
}
.login-showcase {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(22,29,36,.17), rgba(17,24,31,.62)),
    url('./assets/fondo.jpg') center/cover no-repeat;
}
.login-showcase::before,
.login-showcase::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(255,153,55,.18);
}
.login-showcase::before { width: 520px; height: 118px; top: 36px; left: -165px; transform: rotate(-28deg); }
.login-showcase::after { width: 390px; height: 86px; right: -135px; bottom: 70px; transform: rotate(-28deg); }
.login-showcase-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 25% 20%, rgba(255,153,55,.19), transparent 34%);
}
.login-showcase-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 48px;
  color: #fff;
}
.login-showcase-mark {
  width: 68px;
  height: 68px;
  padding: 12px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 14px 34px rgba(0,0,0,.14);
  margin-bottom: 26px;
}
.login-showcase-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  color: #ffc078;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.login-showcase-kicker::before { content:''; width: 24px; height: 2px; border-radius: 2px; background: #ff9937; }
.login-showcase h2 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(30px, 3.3vw, 44px);
  line-height: 1.08;
  letter-spacing: -.04em;
  font-weight: 760;
  text-shadow: 0 3px 18px rgba(0,0,0,.16);
}
.login-showcase p {
  max-width: 500px;
  margin-top: 16px;
  color: rgba(255,255,255,.82);
  font-size: 15px;
  line-height: 1.6;
}
.login-showcase-line { width: 100%; height: 1px; margin: 30px 0 16px; background: rgba(255,255,255,.18); }
.login-showcase-foot { color: rgba(255,255,255,.68); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
.login-card.login-card-corporate {
  width: auto;
  min-width: 0;
  padding: 48px 42px 38px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-brand-block { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom: 30px; }
.login-card-corporate .login-logo { width: 180px; max-width: 62%; height: auto; margin: 0; }
.login-portal-label {
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #eceff3;
  background: #f8fafc;
  color: #697586;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.login-card-corporate .login-heading h1 { font-size: 30px; color: #101828; letter-spacing: -.04em; }
.login-card-corporate .login-heading p { margin-top: 7px; color: #667085; font-size: 13px; }
.login-card-corporate .login-form { margin-top: 28px; }
.login-card-corporate .field + .field { margin-top: 16px; }
.login-card-corporate .field label { font-size: 12px; color: #344054; }
.login-card-corporate .input-wrap input {
  min-height: 49px;
  border-radius: 11px;
  background: #fbfcfd;
  border-color: #e4e7ec;
}
.login-card-corporate .input-wrap input:focus { background: #fff; }
.login-card-corporate .login-options { margin: 13px 0 0; }
.login-card-corporate .login-submit {
  min-height: 50px;
  margin-top: 14px;
  border-radius: 11px;
  font-weight: 750;
  background: linear-gradient(180deg,#ffa341,#ff9222);
  border-color: #ff9222;
  box-shadow: 0 8px 18px rgba(255,146,34,.22);
}
.login-card-corporate .login-submit:hover { background: linear-gradient(180deg,#ffad55,#ff9830); }
.login-security-note {
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #98a2b3;
  font-size: 11px;
}
.login-security-note .icon { width: 14px; height: 14px; }

/* Loader corporativo reducido: pensado para pantallas de notebook 1366x768 y superiores. */
.agstudio-loading-panel,
.agstudio-loading-screen.agstudio-loading-screen-corporate {
  min-height: min(500px, calc(100dvh - 185px));
}
.agstudio-loading-screen.agstudio-loading-screen-corporate { padding: 16px; }
.agstudio-loader-card {
  width: min(760px, 94%);
  min-height: 430px;
  gap: 10px;
  padding: 24px 28px 22px;
  border-radius: 22px;
}
.agstudio-loader-card::before { height: 5px; border-radius: 22px 22px 0 0; }
.agstudio-loader-brand { gap: 11px; margin-bottom: 0; }
.agstudio-loader-brand-logo { width: 130px; }
.agstudio-loader-brand-line { height: 22px; }
.agstudio-loader-brand-text { font-size: 10px; }
.agstudio-loader-orbit { width: 150px; height: 150px; margin-top: 0; }
.agstudio-loader-ring { inset: 8px; border-width: 7px; }
.agstudio-loader-ring::after { inset: -7px; border-width: 7px; }
.agstudio-loader-dot { width: 11px; height: 11px; top: 14px; right: 20px; box-shadow: 0 0 0 6px rgba(255,152,31,.08),0 0 16px rgba(255,152,31,.28); }
.agstudio-loader-logo { width: 66px; height: 66px; }
.agstudio-loader-shadow { bottom: 17px; width: 64px; height: 9px; }
.agstudio-loader-copy { gap: 6px; max-width: 620px; }
.agstudio-loader-kicker { padding: 5px 10px; font-size: 9px; }
.agstudio-loading-screen h2 { font-size: clamp(25px, 3vw, 36px); }
.agstudio-loading-screen p { font-size: 13px; line-height: 1.4; max-width: 560px; }
.agstudio-loading-screen .agstudio-loader-report { padding: 6px 11px; font-size: 11px; }
.agstudio-loader-progress { width: min(470px, 78vw); height: 9px; margin-top: 5px; }
.agstudio-loading-screen small { font-size: 10px; max-width: 520px; line-height: 1.4; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; width: min(470px,100%); min-height: 0; }
  .login-showcase { display: none; }
  .login-card.login-card-corporate { padding: 38px 34px 31px; border-radius: 24px; }
  .login-brand-block { margin-bottom: 24px; }
  .login-card-corporate .login-logo { width: 170px; }
  .agstudio-loading-panel,
  .agstudio-loading-screen.agstudio-loading-screen-corporate { min-height: min(450px, calc(100dvh - 158px)); }
  .agstudio-loader-card { width:min(650px,96%); min-height:390px; padding:20px 20px 18px; }
  .agstudio-loader-orbit { width:132px; height:132px; }
  .agstudio-loader-logo { width:58px; height:58px; }
}
@media (max-width: 600px) {
  .login-screen.login-screen-corporate { padding: max(18px,var(--safe-top)) 14px max(18px,var(--safe-bottom)); align-items:center; }
  .login-card.login-card-corporate { padding: 30px 22px 25px; border-radius: 20px; }
  .login-brand-block { margin-bottom: 20px; }
  .login-card-corporate .login-logo { width: 155px; }
  .login-portal-label { font-size: 9px; padding: 6px 8px; }
  .login-card-corporate .login-heading h1 { font-size: 26px; }
  .login-card-corporate .login-form { margin-top: 23px; }
  .agstudio-loading-panel,
  .agstudio-loading-screen.agstudio-loading-screen-corporate { min-height: min(410px, calc(100dvh - 145px)); }
  .agstudio-loader-card { width:98%; min-height:350px; padding:18px 14px 16px; border-radius:18px; }
  .agstudio-loader-brand-logo { width:112px; }
  .agstudio-loader-brand-text { display:none; }
  .agstudio-loader-brand-line { display:none; }
  .agstudio-loader-orbit { width:116px; height:116px; }
  .agstudio-loader-logo { width:50px; height:50px; }
  .agstudio-loading-screen h2 { font-size: clamp(23px,7vw,30px); }
  .agstudio-loading-screen p { font-size:12px; }
  .agstudio-loading-screen small:last-child { display:none; }
}


/* ================================================================
   Categorias de accesos - v2.6.15
   Color sutil por categoria, aplicado a cards y filtros.
   ================================================================ */
.module-card,
.chip {
  --cat-accent: #64748b;
  --cat-soft: #f8fafc;
  --cat-border: #e2e8f0;
  --cat-icon-bg: #f1f5f9;
}
.category-ventas { --cat-accent:#d96816; --cat-soft:#fff8f1; --cat-border:#f5d8bc; --cat-icon-bg:#fff0df; }
.category-cobranzas { --cat-accent:#2f7d4a; --cat-soft:#f4fbf6; --cat-border:#cfe9d7; --cat-icon-bg:#e8f7ed; }
.category-clientes { --cat-accent:#3b6fa8; --cat-soft:#f5f9fe; --cat-border:#d2e1f2; --cat-icon-bg:#eaf2fb; }
.category-productos { --cat-accent:#7556a8; --cat-soft:#faf7fd; --cat-border:#e1d7ef; --cat-icon-bg:#f1ebf8; }
.category-logistica { --cat-accent:#2782a4; --cat-soft:#f4fbfd; --cat-border:#cde7ef; --cat-icon-bg:#e6f5f9; }
.category-comunicaciones { --cat-accent:#a95787; --cat-soft:#fdf7fa; --cat-border:#edd5e2; --cat-icon-bg:#f8eaf1; }
.category-gestion { --cat-accent:#9a6a25; --cat-soft:#fdfaf4; --cat-border:#eadfca; --cat-icon-bg:#f8f0df; }
.category-general { --cat-accent:#64748b; --cat-soft:#f8fafc; --cat-border:#e2e8f0; --cat-icon-bg:#f1f5f9; }

.module-card[class*="category-"] {
  position: relative;
  overflow: hidden;
  border-color: var(--cat-border);
  background: linear-gradient(110deg, var(--cat-soft) 0%, #fff 48%, #fff 100%);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.module-card[class*="category-"]::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--cat-accent);
  opacity: .58;
}
.module-card[class*="category-"] .card-link > .module-icon {
  background: var(--cat-icon-bg);
  color: var(--cat-accent);
  border: 1px solid var(--cat-border);
}
.module-card[class*="category-"] .card-arrow { color: var(--cat-accent); opacity: .58; }
.module-card[class*="category-"] .favorite.selected { color: var(--cat-accent); }
.module-card[class*="category-"]:hover {
  border-color: var(--cat-accent);
  box-shadow: 0 3px 12px rgba(25,33,45,.055);
}
.module-card[class*="category-"]:hover::before { opacity: .88; }

.chip[class*="category-"] {
  background: var(--cat-soft);
  color: #4b5563;
  border-color: var(--cat-border);
}
.chip[class*="category-"]:hover { border-color: var(--cat-accent); color: var(--cat-accent); }
.chip[class*="category-"].active {
  background: var(--cat-icon-bg);
  color: var(--cat-accent);
  border-color: var(--cat-accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat-accent) 14%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .module-card[class*="category-"] { transition: none; }
}
