:root {
  --blue: #05336d;
  --blue-2: #0d5aa7;
  --red: #c7192f;
  --yellow: #ffd33d;
  --green: #207b38;
  --paper: #fff4d7;
  --wood: #7b421d;
  --ink: #12213a;
  --muted: #687089;
  --line: rgba(18, 33, 58, .16);
  --shadow: 0 18px 45px rgba(22, 29, 48, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(90deg, rgba(123,66,29,.08) 1px, transparent 1px),
    linear-gradient(#fff9e8, #fff2cf 38%, #f6d895);
  background-size: 32px 32px, auto;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(255, 246, 220, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
}
.brand-mark {
  background: var(--blue);
  color: var(--yellow);
  border: 2px dashed var(--yellow);
  border-radius: 8px;
  padding: 6px 10px;
  letter-spacing: 1px;
}
.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-weight: 700;
}
.nav a, .link-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.flash {
  margin: 16px auto 0;
  max-width: 1120px;
  padding: 14px 18px;
  border-radius: 8px;
  font-weight: 800;
}
.flash.success { background: #d8f8df; color: #145427; }
.flash.error { background: #ffe0e3; color: #9d1022; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: clamp(22px, 5vw, 56px);
  min-height: calc(100vh - 70px);
  padding: clamp(28px, 6vw, 70px) clamp(16px, 5vw, 72px);
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 18%, rgba(255,211,61,.65), transparent 24%),
    linear-gradient(135deg, rgba(5,51,109,.08), rgba(199,25,47,.08));
}
.bunting {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  gap: 10px;
  width: 100%;
  padding-left: 28px;
  pointer-events: none;
}
.bunting span {
  width: 42px;
  height: 54px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
  background: var(--red);
}
.bunting span:nth-child(2) { background: var(--yellow); }
.bunting span:nth-child(3) { background: var(--blue-2); }
.bunting span:nth-child(4) { background: #269447; }
.bunting span:nth-child(5) { background: #e84d3c; }
.hero-copy {
  align-self: center;
  max-width: 690px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
h1, h2, p { overflow-wrap: anywhere; }
.hero h1 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(2.45rem, 8vw, 5.4rem);
  line-height: .95;
  text-transform: uppercase;
}
.hero h2 {
  display: inline-block;
  margin: 18px 0 12px;
  padding: 12px 16px;
  color: white;
  background: var(--red);
  border-radius: 8px;
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  text-transform: uppercase;
}
.hero p { font-size: 1.15rem; line-height: 1.55; }
.hero-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}
.hero-facts strong {
  padding: 13px;
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
}
.primary-action, .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 20px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 900;
}
.primary-action {
  background: var(--yellow);
  color: var(--blue);
  box-shadow: 0 8px 0 #dfa900;
}
.secondary-action {
  background: white;
  color: var(--blue);
  border: 2px solid var(--blue);
}
.compact { min-height: 40px; padding: 10px 14px; font-size: .92rem; }
.queen-frame {
  align-self: center;
  margin: 0;
  padding: 12px;
  background: white;
  border: 8px solid var(--yellow);
  border-radius: 999px 999px 18px 18px;
  box-shadow: var(--shadow);
}
.queen-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 4.5;
  object-fit: cover;
  border-radius: 999px 999px 12px 12px;
}
.queen-frame figcaption {
  padding: 12px 8px 4px;
  color: var(--blue);
  font-weight: 900;
  text-align: center;
}

.summary-strip, .report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1120px;
  margin: 22px auto;
  padding: 0 16px;
}
.summary-strip div, .report-grid div {
  padding: 18px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(18,33,58,.08);
}
.summary-strip strong, .report-grid strong {
  display: block;
  color: var(--red);
  font-size: clamp(1.55rem, 4vw, 2.3rem);
}
.summary-strip span, .report-grid span { color: var(--muted); font-weight: 800; }

