html {
  font-size: 14px;
  --club-navy: #12175e;
  --club-blue: #0868a8;
  --club-cyan: #03aeef;
  --club-pale: #f2f8fc;
  --club-ink: #17213b;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin-bottom: 0;
  color: var(--club-ink);
  background: linear-gradient(180deg, #fff 0, var(--club-pale) 330px, #fff 700px);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

body > .container {
  width: 100%;
  flex: 1 0 auto;
}

.club-navbar {
  position: relative;
  background: linear-gradient(100deg, var(--club-navy) 0%, #16357e 62%, var(--club-blue) 100%);
  border-bottom: 5px solid var(--club-cyan);
}

.club-navbar .navbar-brand,
.club-navbar .nav-link {
  color: #fff;
}

.club-navbar .nav-link {
  border-radius: .35rem;
  font-weight: 600;
}

.club-navbar .nav-link:hover,
.club-navbar .nav-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.club-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .7rem;
  margin-right: 1.75rem;
  line-height: 1;
  letter-spacing: .02em;
}

.club-crest {
  width: 42px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2));
}

.club-brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.club-brand-name {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: .11em;
}

.club-brand-module {
  margin-top: .27rem;
  color: #bcecff;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .01em;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--club-navy);
  font-weight: 700;
}

.btn-primary {
  color: #fff;
  background-color: var(--club-blue);
  border-color: var(--club-blue);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  background-color: var(--club-navy);
  border-color: var(--club-navy);
}

.btn-outline-primary {
  color: var(--club-blue);
  border-color: var(--club-blue);
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--club-blue);
  border-color: var(--club-blue);
}

.card {
  border-color: #cbddea;
  box-shadow: 0 .25rem .8rem rgba(18, 23, 94, .06);
}

.card-header {
  color: var(--club-navy);
  background-color: #eaf6fc;
  border-bottom-color: #cbddea;
}

.table thead th {
  color: #fff;
  background-color: var(--club-navy);
  border-color: #293580;
}

/* Keep wide tables horizontally scrollable without trapping vertical swipes on phones. */
.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--club-cyan);
  box-shadow: 0 0 0 .25rem rgba(3, 174, 239, .2);
}

a {
  color: var(--club-blue);
}

.station-scan-card {
  border-top: 5px solid var(--club-cyan);
}

.station-result.alert-success .station-result-message,
.station-result.alert-danger .station-result-message {
  color: inherit;
}

.club-footer {
  text-align: center;
  color: #d9eaf5;
  background-color: var(--club-navy);
  border-top: 4px solid var(--club-cyan) !important;
  font-size: .88rem;
}

body > .footer.club-footer {
  position: static;
  bottom: auto;
  flex: 0 0 auto;
  margin-top: 1.5rem;
  line-height: 1.55;
  white-space: normal;
}

.admin-dashboard {
  padding-bottom: 1rem;
  overflow: visible;
  touch-action: pan-y;
}

.admin-dashboard-card {
  min-height: 84px;
  justify-content: center;
  touch-action: pan-y;
}

