/* ===== Identidad visual ===== */
:root {
  --ink: #252522; --paper: #FAF9F6; --sand: #E9E2D6; --stone: #66655F; --gold-text: #7E5F0B; --gold: #C29211; --gold-dark: #9E770E;
  --ok: #5E7D62; --warn: #B7863B; --danger: #A4483E; --line: #E4DED3; --radius: 14px;
  --bs-body-font-family: "Inter", system-ui, sans-serif; --bs-body-color: var(--ink); --bs-body-bg: var(--paper);
}
body { background: var(--paper); color: var(--ink); font-family: "Inter", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, .serif { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; letter-spacing: -.01em; }
a { color: var(--ink); }
.text-stone { color: var(--stone) !important; }
.text-gold { color: var(--gold) !important; }
.text-gold:not(svg):not(.spinner-border) { color: var(--gold-text) !important; }  /* texto dorado legible sobre fondo claro */
.bg-sand { background: var(--sand) !important; }
svg.lucide { width: 1.15em; height: 1.15em; vertical-align: -.2em; stroke-width: 1.75; }

/* Botones */
.btn { border-radius: 999px; padding: .7rem 1.25rem; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 48px; }
.btn-sm { min-height: 38px; padding: .4rem .9rem; }
.btn-gold { background: var(--gold); color: var(--ink); border: 0; }
.btn-gold:hover, .btn-gold:focus { background: var(--gold-dark); color: #fff; }
.btn-ink { background: var(--ink); color: var(--paper); border: 0; }
.btn-ink:hover { background: #000; color: #fff; }
.btn-line { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn-line:hover { border-color: var(--gold); background: #fff; }
.btn-wa { background: #15803D; color: #fff; border: 0; }
.btn-wa:hover { background: #1ebe5a; color: #fff; }
.btn-danger-soft { color: var(--danger); border: 1px solid #ecd1cd; background: #fff; }

/* Tarjetas y formularios */
.card-soft { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(37,37,34,.04); }
.form-control, .form-select { border-radius: 12px; border-color: var(--line); min-height: 48px; padding: .6rem .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(194,146,17,.2); }
.form-label { font-size: .875rem; font-weight: 500; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }
.errorlist { color: var(--danger); font-size: .82rem; list-style: none; padding: 0; margin: .25rem 0 0; }

/* Estados */
.badge-estado { border-radius: 999px; padding: .3rem .7rem; font-weight: 500; font-size: .75rem; background: var(--sand); color: var(--ink); }
.est-aprobada, .est-finalizado, .est-entregado { background: #e3ece4; color: var(--ok); }
.est-rechazada, .est-cancelado, .est-vencida { background: #f3e1de; color: var(--danger); }
.est-enviada, .est-negociacion, .est-ejecucion, .est-programado { background: #f4ebdc; color: #6E5418; }

/* ===== Sitio público ===== */
.nav-public { position: absolute; inset: 0 0 auto 0; z-index: 10; padding: 1.1rem 0; }
.nav-public a { color: #fff; text-decoration: none; }
.hero { min-height: 92vh; background: #2d2c28 center/cover no-repeat; position: relative; color: #fff; display: flex; align-items: flex-end; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,20,18,.35), rgba(20,20,18,.75)); }
.hero > * { position: relative; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: 1.02; }
.hero-placeholder { background-image: linear-gradient(135deg, #3b3934 0%, #252522 60%, #57503f 100%); }
.section { padding: 5rem 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; color: var(--gold-text); font-weight: 600; }
.hero .eyebrow, footer .eyebrow { color: var(--gold); }  /* sobre fondo oscuro el dorado sí contrasta */
.servicio-card { overflow: hidden; height: 100%; }
.servicio-card .ph { aspect-ratio: 4/3; background: var(--sand) center/cover; display: flex; align-items: center; justify-content: center; color: var(--stone); }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: .45rem 1rem; text-decoration: none; font-size: .9rem; white-space: nowrap; background: #fff; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.ba { position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius); background: var(--sand); user-select: none; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba .after { clip-path: inset(0 0 0 50%); }
.ba input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba .bar { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; pointer-events: none; }
.ba .bar::after { content: "⇆"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #fff; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: .9rem; }
.ba .tag { position: absolute; bottom: .6rem; background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; padding: .2rem .55rem; border-radius: 999px; pointer-events: none; }
.wa-float { position: fixed; right: 16px; bottom: 16px; z-index: 50; height: 60px; min-width: 60px; padding: 0 15px; border-radius: 30px; background: #15803D; color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); text-decoration: none; font-weight: 600; animation: wa-pulso 2.5s ease-in-out 3; }
.wa-float:hover { background: #116B33; color: #fff; }
.wa-float svg { width: 30px; height: 30px; flex: none; }
.wa-float .wa-txt { display: none; }
@media (min-width: 768px) { .wa-float { padding: 0 20px 0 16px; } .wa-float .wa-txt { display: inline; } }
@keyframes wa-pulso { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.btn-wa:hover { background: #116B33; color: #fff; }
.hp { position: absolute; left: -9999px; }
footer.public { background: var(--ink); color: #cfccc4; padding-bottom: 96px !important; }
footer.public a { color: #fff; }

/* ===== Panel ===== */
.panel-top { position: sticky; top: 0; z-index: 30; background: rgba(250,249,246,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.panel-main { padding-bottom: 96px; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--ink); display: flex; justify-content: space-around; padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom)); }
.tabbar a { color: #a9a69d; text-decoration: none; font-size: .64rem; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .35rem .2rem; min-width: 0; flex: 1; position: relative; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--gold); }
.tabbar .dot { position: absolute; top: 2px; right: 12px; background: var(--danger); color: #fff; font-size: .6rem; border-radius: 999px; padding: 0 5px; }
@media (min-width: 992px) {
  .tabbar { top: 0; right: auto; width: 96px; flex-direction: column; justify-content: flex-start; padding-top: 5rem; gap: .5rem; }
  .panel-top, .panel-main { margin-left: 96px; }
  .panel-main { padding-bottom: 2rem; }
}
.kpi { padding: 1rem 1.1rem; height: 100%; }
.kpi .v { font-size: clamp(1.05rem, 4.6vw, 1.45rem); font-weight: 600; line-height: 1.2; white-space: nowrap; }
.kpi .l { font-size: .78rem; color: var(--stone); }
.list-card { display: block; text-decoration: none; color: inherit; padding: .9rem 1rem; }
.list-card + .list-card { border-top: 1px solid var(--line); }
.list-card:active { background: var(--paper); }
.tabs-scroll { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.tabs-scroll a { white-space: nowrap; }
.progress { height: 8px; background: var(--sand); border-radius: 999px; }
.progress-bar { background: var(--gold); }
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.foto-grid figure { margin: 0; position: relative; }
.foto-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.foto-grid form { position: absolute; top: 6px; right: 6px; }
.foto-grid figcaption { font-size: .72rem; color: var(--stone); padding-top: .2rem; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.seg input { display: none; }
.seg label { border: 1px solid var(--line); border-radius: 12px; padding: .7rem; text-align: center; background: #fff; cursor: pointer; font-weight: 500; }
.seg input:checked + label { background: var(--ink); color: #fff; border-color: var(--ink); }
.item-row { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; background: #fff; }
.total-bar { position: sticky; bottom: 76px; z-index: 20; }
@media (min-width: 992px) { .total-bar { bottom: 12px; } }
.offline { display: none; background: var(--warn); color: #fff; text-align: center; font-size: .85rem; padding: .35rem; }
body.is-offline .offline { display: block; }
.toast-zone { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60; width: min(94vw, 480px); }
.loading-overlay { position: fixed; inset: 0; background: rgba(250,249,246,.7); z-index: 80; display: none; place-items: center; }
body.loading .loading-overlay { display: grid; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--stone); }
.empty svg { width: 40px; height: 40px; margin-bottom: .5rem; color: var(--gold); }

/* Bitácora */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-dia { position: relative; font-weight: 600; font-size: .85rem; margin: 1rem 0 .5rem; color: var(--ink); }
.tl-dia::before { content: ""; position: absolute; left: -18px; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--paper); }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .btn { display: none; }
.form-range::-webkit-slider-thumb { background: var(--gold); }
.form-range::-moz-range-thumb { background: var(--gold); }
.form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 .2rem rgba(194,146,17,.3); }

/* Guía */
.guia-btn { background: #fff; border: 0; color: var(--ink); }
.guia-num { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 600; }
.guia-btn.collapsed .guia-num { background: var(--sand); color: var(--ink); }
.guia-btn:not(.collapsed) svg { transform: rotate(180deg); }
@media (min-width: 992px) { .tabbar a { flex: 0 0 auto; } }
.seg-card .ok { color: var(--ok); } .seg-card .alerta { color: #85601F; }

/* Logo */
.logo-nav { height: 64px; width: auto; }
@media (min-width: 768px) { .logo-nav { height: 96px; } }
.logo-footer { height: 80px; width: auto; }

/* Videos */
.hero-con-video { min-height: auto; padding-top: 7.5rem; align-items: center; }
@media (min-width: 768px) { .hero-con-video { padding-top: 9rem; } }
.hero-con-video h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); }
.hero-video-card { width: min(88vw, 460px); aspect-ratio: 9 / 16; object-fit: cover; border-radius: 22px; background: #000;
  border: 3px solid rgba(250,249,246,.9); box-shadow: 0 18px 40px rgba(0,0,0,.45); display: block; }
@media (min-width: 992px) {
  .hero-con-video { min-height: 100vh; }
  .hero-video-card { width: auto; height: min(84vh, 820px); max-width: 100%; }
}
.hero-con-video::before { background: linear-gradient(90deg, rgba(20,20,18,.85) 0%, rgba(20,20,18,.6) 45%, rgba(20,20,18,.35) 100%); }
.video-row { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
.video-card { flex: 0 0 min(72vw, 300px); margin: 0; scroll-snap-align: start; }
.video-card video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--radius); background: var(--ink); display: block; }
.video-card figcaption { padding-top: .5rem; }