.numbers-section, .rules, .dashboard, .admin-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 16px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.section-heading h2, .rules h2, .panel-head h1, .form-card h1 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(1.7rem, 5vw, 3rem);
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-weight: 800;
}
.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 50%;
}
.dot.available { background: var(--green); }
.dot.pending { background: #f5aa18; }
.dot.paid { background: var(--red); }
.number-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}
.number-card {
  min-height: 76px;
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 0 rgba(0,0,0,.18);
}
.number-card strong { display: block; font-size: 1.25rem; }
.number-card span { font-size: .78rem; font-weight: 800; }
.number-card.available { background: var(--green); }
.number-card.pending_payment { background: #d89000; }
.number-card.paid { background: var(--red); }
.number-card:disabled { cursor: not-allowed; opacity: .78; }
.number-card.selected { outline: 4px solid var(--yellow); transform: translateY(3px); box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.selection-panel {
  position: sticky;
  bottom: 14px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  box-shadow: var(--shadow);
}
.selection-panel div:first-child { display: grid; gap: 4px; }

.rules {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 26px;
}
.rules ul {
  margin: 0;
  padding: 24px 24px 24px 42px;
  background: var(--paper);
  border: 2px dashed var(--wood);
  border-radius: 8px;
  line-height: 1.7;
  font-weight: 700;
}

.auth-page {
  min-height: 72vh;
  display: grid;
  place-items: center;
  padding: 36px 16px;
}
.form-card {
  width: min(100%, 460px);
  display: grid;
  gap: 14px;
  padding: 26px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.form-card.wide { width: min(100%, 720px); }
.form-card label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}
.form-card input, .form-card textarea, .filters input, .filters select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}
.form-card textarea { min-height: 120px; resize: vertical; }
.checkbox {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  flex-direction: row;
}
.checkbox input { width: auto; min-height: auto; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.reservation-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background: white;
  border-left: 8px solid var(--line);
  box-shadow: 0 10px 30px rgba(18,33,58,.08);
}
.reservation-card.pending_payment { border-left-color: #d89000; }
.reservation-card.paid { border-left-color: var(--green); }
.reservation-card.expired, .reservation-card.cancelled { border-left-color: var(--red); }
.reservation-card span { color: var(--muted); font-weight: 800; }
.reservation-card strong { color: var(--blue); }
.confirmed {
  padding: 12px;
  border-radius: 8px;
  background: #d8f8df;
  color: #145427;
  font-weight: 900;
}
.empty-state {
  padding: 30px;
  border-radius: 8px;
  background: white;
  color: var(--muted);
}

.admin-actions, .row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filters {
  display: grid;
  grid-template-columns: 1fr 190px auto;
  gap: 10px;
  margin: 20px 0;
}
.table-wrap {
  overflow-x: auto;
  margin-top: 24px;
  padding: 18px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
}
.table-wrap h2 { color: var(--blue); }
table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}
th, td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--blue);
  background: #fff4d7;
}
.row-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue);
  color: white;
  cursor: pointer;
}
.status-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 8px;
  color: white;
  font-weight: 800;
}
.status-pill.pending_payment { background: #d89000; }
.status-pill.paid { background: var(--green); }
.status-pill.expired, .status-pill.cancelled { background: var(--red); }

.whatsapp-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  padding: 12px 16px;
  border-radius: 999px;
  background: #1fae55;
  color: white;
  text-decoration: none;
  font-weight: 900;
  box-shadow: var(--shadow);
}
.footer {
  display: grid;
  gap: 4px;
  padding: 28px 16px 76px;
  color: white;
  text-align: center;
  background: var(--blue);
}

@media (max-width: 820px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .hero { grid-template-columns: 1fr; padding-top: 74px; }
  .hero-facts, .summary-strip, .report-grid, .rules { grid-template-columns: 1fr; }
  .number-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .number-card { min-height: 68px; }
  .selection-panel, .panel-head { align-items: stretch; flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
}