.club-footer strong { color: #fff; }
.club-footer-separator { margin-inline: .4rem; color: var(--club-cyan); }

.billing-guidance {
  border-left: 5px solid var(--club-cyan);
}

.report-form, .report-view-picker { min-width: 0; max-width: 100%; }
.report-view-picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .65rem; margin-bottom: .8rem; }
.report-view-option { position: relative; cursor: pointer; margin: 0; }
.report-view-option input { position: absolute; opacity: 0; pointer-events: none; }
.report-view-option span { display: flex; min-height: 76px; flex-direction: column; justify-content: center; padding: .75rem .9rem; border: 1px solid #cbddea; border-radius: .55rem; background: #fff; }
.report-view-option small { color: #66768a; line-height: 1.15; }
.report-view-option input:checked + span { color: #fff; background: var(--club-navy); border-color: var(--club-navy); box-shadow: 0 .25rem .8rem rgba(18,23,94,.2); }
.report-view-option input:checked + span small { color: #c9efff; }
.report-view-option input:focus-visible + span { outline: 3px solid rgba(3,174,239,.45); outline-offset: 2px; }
.report-advanced { padding: .55rem .75rem; border: 1px solid #d7e1e9; border-radius: .45rem; background: #f8fbfd; }
.report-advanced summary { color: var(--club-blue); cursor: pointer; font-weight: 600; }
.billing-answer { display: flex; align-items: baseline; gap: .8rem; padding: 1rem 1.25rem; color: #fff; background: linear-gradient(100deg,var(--club-navy),var(--club-blue)); border-radius: .6rem; }
.billing-answer span { font-size: 1.05rem; font-weight: 600; }
.billing-answer strong { font-size: 2.5rem; line-height: 1; }
.billing-answer small { color: #d7f3ff; }
.billing-comparison { border-width: 2px; }
.usage-cell { display: flex; min-width: 145px; align-items: center; gap: .55rem; }
.usage-cell .progress { width: 90px; height: .6rem; }
.usage-cell .progress-bar { background-color: var(--club-blue); }

.report-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .8rem;
  margin-bottom: 1rem;
}

.report-kpi {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid #cbddea;
  border-top: 5px solid var(--club-blue);
  border-radius: .55rem;
  background: #fff;
  box-shadow: 0 .25rem .8rem rgba(18, 23, 94, .07);
}

.report-kpi span { color: #4d5d72; font-weight: 600; }
.report-kpi strong { color: var(--club-navy); font-size: 2.15rem; line-height: 1.25; }
.report-kpi small { margin-top: auto; color: #66768a; line-height: 1.25; }
.report-kpi-consumed { border-top-color: #198754; }
.report-kpi-unused { border-top-color: #e0a800; }
.report-kpi-cancelled { border-top-color: #6c757d; }
.report-kpi-usage { border-top-color: var(--club-cyan); }
.report-total { padding: .75rem 1rem; border-left: 5px solid var(--club-cyan); background: #eaf6fc; font-size: 1.1rem; }
.report-table-wrap { border: 1px solid #cbddea; border-radius: .5rem; }

.meal-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .65rem;
}

.meal-checkbox {
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: .65rem;
  cursor: pointer;
  display: flex;
  gap: .55rem;
  margin: 0;
  padding: .7rem .8rem;
}

.meal-checkbox:has(.form-check-input:checked) {
  background: #e8f7ff;
  border-color: var(--club-cyan);
}

.assignment-meals {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.assignment-meal {
  align-items: center;
  background: #e8f7ff;
  border: 1px solid #9bdfff;
  border-radius: .55rem;
  display: inline-flex;
  gap: .45rem;
  padding: .35rem .5rem;
}

.assignment-meal form { display: inline; }
.assignment-meal a,
.assignment-meal button {
  background: none;
  border: 0;
  color: #075985;
  font-size: .78rem;
  padding: 0;
  text-decoration: underline;
}

@media (max-width: 991.98px) {
  .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-view-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.delivery-station { max-width: 1100px; margin: 0 auto; }
.station-heading, .station-history-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.station-title { margin-bottom: .15rem; }
.station-operator { color: var(--bs-secondary-color); }
.station-clock { font-size: 1.05rem; text-align: right; }
.station-settings { display: grid; grid-template-columns: 5fr 4fr 3fr; gap: 1rem; margin: 1rem 0; }
.station-scan-card { border-width: 2px; }
.station-scan-label { font-size: 1.25rem; font-weight: 600; }
.station-scan-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.station-dni { min-height: 58px; border-top-right-radius: 0; border-bottom-right-radius: 0; font-size: 1.35rem; }
.station-action { min-width: 150px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.station-loading { margin-top: .75rem; font-weight: 600; }
.station-result { margin-top: 1rem; padding: 1.5rem; text-align: center; }
.station-result-message { font-size: clamp(1.65rem, 4vw, 2.75rem); line-height: 1.1; font-weight: 700; }
.station-result-person { margin-top: .65rem; font-size: clamp(1.15rem, 3vw, 1.5rem); }
.station-result-balance { margin-top: .35rem; font-size: 1.1rem; }
.station-confirm { min-height: 56px; margin-top: 1rem; padding-inline: 2rem; }
.station-history { margin-top: 1rem; }
.station-daily-summary { margin-bottom: 1rem; padding: 1rem; border: 1px solid #b7d9ed; border-radius: .7rem; background: #f4fbff; }
.station-daily-summary-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.station-meal-counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin-bottom: .45rem; }
.station-meal-counter { display: flex; min-height: 76px; flex-direction: column; justify-content: center; border: 2px solid #c8deeb; border-radius: .65rem; color: var(--club-ink); background: #fff; text-align: center; }
.station-meal-counter span { font-size: .85rem; }
.station-meal-counter strong { color: var(--club-navy); font-size: 1.55rem; line-height: 1.15; }
.station-meal-counter.is-selected { border-color: var(--club-cyan); background: #e4f7ff; box-shadow: 0 0 0 .2rem rgba(3,174,239,.13); }
.station-counter-loading, .station-counter-error { grid-column: 1 / -1; padding: .8rem; color: #5f6e7d; text-align: center; }
.station-counter-error { color: #842029; }

@media (max-width: 767.98px) {
  body { margin-bottom: 0; }
  .delivery-station { margin-inline: -.25rem; }
  .station-heading { align-items: flex-start; }
  .station-title { font-size: 1.7rem; }
  .station-clock { max-width: 8rem; font-size: .9rem; }
  .station-settings { grid-template-columns: 1fr; gap: .7rem; }
  .station-meal-counters { grid-template-columns: 1fr 1fr; }
  .station-meal-counter { min-height: 68px; }
  .station-settings .form-label { margin-bottom: .2rem; font-weight: 600; }
  .station-scan-card .card-body { padding: 1rem; }
  .station-scan-controls { grid-template-columns: 1fr; gap: .65rem; }
  .station-dni, .station-action { width: 100%; min-height: 58px; border-radius: var(--bs-border-radius-lg); }
  .station-action, .station-confirm { font-size: 1.2rem; font-weight: 600; }
  .station-result { padding: 1.25rem .85rem; }
  .station-confirm { width: 100%; }
  .station-history-header { padding-block: .85rem; }
  .station-history .list-group-item { padding-block: .85rem; }
  .footer.club-footer {
    position: static;
    margin-top: 1.5rem;
    padding: 1rem 0;
    line-height: 1.55;
    white-space: normal;
    text-align: center;
  }
  .footer.club-footer .container { white-space: normal; overflow-wrap: anywhere; }
  .club-navbar { border-bottom-width: 4px; }
  .club-crest { width: 34px; height: 49px; }
  .club-brand { gap: .55rem; }
  .club-navbar .navbar-collapse { padding-top: .75rem; }
  .club-navbar .nav-link { padding: .7rem .75rem; }
  .admin-dashboard { row-gap: .75rem !important; }
  .admin-dashboard-card { min-height: 68px; padding: 1rem; font-size: 1.05rem; }
  .report-kpis { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .report-kpi { min-height: 125px; padding: .8rem; }
  .report-kpi strong { font-size: 1.8rem; }
  .report-view-picker { display: flex; width: 100%; overflow-x: auto; padding-bottom: .35rem; }
  .report-view-option { flex: 0 0 155px; min-width: 0; }
  .billing-answer { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .report-summary-table { min-width: 760px; }
}

@media (max-width: 420px) {
  .report-kpis { grid-template-columns: 1fr; }
  .report-kpi { min-height: 105px; }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
