/* Piloto local E/F: una sola aplicación, dos jerarquías visuales. */
#app[data-shell-pilot="ef"] { min-height: 100vh; background: #f4f7f6; }
#app[data-shell-pilot="ef"] .app-shell { --shell-side: 264px; }
#app[data-shell-pilot="ef"] .topbar { min-height: 70px; }
.shell-variant-controls { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.shell-variant-controls > span { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.shell-variant-controls button { min-height: 38px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--ink); font-weight: 850; }
.shell-variant-controls button.active { border-color: var(--teal); background: var(--teal); color: #fff; }
.shell-variant-controls .shell-search-trigger { margin-left: 4px; border-color: #99c9ba; color: var(--teal-dark); }
.shell-variant-controls .shell-workspaces-trigger { border-color: #99c9ba; color: var(--teal-dark); }
.shell-variant-controls .shell-workspaces-trigger span { display: inline-grid; place-items: center; min-width: 21px; height: 21px; margin-left: 4px; border-radius: 999px; background: #e4f7f2; color: #007d64; }
.shell-alpha-controls .shell-alpha-identity { display: inline-flex; align-items: baseline; gap: 5px; color: #006f59; font-size: 12px; letter-spacing: .03em; }
.shell-alpha-controls .shell-alpha-identity small { color: #8a5b00; font-size: 10px; text-transform: lowercase; }
.shell-pilot-navigation { min-width: 0; background: #fff; border-right: 1px solid var(--line); }
.shell-pilot-navigation-title { display: grid; gap: 3px; padding: 18px 16px 12px; }
.shell-pilot-navigation-title b { color: var(--teal-dark); font-size: 15px; letter-spacing: .04em; }
.shell-pilot-navigation-title span { color: var(--muted); font-size: 12px; }
.shell-pilot-local-note { display: grid; gap: 4px; margin: auto 12px 14px; padding: 11px; border-radius: 12px; background: #eef8f4; color: #356357; font-size: 11px; line-height: 1.4; }
.shell-pilot-local-note strong, .shell-pilot-local-note span, .shell-pilot-local-note small { display: block; }
.shell-pilot-local-note small { margin-top: 4px; color: inherit; opacity: .72; }
.shell-module-search { width: min(680px, calc(100% - 28px)); max-height: min(720px, calc(100vh - 40px)); padding: 20px; border: 0; border-radius: 18px; box-shadow: 0 28px 90px rgba(15, 23, 42, .28); }
.shell-module-search::backdrop { background: rgba(15, 23, 42, .58); }
.shell-module-search-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.shell-module-search-head small { color: var(--teal-dark); font-weight: 900; letter-spacing: .06em; }
.shell-module-search-head h2 { margin: 4px 0 16px; }
.shell-module-search form > label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 850; }
.shell-module-search form .quick-search-row { grid-template-columns: minmax(220px, 1fr) auto; }
.shell-module-search form input { width: 100%; min-height: 48px; }
.shell-module-search form .advanced-filters { margin-top: 12px; }
.shell-module-search-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 430px; margin-top: 14px; overflow: auto; }
.shell-module-search-results button { display: grid; gap: 3px; min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); text-align: left; }
.shell-module-search-results button:hover, .shell-module-search-results button:focus-visible { border-color: var(--teal); background: #eef9f5; }
.shell-module-search-results span { color: var(--muted); font-size: 11px; }
.shell-workspaces-backdrop { display: none; }
.shell-workspaces-backdrop[hidden] { display: none !important; }
.shell-e-modebar[hidden] { display: none !important; }
.shell-e-modebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.shell-e-modebar span { min-width: 0; color: #526b65; font-size: 12px; }
.shell-e-modebar b { margin-right: 7px; padding: 4px 8px; border-radius: 999px; background: #dff4ed; color: #08745f; font-size: 10px; letter-spacing: .05em; }

@media (min-width: 901px) {
  #app[data-shell-pilot="ef"] .app-shell { grid-template-columns: var(--shell-side) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  #app[data-shell-pilot="ef"] .app-shell > .topbar { grid-column: 1 / -1; grid-row: 1; }
  #app[data-shell-pilot="ef"] .app-shell > .mobile-navigation-toggle { display: none; }
  #app[data-shell-pilot="ef"] .app-shell > .shell-pilot-navigation { position: sticky; top: 70px; grid-column: 1; grid-row: 2 / 4; display: flex; flex-direction: column; align-self: start; height: calc(100vh - 70px); overflow-y: auto; }
  #app[data-shell-pilot="ef"] .shell-pilot-navigation > .module-tabs { position: static; display: block; flex: 0 0 auto; overflow: visible; padding: 6px 10px; border: 0; background: transparent; }
  #app[data-shell-pilot="ef"] .shell-module-list { display: grid; grid-template-columns: 1fr; align-content: start; gap: 5px; }
  #app[data-shell-pilot="ef"] .shell-module-list > .subtabs { display: grid; grid-template-columns: 1fr; gap: 4px; margin: -2px 4px 8px 15px; padding: 7px 6px 7px 9px; border: 0; border-left: 2px solid #9ccdc0; border-radius: 0 10px 10px 0; background: #f3f7f6; }
  #app[data-shell-pilot="ef"] .shell-module-list > .subtabs.hidden { display: none; }
  #app[data-shell-pilot="ef"] .shell-pilot-navigation .mobile-nav-label { display: block; margin: 5px 4px 3px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
  #app[data-shell-pilot="ef"] .shell-pilot-navigation .tab { width: 100%; min-width: 0; max-width: none; min-height: 42px; justify-content: flex-start; padding: 9px 12px; white-space: normal; text-align: left; }
  #app[data-shell-pilot="ef"] .shell-pilot-navigation .subtabs .tab { min-height: 36px; padding: 7px 10px; font-size: 12px; }
  #app[data-shell-pilot="ef"] .app-shell > .page { grid-column: 2; grid-row: 3; }

  #app[data-shell-variant="e"] .app-shell { --shell-side: 284px; background: #eef3f4; }
  #app[data-shell-variant="e"] .shell-pilot-navigation { background: #f8fafb; }
  #app[data-shell-variant="e"] .shell-pilot-navigation .tab { border-radius: 8px; background: transparent; }
  #app[data-shell-variant="e"] .shell-pilot-navigation .tab.active { background: #dcefeb; color: #075f50; box-shadow: inset 4px 0 #008d6f; }
  #app[data-shell-variant="e"] .app-shell > .modular-workspace-tray { position: sticky; top: 70px; grid-column: 2; grid-row: 2; gap: 5px; padding: 7px 18px 0; border-bottom: 1px solid #cbdcd7; background: #f8fbfa; }
  #app[data-shell-variant="e"] .modular-workspace-heading,
  #app[data-shell-variant="e"] .modular-workspace-continue,
  #app[data-shell-variant="e"] .modular-workspace-explanation,
  #app[data-shell-variant="e"] .modular-workspace-limit,
  #app[data-shell-variant="e"] .modular-workspace-discipline,
  #app[data-shell-variant="e"] .modular-workspace-recovery { display: none; }
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-heading { display: flex; margin-top: 6px; }
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-continue,
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-explanation,
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-limit,
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-discipline,
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-recovery { display: flex; }
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-discipline { display: grid; }
  #app[data-shell-variant="e"] .modular-workspace-heading { align-items: end; }
  #app[data-shell-variant="e"] .modular-workspace-heading h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
  #app[data-shell-variant="e"] .modular-workspace-heading p { display: none; }
  #app[data-shell-variant="e"] .modular-workspace-content { display: block; }
  #app[data-shell-variant="e"] .modular-workspace-continue,
  #app[data-shell-variant="e"] .modular-workspace-explanation,
  #app[data-shell-variant="e"] .modular-workspace-limit,
  #app[data-shell-variant="e"] .modular-workspace-discipline,
  #app[data-shell-variant="e"] .modular-workspace-recovery { margin: 7px 0; }
  #app[data-shell-variant="e"] .modular-workspace-tabs { padding-bottom: 0; }
  #app[data-shell-variant="e"] .modular-workspace-tab { min-height: 39px; border-radius: 9px 9px 0 0; border-bottom-color: transparent; }
  #app[data-shell-variant="e"] .modular-workspace-tab[aria-selected="true"] { background: #fff; border-bottom-color: #fff; box-shadow: inset 0 3px var(--teal); }
  #app[data-shell-variant="e"] .app-shell > .page { width: 100%; padding: 18px 22px 32px; }
  #app[data-shell-variant="e"] .section { border-radius: 12px; box-shadow: none; }

  #app[data-shell-variant="f"] { background: #f3f6fa; }
  #app[data-shell-variant="f"] .app-shell { --shell-side: 264px; background: #f3f6fa; }
  #app[data-shell-variant="f"] .topbar { min-height: 70px; padding: 10px 24px; border-bottom-color: #d8e0ea; background: rgba(255,255,255,.98); box-shadow: 0 3px 14px rgba(15,35,60,.06); }
  #app[data-shell-variant="f"] .brand-title h1 { font-size: 18px; }
  #app[data-shell-variant="f"] .brand-title p { color: #64748b; }
  #app[data-shell-variant="f"] .shell-variant-controls button { border-color: #d8e0ea; background: #f8fafc; color: #10233c; }
  #app[data-shell-variant="f"] .shell-variant-controls button.active { border-color: #009b78; background: #009b78; color: #fff; }
  #app[data-shell-variant="f"] .shell-pilot-navigation { margin: 0; height: calc(100vh - 70px); border: 0; border-right: 1px solid #d8e0ea; border-radius: 0; box-shadow: none; }
  #app[data-shell-variant="f"] .shell-pilot-navigation-title { display: none; }
  #app[data-shell-variant="f"] .shell-pilot-navigation > .module-tabs { padding: 16px 12px 8px; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .module-tab { position: relative; gap: 10px; border-radius: 9px; background: transparent; color: #17243a; font-size: 14px; font-weight: 800; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .module-tab::before { width: 24px; flex: 0 0 24px; color: #10233c; font-size: 18px; text-align: center; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .module-tab::after { content: "›"; margin-left: auto; font-size: 17px; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .module-tab[aria-expanded="true"]::after { content: "⌄"; }
  #app[data-shell-variant="f"] .module-tab[data-module-id="quotes"]::before { content: "▤"; }
  #app[data-shell-variant="f"] .module-tab[data-module-id="sales-crm"]::before { content: "◉"; }
  #app[data-shell-variant="f"] .module-tab[data-module-id="authorizations"]::before { content: "✓"; }
  #app[data-shell-variant="f"] .module-tab[data-module-id="contracts-finance"]::before { content: "$"; }
  #app[data-shell-variant="f"] .module-tab[data-module-id="operation"]::before { content: "⌘"; }
  #app[data-shell-variant="f"] .module-tab[data-module-id="tariffing"]::before { content: "≡"; }
  #app[data-shell-variant="f"] .module-tab[data-module-id="master-catalogs"]::before { content: "◇"; }
  #app[data-shell-variant="f"] .module-tab[data-module-id="admin"]::before { content: "⚙"; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .module-tab.active { background: #009b78; color: #fff; box-shadow: none; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .module-tab.active::before { color: #fff; }
  #app[data-shell-variant="f"] .shell-module-list > .subtabs { margin: -2px 6px 8px 36px; padding: 4px 0 6px 0; border: 0; background: transparent; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .subtabs .tab { border-radius: 9px; background: transparent; color: #45556e; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .subtabs .tab:hover { background: #e8f6f2; color: #00694f; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .subtabs .tab.active { background: #e8f6f2; color: #00694f; box-shadow: inset 3px 0 #009b78; }
  #app[data-shell-variant="f"] .shell-pilot-local-note { flex: 0 0 auto; margin: auto 18px 18px; padding: 14px; border: 0; border-radius: 12px; background: #fff6d7; color: #704d00; }
  #app[data-shell-variant="f"] .app-shell > .modular-workspace-tray { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(460px, 92vw); max-width: none; padding: 20px; overflow-x: hidden; overflow-y: auto; border: 0; border-radius: 0; background: #fff; box-shadow: -15px 0 45px rgba(16, 44, 71, .25); transform: translateX(105%); transition: transform .2s ease; }
  #app[data-shell-variant="f"].shell-workspaces-open .app-shell > .modular-workspace-tray { transform: translateX(0); }
  #app[data-shell-variant="f"] .shell-workspaces-eyebrow { grid-column: 1 / -1; color: var(--teal-dark); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
  #app[data-shell-variant="f"] .modular-workspace-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding-bottom: 13px; border-bottom: 1px solid #dce7e5; }
  #app[data-shell-variant="f"] .modular-workspace-heading h2 { font-size: 20px; }
  #app[data-shell-variant="f"] .modular-workspace-actions { justify-content: flex-end; flex-wrap: wrap; }
  #app[data-shell-variant="f"] [data-toggle-workspace-tray] { display: none; }
  #app[data-shell-variant="f"] .modular-workspace-content,
  #app[data-shell-variant="f"] .modular-workspace-content > *,
  #app[data-shell-variant="f"] .modular-workspace-discipline > * { min-width: 0; max-width: 100%; }
  #app[data-shell-variant="f"] .modular-workspace-discipline { grid-template-columns: 1fr; }
  #app[data-shell-variant="f"] .modular-workspace-continue,
  #app[data-shell-variant="f"] .modular-workspace-explanation { overflow-wrap: anywhere; }
  #app[data-shell-variant="f"] .modular-workspace-tabs { display: grid; overflow: visible; }
  #app[data-shell-variant="f"] .modular-workspace-tab { width: 100%; max-width: none; text-align: left; }
  #app[data-shell-variant="f"] .shell-workspaces-backdrop { position: fixed; z-index: 55; inset: 0; display: block; border: 0; border-radius: 0; background: rgba(16, 44, 71, .46); }
  #app[data-shell-variant="f"] .app-shell > .page { width: 100%; max-width: none; padding: 22px clamp(40px,3vw,48px) 48px; }
  #app[data-shell-variant="f"] .page::before { content: "TRABAJO ORDENADO"; display: block; width: fit-content; margin: 0 0 8px; color: #008268; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
  #app[data-shell-variant="f"][data-shell-module="authorizations"] .page::before,
  #app[data-shell-variant="f"][data-shell-module="contracts-finance"] .page::before,
  #app[data-shell-variant="f"][data-shell-module="operation"] .page::before,
  #app[data-shell-variant="f"][data-shell-module="admin"] .page::before { content: "HERRAMIENTAS AVANZADAS BAJO DEMANDA"; color: #6b2aa0; }
  #app[data-shell-variant="f"] .section { border-color: #d8e0ea; border-radius: 14px; box-shadow: 0 8px 24px rgba(15,35,60,.05); }
  #app[data-shell-variant="f"] .quote-command-bar { background: linear-gradient(135deg,#fff 70%,#e9f9f4); }
  #app[data-shell-variant="f"] .table-wrap { max-width: 100%; overflow-x: auto; }
}

@media (min-width: 901px) and (max-width: 1199px) {
  #app[data-shell-variant="f"] .app-shell { --shell-side: 224px; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .module-tab { font-size: 13px; }
  #app[data-shell-variant="f"] .app-shell > .page { padding-inline: 24px; }
}

@media (max-width: 900px) {
  #app[data-shell-pilot="ef"] .topbar { grid-template-columns: 36px minmax(0, 1fr) auto; }
  #app[data-shell-pilot="ef"] .shell-variant-controls { grid-column: 1 / -1; width: 100%; margin: 4px 0 0; }
  #app[data-shell-pilot="ef"] .shell-variant-controls > span { display: none; }
  #app[data-shell-pilot="ef"] .shell-variant-controls button { flex: 1; min-width: 0; }
  #app[data-shell-pilot="ef"] .app-shell > .shell-pilot-navigation { display: none; }
  #app[data-shell-pilot="ef"] .app-shell.mobile-navigation-open > .shell-pilot-navigation { display: block; }
  #app[data-shell-pilot="ef"] .shell-pilot-navigation > .tabs { display: grid; }
  #app[data-shell-pilot="ef"] .shell-module-list { display: grid; gap: 5px; }
  #app[data-shell-pilot="ef"] .shell-module-list > .subtabs { display: grid; gap: 4px; margin: 0 5px 8px 16px; padding: 6px; border-left: 2px solid #9ccdc0; }
  #app[data-shell-pilot="ef"] .shell-module-list > .subtabs.hidden { display: none; }
  #app[data-shell-pilot="ef"] .shell-pilot-navigation-title, #app[data-shell-pilot="ef"] .shell-pilot-local-note { display: none; }
  #app[data-shell-variant="e"] .app-shell > .modular-workspace-tray { gap: 5px; padding: 7px 10px 0; background: #f8fbfa; }
  #app[data-shell-variant="e"] .shell-e-modebar { flex-wrap: wrap; }
  #app[data-shell-variant="e"] .modular-workspace-heading,
  #app[data-shell-variant="e"] .modular-workspace-continue,
  #app[data-shell-variant="e"] .modular-workspace-explanation,
  #app[data-shell-variant="e"] .modular-workspace-limit,
  #app[data-shell-variant="e"] .modular-workspace-discipline,
  #app[data-shell-variant="e"] .modular-workspace-recovery { display: none; }
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-heading,
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-continue,
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-explanation,
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-limit,
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-recovery { display: flex; }
  #app[data-shell-variant="e"] .shell-e-details-open .modular-workspace-discipline { display: grid; }
  #app[data-shell-variant="f"] .app-shell > .modular-workspace-tray { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(430px, 94vw); overflow-y: auto; transform: translateX(105%); }
  #app[data-shell-variant="f"].shell-workspaces-open .app-shell > .modular-workspace-tray { transform: translateX(0); }
  #app[data-shell-variant="f"] .shell-workspaces-backdrop { position: fixed; z-index: 55; inset: 0; display: block; border: 0; border-radius: 0; background: rgba(16, 44, 71, .46); }
  #app[data-shell-variant="f"] .app-shell > .page { width: 100%; padding: 14px 10px 34px; }
  #app[data-shell-variant="f"] .page::before { content: "TRABAJO ORDENADO"; display: block; width: fit-content; margin: 2px 4px 8px; color: #008268; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .module-tab { justify-content: flex-start; border-radius: 9px; background: transparent; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .module-tab.active { background: #009b78; color: #fff; }
  #app[data-shell-variant="f"] .shell-pilot-navigation .subtabs .tab.active { background: #e8f6f2; color: #00694f; box-shadow: inset 3px 0 #009b78; }
  .shell-module-search-results { grid-template-columns: 1fr; }
}
