:root {
  --app-primary: #0055A4;
  --app-accent: #EF4135;
  --app-bg: #F7F8FA;
  --app-surface: #FFFFFF;
  --app-text: #111827;
  --app-muted: #6B7280;
  --app-border: #E5E7EB;
  --app-font-size: 1rem;
  --app-title-size: 2rem;
  --app-radius: 1rem;
  --app-sidebar-width: 320px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--app-text);
  background: radial-gradient(circle at top left, rgba(0,85,164,.10), transparent 36rem), var(--app-bg);
  font-size: var(--app-font-size);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--app-primary); }
.app-shell { min-height: 100vh; display: flex; }
.app-sidebar {
  width: var(--app-sidebar-width);
  flex: 0 0 var(--app-sidebar-width);
  background: linear-gradient(180deg, var(--app-primary), #07386f);
  color: #fff;
  padding: 2rem;
  position: sticky;
  top: 0;
  min-height: 100vh;
}
.app-logo { max-width: 180px; max-height: 80px; object-fit: contain; margin-bottom: 1rem; }
.app-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 1.1rem; background: #fff; color: var(--app-primary); font-weight: 800; letter-spacing: .02em; margin-bottom: 1rem;
}
.app-sidebar .muted { color: rgba(255,255,255,.78); }
.app-sidebar a { color: #fff; text-decoration: none; }
.app-sidebar .link-card {
  display: block; padding: .75rem .9rem; border-radius: .8rem; background: rgba(255,255,255,.09); margin-bottom: .55rem;
}
.app-sidebar .link-card:hover { background: rgba(255,255,255,.16); }
.app-main { flex: 1; padding: 2rem; }
.app-header { margin-bottom: 1.5rem; }
.app-title { font-size: var(--app-title-size); font-weight: 800; letter-spacing: -.04em; margin: 0 0 .45rem; }
.app-subtitle { max-width: 760px; color: var(--app-muted); margin: 0; }
.app-card {
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--app-radius);
  box-shadow: 0 18px 45px rgba(17, 24, 39, .08); padding: 1.25rem;
}
.app-card-lg { padding: 1.6rem; }
.app-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 1.25rem; align-items: start; }
.app-result {
  border-left: 6px solid var(--app-accent);
}
.result-number { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 850; letter-spacing: -.06em; color: var(--app-primary); }
.result-label { color: var(--app-muted); }
.badge-soft { display: inline-flex; align-items: center; padding: .35rem .65rem; border-radius: 999px; background: rgba(0,85,164,.10); color: var(--app-primary); font-weight: 650; }
.btn-primary { background-color: var(--app-primary) !important; border-color: var(--app-primary) !important; }
.btn-outline-primary { color: var(--app-primary) !important; border-color: var(--app-primary) !important; }
.btn-outline-primary:hover { background-color: var(--app-primary) !important; color: #fff !important; }
.form-label { font-weight: 650; }
.form-text, .text-muted { color: var(--app-muted) !important; }
.required::after { content: " *"; color: var(--app-accent); }
.app-alert { border-radius: .9rem; padding: .9rem 1rem; background: rgba(239,65,53,.08); border: 1px solid rgba(239,65,53,.22); color: #82170f; }
.app-note { border-radius: .9rem; padding: .9rem 1rem; background: rgba(0,85,164,.08); border: 1px solid rgba(0,85,164,.16); color: #07386f; }
.app-footer { margin-top: 2rem; color: var(--app-muted); font-size: .95rem; }
.admin-nav { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.table-status td:first-child { color: var(--app-muted); width: 260px; }

/* Bootstrap fallback mínimo por si el CDN no carga. */
.container-fluid{width:100%;padding-right:calc(1.5rem*.5);padding-left:calc(1.5rem*.5);margin-right:auto;margin-left:auto}.row{display:flex;flex-wrap:wrap;margin-right:calc(-.5*1.5rem);margin-left:calc(-.5*1.5rem)}.col-md-6,.col-12{position:relative;width:100%;padding-right:calc(1.5rem*.5);padding-left:calc(1.5rem*.5)}.g-3{gap:0}.g-3>[class*="col"]{margin-bottom:1rem}@media(min-width:768px){.col-md-6{flex:0 0 auto;width:50%}}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:1rem}.mb-4{margin-bottom:1.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:1rem}.mt-4{margin-top:1.5rem}.d-flex{display:flex}.justify-content-between{justify-content:space-between}.align-items-center{align-items:center}.gap-2{gap:.5rem}.w-100{width:100%}.form-control,.form-select{display:block;width:100%;padding:.65rem .8rem;font-size:1rem;line-height:1.5;color:#212529;background:#fff;border:1px solid #ced4da;border-radius:.7rem}.form-control:disabled,.form-select:disabled{background:#eef1f5;opacity:1}.btn{display:inline-block;padding:.65rem 1rem;border:1px solid transparent;border-radius:.75rem;text-decoration:none;cursor:pointer;font-weight:650}.btn-lg{padding:.85rem 1.15rem;font-size:1.05rem}.btn-secondary{background:#6c757d;color:#fff}.btn-danger{background:#dc3545;color:#fff}.alert{padding:1rem;border-radius:.75rem;margin-bottom:1rem}.alert-success{background:#d1e7dd;color:#0f5132}.alert-danger{background:#f8d7da;color:#842029}.small{font-size:.875em}.table{width:100%;border-collapse:collapse}.table td,.table th{padding:.65rem;border-bottom:1px solid var(--app-border)}

@media (max-width: 991.98px) {
  .app-shell { display: block; }
  .app-sidebar { width: 100%; min-height: auto; position: relative; padding: 1.25rem; }
  .app-main { padding: 1rem; }
  .app-grid { grid-template-columns: 1fr; }
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand-title {
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -.04em;
}
.app-logo {
  width: 96px;
  height: 96px;
  max-width: 96px;
  max-height: 96px;
  object-fit: cover;
  border-radius: 999px;
  margin-bottom: 0;
  border: 3px solid rgba(255,255,255,.75);
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}
.app-header .app-logo {
  border-color: var(--app-surface);
}
.update-pill {
  display: inline-flex;
  align-items: center;
  padding: .45rem .7rem;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.92);
  font-size: .9rem;
  font-weight: 650;
}
.result-summary {
  display: grid;
  gap: .55rem;
  margin-top: 1rem;
}
.result-summary div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .75rem;
  border-radius: .75rem;
  background: rgba(17,24,39,.035);
  border: 1px solid var(--app-border);
}
.result-summary span {
  color: var(--app-muted);
  font-size: .9rem;
}
.result-summary strong {
  text-align: right;
}
.footer-links {
  display: inline-block;
  margin-left: .5rem;
}
textarea.code-area {
  min-height: 9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .9rem;
}
@media (max-width: 575.98px) {
  .brand-inline { align-items: flex-start; }
  .app-logo { width: 72px; height: 72px; max-width: 72px; max-height: 72px; }
  .result-summary div { display: block; }
  .result-summary strong { display: block; text-align: left; margin-top: .15rem; }
}

.btn-whatsapp {
  background: #25D366;
  border-color: #25D366;
  color: #063b1d !important;
  font-weight: 800;
}
.btn-whatsapp:hover {
  filter: brightness(.96);
  color: #063b1d !important;
}
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 1080;
  width: min(980px, calc(100vw - 2rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid var(--app-border);
  box-shadow: 0 20px 55px rgba(17,24,39,.20);
}
.cookie-banner[hidden] { display: none !important; }
.cookie-copy {
  display: grid;
  gap: .25rem;
  color: var(--app-text);
}
.cookie-copy span {
  color: var(--app-muted);
}
@media (max-width: 767.98px) {
  .cookie-banner {
    align-items: stretch;
    flex-direction: column;
  }
  .cookie-banner .btn {
    width: 100%;
  }
}
@media print {
  html, body {
    display: none !important;
  }
}
.admin-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  background: rgba(0,85,164,.08);
  border: 1px solid rgba(0,85,164,.16);
  font-size: .85rem;
  line-height: 1;
}
.admin-lock:hover {
  background: rgba(0,85,164,.14);
}
