/* Presentación compartida, adaptada de Version 2. */

:root {
  --canvas: #f6f7f2;
  --surface: #ffffff;
  --surface-soft: #f9faf7;
  --ink: #182b26;
  --muted: #6d7d76;
  --line: #e3e9e3;
  --forest: #103e32;
  --forest-dark: #0c3028;
  --green: #197c5b;
  --green-soft: #e8f5ed;
  --sun: #f4b648;
  --shadow: 0 15px 45px rgba(21, 55, 43, .075);
  --radius: 18px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0d1c17;
  --surface: #182a22;
  --surface-soft: #1d3329;
  --ink: #ebf5ee;
  --muted: #a5bbac;
  --line: #345243;
  --forest: #246b4e;
  --forest-dark: #174a38;
  --green: #65c692;
  --green-soft: #244333;
  --sun: #efbe64;
  --shadow: 0 18px 50px rgba(0, 0, 0, .23);
}

html { scroll-behavior: smooth; }
body { background: var(--canvas); color: var(--ink); font: 15px/1.5 'DM Sans', sans-serif; }
h1, h2, h3, h4, h5, h6, .btn, .app-brand { font-family: 'Manrope', sans-serif; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -.035em; }
button, a, input, select, textarea, .card, .accordion-button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--green) !important; outline-offset: 3px; }
/* React Select enfoca un buscador de pocos píxeles: el foco visible debe
   rodear el selector completo, no ese input interno. */
