:root { --pumpco-navy: #101923; --pumpco-navy-light: #17314c; --pumpco-yellow: #dcb426; --pumpco-yellow-bright: #f2c400; --topbar-height: calc(62px + env(safe-area-inset-top)); --bottom-nav-height: calc(66px + env(safe-area-inset-bottom)); color-scheme: light; font-family: Arial, Helvetica, sans-serif; color: #1e293b; background: #f1f5f9; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f1f5f9; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(249, 115, 22, .35); outline-offset: 2px; }
.application { min-height: 100vh; padding-bottom: calc(var(--bottom-nav-height) + 16px); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; gap: 9px; align-items: center; padding: max(10px, env(safe-area-inset-top)) 12px 10px; border-bottom: 4px solid var(--pumpco-yellow); background: var(--pumpco-navy); box-shadow: 0 2px 10px rgba(15, 23, 42, .35); }
.icon-button, .outline-button { border: 0; border-radius: 10px; font-weight: 700; }
.icon-button { width: 42px; height: 42px; color: white; background: #1e293b; font-size: 1.4rem; }
.search { display: flex; flex: 1; align-items: center; gap: 7px; min-width: 0; padding: 0 10px; border: 1px solid #475569; border-radius: 10px; color: #cbd5e1; background: #1e293b; }
.search input { width: 100%; min-width: 0; height: 42px; border: 0; outline: 0; color: white; background: transparent; }
.search input::placeholder { color: #94a3b8; }
.connection-status { display: none; }
.qaqc-top-navigator { display: flex; width: 100%; overflow-x: auto; border: 1px solid #dbe3ee; border-radius: 8px; background: white; scrollbar-width: thin; }
.qaqc-top-navigator[hidden] { display: none; }
.qaqc-top-navigator .qaqc-tab { display: inline-flex; flex: 1 0 max-content; gap: 10px; align-items: center; justify-content: center; min-height: 64px; padding: 12px 22px; border: 0; border-right: 1px solid #edf2f7; border-radius: 0; color: #061d3a; background: white; font-size: .95rem; font-weight: 700; white-space: nowrap; transition: background .15s, color .15s; }
.qaqc-top-navigator .qaqc-tab:last-child { border-right: 0; }
.qaqc-top-navigator .qaqc-tab svg { width: 22px; height: 22px; fill: none; stroke: #52677f; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qaqc-top-navigator .qaqc-tab:hover { background: #fffdf4; }
.qaqc-top-navigator .qaqc-tab.active { color: #061d3a; background: white; box-shadow: inset 0 -5px 0 #f2c400; }
.qaqc-top-navigator .qaqc-tab:focus-visible { position: relative; z-index: 1; outline: 2px solid #113b67; outline-offset: -4px; }
.qaqc-top-navigator .qaqc-tab.active svg { stroke: #061d3a; }
.view { width: min(860px, 100%); margin: 0 auto; padding: 24px 16px; }
.view-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 5px; color: #f97316; font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 0; color: #0f172a; font-size: clamp(1.65rem, 7vw, 2.2rem); }
.view-heading p:not(.eyebrow), .settings-card p { margin: 7px 0 0; color: #64748b; line-height: 1.45; }
.outline-button { min-height: 42px; padding: 0 13px; color: var(--pumpco-navy); border: 1px solid var(--pumpco-yellow); background: white; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metrics article, .settings-card, form { padding: 16px; border: 1px solid #e2e8f0; border-radius: 14px; background: white; box-shadow: 0 6px 18px rgba(15, 23, 42, .06); }
.metrics strong { display: block; color: var(--pumpco-navy); font-size: 1.7rem; }
.metrics span { color: #64748b; font-size: .78rem; font-weight: 700; }
.dashboard-analysis { display: grid; gap: 12px; margin: 14px 0; padding: 16px; border-radius: 14px; color: white; background: var(--pumpco-navy); }
.dashboard-analysis div { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: center; }
.dashboard-analysis span { color: #cbd5e1; font-size: .78rem; font-weight: 700; }
.dashboard-analysis strong { color: white; font-size: .95rem; }
.dashboard-analysis i { grid-column: 1 / -1; display: block; height: 7px; overflow: hidden; border-radius: 999px; background: #334155; }
.dashboard-analysis b { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--pumpco-yellow-bright); transition: width .25s ease; }
.dashboard-analysis div:first-child b { background: #3da5ff; }
.message { min-height: 1.4em; margin: 14px 0; font-size: .9rem; }
.message.success { color: #15803d; }
.message.error { color: #b91c1c; }
.activity-list { display: grid; gap: 9px; padding: 0; margin: 0; list-style: none; }
.activity-list li { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: white; }
.activity-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: white; background: var(--pumpco-navy-light); font-size: .8rem; font-weight: 900; }
.activity-list strong, .activity-list span { display: block; }
.activity-list strong { color: #0f172a; font-size: .9rem; }
.activity-list span { margin-top: 3px; color: #64748b; font-size: .82rem; line-height: 1.35; }
.activity-list .empty { display: block; color: #64748b; text-align: center; }
.fab { position: fixed; right: 20px; bottom: 92px; z-index: 10; display: grid; width: 58px; height: 58px; place-items: center; border: 0; border-radius: 17px; color: var(--pumpco-navy); background: var(--pumpco-yellow-bright); box-shadow: 0 10px 20px rgba(194, 65, 12, .35); font-size: 2rem; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: #334155; font-size: .78rem; font-weight: 800; letter-spacing: .03em; }
input, select, textarea { width: 100%; min-height: 47px; padding: 10px 11px; border: 1px solid #cbd5e1; border-radius: 9px; color: #0f172a; background: white; }
textarea { min-height: 116px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.primary-button { min-height: 50px; border: 0; border-radius: 10px; color: white; background: var(--pumpco-navy); font-weight: 900; letter-spacing: .04em; }
.map-panel { position: relative; min-height: 470px; overflow: hidden; border-radius: 15px; background: var(--pumpco-navy); }
#field-map { position: absolute; inset: 0; }
#field-map.map-unavailable { display: grid; place-items: center; padding: 32px; color: #f8fafc; background: radial-gradient(circle at top, #244563, var(--pumpco-navy)); text-align: center; font-weight: 800; line-height: 1.45; }
.map-style-control, .map-legend { position: absolute; z-index: 2; display: flex; gap: 4px; padding: 5px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 9px; background: rgba(16, 25, 35, .92); box-shadow: 0 4px 12px rgba(0, 0, 0, .22); }
.map-style-control { top: 12px; left: 12px; }
.map-style { min-height: 33px; padding: 0 10px; border: 0; border-radius: 6px; color: #d9e2ee; background: transparent; font-size: .73rem; font-weight: 800; }
.map-style.active { color: var(--pumpco-navy); background: var(--pumpco-yellow); }
.map-legend { top: 76px; right: 12px; color: white; font-size: .7rem; font-weight: 700; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { display: inline-block; width: 13px; height: 4px; border-radius: 99px; }
.legend-pipeline-24 { background: #3da5ff; box-shadow: 0 0 5px #1d6fd6; }
.legend-pipeline-48 { background: #ffcf4a; box-shadow: 0 0 5px #ff9800; }
.legend-progress { background: #ffffff; box-shadow: 0 0 7px #ffffff; }
.legend-camp { height: 10px !important; border: 2px solid #62d5b4; border-radius: 2px !important; background: rgba(98, 213, 180, .4); }
.map-copy { position: absolute; right: 12px; bottom: 12px; z-index: 2; width: min(330px, calc(100% - 24px)); padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .94); box-shadow: 0 4px 12px rgba(15, 23, 42, .13); }
.map-copy strong, .map-copy span { display: block; }
.map-copy span { margin-top: 3px; color: #64748b; font-size: .82rem; }
.settings-card { margin-bottom: 15px; }
.report-filters { grid-template-columns: minmax(180px, 1fr) 150px 150px auto; align-items: end; margin-bottom: 14px; }
.report-filters .primary-button { min-height: 47px; }
.data-table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 14px; background: white; }
.data-table { width: 100%; min-width: 690px; border-collapse: collapse; font-size: .83rem; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: middle; }
.data-table th { color: #475569; background: #f8fafc; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fffdf2; }
.planning-analysis { display: grid; gap: 18px; margin: 18px 0; }
.planning-costs { display: grid; gap: 14px; margin: 18px 0; }
.conversion-progress { display: grid; gap: 8px; padding: 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #f8fafc; }
.conversion-progress > div { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; }
.conversion-progress span { color: #64748b; font-weight: 700; }
.conversion-progress i { display: block; height: 8px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.conversion-progress b { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--pumpco-yellow); transition: width .2s ease; }
.conversion-progress p { margin: 0; color: #475569; font-size: .78rem; }
.conversion-progress a { color: #0f4c81; font-weight: 800; }
.planning-cost-import { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: white; font-size: .82rem; }
.planning-cost-import strong { color: var(--pumpco-navy); }
.allocation-form { display: grid; grid-template-columns: minmax(170px, 1fr) 110px auto; gap: 6px; min-width: 390px; }
.allocation-form input { min-height: 35px; padding: 6px 8px; font-size: .76rem; }
.allocation-form button { min-height: 35px; padding: 0 9px; font-size: .72rem; }
.planning-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.planning-section-heading h2, .planning-analysis h2 { margin: 0; color: var(--pumpco-navy); font-size: 1.05rem; }
.planning-section-heading p { margin: 5px 0 0; color: #64748b; font-size: .82rem; line-height: 1.4; }
.curve-wrap, .gantt-wrap { overflow-x: auto; padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: white; }
#planning-curve { display: block; min-width: 620px; width: 100%; height: auto; }
.tilos-wrap { overflow-x: auto; padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: white; }
#tilos-chart { display: block; min-width: 720px; width: 100%; height: auto; }
.tilos-grid { stroke: #e2e8f0; stroke-width: 1; }
.tilos-axis { stroke: #64748b; stroke-width: 1.5; }
.tilos-plan { stroke: #1d6fd6; stroke-width: 5; stroke-linecap: round; }
.tilos-actual { stroke: #ef4444; stroke-width: 5; stroke-linecap: round; }
#tilos-chart text { fill: #475569; font-size: 12px; }
#tilos-chart .tilos-label { font-size: 11px; }
.curve-legend { display: flex; gap: 10px; font-size: .74rem; font-weight: 800; }
.curve-legend span::before { display: inline-block; width: 10px; height: 3px; margin-right: 4px; content: ""; vertical-align: middle; }
.curve-legend .pv::before { background: #3b82f6; }.curve-legend .ev::before { background: #16a34a; }.curve-legend .ac::before { background: #f97316; }
.gantt { min-width: 680px; }
.gantt-row { display: grid; grid-template-columns: 280px 1fr; gap: 10px; align-items: center; min-height: 35px; border-bottom: 1px solid #f1f5f9; font-size: .75rem; }
.gantt-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #334155; font-weight: 700; }
.gantt-track { position: relative; height: 14px; overflow: hidden; border-radius: 5px; background: #e2e8f0; }
.gantt-bar { position: absolute; top: 0; height: 100%; border-radius: inherit; background: #dc2626; }
@media (max-width: 620px) { .planning-section-heading { display: grid; }.curve-legend { margin-top: 4px; } }
.priority-badge { display: inline-block; padding: 4px 7px; border-radius: 999px; color: #334155; background: #e2e8f0; font-size: .7rem; font-weight: 800; }
.priority-badge.high { color: #9a3412; background: #ffedd5; }
.priority-badge.critical { color: #991b1b; background: #fee2e2; }
.table-action { min-height: 32px; padding: 0 9px; border: 1px solid var(--pumpco-yellow); border-radius: 7px; color: var(--pumpco-navy); background: white; font-size: .75rem; font-weight: 800; }
.table-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: #64748b; font-size: .82rem; }
.table-pagination div { display: flex; gap: 8px; }
.table-pagination .outline-button { min-height: 36px; }
.table-pagination button:disabled { cursor: not-allowed; opacity: .45; }
.report-dialog { width: min(680px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 28px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 20px 55px rgba(15, 23, 42, .45); }
.report-dialog::backdrop { background: rgba(15, 23, 42, .7); }
.report-dialog article { padding: 20px; }
.report-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.report-dialog h2 { margin: 0; color: var(--pumpco-navy); font-size: 1.25rem; }
.report-dialog .icon-button { width: 36px; height: 36px; font-size: 1.25rem; }
.report-detail { display: grid; grid-template-columns: 145px 1fr; gap: 0; margin: 18px 0; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.report-detail dt, .report-detail dd { min-height: 38px; margin: 0; padding: 9px 10px; border-bottom: 1px solid #e2e8f0; font-size: .85rem; }
.report-detail dt { color: #475569; background: #f8fafc; font-weight: 800; }
.report-detail dd { color: #0f172a; overflow-wrap: anywhere; }
.report-detail dt:nth-last-of-type(1), .report-detail dd:last-child { border-bottom: 0; }
.report-evidence { margin: 0 0 18px; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.report-evidence img { display: block; width: 100%; max-height: 60vh; object-fit: contain; }
.personnel-form { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.status-badge { display: inline-block; padding: 4px 7px; border-radius: 999px; color: #166534; background: #dcfce7; font-size: .7rem; font-weight: 800; }
.status-badge.suspended { color: #9a3412; background: #ffedd5; }
.status-badge.deactivated { color: #991b1b; background: #fee2e2; }
.activity-resource-list { display: grid; gap: 9px; margin-top: 15px; }
.activity-resource-list section { padding: 11px; border: 1px solid #e2e8f0; border-radius: 9px; }
.activity-resource-list h3 { margin: 0 0 7px; color: var(--pumpco-navy); font-size: .85rem; }
.activity-resource-list ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; color: #475569; font-size: .82rem; }
.settings-card code { font-weight: 800; }
.saved-api-base { margin: -4px 0 15px; color: #475569; font-size: .82rem; overflow-wrap: anywhere; }
.bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 30; display: flex; height: var(--bottom-nav-height); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid #e2e8f0; background: white; box-shadow: 0 -4px 12px rgba(15, 23, 42, .06); }
.tab { flex: 1; border: 0; color: #64748b; background: white; font-size: .75rem; font-weight: 800; }
.tab.active { color: var(--pumpco-navy); background: #fff9db; box-shadow: inset 0 -3px 0 var(--pumpco-yellow); }
.drawer-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .62); }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; display: flex; width: min(82vw, 290px); flex-direction: column; color: white; background: var(--pumpco-navy); box-shadow: 7px 0 25px rgba(15, 23, 42, .28); transform: translateX(-105%); transition: transform .25s ease; }
.drawer.open { transform: translateX(0); }
.brand { display: flex; align-items: center; height: calc(72px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 18px 0; border-bottom: 4px solid var(--pumpco-yellow); background: var(--pumpco-navy); }
.brand-logo { width: 186px; height: auto; object-fit: contain; }
.drawer-nav { display: grid; gap: 4px; padding: 18px 10px; }
.drawer-link { padding: 13px; border: 0; border-radius: 8px; color: #cbd5e1; background: transparent; text-align: left; font-weight: 700; }
.drawer-link.active, .drawer-link:hover { color: var(--pumpco-navy); background: var(--pumpco-yellow); }
.operator { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 16px; border-top: 1px solid #334155; }
.operator-avatar { display: grid; width: 38px; height: 38px; place-items: center; border: 2px solid var(--pumpco-yellow); border-radius: 50%; font-size: .72rem; font-weight: 900; }
.operator strong, .operator small { display: block; }
.operator small { margin-top: 3px; color: #94a3b8; font-size: .72rem; }
#view-map { position: fixed; top: var(--topbar-height); right: 0; bottom: var(--bottom-nav-height); left: 0; z-index: 1; width: 100vw; max-width: none; margin: 0 !important; padding: 0 !important; border: 0; box-shadow: none; }
#view-map .view-heading { display: none; }
#view-map .map-panel { width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
#view-map #field-map, #view-map .maplibregl-map, #view-map .maplibregl-canvas-container, #view-map .maplibregl-canvas { width: 100% !important; height: 100% !important; }
@media (min-width: 700px) { .connection-status { display: block; color: #bbf7d0; font-size: .7rem; font-weight: 800; } .connection-status.offline { color: #fed7aa; } }
@media (max-width: 680px) { .form-grid, .report-filters { grid-template-columns: 1fr; } .view { padding: 20px 13px; } .view-heading { display: block; } .view-heading .outline-button { margin-top: 12px; } .report-detail { grid-template-columns: 110px 1fr; } }

/* Sesión: la app solo se muestra con un usuario autenticado. */
body:not(.authenticated) > :not(#login-screen):not(script) { display: none !important; }
body.authenticated > #login-screen { display: none; }
.operator { flex-wrap: wrap; }
.operator > div { flex: 1; min-width: 0; }
.operator small:empty { display: none; }
.logout-button { width: 100%; min-height: 38px; border: 1px solid #475569; border-radius: 8px; color: #e2e8f0; background: transparent; font-size: .8rem; font-weight: 800; }
.logout-button:hover { border-color: var(--pumpco-yellow); color: var(--pumpco-yellow); }

/* Login, basado en la pantalla de acceso de Pumpco Datafield. */
.auth-container { display: flex; width: 100%; min-height: 100vh; min-height: 100dvh; }
.auth-left { position: relative; width: 50%; overflow: hidden; background-color: var(--pumpco-navy); background-image:
  linear-gradient(90deg, rgba(4, 14, 26, .30), rgba(4, 14, 26, .04)),
  url("/assets/login-pipeline-bg.png"); background-position: center; background-repeat: no-repeat; background-size: cover; }
.auth-left::after { position: absolute; inset: 0; background:
  radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .04), transparent 26%),
  linear-gradient(180deg, rgba(2, 10, 20, .05), rgba(2, 10, 20, .16)); content: ""; pointer-events: none; }
.left-content { position: relative; z-index: 1; display: flex; height: 100%; flex-direction: column; padding: clamp(42px, 6vh, 70px) clamp(48px, 6vw, 92px); }
.logo-pumpco { width: clamp(240px, 24vw, 380px); max-width: 88%; height: auto; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .25)); }
.left-main { margin-top: clamp(62px, 12vh, 130px); }
.pce-title { display: block; color: var(--pumpco-yellow-bright); font-size: clamp(4.4rem, 7vw, 7.5rem); font-weight: 900; line-height: .9; letter-spacing: -.01em; text-transform: uppercase; text-shadow: 0 14px 30px rgba(0, 0, 0, .32); }
.pce-title::after { display: block; width: clamp(140px, 12vw, 200px); height: 5px; margin: 18px 0 26px; border-radius: 999px; background: linear-gradient(90deg, var(--pumpco-yellow-bright), #ffd35a); content: ""; }
.product-name { margin: 0; color: white; font-size: clamp(1.6rem, 2.1vw, 2.4rem); line-height: 1.18; }
.product-subtitle { margin: 14px 0 0; color: rgba(255, 255, 255, .82); font-size: clamp(1rem, 1.2vw, 1.3rem); line-height: 1.45; }
.auth-right { display: flex; width: 50%; align-items: center; justify-content: center; padding: clamp(28px, 5vw, 64px); background:
  radial-gradient(circle at 88% 12%, rgba(242, 196, 0, .14), transparent 24%),
  radial-gradient(circle at 30% 85%, rgba(23, 49, 76, .13), transparent 28%),
  linear-gradient(135deg, #edf3f8 0%, #f8fafc 48%, #e5edf5 100%); }
.auth-card { width: 100%; max-width: 520px; padding: clamp(34px, 6vh, 54px) clamp(28px, 5vw, 60px); border: 1px solid rgba(255, 255, 255, .92); border-top: 5px solid var(--pumpco-yellow-bright); border-radius: 20px; background: rgba(255, 255, 255, .9); box-shadow: 0 30px 74px rgba(7, 28, 52, .18); text-align: center; }
.auth-card-logo { display: none; }
.auth-card h1 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); letter-spacing: -.04em; }
.auth-card .subtitle { margin: 8px 0 30px; color: #64748b; }
.login-form { display: grid; gap: 18px; padding: 0; border: 0; background: none; box-shadow: none; text-align: left; }
.login-form label { font-size: .88rem; letter-spacing: 0; }
.input-wrap { position: relative; display: block; }
.input-icon, .toggle-password svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.input-icon { position: absolute; top: 50%; left: 16px; color: #7b8794; transform: translateY(-50%); pointer-events: none; }
.login-form input { height: 52px; padding: 0 48px; border-color: #d4dce7; border-radius: 13px; font-size: .98rem; font-weight: 400; transition: border-color .18s, box-shadow .18s; }
.login-form input:focus { border-color: var(--pumpco-yellow-bright); outline: 0; box-shadow: 0 0 0 .22rem rgba(242, 196, 0, .2); }
.toggle-password { position: absolute; top: 50%; right: 10px; display: grid; width: 36px; height: 36px; place-items: center; padding: 0; border: 0; color: #7b8794; background: transparent; transform: translateY(-50%); }
.toggle-password:hover { color: var(--pumpco-navy-light); }
.toggle-password .eye-slash { display: none; }
.toggle-password.visible .eye-slash { display: inline; }
.login-form .message { margin: 0; }
.login-form .message:empty, .login-form label[hidden] { display: none; }
.login-form .message.error { padding: 12px 14px; border: 1px solid rgba(220, 38, 38, .18); border-radius: 12px; background: rgba(254, 226, 226, .78); color: #7f1d1d; }
.btn-login { height: 52px; border: 0; border-radius: 13px; color: white; background: linear-gradient(135deg, var(--pumpco-navy), var(--pumpco-navy-light)); box-shadow: 0 15px 30px rgba(7, 28, 52, .25); font-weight: 800; transition: transform .18s, box-shadow .18s; }
.btn-login span { margin-left: 14px; }
.btn-login:hover:not(:disabled) { box-shadow: 0 19px 36px rgba(7, 28, 52, .3); transform: translateY(-1px); }
.btn-login:disabled { cursor: progress; opacity: .7; }
@media (max-width: 900px) {
  .auth-left { display: none; }
  .auth-right { width: 100%; align-items: flex-start; padding: 24px 16px; background: linear-gradient(180deg, var(--pumpco-navy) 0 250px, #f1f5f9 250px); }
  .auth-card { max-width: 440px; padding: 30px 22px; border-radius: 16px; background: white; }
  .auth-card-logo { display: block; width: 200px; margin: -96px auto 52px; }
  .auth-right { padding-top: calc(130px + env(safe-area-inset-top)); }
}

.signature-fieldset { display: grid; gap: 12px; margin: 0; padding: 14px; border: 1px solid #e2e8f0; border-left: 4px solid var(--pumpco-yellow); border-radius: 12px; background: #f8fafc; }
.signature-fieldset legend { padding: 0 6px; color: var(--pumpco-navy); font-weight: 900; }
.signature-fieldset p { margin: 0; color: #64748b; font-size: .82rem; line-height: 1.4; }
.signature-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; color: #475569; background: #e2e8f0; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.signature-badge.sent { color: #854d0e; background: #fef3c7; }
.signature-badge.completed { color: #166534; background: #dcfce7; }
.signature-badge.declined, .signature-badge.voided, .signature-badge.error { color: #991b1b; background: #fee2e2; }
.signature-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.signature-actions[hidden], .signature-actions [hidden] { display: none; }

/* Sistema visual PCE para la consola de campo. */
:root { --pumpco-navy: #101923; --pumpco-navy-2: #0b1520; --pumpco-blue: #113b67; --pumpco-yellow: #dcb426; --pumpco-yellow-bright: #f2c400; --pumpco-bg: #f6f8fb; --pumpco-surface: #ffffff; --pumpco-text: #061d3a; --pumpco-muted: #5f6f85; --pumpco-border: #dbe3ee; --pumpco-border-soft: #edf2f7; --pce-radius: 18px; --topbar-height: calc(88px + env(safe-area-inset-top)); color: var(--pumpco-text); background: var(--pumpco-bg); }
body { background: var(--pumpco-bg); color: var(--pumpco-text); font-size: .96rem; line-height: 1.5; }
h1, h2, h3, h4, h5, h6 { color: var(--pumpco-text); font-weight: 800; letter-spacing: -.025em; }
.application { padding-bottom: calc(var(--bottom-nav-height) + 24px); }
.topbar { min-height: calc(72px + env(safe-area-inset-top)); gap: 16px; padding: max(10px, env(safe-area-inset-top)) 24px 10px; border-bottom: 4px solid var(--pumpco-yellow-bright); background: #0d1b28; box-shadow: none; }
.icon-button { width: 42px; height: 42px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px; background: transparent; font-size: 1.2rem; }
.icon-button:hover { border-color: var(--pumpco-yellow); background: rgba(255, 255, 255, .08); }
.app-identity { display: flex; align-items: center; gap: 14px; min-width: 0; color: white; }
.app-identity img { width: 38px; height: 38px; object-fit: contain; }
.app-identity .app-divider { width: 1px; height: 32px; background: rgba(255, 255, 255, .26); }
.app-identity strong { color: var(--pumpco-yellow-bright); font-size: 1.75rem; font-weight: 900; letter-spacing: -.03em; }
.app-identity .app-product { color: rgba(255, 255, 255, .92); font-size: 1rem; font-weight: 700; white-space: nowrap; }
.topbar .search { max-width: 320px; margin-left: auto; padding: 0 10px; border-color: rgba(255, 255, 255, .18); border-radius: 6px; background: transparent; }
.topbar .search input { min-height: 36px; height: 36px; padding: 6px 0; font-size: .8rem; }
.topbar svg, .qaqc-heading-actions svg { flex-shrink: 0; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar .icon-button { flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 36px; }
.header-account { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 8px; min-height: 38px; max-width: 180px; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px; color: #f1f5f9; background: transparent; font-size: .85rem; font-weight: 700; }
.header-account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-account:hover { border-color: var(--pumpco-yellow-bright); background: rgba(255, 255, 255, .06); }
.topbar .connection-status { white-space: nowrap; font-size: .7rem; }
.search:focus-within { border-color: var(--pumpco-yellow); box-shadow: 0 0 0 3px rgba(220, 180, 38, .16); }
.view { width: min(1440px, 100%); padding: 40px max(24px, calc((100vw - 1360px) / 2)); }
#view-qaqc { width: 100%; padding: 20px 16px; scroll-margin-top: calc(var(--topbar-height) + var(--qaqc-header-height, 140px)); }
.view-heading { gap: 32px; margin-bottom: 28px; }
.view-heading h1 { display: inline-block; font-size: clamp(2.15rem, 4vw, 3.5rem); line-height: 1; }
.view-heading h1::after { display: block; width: 100%; height: 5px; margin-top: 17px; border-radius: 999px; background: var(--pumpco-yellow-bright); content: ""; }
.eyebrow { color: #9b7500; font-size: .74rem; letter-spacing: .1em; }
.view-heading p:not(.eyebrow), .settings-card p { color: var(--pumpco-muted); font-size: 1rem; }
.metrics { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.metrics article, .settings-card, form { border-color: var(--pumpco-border-soft); border-radius: var(--pce-radius); box-shadow: 0 12px 34px rgba(7, 22, 36, .06); }
.metrics article { padding: 22px; }
.metrics strong { color: var(--pumpco-text); font-size: 2rem; }
.metrics span { color: var(--pumpco-muted); }
.dashboard-analysis { border-radius: var(--pce-radius); box-shadow: 0 12px 34px rgba(7, 22, 36, .1); }
.outline-button, .table-action { border-color: #bdcad9; border-radius: 10px; color: var(--pumpco-blue); }
.outline-button:hover, .table-action:hover { border-color: var(--pumpco-blue); color: white; background: var(--pumpco-blue); }
.primary-button { border-radius: 10px; background: var(--pumpco-blue); box-shadow: 0 8px 18px rgba(17, 59, 103, .18); }
.primary-button:hover { background: #0f3157; }
input, select, textarea { border-color: #d8e0ea; border-radius: 10px; font-size: .95rem; }
input:focus, select:focus, textarea:focus { border-color: #9bb6d6; outline: 0; box-shadow: 0 0 0 .2rem rgba(17, 59, 103, .13); }
.data-table-wrap, .curve-wrap, .gantt-wrap, .tilos-wrap { border-color: var(--pumpco-border-soft); border-radius: var(--pce-radius); box-shadow: 0 12px 34px rgba(7, 22, 36, .045); }
.data-table th { padding: 15px 16px; color: var(--pumpco-muted); background: #fbfcfe; font-size: .76rem; }
.data-table td { padding: 15px 16px; border-color: #eef1f5; }
.data-table tbody tr:hover { background: #fffdf4; }
.planning-analysis { gap: 20px; margin: 26px 0; }
.planning-section-heading h2, .planning-analysis h2 { font-size: 1.22rem; }
.planning-section-heading p { color: var(--pumpco-muted); font-size: .9rem; }
.status-badge, .priority-badge { padding: 5px 10px; font-weight: 800; }
.report-dialog { border-radius: var(--pce-radius); box-shadow: 0 24px 60px rgba(7, 22, 36, .3); }
.drawer { width: min(82vw, 330px); background: var(--pumpco-navy-2); }
.brand { height: calc(88px + env(safe-area-inset-top)); border-bottom-width: 5px; }
.drawer-link { border-radius: 10px; }
.bottom-nav { border-color: var(--pumpco-border); box-shadow: 0 -4px 12px rgba(7, 22, 36, .06); }

@media (max-width: 900px) {
  .topbar { min-height: calc(64px + env(safe-area-inset-top)); gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; }
  .app-identity .app-divider, .app-identity .app-product { display: none; }
  .app-identity { gap: 8px; }
  .app-identity img { width: 30px; height: 30px; }
  .app-identity strong { font-size: 1.35rem; }
  .topbar .connection-status, .header-account span { display: none; }
  .header-account { width: 36px; padding: 8px; }
  .topbar .search { flex: 1; }
  .qaqc-top-navigator .qaqc-tab { min-height: 52px; padding: 10px 16px; font-size: .85rem; }
  .view, #view-qaqc { padding: 28px 16px; }
  .view-heading h1 { font-size: clamp(2rem, 9vw, 2.7rem); }
}

/* Trazabilidad QA/QC */
.view[hidden], #view-qaqc [data-qaqc-panel][hidden], .qaqc-workspace-header[hidden] { display: none !important; }
.qaqc-workspace-header { position: sticky; top: var(--topbar-height); z-index: 19; padding: 12px 16px 16px; border-bottom: 1px solid var(--pumpco-border-soft); background: #fbfcfe; scroll-margin-top: var(--topbar-height); }
.qaqc-workspace-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.qaqc-workspace-heading h1 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.8rem); line-height: 1.2; }
.qaqc-module-label { padding: 3px 9px; border: 1px solid var(--pumpco-border); border-radius: 5px; color: #52677f; background: #f6f8fb; font-size: .75rem; font-weight: 700; }
#view-qaqc .planning-analysis, #view-planning .planning-analysis { min-width: 0; margin-top: 16px; padding: 24px; border: 1px solid var(--pumpco-border); border-radius: 12px; background: white; }
#view-qaqc .planning-section-heading, #view-planning .planning-section-heading { align-items: center; gap: 24px; }
#view-qaqc .planning-section-heading .primary-button, #view-planning .planning-section-heading .primary-button { flex-shrink: 0; padding: 10px 20px; }
#view-qaqc .report-filters, #view-planning .report-filters { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px; margin: 0; border-radius: 10px; background: var(--pumpco-bg); box-shadow: none; }
#view-qaqc .report-filters label, #view-planning .report-filters label { flex: 1 1 180px; }
#qaqc-message:empty { display: none; }
.qaqc-summary { padding: 12px 16px; border: 1px solid var(--pumpco-border); border-radius: 10px; background: white; }
.qaqc-summary summary { cursor: pointer; color: var(--pumpco-blue); font-weight: 700; }
.qaqc-summary[open] summary { margin-bottom: 16px; }
.qaqc-load-status { margin: 8px 0; color: var(--pumpco-muted); font-size: .8rem; }
.qaqc-heading-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.qaqc-heading-actions select { width: auto; min-width: 88px; min-height: 34px; padding: 5px 10px; border-radius: 6px; font-size: .85rem; }
.qaqc-heading-actions .outline-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 5px 12px; border: 1px solid #f2c400; border-radius: 6px; color: #061d3a; background: #fffdf3; font-size: .85rem; }
.qaqc-heading-actions .outline-button:hover { background: #fff5c2; }
#view-qaqc button:disabled { cursor: not-allowed; opacity: .55; }
.qaqc-heading-actions label { color: #475569; font-size: .75rem; font-weight: 700; }
.qaqc-metrics { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 6px; }
.qaqc-metrics strong { font-size: 1.4rem; }
.qaqc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.qaqc-tab { min-height: 38px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 999px; color: var(--pumpco-navy); background: white; font-weight: 800; }
.qaqc-tab.active { border-color: var(--pumpco-navy); color: white; background: var(--pumpco-navy); }
.qaqc-actions { white-space: nowrap; }
.qaqc-actions .table-action { margin: 2px 0; }
.qaqc-dialog { width: min(820px, calc(100vw - 28px)); }
.qaqc-form { margin-top: 14px; box-shadow: none; }
.qaqc-form .wide { grid-column: 1 / -1; }
.qaqc-form .primary-button { width: 100%; margin-top: 14px; }
.qaqc-dialog .icon-button { color: var(--pumpco-text); background: var(--pumpco-bg); border-color: var(--pumpco-border); }
.qaqc-form input[type="checkbox"] { width: 20px; min-height: 20px; accent-color: var(--pumpco-blue); }
.qaqc-detail ul { margin: 0; padding-left: 18px; }
.qaqc-detail li { margin: 3px 0; }
#qaqc-pk-result { align-self: center; color: var(--pumpco-navy); }
@media (max-width: 640px) {
  #view-qaqc .planning-analysis { padding: 16px; }
  #view-qaqc .planning-section-heading { align-items: stretch; }
  .qaqc-workspace-header { padding: 12px; }
  .qaqc-module-label { display: none; }
  .qaqc-heading-actions { width: 100%; margin-left: 0; }
  .qaqc-heading-actions .outline-button { margin-left: auto; }
  #view-qaqc { padding: 16px 12px; }
  .qaqc-form .form-grid { grid-template-columns: 1fr; }
}

/* Plan de materiales (Logística) */
.material-kind { min-height: 32px; padding: 0 8px; border-radius: 7px; border: 1px solid #cbd5e1; font-size: .78rem; font-weight: 700; }
.material-kind.kind-physical { background: #ecfdf5; border-color: #6ee7b7; }
.material-kind.kind-service { background: #eff6ff; border-color: #93c5fd; }
.material-kind.kind-indirect { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
.material-plan-detail { margin-top: 14px; }
.material-plan-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.material-plan-detail h3 { margin: 0; font-size: 1rem; }
.material-plan-detail ul { margin: 6px 0 0; padding-left: 18px; }
.material-plan-pick { grid-column: 1 / -1; }
#material-lot-form input[readonly] { background: #f1f5f9; color: #475569; }

/* Sidebar: grupo "Control de proyecto" con submenús */
.drawer-nav { overflow-y: auto; align-content: start; }
.nav-group { display: grid; gap: 2px; margin: 6px 0; padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .1); border-bottom: 1px solid rgba(255, 255, 255, .1); }
.nav-group-toggle { display: flex; align-items: center; justify-content: space-between; padding: 8px 13px; border: 0; color: #94a3b8; background: transparent; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav-group-toggle:hover { color: white; }
.nav-group-items { display: grid; gap: 2px; }
.nav-group-items[hidden] { display: none; }
.nav-chevron { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s ease; }
.nav-group.collapsed > .nav-group-toggle .nav-chevron, .nav-module:not(.open) .nav-expand .nav-chevron { transform: rotate(-45deg); }
.nav-module-row { display: flex; align-items: stretch; gap: 2px; }
.nav-module-row .drawer-link { flex: 1; display: flex; align-items: center; gap: 9px; }
.nav-icon { width: 18px; text-align: center; opacity: .8; }
.nav-expand { display: grid; place-items: center; width: 38px; border: 0; border-radius: 8px; color: #cbd5e1; background: transparent; }
.nav-expand:hover { color: white; background: rgba(255, 255, 255, .08); }
.nav-module.current > .nav-module-row .drawer-link:not(.active) { color: white; background: rgba(255, 255, 255, .06); }
.nav-sub { display: grid; gap: 1px; margin: 2px 0 6px 22px; padding-left: 12px; border-left: 2px solid rgba(255, 255, 255, .14); animation: nav-sub-in .18s ease; }
.nav-sub[hidden] { display: none; }
.nav-sub-label { padding: 8px 10px 2px; color: #64748b; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.drawer-sublink { padding: 8px 10px; border: 0; border-radius: 7px; color: #cbd5e1; background: transparent; text-align: left; font-size: .86rem; font-weight: 600; }
.drawer-sublink:hover { color: white; background: rgba(255, 255, 255, .08); }
.drawer-sublink.active { color: var(--pumpco-navy); background: var(--pumpco-yellow); font-weight: 800; }
@keyframes nav-sub-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Subpáginas de Planificación */
.subpage-off { display: none !important; }
.subpage-tabs { margin-bottom: 16px; }
