/* ===== Explorador de módulos: pestañas + mini-demo por módulo ===== */
.xp { background: var(--navy-900); color: var(--on-dark); position: relative; overflow: hidden; padding: var(--sec-y) 0; }
.xp::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 20%, transparent 100%); -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 20%, transparent 100%); pointer-events: none; }
.xp::after { content: ""; position: absolute; width: 760px; height: 760px; right: -240px; top: -300px; background: radial-gradient(circle, rgba(30,111,217,.22), transparent 62%); pointer-events: none; }
.xp .wrap { position: relative; z-index: 1; }
.xp .eyebrow { color: #6FA6F0; }
.xp-head { max-width: 760px; margin-bottom: 40px; }
.xp-head h2 { color: #fff; font-size: clamp(32px, 4.2vw, 48px); letter-spacing: -0.03em; }
.xp-head p { margin-top: 16px; font-size: 18px; color: var(--on-dark); }

/* Pestañas */
.xp-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.xp-tab { text-align: left; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line-dark); border-radius: 14px; background: rgba(255,255,255,.03); color: var(--on-dark); cursor: pointer; font: inherit; transition: background .2s, border-color .2s, box-shadow .2s, color .2s; }
.xp-tab:hover { background: rgba(255,255,255,.08); }
.xp-tab:focus-visible { outline: 3px solid #6FA6F0; outline-offset: 2px; }
.xp-tab[aria-selected="true"] { background: #fff; color: var(--navy); border-color: #fff; box-shadow: 0 16px 40px -16px rgba(0,0,0,.65); }
.xp-ti { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #fff; transition: background .2s; }
.xp-tab[aria-selected="true"] .xp-ti { background: var(--navy); }
.xp-ti img { width: 28px; height: 28px; border-radius: 6px; }
.xp-tab b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.2; }
.xp-tab small { display: block; font-size: 12.5px; opacity: .72; margin-top: 2px; line-height: 1.3; }

/* Panel */
.xp-panel { position: relative; border: 1px solid var(--line-dark); border-radius: 22px; overflow: hidden; background: rgba(255,255,255,.03); display: grid; grid-template-columns: 5fr 7fr; gap: 44px; padding: 44px; align-items: center; }
.xp-panel[hidden] { display: none; }
.xp-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .22; }
.xp-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,27,38,.94) 0%, rgba(18,27,38,.6) 100%); }
.xp-info, .xp-demo { position: relative; z-index: 1; min-width: 0; }
.xp-info .module-tag { color: var(--on-dark); border-color: var(--line-dark); }
.xp-info h3 { color: #fff; font-size: clamp(26px, 2.9vw, 34px); letter-spacing: -0.02em; line-height: 1.14; margin: 16px 0 12px; }
.xp-desc { color: var(--on-dark); font-size: 16.5px; }
.xp-list { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 11px; }
.xp-list li { display: flex; gap: 11px; font-size: 15.5px; color: #E6EDF6; line-height: 1.45; }
.xp-list svg { flex: none; margin-top: 3px; color: #6FA6F0; }
.xp-for { font-size: 13px; color: var(--on-dark-muted); margin-bottom: 24px; }
.xp-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.xp-link { font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,.4); padding-bottom: 2px; }
.xp-link:hover { border-bottom-color: #fff; }

/* Nota de contratación */
.xp-note { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 22px 28px; border: 1px solid var(--line-dark); border-radius: 16px; background: rgba(255,255,255,.04); }
.xp-note strong { display: block; color: #fff; font-size: 17px; margin-bottom: 2px; }
.xp-note div { color: var(--on-dark); font-size: 15.5px; max-width: 760px; }
.xp-rel { margin-top: 16px; font-size: 14px; color: var(--on-dark-muted); max-width: 900px; }

/* ----- Demo ----- */
.xd { background: #fff; color: var(--text); border-radius: 18px; box-shadow: 0 30px 60px -24px rgba(0,0,0,.65); overflow: hidden; display: flex; flex-direction: column; min-height: 500px; font-size: 14px; line-height: 1.45; }
.xd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #F7F9FC; }
.xd-dots { display: flex; gap: 6px; }
.xd-dots button { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #C8D1DC; background: #fff; color: var(--muted); font: 600 12.5px var(--mono); cursor: pointer; padding: 0; transition: background .2s, border-color .2s, color .2s; }
.xd-dots button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.xd-dots button.done { background: #E8F6EE; border-color: #15803D; color: #15803D; }
.xd-dots button:focus-visible { outline: 3px solid #6FA6F0; outline-offset: 2px; }
.xd-cap { font-size: 13.5px; font-weight: 600; color: var(--navy); text-align: right; }
.xd-stage { padding: 18px; flex: 1; position: relative; }
.xd-view { animation: xdIn .35s ease; }
.xd-view[hidden] { display: none; }
@keyframes xdIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.xd-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); background: #fff; }
.xd-hint { font-size: 12.5px; color: var(--muted); }
.xd-btn { font: 600 15px var(--sans); padding: 11px 20px; border-radius: 10px; border: 0; background: var(--red); color: #fff; cursor: pointer; transition: background .2s, transform .2s; white-space: nowrap; }
.xd-btn:hover { background: var(--red-600); transform: translateY(-1px); }
.xd-btn:focus-visible { outline: 3px solid #6FA6F0; outline-offset: 2px; }
.xd:not(.used) .xd-btn { animation: xdPulse 2.2s ease-in-out infinite; }
@keyframes xdPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(227,6,19,.45); } 50% { box-shadow: 0 0 0 8px rgba(227,6,19,0); } }

.xd-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; color: var(--navy); font-size: 15px; margin-bottom: 12px; }
.xd-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.xd-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #EEF2F7; color: #475467; white-space: nowrap; }
.xd-chip.ok { background: #E8F6EE; color: #15803D; }
.xd-chip.warn { background: #FFF1D6; color: #8A5A00; }
.xd-chip.info { background: #E2ECFC; color: #1E5BB8; }
.xd-chip.bad { background: #FDECEC; color: #B42318; }
.xd-rows { display: grid; gap: 8px; }
.xd-row { display: grid; grid-template-columns: 122px 1fr 20px; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; background: #fff; }
.xd-row > span:first-child { color: var(--muted); }
.xd-row .full { display: none; color: var(--navy); font-weight: 500; }
.xd-row .empty { color: #98A2B3; }
.xd-row .tick { color: #15803D; opacity: 0; transform: scale(.5); transition: opacity .3s, transform .3s; }
.xd[data-step="2"] .xd-row .full { display: block; }
.xd[data-step="2"] .xd-row .empty { display: none; }
.xd[data-step="2"] .xd-row .tick { opacity: 1; transform: none; }
.xd[data-step="2"] .xd-row { animation: xdIn .4s ease backwards; }
.xd[data-step="2"] .xd-row:nth-child(2) { animation-delay: .08s; }
.xd[data-step="2"] .xd-row:nth-child(3) { animation-delay: .16s; }
.xd[data-step="2"] .xd-row:nth-child(4) { animation-delay: .24s; }
.xd[data-step="2"] .xd-row:nth-child(5) { animation-delay: .32s; }
.xd[data-step="2"] .xd-row:nth-child(6) { animation-delay: .4s; }
.xd-thumbs i { width: 34px; height: 24px; border-radius: 5px; background: linear-gradient(135deg, #B9C4D2, #8D9DB0); display: inline-block; margin-right: 6px; vertical-align: middle; }
#px-saldo-desp.neg { color: #B42318; }
.xd-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #F4F6FB; color: var(--text); font-size: 13px; }
.xd-note.warn { background: #FDECEC; color: #B42318; }
.xd-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.xd-line span { color: var(--muted); }
.xd-line em { font-style: normal; color: var(--navy); font-weight: 500; text-align: right; }
.xd-line:last-child { border-bottom: 0; }
.xd-report { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.xd-report h4 { font-size: 15px; color: var(--navy); margin-bottom: 4px; }
.xd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* Control Presupuestario */
.xd-slider { display: block; margin: 14px 0 6px; font-size: 13.5px; color: var(--muted); }
.xd-slider b { float: right; color: var(--navy); font-size: 16px; }
.xd-slider input[type=range] { width: 100%; padding: 0; border: 0; box-shadow: none; background: none; accent-color: var(--red); margin-top: 8px; }
.xd-bar { margin: 12px 0; }
.xd-bar-top { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text); margin-bottom: 5px; }
.xd-bar-top b { color: var(--navy); }
.xd-track { height: 10px; border-radius: 6px; background: #E9EEF5; position: relative; overflow: hidden; }
.xd-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: #1E6FD9; transition: width .8s ease; }
.xd-fill.red { background: #C70511; }
.xd-fill.pay { background: #C70511; }
.xd-ghost { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(30,111,217,.5) 0 6px, rgba(30,111,217,.2) 6px 12px); transition: width .15s, left .15s; }
.xd-big { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.xd-big span { color: var(--muted); font-size: 13.5px; }
.xd-big b { font-size: 24px; color: var(--navy); letter-spacing: -0.01em; }
.xd-big b.neg { color: #B42318; }

/* Coordinación */
.xd-people { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.xd-check { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; background: #fff; transition: border-color .2s, background .2s; }
.xd-check + .xd-check { margin-top: 8px; }
.xd-check input { width: 18px; height: 18px; padding: 0; margin: 0; accent-color: #15803D; cursor: default; box-shadow: none; }
.xd-check em { font-style: normal; color: var(--muted); font-size: 12.5px; text-align: right; }
.xd-check small { display: block; color: var(--muted); font-size: 12px; }
.xd-check:has(input:checked) { border-color: #15803D; background: #F2FBF6; }
.xd-check:has(input:checked) span { text-decoration: line-through; color: #6B7785; }
.xd[data-step="2"] .xd-check:has(input:not(:disabled)) { border-color: #1E6FD9; cursor: pointer; }
.xd[data-step="2"] .xd-check input { cursor: pointer; }
.xd-carry { display: inline-block; font-size: 12px; font-weight: 600; color: #1E5BB8; background: #E2ECFC; padding: 1px 8px; border-radius: 999px; }

/* BK Tareas (teléfono) */
.xd-phonewrap { display: grid; place-items: center; padding: 6px 0; }
.xd-phone { width: 250px; border: 8px solid #121B26; border-radius: 32px; background: #F4F6FB; overflow: hidden; box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.xd-phone-bar { background: #152B47; color: #fff; font: 600 12px var(--mono); padding: 11px 14px; letter-spacing: .02em; }
.xd-phone-body { padding: 12px; min-height: 270px; }
.xd-photo { height: 104px; border-radius: 10px; overflow: hidden; margin-bottom: 10px; position: relative; background: #8D9DB0; }
.xd-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; display: block; }
.xd-photo span { position: absolute; left: 8px; bottom: 8px; background: rgba(18,27,38,.78); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.xd-field { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid #E4E9F0; font-size: 12.5px; }
.xd-field span { color: var(--muted); }
.xd-field b { color: var(--navy); font-weight: 600; text-align: right; }
.xd-task { background: #fff; border: 1px solid #E1E5EE; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.xd-task h5 { font-size: 13.5px; color: var(--navy); margin-bottom: 2px; }
.xd-task small { color: var(--muted); font-size: 12px; display: block; margin-bottom: 8px; }
.xd-mini { display: flex; gap: 8px; margin-top: 10px; }
.xd-mini i { flex: 1; text-align: center; font-style: normal; font-size: 12px; font-weight: 600; padding: 7px; border-radius: 8px; border: 1px solid #C8D1DC; color: var(--navy); background: #fff; }
.xd-mini i.main { background: var(--navy); color: #fff; border-color: var(--navy); }
.xd-okbig { display: grid; place-items: center; text-align: center; gap: 8px; padding: 18px 6px; }
.xd-okbig .ic-ok { width: 46px; height: 46px; border-radius: 50%; background: #E8F6EE; color: #15803D; display: grid; place-items: center; }
.xd-who { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); }

/* Responsive */
@media (max-width: 1080px) { .xp-panel { grid-template-columns: 1fr; padding: 32px; gap: 32px; } }
@media (max-width: 900px) { .xp-tabs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .xp-tab { grid-template-columns: 38px 1fr; padding: 12px; }
  .xp-ti { width: 38px; height: 38px; }
  .xp-tab small { display: none; }
  .xp-panel { padding: 22px; border-radius: 18px; }
  .xd-row { grid-template-columns: 96px 1fr 16px; }
  .xd-top { flex-direction: column; align-items: flex-start; }
  .xd-cap { text-align: left; }
  .xd-foot { flex-direction: column; align-items: stretch; }
  .xd-hint { text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .xd-view, .xd[data-step="2"] .xd-row { animation: none; } .xd:not(.used) .xd-btn { animation: none; } .xd-fill, .xd-ghost, .xd-row .tick { transition: none; } }

.xd-check-next { grid-template-columns: 1fr auto; }
.xd-check-next .xd-carry { margin-bottom: 4px; }

.xp-tab { min-width: 0; }
.xp-tab b { overflow-wrap: anywhere; }
@media (max-width: 640px) { .xp-tab b { font-size: 14px; } }

/* Control de Obras: pantalla de registro del día */
.xh-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.xh-info { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #E1E5EE; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.xh-info b { display: block; font-size: 14px; color: #101828; line-height: 1.2; }
.xh-info small { font-size: 12px; color: #98A2B3; }
.xh-info .xh-ic { margin: 0; --c: #1E6FD9; --ct: #E2ECFC; }
.xh-tile { --c: #1E6FD9; --ct: #E2ECFC; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 34px 8px 12px; border-radius: 12px; background: #fff; border: 1px solid #E1E5EE; border-top: 3px solid var(--c); box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.xh-tile.amber { --c: #B45309; --ct: #FDEBC8; }
.xh-tile.green { --c: #15803D; --ct: #DDF3E6; }
.xh-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--ct); color: var(--c); display: grid; place-items: center; margin-bottom: 4px; flex: none; }
.xh-tile b { font-size: 13.5px; color: #101828; line-height: 1.2; }
.xh-tile small { font-size: 11px; color: #98A2B3; line-height: 1.3; }
.xh-b { position: absolute; top: 8px; left: 8px; font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.xh-b0 { background: #EEF2F7; color: #98A2B3; font-weight: 600; }
.xh-b1 { display: none; background: #DDF3E6; color: #15803D; font-weight: 700; }
@keyframes xhPop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.xh-go { position: absolute; top: 6px; right: 9px; color: #98A2B3; font-size: 16px; line-height: 1; }
@media (max-width: 640px) { .xh-grid { grid-template-columns: repeat(2, 1fr); } }
.xh-tile { padding-bottom: 16px; }

/* Control de Obras en dos pasos: el día ya registrado + los reportes que salen de él */
.xh-tile.has .xh-b0 { display: none; }
.xh-tile.has .xh-b1 { display: inline-block; animation: xhPop .45s ease backwards; }
.xh-tile:nth-child(2) .xh-b1 { animation-delay: .05s; }
.xh-tile:nth-child(3) .xh-b1 { animation-delay: .12s; }
.xh-tile:nth-child(4) .xh-b1 { animation-delay: .19s; }
.xh-tile:nth-child(5) .xh-b1 { animation-delay: .26s; }
.xh-tile:nth-child(6) .xh-b1 { animation-delay: .33s; }
.xh-tile:nth-child(7) .xh-b1 { animation-delay: .4s; }
.xh-tile:nth-child(8) .xh-b1 { animation-delay: .47s; }
.xr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.xr-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid #E1E5EE; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.05); animation: xdIn .45s ease backwards; }
.xr-card:nth-child(2) { animation-delay: .1s; }
.xr-card:nth-child(3) { animation-delay: .2s; }
.xr-card:nth-child(4) { animation-delay: .3s; }
.xr-card b { font-size: 13px; color: #101828; line-height: 1.25; }
.xr-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: #15803D; }
.xr-ok svg { width: 13px; height: 13px; }
.xr-thumb { aspect-ratio: 3 / 4; border-radius: 8px; background: #F4F6FB; border: 1px solid #E4E9F0; padding: 9px 8px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.xr-thumb .h { height: 7px; width: 55%; border-radius: 3px; background: #1E3A5F; }
.xr-thumb i { display: block; height: 4px; border-radius: 2px; background: #D5DCE6; }
.xr-thumb i.s { width: 60%; }
.xr-thumb .bars { display: flex; align-items: flex-end; gap: 5px; height: 38px; margin: 2px 0; }
.xr-thumb .bars u { flex: 1; background: #8FB4EE; border-radius: 2px 2px 0 0; text-decoration: none; }
.xr-thumb .bars u:nth-child(1) { height: 45%; } .xr-thumb .bars u:nth-child(2) { height: 80%; background: #1E6FD9; } .xr-thumb .bars u:nth-child(3) { height: 60%; } .xr-thumb .bars u:nth-child(4) { height: 95%; background: #1E6FD9; }
.xr-thumb .box { height: 30px; border: 1px dashed #B9C4D2; border-radius: 4px; }
.xr-card.more { justify-content: center; align-items: center; text-align: center; border-style: dashed; background: transparent; box-shadow: none; color: var(--muted); }
.xr-more { width: 40px; height: 40px; border-radius: 50%; border: 1.5px dashed #B9C4D2; display: grid; place-items: center; font-size: 22px; color: #98A2B3; }
@media (max-width: 640px) { .xr-grid { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .xh-tile.has .xh-b1, .xr-card { animation: none; } }

/* Control de Obras: tablero de gerencia (paso 3) */
.xdb { display: grid; gap: 10px; }
.xdb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.xdb-head b { display: block; font-size: 17px; color: #101828; line-height: 1.2; }
.xdb-head small { font-size: 12px; color: #667085; }
.xdb-proj { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #344054; border: 1px solid #D0D5DD; border-radius: 8px; padding: 5px 10px; white-space: nowrap; }
.xdb-proj i, .xdb-rem i, .xdb-ch i { display: inline-grid; place-items: center; font-style: normal; }
.xdb-proj svg, .xdb-rem svg, .xdb-ch svg { width: 15px; height: 15px; }
.xdb-rem { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #344054; }
.xdb-kpis { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid #E1E5EE; border-radius: 12px; background: #fff; overflow: hidden; }
.xdb-k { padding: 10px 10px 9px; border-right: 1px solid #E1E5EE; min-width: 0; }
.xdb-k:last-child { border-right: 0; }
.xdb-kl { display: flex; justify-content: space-between; align-items: center; font: 600 9.5px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: #667085; gap: 4px; }
.xdb-kl i { display: inline-grid; place-items: center; font-style: normal; color: #98A2B3; flex: none; }
.xdb-kl svg { width: 13px; height: 13px; }
.xdb-k b { display: block; font-size: 24px; line-height: 1.15; color: #101828; margin-top: 4px; letter-spacing: -0.01em; }
.xdb-k b.ok { color: #101828; }
.xdb-k b.warn { color: #B45309; }
.xdb-k small { font-size: 10.5px; color: #98A2B3; display: block; }
.xdb-k:first-child small { color: #15803D; }
.xdb-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 10px; }
.xdb-card { border: 1px solid #E1E5EE; border-radius: 12px; background: #fff; padding: 12px; }
.xdb-ch { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 600; color: #101828; margin-bottom: 8px; }
.xdb-ch span { display: inline-flex; align-items: center; gap: 6px; }
.xdb-ch em { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .05em; color: #1E5BB8; background: #E2ECFC; border-radius: 999px; padding: 2px 8px; }
.xdb-name { font-size: 17px; color: #101828; display: block; margin-bottom: 8px; }
.xdb-stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #E4E9F0; border-radius: 8px; background: #F9FAFB; }
.xdb-stats div { padding: 7px 9px; border-right: 1px solid #E4E9F0; }
.xdb-stats div:last-child { border-right: 0; }
.xdb-stats small { display: block; font: 600 9px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: #667085; }
.xdb-stats b { font-size: 16px; color: #101828; }
.xdb-li { display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: center; padding: 7px 0; border-top: 1px solid #EEF1F5; }
.xdb-li:first-of-type { border-top: 0; }
.xdb-li i { width: 30px; height: 30px; border-radius: 8px; background: #F2F4F7; color: #667085; display: grid; place-items: center; font-style: normal; }
.xdb-li i.am { background: #FEF0C7; color: #B45309; }
.xdb-li svg { width: 15px; height: 15px; }
.xdb-li b { display: block; font-size: 12.5px; color: #101828; line-height: 1.2; }
.xdb-li small { font-size: 10.5px; color: #98A2B3; }
.xdb-li em { font-style: normal; font-weight: 700; font-size: 15px; color: #101828; }
.xdb-li em.am { color: #B45309; }
@media (max-width: 900px) { .xdb-cols { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .xdb-kpis { grid-template-columns: repeat(2, 1fr); } .xdb-k { border-bottom: 1px solid #E1E5EE; } }

/* Reportes: cinco categorías */
.xr-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
.xr-card { padding: 8px; }
.xr-card b { font-size: 12px; }
.xr-thumb .rows { display: grid; gap: 4px; margin: 2px 0; }
.xr-thumb .rows u { display: block; height: 7px; border-radius: 2px; background: #D5DCE6; text-decoration: none; position: relative; }
.xr-thumb .rows u::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 28%; background: #8FB4EE; border-radius: 2px; }
@media (max-width: 900px) { .xr-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .xr-grid { grid-template-columns: repeat(2, 1fr); } }

/* Control Presupuestario: panel del proyecto */
.xs-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.xs-top small { display: block; font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #667085; }
.xs-top b { font-size: 26px; line-height: 1.1; color: #101828; letter-spacing: -0.015em; }
.xs-top .dec, .xs-top .dec { color: #98A2B3; font-weight: 500; }
.xs-r { text-align: right; }
.xs-r small em { font-style: normal; color: #15803D; }
.xs-bar { display: flex; height: 12px; border-radius: 7px; background: #E4E9F0; overflow: hidden; gap: 2px; margin-bottom: 12px; }
.xs-bar i { display: block; height: 100%; transition: width .8s ease; }
.xs-bar .g { background: #15803D; } .xs-bar .a { background: #B45309; } .xs-bar .b { background: #1E6FD9; } .xs-bar .c { background: #1E3A8A; }
.xs-bar .free { flex: 1; background: #E4E9F0; }
.xs-cards { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #E1E5EE; border-radius: 12px; overflow: hidden; background: #fff; }
.xs-c { padding: 10px 11px 11px; border-top: 3px solid var(--k); border-right: 1px solid #E1E5EE; min-width: 0; }
.xs-c:last-child { border-right: 0; }
.xs-c.g { --k: #15803D; } .xs-c.a { --k: #B45309; } .xs-c.b { --k: #1E6FD9; } .xs-c.c { --k: #1E3A8A; }
.xs-c small { display: block; font-size: 11px; color: #667085; line-height: 1.25; min-height: 28px; }
.xs-c b { font-size: 17px; color: #101828; letter-spacing: -0.01em; }
.xs-reg { display: none; margin-top: 12px; }
.xd[data-step="3"] .xs-reg { display: block; animation: xdIn .4s ease; }
.xd-fill.free { background: #15803D; }
@media (max-width: 640px) { .xs-cards { grid-template-columns: repeat(2, 1fr); } .xs-c { border-bottom: 1px solid #E1E5EE; } .xs-top b { font-size: 21px; } }

/* Control Presupuestario: rubros, planilla y saldos */
.xd-title .t3 { display: none; }
.xd[data-step="3"] .xd-title .t1 { display: none; }
.xd[data-step="3"] .xd-title .t3 { display: inline; }
.xb-ok { display: none; align-items: center; gap: 8px; margin-bottom: 10px; padding: 9px 12px; border-radius: 10px; background: #E8F6EE; color: #15803D; font-size: 13px; font-weight: 600; }
.xd[data-step="3"] .xb-ok { display: flex; animation: xdIn .4s ease; }
.xb-head, .xb-row { display: grid; grid-template-columns: 1.35fr 1.5fr .8fr .8fr; gap: 12px; align-items: center; }
.xb-head { font: 600 9.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: #667085; padding: 0 4px 6px; border-bottom: 1px solid var(--line); }
.xb-head span:nth-child(3), .xb-head span:nth-child(4) { text-align: right; }
.xb-row { padding: 11px 4px; border-bottom: 1px solid #EEF1F5; }
.xb-n b { display: block; font-size: 13.5px; color: #101828; line-height: 1.25; }
.xb-n small { font-size: 11px; color: #98A2B3; }
.xb-bar { display: flex; height: 10px; border-radius: 6px; background: #E9EEF5; overflow: hidden; }
.xb-bar i { display: block; height: 100%; }
.xb-bar .p { background: #1E6FD9; }
.xb-bar .n { background: #15803D; width: 0; transition: width .9s ease .15s; }
.xd[data-step="3"] .xb-bar .n { width: var(--w); }
.xb-v, .xb-s { text-align: right; font-size: 13.5px; color: #475467; }
.xb-s { font-weight: 700; color: #101828; }
.xb-s .s3 { display: none; color: #15803D; }
.xd[data-step="3"] .xb-s .s1 { display: none; }
.xd[data-step="3"] .xb-s .s3 { display: inline; animation: xhPop .5s ease backwards; }
.xb-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 11.5px; color: #667085; }
.xb-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.xb-legend .p { background: #1E6FD9; } .xb-legend .n { background: #15803D; } .xb-legend .f { background: #E9EEF5; border: 1px solid #D0D5DD; }
.xb-legend .lg-n { display: none; }
.xd[data-step="3"] .xb-legend .lg-n { display: inline; }
.xb-who { margin: 14px 0 4px; font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #667085; }
.xb-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; margin-top: 8px; border-radius: 10px; background: #F4F6FB; }
.xb-total span { color: #475467; font-size: 13.5px; }
.xb-total b { font-size: 20px; color: #101828; }
@media (max-width: 640px) { .xb-head, .xb-row { grid-template-columns: 1.4fr 1fr .9fr; } .xb-head span:nth-child(2), .xb-bar { display: none; } .xb-head span:nth-child(3), .xb-v { display: none; } }
@media (prefers-reduced-motion: reduce) { .xb-bar .n, .xd[data-step="3"] .xb-s .s3 { transition: none; animation: none; } }

/* Registro con rubro: fichas + lista de lo registrado (paso 1 y Funciones de Control de Obras) */
.rbx { display: grid; gap: 12px; }
.rbx .xh-tile[data-k] { cursor: pointer; }
.rbx .xh-tile[data-k]:focus-visible { outline: 3px solid #6FA6F0; outline-offset: 2px; }
.rbx .xh-tile.sel { outline: 2px solid #1E6FD9; outline-offset: -2px; box-shadow: 0 8px 20px -10px rgba(30,111,217,.55); }
.rbx-panel { border: 1px solid #E1E5EE; border-radius: 12px; overflow: hidden; background: #fff; }
.rbx-ph { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #F7F9FC; border-bottom: 1px solid #E1E5EE; font-weight: 600; font-size: 14px; }
.rbx-ph em { font-style: normal; font-size: 12px; color: #15803D; background: #DDF3E6; border-radius: 999px; padding: 3px 10px; font-weight: 700; }
.rbx-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rbx-t th { text-align: left; font-weight: 600; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: #667085; padding: 8px 14px; border-bottom: 1px solid #E1E5EE; }
.rbx-t td { padding: 9px 14px; border-bottom: 1px solid #EEF1F6; vertical-align: top; line-height: 1.3; }
.rbx-t tr:last-child td { border-bottom: 0; }
.rbx-t td:first-child { font-weight: 600; white-space: nowrap; }
.rbx-r { display: inline-block; color: #1E4FA8; background: #E8F0FD; border-radius: 6px; padding: 1px 6px; font-size: 11.5px; font-weight: 600; }
.rbx-mas { padding: 8px 14px; font-size: 12px; color: #667085; border-top: 1px solid #EEF1F6; }
.rbx-mas:empty { display: none; }
@media (max-width: 640px) { .rbx-t th:nth-child(3), .rbx-t td:nth-child(3) { display: none; } .rbx-t td:first-child { white-space: normal; } }

.rbx-fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 12px 14px 4px; }
.rbx-fotos[hidden], .rbx-t[hidden] { display: none; }
.rbx-fotos figure { margin: 0; border: 1px solid #E1E5EE; border-radius: 10px; overflow: hidden; background: #fff; }
.rbx-ph-img { aspect-ratio: 4/3; background-size: cover; position: relative; }
.rbx-ph-img span { position: absolute; right: 0; bottom: 0; left: 0; padding: 18px 8px 5px; font-size: 10.5px; color: #fff; text-align: right; background: linear-gradient(transparent, rgba(10,18,30,.7)); }
.rbx-fotos figcaption { padding: 7px 8px; font-size: 11.5px; color: #344054; text-align: center; line-height: 1.3; }
@media (max-width: 640px) { .rbx-fotos { grid-template-columns: 1fr; } }
.rbx-t[data-tipo="incidencias"] td:first-child { white-space: normal; color: #667085; font-weight: 500; width: 28px; }
.rbx-t[data-tipo="incidencias"] td:nth-child(2) { white-space: nowrap; }
@media (max-width: 640px) {
  .rbx-t[data-tipo="incidencias"] th:nth-child(3), .rbx-t[data-tipo="incidencias"] td:nth-child(3) { display: table-cell; }
  .rbx-t[data-tipo="incidencias"] th:nth-child(1), .rbx-t[data-tipo="incidencias"] td:nth-child(1), .rbx-t[data-tipo="incidencias"] th:nth-child(5), .rbx-t[data-tipo="incidencias"] td:nth-child(5) { display: none; }
}

/* Demostración de Control Presupuestario */
.xd[data-demo="presupuesto"] { min-height: 548px; }
.dp-k { border: 1px solid #E1E5EE; border-left: 3px solid #152B47; border-radius: 10px; padding: 9px 14px; margin-bottom: 10px; } .dp-k small { display: block; color: #667085; font-size: 12px; } .dp-k b { font-size: 21px; color: #101828; }
.dp-th, .dp-tr { display: grid; grid-template-columns: .8fr 1.7fr .9fr 1fr 1.1fr; gap: 8px; padding: 9px 12px; font-size: 12.5px; align-items: center; }
.dp-th { background: #F7F9FC; font-family: var(--mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: #667085; border-bottom: 1px solid #E1E5EE; }
.dp-th span:nth-child(n+3), .dp-tr span:nth-child(n+3) { text-align: right; } .dp-tr { border-bottom: 1px solid #EEF1F6; } .dp-tr:last-child { border-bottom: 0; }
.dp-c { background: #EAF0F8; font-weight: 700; color: #101828; } .dp-r span:first-child { color: #475467; }
@media (max-width: 640px) { .dp-th, .dp-tr { grid-template-columns: .8fr 1.6fr 1fr; } .dp-th span:nth-child(3), .dp-tr span:nth-child(3), .dp-th span:nth-child(4), .dp-tr span:nth-child(4) { display: none; } }

.xd[data-demo="bk"] { min-height: 545px; }

/* Pestañas de módulos en móvil: los nombres no se parten a media palabra */
@media (max-width: 640px) { .xp-tab { gap: 8px; padding: 10px; } .xp-tab b { font-size: 13px; overflow-wrap: normal; hyphens: none; } }

/* Con tres módulos, la pestaña que queda sola ocupa todo el ancho en pantallas chicas */
@media (max-width: 900px) { .xp-tab:last-child:nth-child(odd) { grid-column: 1 / -1; } }
