/* Línea visual del portal. Sólo pantalla: no modifica etiquetas ni impresión. */
@media screen {
html[data-portal-module] body {
  --page: #f0f3f8; --canvas: #f0f3f8; --background: #f0f3f8; --bg: #f0f3f8;
  --surface: #fff; --surface-solid: #fff; --surface-soft: #f8fafc; --surface-muted: #f8fafc; --surface-light: #edf3fb;
  --panel: #fff; --panel-strong: #fff; --card: #fff;
  --text: #172c44; --ink: #172c44; --muted: #576b80; --ink-muted: #576b80;
  --line: #dce4ed; --border: #dce4ed; --line-strong: #bdcddd; --border-focus: #205bc5;
  --brand: #205bc5; --brand-dark: #184aa3; --primary: #205bc5; --primary-dark: #184aa3;
  --theme: #205bc5; --theme-strong: #184aa3; --blue: #205bc5; --blue-deep: #184aa3; --blue-soft: #edf3ff;
  --accent: #205bc5; --accent-deep: #184aa3; --accent-dark: #184aa3;
  --issue-accent: #205bc5; --issue-accent-dark: #184aa3; --issue-soft: #edf3ff;
  --navy: #172f4d; --navy-soft: #213e60; --coral: #205bc5; --coral-soft: #edf3ff;
  --success: #16734e; --green: #16734e; --green-soft: #eaf7f0;
  --danger: #a63143; --red: #a63143; --red-soft: #fff0f3; --warning: #926116; --amber: #926116; --amber-soft: #fff4da;
  --shadow: 0 4px 18px #152d4910; --shadow-soft: 0 4px 18px #152d4910; --shadow-sm: 0 3px 12px #152d490a; --shadow-md: 0 12px 40px #172f4d20;
  --radius-large: 14px; --radius-medium: 12px; --radius-small: 8px; --radius-lg: 14px; --radius-md: 12px; --radius-sm: 8px;
  --select-bg: #fff; --select-ink: #172c44; --select-focus: #205bc5; --select-focus-ring: #205bc522;
  --select-menu-bg: #fff; --select-menu-ink: #172c44; --select-option-hover: #edf3ff; --select-option-selected: #205bc5;
  margin: 0; min-height: 100vh; background: #f0f3f8; color: #172c44;
  font-family: "Segoe UI", system-ui, sans-serif; font-size: 16px; line-height: 1.5;
}
html[data-portal-module] body::before { display: none; }
html[data-portal-module] :where(button, input, select, textarea) { font-family: inherit; }
html[data-portal-module] :where(.creator-shell, .receipt-shell, .users-shell, .database-shell, .search-shell, .portal-shell) {
  width: min(1560px, calc(100% - 64px)); margin: 0 auto; padding: 28px 0 100px;
}
html[data-portal-module] :where(.creator-topbar, .receipt-header, .users-topbar, .database-header, .search-topbar, .portal-header, .studio-header) {
  color: #172c44; background: transparent; border: 0; border-bottom: 1px solid #dce4ed;
  border-radius: 0; box-shadow: none; backdrop-filter: none; min-height: 0;
  padding: 0 0 24px; margin-bottom: 28px; gap: 24px;
}
html[data-portal-module] :where(.brand-block, .header-copy) { color: #172c44; }
html[data-portal-module] :where(.brand-block h1, .receipt-header h1, .database-header h1, .search-topbar h1, .users-topbar h1) {
  color: #172c44; font-size: clamp(1.7rem, 3vw, 2.25rem); line-height: 1.2; letter-spacing: -.035em; margin: 4px 0 10px;
}
html[data-portal-module] :where(.hero-copy, .header-description, .database-header p, .search-topbar p, .users-topbar p) {
  color: #576b80; font-size: 1rem; line-height: 1.5;
}
html[data-portal-module] :where(.eyebrow, .panel-label, .section-kicker, .company-caption, .workspace-overline) {
  font-size: .75rem; color: #526a83; letter-spacing: .09em; text-transform: uppercase;
}
html[data-portal-module] .back-link { color: #526a83; font-size: .875rem; text-decoration: none; }
html[data-portal-module] .back-link:hover { color: #205bc5; }
html[data-portal-module] :where(.panel, .panel-card, .form-panel, .search-card, .results-card, .label-card, .receipt-labels-card, .tip-card, .catalog-import-card, .module-card) {
  background: #fff; color: #172c44; border: 1px solid #dce4ed; border-radius: 14px;
  box-shadow: none; backdrop-filter: none;
}
html[data-portal-module] :where(.panel-header, .section-heading) { border-color: #dce4ed; }
html[data-portal-module] :where(.company-header, .session-card, .header-meta) {
  background: #fff; color: #172c44; border: 1px solid #dce4ed; border-radius: 12px; box-shadow: none; backdrop-filter: none;
}
html[data-portal-module] #companyTitle { font-size: 1rem; color: #172c44; overflow-wrap: anywhere; }
html[data-portal-module] .logofondo { display: none; }
html[data-portal-module] .status-card { background: #fff; color: #172c44; border: 1px solid #dce4ed; border-radius: 12px; box-shadow: none; }
html[data-portal-module] .status-card :where(strong, span) { color: #526a83; }
html[data-portal-module] .eyebrow { margin-top: 12px; }
html[data-portal-module] :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea, .custom-select-trigger) {
  border-radius: 8px; border: 1px solid #ccd8e5; background-color: #fff; color: #172c44;
  min-height: 44px; font-size: .875rem; box-shadow: none; backdrop-filter: none;
}
html[data-portal-module] :where(input, textarea)::placeholder { color: #6c7f91; opacity: 1; }
html[data-portal-module] :where(input:disabled, select:disabled, textarea:disabled) { background-color: #edf1f6; color: #65788c; }
html[data-portal-module] :where(label, .field-label, .form-field > span, .field > span) { font-size: .875rem; }
html[data-portal-module] :where(button, .primary-button, .secondary-button) { border-radius: 8px; box-shadow: none; font-weight: 600; font-size: .875rem; }
html[data-portal-module] :where(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid #3784ed; outline-offset: 3px; }
html[data-portal-module] :where(input[type="checkbox"], input[type="radio"]) { accent-color: #205bc5; }
html[data-portal-module] :where(.primary-button, .create-button, .primary-action, #uploadButton, #loginButton, #saveUserBtn, #generateButton, .label-card button[type="submit"]) {
  background: #205bc5; color: #fff; border: 1px solid #205bc5; box-shadow: none;
}
html[data-portal-module] :where(.secondary-button, .secondary-action, .logout-button) { background: #fff; color: #254e85; border: 1px solid #ccd8e5; }
html[data-portal-module] :where(.danger-button, .danger-action) { color: #a63143; background: #fff0f3; border: 1px solid #e8ccd3; }
html[data-portal-module] button:hover:not(:disabled) { transform: none; }
html[data-portal-module] :where(.table-container, .table-wrap, .table-wrapper) { border-radius: 10px; border-color: #dce4ed; background: #fff; }
html[data-portal-module] th { background: #edf2f8; color: #405a75; border-color: #dce4ed; font-size: .8125rem; }
html[data-portal-module] td { border-color: #e6ecf3; font-size: .875rem; }
html[data-portal-module] :where(dialog, .modal-content, .dialog-card, .upload-progress-card, .loading-box) { border-radius: 14px; color: #172c44; background-color: #fff; box-shadow: 0 20px 60px #172f4d30; }
html[data-portal-module] dialog::backdrop { background: #122944a6; backdrop-filter: blur(3px); }
html[data-portal-module] :where(.empty-state, .empty-card) { color: #576b80; }
html[data-portal-module] #disclaimer { background: transparent; color: #65788d; font-size: .75rem; }
/* Flujos de inventario: contexto lateral y espacio principal sin encabezados gigantes. */
html[data-portal-module] :where(.receipt-layout, .users-grid, .creator-grid, .search-grid) { gap: 24px; align-items: start; }
html[data-portal-module] :where(.setup-panel, .connection-panel > .panel-card:first-child) { border-top: 4px solid #172f4d; }
html[data-portal-module] :where(.issue-header, .delivery-header) { background: transparent; box-shadow: none; }
html[data-portal-module] :where(.order-card, .line-card, .result-item, .history-item) { border-radius: 10px; box-shadow: none; }
html[data-portal-module] :where(.accent-pill, .source-chip, .batch-chip) { background: #edf3ff; color: #24558c; border-radius: 5px; font-size: .8125rem; }
/* Dashboard: se conserva la navegación y el selector existentes. */
html[data-portal-module="dashboard"] .context-sidebar { background: #172f4d; color: #fff; border-radius: 14px; border: 0; box-shadow: none; }
html[data-portal-module="dashboard"] .context-sidebar :where(h1, h2, h3, label) { color: #fff; }
html[data-portal-module="dashboard"] .context-sidebar :where(p, small, .section-kicker) { color: #c8d6e6; }
html[data-portal-module="dashboard"] .context-sidebar h1 { font-size: 1.5rem; }
html[data-portal-module="dashboard"] .module-card { border-radius: 12px; }
html[data-portal-module="dashboard"] .module-card:hover { border-color: #9eb9dc; box-shadow: 0 4px 18px #152d4910; }
html[data-portal-module="dashboard"] :is(.module-icon, .admin-utility-icon) { background: transparent; color: var(--module-color, var(--brand)); border: 0; border-radius: 0; box-shadow: none; }
html[data-portal-module="dashboard"] .action-card { transition: background-color .18s ease, color .18s ease, border-color .18s ease; }
html[data-portal-module="dashboard"] .action-card:is(:hover, :focus-visible):not(:disabled):not(.is-connecting):not(.is-connected) {
  background: var(--module-color); border-color: var(--module-color); color: #fff;
}
html[data-portal-module="dashboard"] .action-card:is(:hover, :focus-visible):not(:disabled):not(.is-connecting):not(.is-connected) :is(.module-icon, .module-content, .module-content strong, .module-content p, .card-kicker, .module-arrow) { color: #fff; }
html[data-portal-module="dashboard"] .admin-utility-link:is(:hover, :focus-visible) { background: var(--brand); border-color: var(--brand); color: #fff; }
html[data-portal-module="dashboard"] .admin-utility-link:is(:hover, :focus-visible) :is(.admin-utility-icon, .admin-utility-copy strong, .admin-utility-copy small, .admin-utility-arrow) { color: #fff; }
html[data-portal-module="dashboard"] .portal-workspace { width: 100%; margin-top: 0; }
html[data-portal-module="dashboard"] .portal-header { position: static; width: 100%; }
html[data-portal-module="dashboard"] .context-hint { background: #ffffff0d; border-color: #ffffff22; }
html[data-portal-module="dashboard"] .context-hint p { color: #c8d6e6; }
/* Creador: mismo estudio, paleta y densidad del aprobador. */
html[data-portal-module="item-creator"] .studio-app { width: min(1560px, calc(100% - 48px)); }
html[data-portal-module="item-creator"] .studio-header { padding-top: 24px; }
html[data-portal-module="item-creator"] .studio-rail { background: #172f4d; border-radius: 14px; }
html[data-portal-module="item-creator"] :where(.workspace-toolbar, .form-section) { border-radius: 12px; }
html[data-portal-module="item-creator"] .rail-intro h1 { font-size: 1.6rem; }
/* Captura sin panel lateral; contexto claro y acento verde de alto contraste. */
html[data-portal-module="item-creator"] body { --blue: #176454; --blue-soft: #edf6f2; --coral: #176454; --select-focus: #176454; --select-option-selected: #176454; }
html[data-portal-module="item-creator"] .studio-layout { grid-template-columns: minmax(0, 1fr); }
html[data-portal-module="item-creator"] .studio-workspace { width: 100%; max-width: 1320px; margin: 0 auto; }
html[data-portal-module="item-creator"] :is(.workspace-toolbar, .form-section) { padding: 24px; box-shadow: none; }
html[data-portal-module="item-creator"] #workspaceFormTitle { margin: 4px 0 8px; font-size: 1.8rem; line-height: 1.2; letter-spacing: -.03em; }
html[data-portal-module="item-creator"] #creatorStatus { color: #52645c; font-size: .875rem; }
html[data-portal-module="item-creator"] .master-command { background: #f4f7f5; color: #243c32; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 20px; padding: 20px; border-color: #d4e0d9; border-radius: 10px; }
html[data-portal-module="item-creator"] .code-input-shell { grid-template-columns: minmax(0, 1fr); }
html[data-portal-module="item-creator"] :is(.company-control > label, .code-control > label, .specific-code-control > label) { color: #243c32; font-size: .875rem; }
html[data-portal-module="item-creator"] :is(.company-control > small, .code-feedback .sequence-hint, .specific-code-control > small, .toggle-copy small) { color: #52645c; font-size: .8125rem; line-height: 1.5; }
html[data-portal-module="item-creator"] .specific-code-toggle { color: #243c32; align-items: flex-start; font-weight: 500; }
html[data-portal-module="item-creator"] .specific-code-toggle input { height: 16px; margin-top: 3px; flex-shrink: 0; }
html[data-portal-module="item-creator"] .specific-code-control { background: #fff; }
html[data-portal-module="item-creator"] .catalog-action { background: #fff; color: #274f42; border-color: #cbdcd3; min-height: 42px; }
html[data-portal-module="item-creator"] .catalog-action:hover:not(:disabled) { background: #edf6f2; border-color: #176454; }
html[data-portal-module="item-creator"] .edit-action > span { color: inherit; }
html[data-portal-module="item-creator"] .creator-form { gap: 20px; margin-top: 20px; }
html[data-portal-module="item-creator"] .identity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
html[data-portal-module="item-creator"] .identity-grid .form-field { grid-column: auto; }
html[data-portal-module="item-creator"] .identity-grid .field-name { grid-column: 1 / -1; }
html[data-portal-module="item-creator"] .form-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
html[data-portal-module="item-creator"] .section-heading { padding-bottom: 16px; border-bottom: 1px solid #e0e7e3; }
html[data-portal-module="item-creator"] .section-number { color: #176454; background: #edf6f2; border-radius: 8px; font-size: .875rem; }
html[data-portal-module="item-creator"] .section-heading p { font-size: .75rem; }
html[data-portal-module="item-creator"] .toggle-copy strong { font-size: .875rem; }
html[data-portal-module="item-creator"] .toggle-card { background: #f8faf9; border-radius: 8px; min-height: 84px; }
html[data-portal-module="item-creator"] .toggle-card:has(input:checked) { border-color: #87b5a2; background: #edf6f2; }
html[data-portal-module="item-creator"] .submit-dock { position: static; color: #243c32; background: #fff; border: 1px solid #d4e0d9; border-radius: 12px; box-shadow: none; backdrop-filter: none; padding: 20px 24px; }
html[data-portal-module="item-creator"] .submit-copy > span { color: #52645c; font-size: .75rem; }
html[data-portal-module="item-creator"] .submit-copy strong { font-size: .875rem; }
html[data-portal-module="item-creator"] #editModeHint { color: #52645c; font-size: .875rem; }
html[data-portal-module="item-creator"] #submitCreate { background: #176454; color: #fff; box-shadow: none; }
html[data-portal-module="item-creator"] #submitCreate:hover:not(:disabled) { background: #104a3e; }
@media (max-width: 900px) {
  html[data-portal-module="item-creator"] .workspace-title-row { flex-direction: column; align-items: flex-start; }
  html[data-portal-module="item-creator"] .workspace-title-actions { justify-content: flex-start; }
  html[data-portal-module="item-creator"] .master-command { grid-template-columns: minmax(0, 1fr); }
  html[data-portal-module="item-creator"] .form-duo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  html[data-portal-module="item-creator"] .studio-app { width: calc(100% - 20px); }
  html[data-portal-module="item-creator"] :is(.workspace-toolbar, .form-section, .master-command) { padding: 16px; }
  html[data-portal-module="item-creator"] :is(.identity-grid, .units-grid, .toggle-grid, .specific-code-control) { grid-template-columns: minmax(0, 1fr); }
  html[data-portal-module="item-creator"] .workspace-title-actions { width: 100%; }
}
/* Gestor de tablas: reemplaza las superficies oscuras sin alterar sus secciones. */
html[data-portal-module="database-admin"] .database-header { padding: 0 0 24px; }
html[data-portal-module="database-admin"] .database-header::before,
html[data-portal-module="database-admin"] .database-header::after { display: none; }
html[data-portal-module="database-admin"] :where(.database-tab, .tab-button) { background: #fff; color: #526a83; border: 1px solid #dce4ed; border-radius: 8px; }
html[data-portal-module="database-admin"] :where(.database-tab.active, .database-tab.is-active) { background: #172f4d; color: #fff; border-color: #172f4d; }
html[data-portal-module="database-admin"] :where(.panel h2, .panel h3, .panel-header, .form-field, tbody) { color: #172c44; }
html[data-portal-module="database-admin"] .primary-button { color: #fff; background: #205bc5; }
html[data-portal-module="database-admin"] td { color: #172c44; background: #fff; }
html[data-portal-module="database-admin"] tbody tr:hover td { background: #f3f7fc; }
html[data-portal-module="database-admin"] .summary-strip { color: #526a83; background: #edf2f8; }
html[data-portal-module="database-admin"] .summary-strip::before { text-shadow: none; }
html[data-portal-module="database-admin"] .operations-page-status { color: #526a83; }
html[data-portal-module="database-admin"] .table-action-button { color: #205bc5; background: #edf3ff; border-color: #ccd8e5; }
html[data-portal-module="database-admin"] .table-action-button:hover { color: #fff; background: #205bc5; }
html[data-portal-module="database-admin"] .table-url:hover { color: #184aa3; }
html[data-portal-module="database-admin"] :where(.import-result.new, .import-summary .new) { color: #16734e; }
html[data-portal-module="database-admin"] :where(.import-result.update, .import-summary .update) { color: #926116; }
html[data-portal-module="database-admin"] :where(.import-result.error, .import-summary .error) { color: #a63143; }
/* Etiquetas: no cambiar tamaños de códigos, canvas ni plantillas de impresión. */
html[data-portal-module="labels"] .labels-shell { width: min(1120px, calc(100% - 48px)); margin: 28px auto 80px; }
html[data-portal-module="labels"] .labels-shell > h1 { font-size: 2rem; letter-spacing: -.035em; }
/* Acceso: panel blanco y contexto institucional, sin cambiar autenticación. */
html[data-portal-module="login"] body { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(360px, 1fr); align-items: center; gap: 48px; padding: 8vw; }
html[data-portal-module="login"] #LgCtb { position: static; width: auto; height: auto; margin: 0; background: none; color: #172f4d; }
html[data-portal-module="login"] .login-brand { max-width: 430px; }
html[data-portal-module="login"] .login-brand small { display: block; font-size: .875rem; letter-spacing: .1em; text-transform: uppercase; color: #526a83; }
html[data-portal-module="login"] .login-brand strong { display: block; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.1; letter-spacing: -.045em; margin: 18px 0; }
html[data-portal-module="login"] .login-brand p { color: #576b80; }
html[data-portal-module="login"] .login-box { width: min(100%, 440px); margin: 0; padding: 36px; background: #fff; border: 1px solid #dce4ed; border-top: 4px solid #172f4d; border-radius: 14px; box-shadow: 0 12px 40px #172f4d12; backdrop-filter: none; }
html[data-portal-module="login"] .login-box h2 { color: #526a83; text-align: left; font-size: .875rem; }
html[data-portal-module="login"] .login-box h1 { color: #172c44; text-align: left; font-size: 1.6rem; }
html[data-portal-module="login"] .login-box input { background: #fff; }
html[data-portal-module="login"] .login-box label { display: block; margin-bottom: 6px; color: #405a75; }
@media (max-width: 900px) {
  html[data-portal-module] :where(.creator-shell, .receipt-shell, .users-shell, .database-shell, .search-shell, .portal-shell) { width: calc(100% - 32px); padding-top: 20px; }
  html[data-portal-module] :where(.creator-topbar, .receipt-header, .users-topbar, .database-header, .search-topbar) { flex-wrap: wrap; gap: 16px; }
  html[data-portal-module] :where(.creator-grid, .receipt-layout, .users-grid, .search-grid) { grid-template-columns: 1fr; }
  html[data-portal-module="login"] body { grid-template-columns: 1fr; gap: 28px; padding: 32px 20px; justify-items: center; }
  html[data-portal-module="login"] .login-brand { width: min(100%, 440px); }
  html[data-portal-module="login"] .login-brand strong { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) { html[data-portal-module] *, html[data-portal-module] *::before, html[data-portal-module] *::after { transition: none !important; animation: none !important; scroll-behavior: auto; } }
}