.Select-input > input:focus,
.Select-input > input:focus-visible { outline: none !important; box-shadow: none !important; caret-color: var(--ink); }
.Select.is-focused > .Select-control { outline: 2px solid var(--green); outline-offset: 2px; }
::selection { color: var(--forest-dark); background: #f8d991; }

/* Entry and login */
.auth-screen { position: relative; min-height: 100dvh; overflow: hidden; background: #0e352c; }
.auth-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.auth-overlay { position: absolute; inset: 0; background: linear-gradient(110deg, rgba(7, 42, 33, .96) 3%, rgba(8, 50, 40, .73) 48%, rgba(10, 44, 35, .64)); }
.auth-layout { position: relative; z-index: 1; width: min(1320px, 100%); min-height: 100dvh; margin: auto; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: clamp(36px, 7vw, 110px); padding: clamp(28px, 5vw, 72px); }
.auth-intro { min-height: min(660px, 84dvh); display: flex; flex-direction: column; justify-content: space-between; color: #fff; animation: rise-in .75s ease both; }
.auth-brand { display: flex; align-items: center; gap: 15px; width: max-content; }
.auth-brand-mark { width: 46px; height: 46px; object-fit: contain; background: #fff; border-radius: 13px; padding: 6px; }
.auth-brand-name { font: 800 23px 'Manrope', sans-serif; letter-spacing: -.045em; }
.eyebrow { display: block; color: var(--green); font: 800 10px/1.4 'Manrope', sans-serif; letter-spacing: .15em; }
.eyebrow-light { color: #e6c575; }
.auth-story { max-width: 620px; margin: 80px 0; }
.auth-story h1 { color: #fff; font-size: clamp(42px, 5vw, 68px); line-height: 1.07; font-weight: 800; margin: 20px 0 24px; }
.auth-story p { color: #dfebe5; max-width: 510px; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.65; }
.auth-caption { color: #d5e4dd; font-size: 13px; }
.auth-form-area { display: flex; justify-content: center; }
.auth-card { position: relative; width: min(100%, 468px); background: #fff; padding: clamp(30px, 4vw, 50px); border: 1px solid rgba(255,255,255,.55); border-radius: 26px; box-shadow: 0 30px 90px rgba(2, 25, 19, .29); overflow: hidden; animation: rise-in .8s .12s ease both; }
.auth-card-accent { width: 46px; height: 5px; border-radius: 10px; background: var(--sun); margin-bottom: 28px; }
.auth-card h2 { color: var(--ink); font-size: clamp(28px, 3vw, 36px); font-weight: 800; margin: 10px 0 8px; }
.auth-help { color: var(--muted); margin: 0 0 30px; }
.auth-card label { margin: 0 0 9px; color: var(--ink); font-weight: 700; font-size: 13px; }
.auth-card .form-control { height: 50px; }
.auth-message { min-height: 28px; margin: 5px 0 8px; color: #b63737; font-size: 13px; }
.auth-submit { width: 100%; min-height: 51px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 800; }
.auth-footnote { text-align: center; color: #8b9990; font-size: 12px; margin: 22px 0 0; }
.password-field { position: relative; width: 100%; }
.password-field .password-input { padding-right: 52px; }
.password-field button.password-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: #708277; background: transparent; border: 0; border-radius: 9px; cursor: pointer; }
.password-field button.password-toggle:hover { color: var(--green); background: var(--green-soft); }
.password-field button.password-toggle .bi { font-size: 18px; }
.remember-row { display: flex; align-items: center; gap: 9px; margin: 5px 0 18px; }
.remember-row .form-check-input { float: none; margin: 0; width: 16px; height: 16px; cursor: pointer; }
.auth-card .remember-row label { margin: 0; color: #50655a; font-size: 12px; font-weight: 700; cursor: pointer; }
.remembered-access { display: grid; gap: 3px; padding: 15px; color: var(--ink); background: var(--green-soft); border: 1px solid #d8e9dc; border-radius: 13px; }
.remembered-access strong { font-size: 14px; }
.password-screen { background: radial-gradient(circle at 20% 20%, #daeadd, transparent 38%), var(--canvas); }
.password-screen .card { border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.password-screen .card-body { padding: clamp(28px, 4vw, 45px); }
.password-screen h3 { color: var(--ink); font-size: 25px; font-weight: 800; }
.password-screen p, .password-screen .form-text { color: var(--muted); font-size: 13px; }
.password-screen label { font-size: 12px; font-weight: 800; margin: 0 0 7px; }

.back-guard-dialog { width: min(430px, calc(100vw - 32px)); padding: 30px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 28px 90px rgba(8, 42, 29, .28); animation: rise-in .2s ease both; }
.back-guard-dialog::backdrop { background: rgba(8, 31, 24, .59); backdrop-filter: blur(4px); }
.back-guard-symbol { display: grid; place-items: center; width: 44px; height: 44px; color: var(--green); background: var(--green-soft); border-radius: 12px; font-size: 24px; font-weight: 700; }
.back-guard-dialog h2 { color: var(--ink); margin: 19px 0 8px; font-size: 23px; font-weight: 800; }
.back-guard-dialog p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 23px; }
.back-guard-actions { display: flex; justify-content: flex-end; gap: 9px; }
.back-guard-dialog .back-guard-actions button { min-height: 41px; padding: 9px 14px; border-radius: 10px; font: 800 12px 'Manrope', sans-serif; cursor: pointer; }
.back-guard-dialog button.back-guard-stay { color: var(--forest); background: var(--green-soft); border: 1px solid #d8eadd; }
.back-guard-dialog button.back-guard-stay:hover { background: #dbeede; }
.back-guard-dialog button.back-guard-leave { color: white; background: var(--forest); border: 1px solid var(--forest); }
.back-guard-dialog button.back-guard-leave:hover { background: var(--green); }

button.theme-toggle:not(.btn) { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 36px; padding: 7px 12px; color: #32634a; background: #edf6ee; border: 1px solid #d9e9dc; border-radius: 10px; font: 800 11px 'Manrope', sans-serif; white-space: nowrap; cursor: pointer; }
button.theme-toggle:not(.btn):hover { color: #14533d; background: #e0efe3; }
.theme-toggle .bi { font-size: 15px; }
.theme-icon-light { display: none; }
.auth-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-topbar button.theme-toggle:not(.btn) { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.23); }
.auth-topbar button.theme-toggle:not(.btn):hover { background: rgba(255,255,255,.22); }
.password-theme-control { position: absolute; top: 22px; right: 25px; z-index: 2; }

html[data-theme="dark"] .theme-icon-dark { display: none; }
html[data-theme="dark"] .theme-icon-light { display: inline; }
html[data-theme="dark"] body,
html[data-theme="dark"] #react-entry-point,
html[data-theme="dark"] #page-content { background: var(--canvas); color: var(--ink); }
html[data-theme="dark"] .app-shell { background: var(--canvas); }
html[data-theme="dark"] .app-topbar { background: rgba(21, 41, 31, .95); border-bottom-color: var(--line); }
html[data-theme="dark"] .app-topbar .eyebrow { color: #8fb09c; }
html[data-theme="dark"] .breadcrumb-parent, html[data-theme="dark"] .breadcrumb-line { color: #8ea796; }
html[data-theme="dark"] .breadcrumb-line strong, html[data-theme="dark"] .user-chip { color: var(--ink); }
html[data-theme="dark"] .user-avatar { color: #d9f7e4; background: #29513a; }
html[data-theme="dark"] .shell-logout.btn { color: #aac6b3; }
html[data-theme="dark"] .shell-logout.btn:hover { color: #fff; background: #594037; }
html[data-theme="dark"] .mobile-menu summary { color: var(--ink); background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .app-main { background: radial-gradient(circle at 100% 0, #173428 0, transparent 360px), var(--canvas); }
html[data-theme="dark"] .page-heading h1, html[data-theme="dark"] .section-heading h2 { color: var(--ink); }
html[data-theme="dark"] .workspace-badge { color: #a8edbd; background: #203c2d; border-color: #315940; }
html[data-theme="dark"] .module-card { background: var(--surface); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .module-card:hover { border-color: #5aa878; color: #d5f4df; }
html[data-theme="dark"] .module-icon { color: #94ddb0; background: #274b35; }
html[data-theme="dark"] .module-card-caption, html[data-theme="dark"] .module-arrow { color: var(--muted); }
html[data-theme="dark"] .module-empty { color: var(--muted); background: var(--surface); border-color: var(--line); }

html[data-theme="dark"] .auth-card { background: #182c23; border-color: #335442; }
html[data-theme="dark"] .auth-card h2, html[data-theme="dark"] .auth-card label { color: var(--ink); }
html[data-theme="dark"] .auth-help, html[data-theme="dark"] .auth-footnote { color: var(--muted); }
html[data-theme="dark"] .auth-card .remember-row label { color: #b7cdbb; }
html[data-theme="dark"] .remembered-access { background: #234534; border-color: #3b6649; }
html[data-theme="dark"] .password-screen { background: radial-gradient(circle at 20% 20%, #17392a, transparent 40%), var(--canvas); }
html[data-theme="dark"] .password-screen .card { color: var(--ink); background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .password-screen h3, html[data-theme="dark"] .password-screen label { color: var(--ink); }
html[data-theme="dark"] .password-screen p, html[data-theme="dark"] .password-screen .form-text { color: var(--muted); }

html[data-theme="dark"] .app-main > .container-fluid { color: var(--ink) !important; }
html[data-theme="dark"] .app-main .card,
html[data-theme="dark"] .app-main .accordion-item,
html[data-theme="dark"] .app-main .module-table-wrapper,
html[data-theme="dark"] .app-main .supervisor-table-wrapper { color: var(--ink); background: var(--surface) !important; border-color: var(--line) !important; }
html[data-theme="dark"] .app-main .card-header,
html[data-theme="dark"] .app-main .card-footer { color: var(--ink); background: var(--surface-soft); border-color: var(--line); }
html[data-theme="dark"] .app-main .text-dark,
html[data-theme="dark"] .app-main .text-white,
html[data-theme="dark"] .modal-content .text-dark { color: var(--ink) !important; }
html[data-theme="dark"] .app-main .bg-white,
html[data-theme="dark"] .app-main .bg-light,
html[data-theme="dark"] .modal-content .bg-white,
html[data-theme="dark"] .modal-content .bg-light { background: var(--surface) !important; }
html[data-theme="dark"] .app-main .table,
html[data-theme="dark"] .modal-content .table { color: var(--ink); background: var(--surface) !important; border-color: var(--line); }
html[data-theme="dark"] .app-main .table > :not(caption) > * > *,
html[data-theme="dark"] .modal-content .table > :not(caption) > * > * { color: var(--ink); background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .app-main .table thead th,
html[data-theme="dark"] .modal-content .table thead th { color: #b2d1bc; background: var(--surface-soft) !important; }
html[data-theme="dark"] .app-main .table-hover > tbody > tr:hover > *,
html[data-theme="dark"] .modal-content .table-hover > tbody > tr:hover > * { color: var(--ink); background: #244032; }
html[data-theme="dark"] .app-main label, html[data-theme="dark"] .modal label { color: #c9e1d0; }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] .Select-control { color: var(--ink) !important; background-color: #172c22 !important; border-color: #3b6049 !important; }
html[data-theme="dark"] .form-control::placeholder { color: #8eab97; }
html[data-theme="dark"] .Select-menu-outer,
html[data-theme="dark"] .Select-menu,
html[data-theme="dark"] .Select-option { color: var(--ink) !important; background: #1b3227 !important; border-color: var(--line) !important; }
html[data-theme="dark"] .Select-option:hover,
html[data-theme="dark"] .Select-option.is-focused { background: #2a5238 !important; }
html[data-theme="dark"] .Select-value-label,
html[data-theme="dark"] .Select-input > input,
html[data-theme="dark"] .Select-placeholder { color: var(--ink) !important; }
html[data-theme="dark"] .module-search.form-control { background-color: #172c22 !important; }
html[data-theme="dark"] .nav-tabs { border-color: var(--line); }
html[data-theme="dark"] .nav-tabs .nav-link { color: var(--muted); }
html[data-theme="dark"] .nav-tabs .nav-link.active { color: #9ee5b4; background: var(--surface); }
html[data-theme="dark"] .accordion-button { color: var(--ink); background: var(--surface); }
html[data-theme="dark"] .accordion-button:not(.collapsed) { color: #c7efcf; background: var(--surface-soft); }
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .toast { color: var(--ink); background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer { background: var(--surface-soft); border-color: var(--line); }
html[data-theme="dark"] .modal-title { color: var(--ink); }
html[data-theme="dark"] .modal-body { color: var(--ink); }
html[data-theme="dark"] .back-guard-dialog { color: var(--ink); background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .back-guard-dialog h2 { color: var(--ink); }
html[data-theme="dark"] .back-guard-dialog .back-guard-symbol { color: #b5edc3; background: #254d36; }
html[data-theme="dark"] .back-guard-dialog button.back-guard-stay { color: #d4efd9; background: #274634; border-color: #3d6848; }
html[data-theme="dark"] .back-guard-dialog button.back-guard-leave { color: #fff; background: #257d58; border-color: #257d58; }
html[data-theme="dark"] button.theme-toggle:not(.btn) { color: #c8e6d2; background: #254335; border-color: #38614a; }
html[data-theme="dark"] button.theme-toggle:not(.btn):hover { color: #fff; background: #315d44; }
html[data-theme="dark"] .auth-topbar button.theme-toggle:not(.btn) { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); }
html[data-theme="dark"] .password-field button.password-toggle { color: #b2cdb8; background: transparent; }
html[data-theme="dark"] .password-field button.password-toggle:hover { color: #e5f5e7; background: #294734; }
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-light { --bs-btn-bg: #284536; --bs-btn-border-color: #3c614b; --bs-btn-color: #e5f2e7; --bs-btn-hover-bg: #345841; --bs-btn-hover-border-color: #4b785a; --bs-btn-hover-color: #fff; }
html[data-theme="dark"] .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table,
html[data-theme="dark"] .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td,
html[data-theme="dark"] .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th { color: var(--ink) !important; background: var(--surface) !important; border-color: var(--line) !important; }

@media (max-width: 620px) {
  .theme-toggle .theme-label { display: none; }
  button.theme-toggle:not(.btn) { width: 36px; padding: 7px; }
  .auth-brand { margin-bottom: 0; }
  .auth-topbar { margin-bottom: 25px; }
}

/* Shared application frame */
.app-shell { --sidebar-width: 258px; --topbar-height: 80px; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); background: var(--canvas); }
.app-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width); height: 100dvh; z-index: 1030; display: flex; flex-direction: column; background: linear-gradient(165deg, #123f34 0%, #0d3129 100%); color: #fff; padding: 30px 17px 22px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #487365 transparent; }
.app-brand { display: flex; align-items: center; gap: 12px; padding: 0 12px 36px; }
.brand-symbol { width: 43px; height: 43px; display: grid; place-items: center; background: white; border-radius: 12px; flex: none; }
.brand-symbol img { width: 34px; height: 34px; object-fit: contain; }
.brand-wordmark { display: flex; flex-direction: column; line-height: 1.1; }
.brand-wordmark strong { font-size: 17px; letter-spacing: -.045em; }
.brand-wordmark small { font-size: 9px; letter-spacing: .17em; color: #a7c6b7; margin-top: 5px; }
.nav-section { margin: 0 0 18px; }
.nav-section-label { color: #82ab9a; text-transform: uppercase; letter-spacing: .15em; font-size: 10px; font-weight: 800; padding: 0 17px; margin: 0 0 9px; }
.nav-list { display: grid; gap: 3px; }
.nav-link-item { min-height: 43px; display: flex; align-items: center; gap: 13px; color: #d3e4da; text-decoration: none; border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 600; transition: background .2s, color .2s, transform .2s; }
.nav-link-item > .bi:first-child { width: 18px; text-align: center; font-size: 17px; }
.nav-chevron { font-size: 11px; margin-left: auto; opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; }
.nav-link-item:hover { color: #fff; background: #255646; transform: translateX(3px); }
.nav-link-item:hover .nav-chevron, .nav-link-item.is-active .nav-chevron { opacity: 1; transform: none; }
.nav-link-item.is-active { color: #fff; background: #2c7659; box-shadow: inset 3px 0 var(--sun); }
.sidebar-status { display: flex; align-items: center; gap: 9px; margin: auto 12px 0; padding-top: 18px; color: #a8c8b8; border-top: 1px solid #31594a; font-size: 11px; }
.status-dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #70d7a2; box-shadow: 0 0 0 4px rgba(112,215,162,.15); }
.app-workspace { grid-column: 2; min-width: 0; padding-top: var(--topbar-height); }
.app-topbar { height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(20px, 3.4vw, 52px); background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); position: fixed; top: 0; left: var(--sidebar-width); right: 0; z-index: 1030; }
.app-topbar .eyebrow { font-size: 9px; color: #84968b; margin-bottom: 4px; }
.breadcrumb-line { display: flex; align-items: center; gap: 10px; color: #9aa89e; font-size: 13px; }
.breadcrumb-line strong { color: var(--ink); font-weight: 800; }
.breadcrumb-line .bi { font-size: 9px; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.header-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; max-width: 220px; font-size: 12px; font-weight: 700; }
.user-avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 12px; color: var(--forest); background: var(--green-soft); font: 800 11px 'Manrope', sans-serif; }
.user-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-logout.btn { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; color: var(--muted); border-radius: 10px; }
.shell-logout.btn:hover { background: #fff0ec; color: #b84b42; }
.mobile-menu { display: none; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 2000; padding: 9px 14px; background: var(--sun); color: var(--ink); border-radius: 9px; }
.skip-link:focus { top: 10px; }
.app-main { min-height: calc(100dvh - 80px); padding: 35px clamp(20px, 3.4vw, 52px) 64px; background: radial-gradient(circle at 100% 0, #edf4e8 0, transparent 360px), var(--canvas); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 27px; animation: rise-in .55s ease both; }
.page-heading h1 { color: var(--ink); font-size: clamp(28px, 2.7vw, 38px); font-weight: 800; margin: 5px 0 5px; }
.page-heading p { color: var(--muted); margin: 0; font-size: 13px; }
.workspace-badge { display: inline-flex; align-items: center; gap: 6px; flex: none; color: var(--green); background: var(--green-soft); border: 1px solid #d8ebdd; border-radius: 99px; padding: 8px 12px; font-size: 11px; font-weight: 800; }

/* Home */
.dashboard-content { animation: rise-in .65s .08s ease both; }
.welcome-panel { display: flex; align-items: center; justify-content: space-between; min-height: 250px; overflow: hidden; position: relative; padding: clamp(26px, 4vw, 48px); color: white; background: linear-gradient(110deg, #144d3e, #207454); border-radius: 23px; box-shadow: 0 20px 50px rgba(24,89,67,.16); }
.welcome-panel::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 75% 30%, rgba(250,211,119,.18), transparent 32%); }
.welcome-copy { z-index: 1; }
.welcome-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px; background: rgba(255,255,255,.13); color: #e6f3ea; font-size: 11px; font-weight: 700; }
.welcome-panel h2 { margin: 18px 0 8px; color: #fff; font-size: clamp(27px, 3vw, 40px); font-weight: 800; }
.welcome-panel p { color: #d8eadd; margin-bottom: 19px; }
.welcome-cta { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 12px; font-weight: 800; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.55); padding-bottom: 5px; }
.welcome-cta:hover { color: #ffe0a0; }
.welcome-art { width: 260px; height: 240px; position: absolute; right: 9%; top: 5%; opacity: .9; }
.welcome-mark { position: absolute; width: 130px; height: 130px; object-fit: contain; left: 65px; top: 54px; background: #fff; padding: 20px; border-radius: 32px; transform: rotate(-8deg); box-shadow: 0 20px 36px rgba(5,36,26,.15); animation: float-mark 6s ease-in-out infinite; }
.welcome-orbit { position: absolute; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; }
.orbit-one { width: 240px; height: 240px; inset: 0 10px; }
.orbit-two { width: 195px; height: 195px; inset: 22px 32px; }
.modules-section { padding-top: 37px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { font-size: clamp(22px, 2vw, 27px); font-weight: 800; margin: 6px 0 2px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.module-search.form-control { width: min(250px, 100%); padding-left: 39px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23839689' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m16 16 5 5'/%3E%3C/svg%3E") no-repeat 13px center; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.module-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 167px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 23px; text-decoration: none; color: var(--ink); box-shadow: 0 4px 15px rgba(22,61,43,.025); transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease; }
.module-card:hover { transform: translateY(-5px); border-color: #a9d6b9; box-shadow: var(--shadow); color: var(--forest); }
.module-icon { width: 40px; height: 40px; display: grid; place-items: center; background: var(--green-soft); border-radius: 11px; color: var(--green); font-size: 20px; margin-bottom: auto; transition: transform .25s, background .25s; }
.module-card:hover .module-icon { transform: rotate(-6deg) scale(1.08); background: #def0df; }
.module-card strong { font: 800 14px 'Manrope', sans-serif; margin-top: 16px; }
.module-card-caption { color: var(--muted); font-size: 11px; margin-top: 2px; }
.module-arrow { position: absolute; top: 23px; right: 23px; font-size: 16px; color: #a3b6a9; transition: transform .2s, color .2s; }
.module-card:hover .module-arrow { transform: translate(3px, -3px); color: var(--green); }
.module-empty { padding: 28px; background: white; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* Existing workflows */
.app-main > .container-fluid { background: transparent !important; color: var(--ink) !important; min-height: auto !important; padding: 0 !important; animation: rise-in .55s .08s ease both; }
.app-main > .container-fluid > h1, .app-main > .container-fluid > h2, .app-main > .container-fluid > h3 { display: none; }
.app-main > .container-fluid > div:has(> div > img[src="/assets/logo.png"]) { display: none !important; }
.app-main .module-header-actions { position: static !important; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.app-main [id*='btn-logout'] { display: none !important; }
.app-main a[href="/administrador-dashboard"] { display: none !important; }
.app-main .text-white { color: var(--ink) !important; }
.app-main .lead { color: var(--muted); }
.app-main .card, .app-main .accordion-item, .app-main .nav-tabs, .app-main .table-responsive, .app-main .module-table-wrapper, .app-main .supervisor-table-wrapper { border-color: var(--line); }
.app-main .card { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 22px rgba(28,64,47,.045); overflow: hidden; }
.app-main .card-header { color: var(--forest); background: var(--surface-soft); border-color: var(--line); padding: 17px 20px; font-weight: 800; }
.app-main .card-body { padding: clamp(18px, 2vw, 26px); }
.app-main .card-footer { background: var(--surface-soft); border-color: var(--line); }
.app-main .module-table-wrapper, .app-main .supervisor-table-wrapper { background: #fff; border: 1px solid var(--line) !important; border-radius: 15px; padding: 0 !important; box-shadow: 0 5px 24px rgba(24,58,43,.035); }
.app-main > .container-fluid > div:has(> .module-table-wrapper) { border: 0 !important; padding: 0 !important; border-radius: 15px; }
.app-main .table { color: var(--ink); background: #fff; border-color: #e7ebe6; font-size: 13px; margin: 0; vertical-align: middle; }
.app-main .table > :not(caption) > * > * { padding: 12px 14px; border-bottom-color: #e9eee9; }
.app-main .table thead th { background: #f2f7f2; color: #52685b; font: 800 10px 'Manrope', sans-serif; letter-spacing: .065em; text-transform: uppercase; white-space: nowrap; }
.app-main .table-hover > tbody > tr:hover > * { background: #f6fbf6; color: var(--ink); }
.app-main .table-bordered > :not(caption) > * { border-width: 0; }
.app-main .table td { color: var(--ink); }
.app-main .table .text-dark { color: var(--ink) !important; }
.app-main .row { row-gap: 10px; }
.app-main label, .modal label { color: #344b3e; font-size: 12px; font-weight: 800; margin: 0 0 7px; }
.form-control, .form-select, .Select-control { min-height: 42px; border: 1px solid #dce5dd !important; border-radius: 10px !important; color: var(--ink) !important; background-color: #fff !important; box-shadow: none !important; transition: border-color .2s, box-shadow .2s; }
.form-control:focus, .form-select:focus, .is-focused .Select-control { border-color: #49a477 !important; box-shadow: 0 0 0 4px rgba(48,151,100,.12) !important; }
.form-control::placeholder { color: #9aaba0; }
.Select-menu-outer { border: 1px solid var(--line) !important; border-radius: 12px !important; box-shadow: var(--shadow) !important; overflow: hidden; }
.Select-option { padding: 10px 13px; }
.Select-option:hover, .Select-option.is-focused { background: var(--green-soft) !important; }
input[type="number"] { min-height: 42px; padding: 9px 11px; border-color: #dce5dd; border-radius: 10px; }
.btn { border-radius: 10px; font-size: 12px; font-weight: 800; padding: 10px 16px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(23,67,43,.12); }
.btn:disabled { cursor: not-allowed; opacity: .56; }
.btn-sm { padding: 7px 11px; font-size: 11px; }
.btn-primary, .btn-info { --bs-btn-bg: #197c5b; --bs-btn-border-color: #197c5b; --bs-btn-hover-bg: #126d50; --bs-btn-hover-border-color: #126d50; --bs-btn-active-bg: #0d6045; --bs-btn-active-border-color: #0d6045; --bs-btn-color: #fff; --bs-btn-hover-color: #fff; }
.btn-success { --bs-btn-bg: #327d53; --bs-btn-border-color: #327d53; --bs-btn-hover-bg: #246a45; --bs-btn-hover-border-color: #246a45; }
.btn-warning { --bs-btn-bg: #f5c865; --bs-btn-border-color: #f5c865; --bs-btn-hover-bg: #edb744; --bs-btn-hover-border-color: #edb744; --bs-btn-color: #352b1c; }
.btn-secondary, .btn-light { --bs-btn-bg: #eff3ef; --bs-btn-border-color: #e4ebe4; --bs-btn-hover-bg: #e4ece4; --bs-btn-hover-border-color: #d3ded3; --bs-btn-color: #365042; --bs-btn-hover-color: #234033; }
.btn-danger { --bs-btn-bg: #c35950; --bs-btn-border-color: #c35950; --bs-btn-hover-bg: #aa453f; --bs-btn-hover-border-color: #aa453f; }
.btn-link { color: var(--green); text-decoration: none; }
button:not(.btn):not(.btn-close) { background: var(--forest); border-radius: 10px; }
button:not(.btn):not(.btn-close):hover { background: var(--green); }
.nav-tabs { border-bottom: 1px solid var(--line); gap: 4px; }
.nav-tabs .nav-link { color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; font-size: 12px; font-weight: 800; }
.nav-tabs .nav-link:hover { color: var(--green); background: var(--green-soft); }
.nav-tabs .nav-link.active { color: var(--green); background: transparent; border-bottom-color: var(--green); }
.accordion-item { overflow: hidden; background: #fff; }
.accordion-button { color: var(--forest); font-weight: 800; }
.accordion-button:not(.collapsed) { color: var(--forest); background: var(--green-soft); box-shadow: none; }
.accordion-button:focus { box-shadow: 0 0 0 3px rgba(46,152,98,.15); }
.modal-content { border: 1px solid var(--line); border-radius: 19px; overflow: hidden; box-shadow: 0 28px 80px rgba(15,43,29,.18); }
.modal-header, .modal-footer { background: #f9fbf8; border-color: var(--line); padding: 18px 24px; }
.modal-title { color: var(--ink); font-weight: 800; }
.modal-body { color: var(--ink); padding: 24px; }
.alert { border-radius: 11px; border-width: 1px; }
.badge { border-radius: 6px; font-weight: 800; }
.form-check-input:checked { background-color: var(--green); border-color: var(--green); }
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table { border-color: var(--line); }

@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float-mark { 0%,100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-9px) rotate(-6deg); } }

@media (max-width: 1120px) {
  .app-shell { --sidebar-width: 220px; }
  .app-sidebar { padding-left: 11px; padding-right: 11px; }
  .module-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .header-status { display: none; }
}
@media (max-width: 800px) {
  .app-shell { display: block; }
  .app-sidebar { display: none; }
  .app-topbar { height: 68px; padding: 0 18px; }
  .app-main { min-height: calc(100dvh - 68px); padding: 27px 18px 45px; }
  .mobile-menu { display: block; position: relative; }
  .mobile-menu summary { list-style: none; display: flex; align-items: center; gap: 7px; cursor: pointer; color: var(--forest); font-size: 12px; font-weight: 800; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu summary .bi { font-size: 17px; }
  .mobile-navigation { position: absolute; top: 47px; right: 0; width: min(300px, calc(100vw - 30px)); max-height: min(70dvh, 600px); overflow-y: auto; background: var(--forest); border-radius: 15px; padding: 20px 12px; box-shadow: 0 20px 50px rgba(10,44,33,.23); z-index: 1050; }
  .auth-layout { grid-template-columns: 1fr 1fr; gap: 30px; padding: 28px; }
  .auth-story h1 { font-size: 42px; }
  .auth-intro { min-height: 560px; }
}
@media (max-width: 620px) {
  .auth-layout { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 30px; padding: 24px 18px 36px; }
  .auth-intro { min-height: auto; }
  .auth-brand { margin-bottom: 25px; }
  .auth-story { margin: 0; }
  .auth-story h1 { font-size: 32px; margin: 10px 0 8px; }
  .auth-story p { font-size: 14px; margin-bottom: 0; }
  .auth-caption { display: none; }
  .auth-card { padding: 28px; border-radius: 21px; }
  .breadcrumb-parent, .breadcrumb-line > .bi, .app-topbar .eyebrow, .user-name { display: none; }
  .breadcrumb-line { font-size: 13px; }
  .header-actions { gap: 8px; }
  .user-avatar { width: 31px; height: 31px; }
  .workspace-badge { display: none; }
  .page-heading { margin-bottom: 20px; }
  .module-grid { grid-template-columns: 1fr; gap: 12px; }
  .module-card { min-height: 128px; padding: 17px; }
  .module-icon { margin-bottom: 5px; }
  .module-card strong { margin-top: 5px; }
  .welcome-panel { min-height: 220px; }
  .welcome-art { right: -135px; opacity: .27; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .module-search.form-control { width: 100%; }
  .app-main .module-header-actions { justify-content: flex-start; }
  .app-main .module-header-actions .btn { flex: auto; }
  .app-main .table > :not(caption) > * > * { padding: 9px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .auth-video { display: none; }
}
@media print {
  .app-sidebar, .app-topbar, .page-heading { display: none !important; }
  .app-shell { display: block; }
  .app-workspace { padding-top: 0 !important; grid-column: auto; }
  .app-main { padding: 0; background: #fff; }
}

/* Los botones sin clase Bootstrap tienen un estilo genérico anterior. */
.password-field button.password-toggle { background: transparent; }
.password-field button.password-toggle:hover { background: var(--green-soft); }
.back-guard-dialog button.back-guard-stay { background: var(--green-soft); }
.back-guard-dialog button.back-guard-stay:hover { background: #dbeede; }
.back-guard-dialog button.back-guard-leave { background: var(--forest); }
.back-guard-dialog button.back-guard-leave:hover { background: var(--green); }


/* Adaptación a los flujos completos de la versión principal. */
.login-clean-screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(ellipse at 8% 12%, rgba(133, 190, 102, .3), transparent 48%),
              radial-gradient(ellipse at 95% 92%, rgba(244, 182, 72, .22), transparent 44%),
              linear-gradient(135deg, #082f27, #175342 60%, #0b382c);
}
.login-clean-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(125deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 38px);
}
.login-clean-screen::after {
  content: '';
  position: absolute;
  width: min(85vw, 1100px);
  aspect-ratio: 1;
  border: 1px solid rgba(220, 240, 208, .12);
  border-radius: 50%;
  left: -35%;
  top: -55%;
  box-shadow: 0 0 0 80px rgba(220, 240, 208, .025), 0 0 0 160px rgba(220, 240, 208, .02);
  pointer-events: none;
}
.login-clean-card { position: relative; z-index: 1; animation: none; width: min(100%, 450px); padding: 38px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 28px 80px rgba(0, 20, 12, .28); }
.login-clean-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; gap: 18px; }
.login-clean-logo { width: 72px; height: 72px; object-fit: contain; }
.login-clean-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.login-clean-wordmark { color: var(--ink); font-family: 'Segoe UI', Arial, sans-serif; font-size: 24px; font-weight: 750; letter-spacing: -.7px; }
@media (max-width: 480px) { .login-clean-brand { gap: 10px; } .login-clean-wordmark { font-size: 21px; } }
@media (max-width: 350px) { .login-clean-brand .login-clean-logo { width: 48px; height: 48px; } .login-clean-wordmark { font-size: 19px; } .login-clean-header { gap: 10px; } }
.login-clean-theme .theme-label { display: none; }
.login-screen .login-clean-card #login-msg { min-height: 76px; margin: 14px 0 0; }
.login-clean-card label { color: var(--ink); }
.login-clean-card .form-check-label { color: var(--muted); }
.login-clean-card .form-check { margin-top: 6px; margin-bottom: 22px !important; }
.login-clean-card .form-control { background-color: var(--surface) !important; color: var(--ink) !important; }
@media (max-width: 480px) { .login-clean-card { padding: 28px 24px !important; } .login-clean-logo { width: 62px; height: 62px; } }
.login-fields-card #login-form { width: 100%; }
.login-fields-card .text-white { color: #f7fcf8 !important; }
.login-fields-card .form-check-label { margin-top: 0; color: #edf6ef; font-size: 14px; }
.login-fields-card #login-btn { width: 100%; min-height: 46px; margin-top: 8px; }
.login-fields-card #login-msg { min-height: 72px; margin-top: 0; font-size: 14px; color: #ffb9b2 !important; }
.login-fields-card .input-group .form-control { min-width: 0; }
.login-fields-card .password-visibility-toggle { background: #f0f5f1; color: #244536; border-color: #dce5dd; }
.login-fields-card label { font-size: 14px; }
.login-fields-card { backdrop-filter: blur(14px); }
.login-screen .login-fields-card .form-control { background-color: #fff !important; color: #24372b !important; }
.welcome-copy { max-width: calc(100% - 230px); }
@media (max-width: 1120px) { .welcome-copy { max-width: 100%; } .welcome-art { right: -90px; opacity: .25; } }
button.theme-toggle.theme-toggle { color: #285c45; background: #edf6ee; border: 1px solid #d9e9dc; }
button.theme-toggle.theme-toggle:hover { background: #deeee3; color: #14432e; }
html[data-theme="dark"] button.theme-toggle.theme-toggle { color: #e2f3e8; background: #294e3a; border-color: #466e55; }
.auth-topbar button.theme-toggle.theme-toggle { color: white; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); }
body { font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif; }
.app-main .card { overflow: visible; }
.app-main .card-header:first-child { border-radius: 18px 18px 0 0; }
.app-main .card-body { min-width: 0; }
.app-main .row > *, .header-actions, .auth-form-area { min-width: 0; }
.app-main .Select-menu-outer, .modal .Select-menu-outer { z-index: 1100; }
.app-main .Select-value-label { color: var(--ink) !important; }
.app-main .container2 { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); }
.app-main .table-responsive { border-radius: 12px; }
.app-main .table .btn { white-space: nowrap; }
.app-main .table td:has(> .btn + .btn) { white-space: nowrap; }
.app-main .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td,
.app-main .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th { color: var(--ink) !important; background-color: var(--surface) !important; border-color: var(--line) !important; font-family: 'Segoe UI', Arial, sans-serif; }
.app-main .DateInput, .app-main .DateInput_input, .app-main .SingleDatePickerInput { background: var(--surface); color: var(--ink); border-color: var(--line); border-radius: 8px; }
.app-main .DateInput_input { font-size: 14px; padding: 10px; }
.app-main > .container-fluid > .row:first-child:has(a[href="/control-usuarios"]) { margin-bottom: 18px; }
.app-main .btn { white-space: normal; }
.btn-primary, .btn-info { --bs-btn-disabled-bg: #197c5b; --bs-btn-disabled-border-color: #197c5b; --bs-btn-disabled-color: #fff; }
.btn-secondary { --bs-btn-disabled-bg: #e4ece4; --bs-btn-disabled-border-color: #d3ded3; --bs-btn-disabled-color: #365042; }
.app-main .form-text { color: var(--muted) !important; }
.auth-card #login-msg { margin: 12px 0 0; min-height: 36px; overflow-wrap: anywhere; }
.auth-card .password-visibility-toggle { background: var(--surface-soft); color: var(--ink); border-color: var(--line); }
.auth-card .form-check { display: flex; align-items: center; gap: 10px; padding-left: 0; }
.auth-card .form-check-input { margin-left: 0; float: none; flex-shrink: 0; }
.auth-card .form-check label { margin-bottom: 0; }
.auth-card #login-form { width: 100%; }
.auth-card .input-group > .form-control { min-width: 0; }
.auth-screen { padding: 0; }
.session-screen { min-height: 100dvh; padding: 24px; background: var(--canvas) !important; color: var(--ink); }
.session-screen .card { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.session-screen .card-body { padding: 30px; }
.session-screen .password-visibility-toggle { color: var(--ink); background: var(--surface-soft); }
.modal-content { background: var(--surface); color: var(--ink); max-height: calc(100dvh - 32px); }
.modal-body { overflow: auto; }
.modal-footer { flex-wrap: wrap; gap: 8px; }
.modal-footer > .d-flex { flex-wrap: wrap; gap: 8px; }
.modal-footer .btn { white-space: normal; }
.modal-body .table { --bs-table-color: var(--ink); --bs-table-bg: var(--surface); --bs-table-border-color: var(--line); }
.modal-body .table thead th { color: var(--ink); background: var(--surface-soft); }
.provider-allocation-table thead th { position: sticky; top: 0; z-index: 2; }
.provider-allocation-table td:first-child, .provider-allocation-table th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.provider-allocation-table th:first-child { z-index: 3; }
.market-breakdown-table td:first-child, .market-breakdown-table th:first-child { background: var(--surface) !important; }
html[data-theme="dark"] .modal label { color: var(--ink); }
html[data-theme="dark"] .modal .btn-close { filter: invert(1); }
html[data-theme="dark"] .modal .text-muted, html[data-theme="dark"] .app-main .text-muted { color: var(--muted) !important; }
html[data-theme="dark"] .modal-content .table { --bs-table-striped-bg: #213a2e; --bs-table-striped-color: var(--ink); }
html[data-theme="dark"] .session-screen .card { color: var(--ink); }
html[data-theme="dark"] .modal .Select-value-label { color: var(--ink) !important; }
@media (max-width: 620px) {
  .app-topbar { padding: 0 12px; gap: 8px; }
  .app-topbar .theme-label { display: none; }
  .app-topbar .header-actions { gap: 6px; }
  .app-topbar .breadcrumb-line { font-size: 12px; }
  .page-heading h1 { font-size: 27px; }
  .modal-body { padding: 16px; }
  .modal-header, .modal-footer { padding: 14px 16px; }
  .modal-footer > .d-flex { width: 100%; }
  .modal-footer .btn { min-height: 44px; }
  .app-main .module-header-actions .btn { flex-basis: auto; }
  .app-main .card-body .btn.w-100 { min-height: 44px; }
  .auth-story h1 { max-width: 370px; }
  .auth-topbar { align-items: flex-start; }
  .auth-topbar .theme-label { display: none; }
  .auth-brand { gap: 10px; }
}
@media (max-width: 800px) {
  .mobile-navigation { position: fixed; top: 66px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 84px); }
}
/* Celulares y tabletas: espacio útil completo y controles táctiles. */
@media screen and (max-width: 1024px) {
  .app-shell { --sidebar-width: 0px; --topbar-height: 68px; display: block; }
  .app-sidebar { display: none; }
  .app-topbar { height: 68px; padding: 0 16px; gap: 12px; }
  .app-topbar .header-status { display: none; }
  .app-topbar .theme-label { display: none; }
  .app-topbar .header-actions { gap: 8px; flex: 0 0 auto; }
  .app-topbar > div:first-child { min-width: 0; }
  .breadcrumb-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-main { min-height: calc(100dvh - 68px); padding: 26px 18px 40px; }
  .mobile-menu { display: block; }
  .mobile-menu summary { list-style: none; display: flex; align-items: center; gap: 7px; padding: 10px 12px; min-height: 44px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 700; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-navigation { position: fixed; top: 68px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 88px); overflow-y: auto; overscroll-behavior: contain; padding: 18px 12px; background: #123f34; border: 1px solid #386452; border-radius: 14px; box-shadow: 0 20px 55px rgba(0, 25, 15, .3); z-index: 1050; }
  .mobile-navigation .nav-link-item { min-height: 46px; }
  .app-main .btn, .modal .btn, .login-screen .btn { min-height: 44px; }
  .app-main .btn-sm, .modal .btn-sm { padding: 10px 12px; font-size: 13px; }
  .shell-logout.btn, button.theme-toggle.theme-toggle { min-width: 44px; min-height: 44px; }
  .app-topbar .user-chip { max-width: 180px; }
  .form-control, .form-select, .Select-control, .DateInput_input { min-height: 44px; }
  .form-control, .form-select, .Select-input > input, .Select-placeholder,
  .Select-value-label, .DateInput_input, .app-main input[type="number"],
  .modal input[type="number"] { font-size: 16px !important; }
  .form-check-input { width: 21px; height: 21px; }
  .modal-dialog { width: calc(100% - 24px); max-width: calc(100% - 24px); margin: 12px auto; }
  .modal-content { max-height: calc(100dvh - 24px); }
  .modal-header, .modal-footer { flex-shrink: 0; }
  .modal-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
  .modal-footer { gap: 8px; }
  .modal-footer .btn { margin: 0 !important; }
  .market-breakdown-scroll, .provider-allocation-scroll, .module-table-wrapper { overscroll-behavior-x: contain; }
  #modal-editar-desglose .modal-content,
  #modal-desglose-orden .modal-content { height: calc(100dvh - 24px); }
  #modal-editar-desglose .modal-body,
  #modal-desglose-orden .modal-body { display: flex; flex-direction: column; overflow: hidden; }
  #modal-editar-desglose .modal-body > p,
  #modal-desglose-orden .modal-body > label,
  #dropdown-market-imprimir-desglose { flex: 0 0 auto; }
  #contenido-editar-desglose,
  #tabla-desglose-markets-container { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  #contenido-editar-desglose .market-breakdown-scroll,
  #tabla-desglose-markets-container .market-breakdown-scroll { height: 100%; max-height: none; scroll-padding-block-start: 44px; }
  #mensaje-editar-desglose:empty { display: none; }
}
@media screen and (max-width: 620px) {
  .app-topbar { padding: 0 12px; gap: 8px; }
  .app-topbar .eyebrow, .breadcrumb-parent, .breadcrumb-line > .bi { display: none; }
  .app-topbar .header-actions { gap: 6px; }
  .app-topbar .user-name { display: none; }
  .app-main { padding: 22px 12px 32px; }
  .module-search.form-control { width: 100%; }
  .page-heading p { line-height: 1.6; }
  .modal-body .market-breakdown-table th:first-child,
  .modal-body .market-breakdown-table td:first-child,
  .modal-body .provider-allocation-table th:first-child,
  .modal-body .provider-allocation-table td:first-child { width: 140px; min-width: 140px; max-width: 140px; white-space: normal; overflow-wrap: anywhere; }
  .modal-body .market-breakdown-table input[type="number"],
  .modal-body .provider-allocation-table input[type="number"] { width: 110px; min-width: 110px !important; max-width: 110px; }
  .market-breakdown-scroll, .provider-allocation-scroll { scroll-padding-inline-start: 148px; scroll-padding-inline-end: 8px; }
  .modal-body .market-breakdown-table td:first-child label,
  .modal-body .provider-allocation-table td:first-child label { white-space: normal; }
  .modal-body .market-breakdown-table th:not(:first-child),
  .modal-body .provider-allocation-table th:not(:first-child) { white-space: normal !important; overflow-wrap: break-word; }
  .login-clean-header { gap: 10px; }
  .login-clean-wordmark { font-size: 21px; }
  .login-clean-brand { gap: 10px; }
}
@media screen and (max-width: 400px) {
  .app-topbar .user-chip { display: none; }
  .app-topbar .breadcrumb-line { font-size: 11px; }
  .mobile-menu summary { padding: 10px; }
  .login-clean-brand .login-clean-logo { width: 48px; height: 48px; }
  .login-clean-wordmark { font-size: 19px; }
}
@media screen and (max-height: 500px) and (orientation: landscape) {
  .login-clean-screen { align-items: start; }
}
@media print {
  html[data-theme] { color-scheme: light; --ink: #17212b; --surface: #fff; --surface-soft: #f3f5f3; --line: #bbc5bf; }
  .modal-content { max-height: none !important; overflow: visible !important; box-shadow: none; }
  .modal-body, .market-breakdown-scroll, .provider-allocation-scroll { max-height: none !important; overflow: visible !important; }
  .modal-body .table > :not(caption) > * > * { color: #17212b !important; background: white !important; }
}

