:root {
  --navy: #201b1d;
  --navy-2: #4d3f44;
  --orange: #f4a81c;
  --orange-soft: #fff4dc;
  --teal: #9d858c;
  --teal-soft: #f1e8eb;
  --green: #2f8a62;
  --green-soft: #e8f5ee;
  --red: #c75555;
  --red-soft: #fbecec;
  --amber: #b7791f;
  --amber-soft: #fff7df;
  --ink: #231d20;
  --muted: #7a6c72;
  --line: #eadfe0;
  --surface: #ffffff;
  --canvas: #f8f3f0;
  --shadow: 0 10px 28px rgba(32, 27, 29, .10);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { -webkit-font-smoothing: antialiased; }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; padding-bottom: calc(84px + var(--safe-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: calc(68px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 18px 0;
  background: linear-gradient(135deg, #171214 0%, #2b2327 58%, #463b40 100%); color: #fff;
  backdrop-filter: blur(14px); box-shadow: 0 4px 16px rgba(20, 38, 50, .18);
}
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: #fff; color: var(--navy); font-weight: 900; letter-spacing: -.5px; box-shadow: inset 0 -3px 0 var(--orange); }
.brand-logo { width: 42px; height: 42px; border-radius: 13px; object-fit: contain; background: rgba(255,255,255,.97); padding: 5px; box-shadow: inset 0 -3px 0 var(--orange), 0 5px 15px rgba(0,0,0,.18); }
.brand-title { font-weight: 780; font-size: 16px; line-height: 1.05; }
.brand-subtitle { margin-top: 3px; font-size: 11px; color: #ddd3d6; letter-spacing: .06em; text-transform: uppercase; }
.icon-button { border: 0; background: transparent; color: inherit; display: flex; align-items: center; gap: 8px; padding: 4px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff8ed; color: var(--navy); font-weight: 800; font-size: 12px; border: 1px solid rgba(244,168,28,.28); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #5fd495; box-shadow: 0 0 0 4px rgba(95, 212, 149, .12); }

.main-view { width: min(1120px, 100%); margin: 0 auto; padding: 18px 15px 26px; }
.page-head { margin: 4px 2px 15px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.page-head > div:first-child { min-width: 0; }
.page-kicker { color: #c88a10; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.page-title { margin: 3px 0 0; font-size: clamp(24px, 7vw, 34px); letter-spacing: -.035em; line-height: 1.05; }
.page-description { color: var(--muted); font-size: 13px; margin-top: 7px; max-width: 650px; }
.mode-badge { flex: none; border-radius: 999px; padding: 7px 10px; font-size: 10px; font-weight: 800; color: var(--navy); background: #f2e8d8; text-transform: uppercase; letter-spacing: .05em; border: 1px solid rgba(244,168,28,.18); }


.brand-hero-card {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr; gap: 14px;
  padding: 20px; margin-bottom: 14px; border-radius: 24px; color: #fff;
  background: linear-gradient(145deg, #171214 0%, #2d2428 52%, #5a4b52 100%);
  box-shadow: 0 16px 36px rgba(32, 27, 29, .18);
}
.brand-hero-card::before {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  right: -35px; top: -58px; background: rgba(244,168,28,.22);
}
.brand-hero-copy, .brand-hero-image { position: relative; z-index: 1; }
.brand-hero-kicker { color: #f3c765; font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.brand-hero-card h2 { margin: 8px 0 0; font-size: clamp(24px, 7vw, 32px); line-height: 1.04; letter-spacing: -.04em; }
.brand-hero-card p { margin: 10px 0 0; max-width: 540px; color: #e8dde0; font-size: 13px; line-height: 1.52; }
.brand-hero-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.brand-hero-pills span {
  border-radius: 999px; padding: 7px 10px; background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.brand-hero-image {
  width: min(100%, 330px); justify-self: end; align-self: end; border-radius: 18px;
  background: rgba(255,255,255,.06); padding: 12px; border: 1px solid rgba(255,255,255,.10);
}
.quick-access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.quick-link-card {
  width: 100%; text-align: left; border: 1px solid rgba(38,63,81,.07); background: #fff; color: var(--ink);
  border-radius: 18px; padding: 14px; box-shadow: 0 5px 16px rgba(38,63,81,.055); display: grid; gap: 10px;
}
.quick-link-top { display: flex; align-items: center; gap: 10px; }
.quick-link-icon {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(180deg, #fff4dc 0%, #ffecc1 100%); color: #8c6212; font-size: 16px; font-weight: 900;
}
.quick-link-title { font-size: 13px; font-weight: 820; color: var(--navy); }
.quick-link-text { color: var(--muted); font-size: 10px; line-height: 1.45; min-height: 42px; }
.quick-link-cta { color: #b27a13; font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 4px; }
.quick-link-card:active { transform: translateY(1px); }
.quick-link-card { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
@media (hover:hover) {
  .quick-link-card:hover { transform: translateY(-2px); border-color: rgba(244,168,28,.35); box-shadow: 0 10px 24px rgba(32,27,29,.10); }
}

.data-status-strip {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: -2px 0 14px;
}
.data-status-item {
  min-height: 54px; border-radius: 14px; padding: 10px 11px; border: 1px solid var(--line); background: #fff;
  display: flex; flex-direction: column; justify-content: center; gap: 4px; box-shadow: 0 4px 12px rgba(32,27,29,.04);
}
.data-status-item span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.data-status-item strong { font-size: 12px; }
.data-status-item.complete { background: linear-gradient(180deg,#f7fcf9,#edf8f1); border-color: #cde8d7; color: var(--green); }
.data-status-item.partial { background: linear-gradient(180deg,#fffaf0,#fff3d8); border-color: #f1d898; color: #996400; }
.data-status-item.pending { background: linear-gradient(180deg,#fafafa,#f1f2f3); border-color: #dfe4e7; color: #7d8990; }

.filter-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 14px; }
.filter-bar.three { grid-template-columns: 1fr 1fr 1fr; }
.field { position: relative; }
.field label { display: block; margin: 0 0 5px 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.field select, .field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); outline: none; min-height: 44px; padding: 10px 12px; box-shadow: 0 3px 12px rgba(38,63,81,.04);
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field select:focus, .field input:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(157,133,140,.14); }

.segmented { display: grid; grid-template-columns: 1fr 1fr; background: #efe7e8; padding: 3px; border-radius: 13px; }
.segmented button { border: 0; border-radius: 10px; padding: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }
.segmented button.active { background: #fff; color: var(--navy); box-shadow: 0 2px 7px rgba(38,63,81,.10); }

.hero-card { background: linear-gradient(135deg, #201b1d 0%, #3a2f34 58%, #6b5a61 100%); color: #fff; border-radius: 22px; padding: 19px; box-shadow: var(--shadow); margin-bottom: 13px; overflow: hidden; position: relative; }
.hero-card::after { content: ""; position: absolute; width: 170px; height: 170px; border-radius: 50%; right: -60px; top: -80px; background: rgba(244,168,28,.28); }
.hero-label { color: #cbd9e0; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.hero-value { position: relative; z-index: 1; margin-top: 7px; font-size: clamp(33px, 11vw, 48px); font-weight: 860; letter-spacing: -.04em; }
.hero-row { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-top: 13px; }
.hero-meta { color: #dce7eb; font-size: 12px; line-height: 1.5; }
.hero-change { border-radius: 999px; padding: 7px 10px; font-weight: 800; font-size: 12px; background: rgba(255,255,255,.13); white-space: nowrap; }

.section-title { margin: 22px 2px 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section-title h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; color: var(--navy); }
.section-title span { color: var(--muted); font-size: 11px; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi-card { background: var(--surface); border: 1px solid rgba(38,63,81,.07); border-radius: var(--radius); padding: 14px; box-shadow: 0 5px 16px rgba(38,63,81,.06); min-height: 116px; transition: box-shadow .16s ease, transform .16s ease; }
@media (hover:hover) { .kpi-card:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(32,27,29,.09); } }
.kpi-card.wide { grid-column: span 2; }
.kpi-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.kpi-label { color: var(--muted); font-size: 11px; line-height: 1.25; font-weight: 750; }
.kpi-icon { width: 29px; height: 29px; border-radius: 10px; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange); font-size: 14px; }
.kpi-value { margin-top: 11px; font-size: clamp(20px, 6vw, 27px); font-weight: 850; letter-spacing: -.035em; }
.kpi-foot { margin-top: 7px; display: flex; justify-content: space-between; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.delta { font-weight: 850; border-radius: 999px; padding: 4px 7px; }
.delta.good { color: var(--green); background: var(--green-soft); }
.delta.bad { color: var(--red); background: var(--red-soft); }
.delta.neutral { color: var(--amber); background: var(--amber-soft); }

.comparison-card { background: #fff; border-radius: var(--radius); padding: 15px; box-shadow: 0 5px 16px rgba(38,63,81,.06); border: 1px solid rgba(38,63,81,.07); margin-bottom: 10px; }
.comparison-header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.comparison-name { font-weight: 800; font-size: 13px; }
.comparison-value { font-weight: 850; font-size: 16px; }
.bar-row { display: grid; grid-template-columns: 72px 1fr 68px; align-items: center; gap: 9px; margin-top: 10px; font-size: 10px; color: var(--muted); }
.bar-track { height: 8px; background: #edf1f3; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; min-width: 2px; border-radius: 999px; background: var(--teal); }
.bar-fill.budget { background: #b9c5ca; }
.bar-fill.previous { background: var(--orange); }
.bar-number { text-align: right; font-variant-numeric: tabular-nums; }

.data-list { display: grid; gap: 8px; }
.data-row { background: #fff; border-radius: 15px; padding: 13px; border: 1px solid rgba(38,63,81,.07); display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.data-row-title { font-size: 13px; font-weight: 780; }
.data-row-sub { color: var(--muted); font-size: 10px; margin-top: 3px; }
.data-row-value { font-size: 15px; font-weight: 850; text-align: right; }
.data-row-detail { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding-top: 8px; border-top: 1px solid #edf0f2; }
.mini-stat { background: #f7f8f8; border-radius: 10px; padding: 8px; }
.mini-stat span { display: block; color: var(--muted); font-size: 9px; }
.mini-stat strong { display: block; margin-top: 3px; font-size: 12px; }

.alert-list { display: grid; gap: 8px; }
.alert { border-radius: 14px; padding: 12px 13px; display: flex; gap: 10px; align-items: start; font-size: 12px; line-height: 1.42; }
.alert.warning { background: var(--amber-soft); color: #77510f; }
.alert.error { background: var(--red-soft); color: #8d3737; }
.alert.ok { background: var(--green-soft); color: #236f4c; }
.alert-icon { flex: none; width: 23px; height: 23px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.55); font-weight: 900; }

.day-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px 8px; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day-chip { min-width: 62px; border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 9px 8px; text-align: center; color: var(--muted); }
.day-chip strong { display: block; color: var(--ink); font-size: 15px; margin-top: 2px; }
.day-chip.active { border-color: var(--orange); background: var(--orange-soft); color: #a3541b; }
.day-chip.active strong { color: var(--orange); }

.floor-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.floor-tabs::-webkit-scrollbar { display: none; }
.floor-tab { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; padding: 9px 13px; white-space: nowrap; font-weight: 750; font-size: 12px; }
.floor-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.plan-card { background: #fff; border-radius: 20px; padding: 8px; box-shadow: var(--shadow); overflow: auto; -webkit-overflow-scrolling: touch; }
.plan-card img { width: 100%; min-width: 720px; display: block; border-radius: 13px; }
.plan-help { color: var(--muted); font-size: 11px; margin: 8px 3px 0; }

.menu-list { display: grid; gap: 9px; }
.menu-item { width: 100%; border: 1px solid rgba(38,63,81,.07); background: #fff; border-radius: 16px; padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink); box-shadow: 0 4px 13px rgba(38,63,81,.045); text-align: left; }
.menu-item-main { display: flex; gap: 12px; align-items: center; }
.menu-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font-size: 18px; }
.menu-title { font-weight: 790; font-size: 13px; }
.menu-sub { color: var(--muted); font-size: 10px; margin-top: 3px; }
.menu-chevron { color: #9aa7ae; font-size: 20px; }

.upload-zone { border: 1.5px dashed #a8b8c0; border-radius: 18px; background: #f9fbfb; min-height: 145px; padding: 20px; display: grid; place-items: center; text-align: center; transition: .2s; }
.upload-zone.drag { border-color: var(--orange); background: var(--orange-soft); }
.upload-zone input { display: none; }
.upload-zone-icon { font-size: 30px; }
.upload-zone strong { display: block; margin-top: 7px; font-size: 14px; }
.upload-zone span { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }

.primary-button, .secondary-button, .danger-button { border: 0; border-radius: 13px; min-height: 45px; padding: 11px 15px; font-weight: 800; }
.primary-button { background: var(--orange); color: #fff; box-shadow: 0 6px 14px rgba(244,168,28,.28); }
.secondary-button { background: #efe7e8; color: var(--navy); }
.danger-button { background: var(--red-soft); color: var(--red); }
.button-row { display: flex; gap: 9px; margin-top: 12px; }
.button-row > * { flex: 1; }

.preview-table { overflow-x: auto; background: #fff; border-radius: 16px; border: 1px solid var(--line); }
.preview-table table { width: 100%; border-collapse: collapse; font-size: 11px; min-width: 540px; }
.preview-table th, .preview-table td { padding: 10px; border-bottom: 1px solid #edf0f2; text-align: right; white-space: nowrap; }
.preview-table th:first-child, .preview-table td:first-child { text-align: left; }
.preview-table th { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; background: #fafbfb; }

.bottom-nav {
  position: fixed; z-index: 80; bottom: 0; left: 0; right: 0;
  height: calc(70px + var(--safe-bottom)); padding: 6px 7px var(--safe-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(255,255,255,.97); border-top: 1px solid #e9dfdf; backdrop-filter: blur(16px);
  box-shadow: 0 -8px 24px rgba(38,63,81,.08);
}
.nav-item { height: 56px; border: 0; background: transparent; color: #7f7278; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 9px; font-weight: 800; }
.nav-item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { color: var(--navy); background: linear-gradient(180deg, #fff6e7 0%, #fff0cf 100%); box-shadow: inset 0 -2px 0 rgba(244,168,28,.45); }

.toast { position: fixed; z-index: 200; left: 50%; bottom: calc(86px + var(--safe-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; width: min(90vw, 420px); background: #251f22; color: #fff; border-radius: 13px; padding: 12px 14px; font-size: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.2); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-backdrop { position: fixed; z-index: 150; inset: 0; background: rgba(20,38,50,.54); display: grid; place-items: end center; padding: 14px; }
.modal { width: min(100%, 620px); max-height: 88vh; overflow-y: auto; background: #fff; border-radius: 24px 24px 18px 18px; padding: 18px; box-shadow: 0 18px 60px rgba(0,0,0,.28); }
.modal-header { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 14px; }
.modal-title { font-size: 19px; font-weight: 850; }
.modal-sub { color: var(--muted); font-size: 11px; margin-top: 4px; }
.close-button { border: 0; background: #edf1f2; border-radius: 50%; width: 34px; height: 34px; color: var(--navy); font-weight: 900; }

.empty-state { background: #fff; border-radius: 18px; padding: 28px 18px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 5px; }
.small-note { color: var(--muted); font-size: 10px; line-height: 1.45; }

@media (min-width: 720px) {
  .brand-hero-card { grid-template-columns: 1.25fr .75fr; align-items: end; }
  .quick-access-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .main-view { padding: 25px 25px 40px; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-card.wide { grid-column: span 2; }
  .filter-bar { max-width: 650px; }
  .comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .comparison-grid .comparison-card { margin-bottom: 0; }
  .data-list.centers { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bottom-nav { left: 50%; right: auto; transform: translateX(-50%); width: min(620px, 100%); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; }
  .plan-card img { min-width: 900px; }
}

/* v0.2 · accesibilidad y cargas seguras */
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, label.menu-item:focus-within {
  outline: 3px solid rgba(244,168,28,.35);
  outline-offset: 2px;
}
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.status-dot.offline { background: #d89a3a; box-shadow: 0 0 0 4px rgba(216,154,58,.15); }
.full-button { width: 100%; margin-top: 10px; }
.import-order { padding-left: 22px; font-size: 11px; line-height: 1.7; color: var(--muted); columns: 2; column-gap: 28px; }
.backup-actions label.menu-item { cursor: pointer; }
.field input::placeholder, .field textarea::placeholder { color: #9aa6ad; }

@media (max-width: 430px) {
  .quick-access-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .quick-link-card { padding: 11px; gap: 8px; }
  .quick-link-text { min-height: 0; font-size: 9px; }
  .quick-link-icon { width: 34px; height: 34px; }
  .quick-link-title { font-size: 12px; }
  .brand-hero-card { padding: 17px; }
  .brand-hero-image { justify-self: center; width: min(100%, 250px); }

  .filter-bar.three { grid-template-columns: 1fr 1fr; }
  .filter-bar.three > .field:nth-child(3) { grid-column: 1 / -1; }
  .filter-bar.three.import-meta > .field:nth-child(2),
  .filter-bar.three.import-meta > .field:nth-child(3) { grid-column: 1 / -1; }
  .import-order { columns: 1; }
  .page-head { align-items: flex-start; }
  .mode-badge { margin-top: 2px; }
}

@media (max-width: 340px) {
  .quick-access-grid, .data-status-strip { grid-template-columns: 1fr; }
}

@media (min-width: 720px) {
  .data-status-strip { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Acceso privado mediante PIN */
[hidden] { display: none !important; }
.security-gate {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  padding: max(22px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at top, rgba(244,168,28,.16) 0%, rgba(244,168,28,0) 28%), linear-gradient(160deg, #141012 0%, #241d21 60%, #44393f 100%);
}

.security-gate::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background: url("assets/logo-full.png") center 10% / min(620px, 92vw) auto no-repeat;
}
.security-gate::after {
  content: ""; position: absolute; width: 240px; height: 240px; right: -80px; bottom: -80px; border-radius: 50%;
  background: rgba(244,168,28,.12); filter: blur(4px); pointer-events: none;
}
.security-card {
  position: relative; z-index: 1; width: min(100%, 420px); border-radius: 25px; padding: 30px 24px; text-align: center;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px); box-shadow: 0 24px 70px rgba(0,0,0,.3); border: 1px solid rgba(244,168,28,.18);
}
.security-logo { display: block; margin: 0 auto 10px; width: min(250px, 78%); height: auto; }
.security-kicker { color: #b27a13; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.security-card h1 { margin: 0; color: var(--navy); font-size: 23px; letter-spacing: -.02em; }
.security-card p { margin: 12px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.security-note { margin-top: 13px; color: #8b7c82; font-size: 11px; line-height: 1.45; }
.security-spinner {
  width: 34px; height: 34px; margin: 4px auto 0; border-radius: 50%;
  border: 3px solid #e5e9eb; border-top-color: var(--orange); animation: security-spin .8s linear infinite;
}
#securityRetry:not([hidden]) + .security-spinner, #securityRetry:not([hidden]) ~ .security-spinner { display: none; }
@keyframes security-spin { to { transform: rotate(360deg); } }

/* v0.6 · vista global mensual de previsión */
.forecast-month-panel { display: grid; gap: 11px; }
.forecast-month-quick {
  display: flex; gap: 9px; overflow-x: auto; padding: 1px 1px 5px;
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.forecast-month-quick::-webkit-scrollbar { display: none; }
.forecast-quick-card {
  flex: 0 0 158px; scroll-snap-align: start; min-height: 78px;
  border: 1px solid rgba(38,63,81,.08); border-radius: 16px; padding: 12px;
  background: #fff; box-shadow: 0 4px 13px rgba(38,63,81,.045);
}
.forecast-quick-card span { display: block; color: var(--muted); font-size: 10px; line-height: 1.25; font-weight: 750; }
.forecast-quick-card strong { display: block; margin-top: 8px; color: var(--navy); font-size: 17px; letter-spacing: -.02em; }
.forecast-legend { display: flex; gap: 10px 14px; flex-wrap: wrap; padding: 4px 3px 2px; color: var(--muted); font-size: 10px; }
.forecast-legend span { display: inline-flex; gap: 6px; align-items: center; }
.forecast-legend i { width: 10px; height: 10px; border-radius: 4px; display: inline-block; }
.forecast-legend i.normal { background: #7bb7a0; }
.forecast-legend i.attention { background: #e2ad51; }
.forecast-legend i.high { background: #ed8a42; }
.forecast-legend i.critical { background: #cf6060; }
.forecast-legend i.traffic-green { background: #6fb08a; }
.forecast-legend i.traffic-yellow { background: #e2ad51; }
.forecast-legend i.traffic-red { background: #cf6060; }
.forecast-weeks { display: grid; gap: 10px; }
.forecast-week { border: 1px solid rgba(38,63,81,.08); border-radius: 18px; background: #fff; box-shadow: 0 5px 16px rgba(38,63,81,.05); overflow: hidden; }
.forecast-week > summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 10px 13px; color: var(--navy); cursor: pointer; user-select: none;
  background: #fafbfb;
}
.forecast-week > summary::-webkit-details-marker { display: none; }
.forecast-week > summary::after { content: '⌄'; color: #8b9aa2; font-size: 18px; transition: transform .18s ease; }
.forecast-week[open] > summary::after { transform: rotate(180deg); }
.forecast-week > summary > span:first-child { display: grid; gap: 2px; }
.forecast-week > summary strong { font-size: 12px; }
.forecast-week > summary small { color: var(--muted); font-size: 10px; text-transform: capitalize; }
.forecast-week-summary { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 750; }
.forecast-week-summary .week-occ { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; background: #eef1f2; color: var(--navy); font-weight: 850; }
.traffic-pill { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 999px; font-weight: 850; }
.traffic-pill small { color: inherit; opacity: .86; font-size: 9px; text-transform: none; }
.traffic-pill.traffic-normal { background: #e5f4ea; color: #2b6d49; }
.traffic-pill.traffic-attention { background: #fff2d9; color: #9d6d00; }
.traffic-pill.traffic-critical { background: #fde3e3; color: #b23f3f; }
.traffic-pill.traffic-empty { background: #edf1f2; color: #81919a; }
.forecast-week-board {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px;
  scroll-snap-type: x mandatory; scrollbar-width: thin; background: #f6f7f7;
  -webkit-overflow-scrolling: touch;
}
.forecast-day-card {
  flex: 0 0 164px; scroll-snap-align: start; border: 1px solid #e3e8ea; border-top-width: 4px;
  border-radius: 15px; background: #fff; overflow: hidden; min-height: 432px;
}
.forecast-day-card.occ-normal { border-top-color: #7bb7a0; }
.forecast-day-card.occ-attention { border-top-color: #e2ad51; }
.forecast-day-card.occ-high { border-top-color: #ed8a42; }
.forecast-day-card.occ-critical { border-top-color: #cf6060; }
.forecast-day-card.occ-empty { border-top-color: #c9d1d5; }
.forecast-day-card.outside-month { opacity: .52; }
.forecast-day-card.no-data { background: #f3f5f5; }
.forecast-day-head {
  width: 100%; min-height: 82px; border: 0; border-bottom: 1px solid #edf0f1; padding: 9px 10px;
  display: grid; grid-template-columns: 1fr auto; gap: 3px 7px; align-items: center; text-align: left;
  background: transparent; color: var(--ink);
}
.forecast-day-head:not(:disabled):active { background: var(--orange-soft); }
.forecast-weekday { grid-column: 1; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .07em; }
.forecast-date-number { grid-column: 1; font-size: 18px; font-weight: 860; line-height: 1; }
.forecast-date-number small { font-size: 9px; color: var(--muted); font-weight: 800; }
.forecast-occ-badge {
  grid-column: 2; grid-row: 1 / span 2; min-width: 47px; border-radius: 999px; padding: 6px 7px;
  text-align: center; background: #edf1f2; color: var(--navy); font-size: 11px; font-weight: 850;
}
.occ-normal .forecast-occ-badge { background: var(--green-soft); color: var(--green); }
.occ-attention .forecast-occ-badge { background: var(--amber-soft); color: var(--amber); }
.occ-high .forecast-occ-badge { background: var(--orange-soft); color: #b85f20; }
.occ-critical .forecast-occ-badge { background: var(--red-soft); color: var(--red); }
.forecast-day-body { padding: 8px 10px 10px; display: grid; gap: 8px; }
.forecast-group { border: 1px solid #edf0f1; border-radius: 12px; background: #fff; overflow: hidden; }
.forecast-group-title { padding: 7px 9px; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); background: #f7f8f9; border-bottom: 1px solid #edf0f1; }
.forecast-group.group-movement .forecast-group-title { background: #f8f2e7; }
.forecast-group.group-guests .forecast-group-title { background: #eef4f8; }
.forecast-group.group-services .forecast-group-title { background: #f2f7f2; }
.forecast-metric { min-height: 31px; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 0 9px; border-bottom: 1px solid #eef1f2; }
.forecast-metric:last-child { border-bottom: 0; }
.forecast-metric span { color: var(--muted); font-size: 9px; }
.forecast-metric strong { color: var(--ink); font-size: 11px; }
.forecast-metric.traffic-normal strong { color: #2b6d49; }
.forecast-metric.traffic-attention strong { color: #9d6d00; }
.forecast-metric.traffic-critical strong { color: #b23f3f; }
.forecast-metric.traffic-normal::before,
.forecast-metric.traffic-attention::before,
.forecast-metric.traffic-critical::before,
.forecast-metric.traffic-empty::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; margin-right: 2px; }
.forecast-metric.traffic-normal::before { background: #6fb08a; }
.forecast-metric.traffic-attention::before { background: #e2ad51; }
.forecast-metric.traffic-critical::before { background: #cf6060; }
.forecast-metric.traffic-empty::before { background: #c9d1d5; }
.forecast-metric.traffic-normal span,
.forecast-metric.traffic-attention span,
.forecast-metric.traffic-critical span,
.forecast-metric.traffic-empty span { margin-left: -2px; }

@media (min-width: 900px) {
  .forecast-month-quick { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); overflow: visible; }
  .forecast-quick-card { min-width: 0; }
  .forecast-week-board { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); overflow: visible; }
  .forecast-day-card { min-width: 0; min-height: 0; }
  .forecast-week > summary::after { display: none; }
}


/* Acceso PIN */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.pin-form { display: grid; gap: 12px; margin-top: 4px; }
.pin-input { width: 100%; min-height: 52px; border: 1px solid #d8dfe2; border-radius: 14px; background: #fff; color: var(--navy); font: 800 24px/1 system-ui, sans-serif; letter-spacing: .35em; text-align: center; padding: 10px 8px 10px 16px; outline: none; box-sizing: border-box; }
.pin-input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(244,168,28,.16); }
.pin-input:disabled { opacity: .65; background: #f4f5f5; }
.pin-error { margin-top: 12px; border-radius: 12px; padding: 10px 12px; background: #fff2f0; color: #a93f38; font-size: 12px; font-weight: 700; line-height: 1.4; }
.pin-form .primary-button { width: 100%; min-height: 48px; }
.pin-form .primary-button:disabled { opacity: .55; cursor: not-allowed; }
