/* quota.css (normalized) */
:root {
  --q-bg: #f4f6f9;
  --q-card: #fff;
  --q-ink: #111827;
  --q-muted: #6b7280;
  --q-line: #e5e7eb; /* site-style grid */
  --q-soft: #eef2f7;
  --q-head: #f3f4f6; /* site-style header */
  --q-stripe: #fafbfc;
}

/* ===== Page Layout ===== */
.quota-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.quota-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 18px;
}

.quota-empty {
  background: var(--q-card);
  border: 1px solid var(--q-line);
  border-radius: 12px;
  padding: 16px;
}

/* each flight is a “page” */
.quota-sheet {
  background: var(--q-card);
  border: 1px solid var(--q-line);
  border-radius: 14px;
  padding: 14px 14px 18px;
  margin: 18px 0 22px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}

.quota-sheet__header {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px 8px 12px;
}

.quota-sheet__title {
  text-align: center;
}

.quota-sheet__h1 {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 18px;
  color: var(--q-ink);
}

.quota-sheet__h2 {
  margin-top: 2px;
  color: var(--q-muted);
  font-size: 12px;
}

/* ===== Course strip (replaces Excel header look) ===== */
.quota-courses {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

.quota-course {
  border: 1px solid var(--q-line);
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
  background: #fff;
}

.qc-name {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.2px;
  color: var(--q-ink);
}

.qc-date {
  font-size: 11px;
  color: var(--q-muted);
  margin-top: 2px;
}

/* ===== Table Wrap ===== */
.quota-table-wrap {
  overflow: auto;
}

/* ===== Table Base ===== */
.quota-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  border: 1px solid var(--q-line);
}

.quota-table th,
.quota-table td {
  border: 1px solid var(--q-line);
  padding: 6px 6px;
  vertical-align: middle;
}

/* Header row (site-style, not black) */
.quota-table thead th {
  background: var(--q-head);
  color: var(--q-ink);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

/* ===== Column sizing (fit 5 rounds across) ===== */
.q-col-player {
  width: 138px;
}
.q-col-lbl {
  width: 38px;
} /* Tee/HCP/Quota label */
.q-col-val {
  width: 78px;
} /* Gold/6/48 */
.q-col-pts {
  width: 72px;
} /* Stableford + Delta */

/* ===== Player cell ===== */
.q-playercell {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
  text-align: center;
  font-weight: 500;
  background: #fff;
}

.q-name {
  font-size: 12px;
  font-weight: 650; /* slightly stronger only */
  margin: 0 !important;
  line-height: 1.35;
  margin-bottom: 4px;
  color: var(--q-ink);
}

.q-small {
  font-size: 11px;
  font-weight: 500;
  margin: 0 !important;
  line-height: 1.35;
  color: var(--q-ink);
}

.q-small.muted,
.muted {
  color: var(--q-muted);
  font-weight: 500;
}

.q-index {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500; /* not bold */
  color: var(--q-ink);
}

/* ===== Striping by player block ===== */
/* apply pblock--odd / pblock--even to ALL 3 rows for a player */
.pblock--even td {
  background: #fff;
}
.pblock--odd td {
  background: var(--q-stripe);
}

/* keep player cell matching the stripe */
.pblock--even .q-playercell {
  background: #fff;
}
.pblock--odd .q-playercell {
  background: var(--q-stripe);
}

/* ===== Row spacing ===== */
.q-row--top td {
  padding-top: 7px;
  padding-bottom: 7px;
}

.q-row--mid td,
.q-row--bottom td {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  line-height: 1.05;
}

/* subtle separation between player blocks */
.q-row--bottom td {
  padding-bottom: 8px;
}

/* ===== Label/Value cells (Tee/HCP/Quota) ===== */
.q-lbl {
  font-size: 10px;
  font-weight: 500;
  color: var(--q-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: left !important;
  opacity: 0.9;
}

.q-row--top .q-lbl {
  font-size: 9px; /* reduce tee label */
}

.q-val {
  font-size: 12px;
  font-weight: 600; /* “strong” but not bold-bold */
  color: var(--q-ink);
  text-align: center !important; /* stop “tee value floating right” */
  white-space: nowrap;
  line-height: 1.1;
}

/* HCP + Quota values slightly smaller */
.q-row--mid .q-val,
.q-row--bottom .q-val {
  font-size: 11px;
  font-weight: 600;
}

/* ===== Stableford / Delta stacked blocks ===== */
.q-pts,
.q-delta {
  text-align: center !important;
  vertical-align: middle;
}

.qcell-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.qcell-lbl {
  font-size: 10px;
  font-weight: 500;
  color: var(--q-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  margin-bottom: 2px;
}

.qcell-val {
  font-size: 12px;
  font-weight: 600; /* match other values */
  color: var(--q-ink);
  line-height: 1.1;
  text-align: center;
  margin-top: 1px;
}

/* Delta number must not appear larger than others */
.q-delta .qcell-val {
  font-size: 12px;
  font-weight: 600;
}

/* If Stableford points are rendered into a “blank” td */
.q-blank {
  text-align: center !important;
  font-size: 12px;
  font-weight: 600;
  color: var(--q-ink);
  background: transparent;
}

/* ===== Optional: make tee values fit better ===== */
.q-row--top .q-val {
  /* choose ONE behavior */
  /* overflow: hidden; text-overflow: ellipsis; */
  white-space: normal;
}

/* ===== Print ===== */
@media print {
  body {
    background: #fff !important;
  }
  .quota-wrap {
    max-width: none;
    padding: 0;
  }
  .quota-meta,
  .page-title,
  #header,
  #nav,
  header#header {
    display: none !important;
  }

  .quota-sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    page-break-after: always;
  }

  .quota-table-wrap {
    overflow: visible;
  }
  .quota-table {
    width: 100%;
  }
}

/* ===== Player Block Striping ===== */

:root {
  --q-stripe: #fafbfc;
}

.quota-table tbody tr.pblock--odd td {
  background: var(--q-stripe) !important;
}

.quota-table tbody tr.pblock--even td {
  background: #fff !important;
}

/* Rowspan player cell must follow striping */
.quota-table tbody tr.pblock--odd td.q-playercell {
  background: var(--q-stripe) !important;
}

.quota-table tbody tr.pblock--even td.q-playercell {
  background: #fff !important;
}
/* Player block striping (works for .quota-table OR .quota-table) */
.quota-table tbody tr.pblock--odd > td,
.quota-table tbody tr.pblock--odd > td {
  background: #fafbfc !important;
}

.quota-table tbody tr.pblock--even > td,
.quota-table tbody tr.pblock--even > td {
  background: #fff !important;
}

/* Ensure the rowspan player cell follows striping */
.quota-table tbody tr.pblock--odd td.q-playercell,
.quota-table tbody tr.pblock--odd td.q-playercell {
  background: #fafbfc !important;
}

.quota-table tbody tr.pblock--even td.q-playercell,
.quota-table tbody tr.pblock--even td.q-playercell {
  background: #fff !important;
}
/* Tee row should feel like a compact block header, not an extra row */
.q-row--tee td {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
}

.q-tee-span {
  text-align: center;
  font-size: 12px;
  line-height: 1.1;
  padding: 4px 6px !important;
  vertical-align: middle;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.q-tee-lbl {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 6px;
}

/* Tee label + value share same visual weight */
.q-tee-lbl,
.q-tee-val {
  display: inline;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
}
/* Center Tee label+value WITHOUT flex on the <td> */
.quota-table td.q-tee-span {
  text-align: center !important;
  padding: 4px 6px !important;
  white-space: nowrap;
}

/* Make sure the inner spans behave like normal inline text */
.quota-table td.q-tee-span .q-tee-lbl,
.quota-table td.q-tee-span .q-tee-val {
  display: inline !important; /* not inline-block */
  float: none !important;
  margin: 0 !important;
}

.quota-table tr.q-row--tee td {
  padding-top: 8px !important;
  padding-bottom: 6px !important;
}

/* Darker separators framing each player block */
/* Top separator */
.quota-table tbody tr.q-row--tee td {
  border-top: 1.5px solid rgba(17, 24, 39, 0.28);
}

/* Bottom separator across round columns */
.quota-table tbody tr.q-row--bottom td {
  border-bottom: 1.5px solid rgba(17, 24, 39, 0.28);
}

/* CRITICAL: also draw bottom line on rowspan player cell */
.quota-table tbody td.q-playercell {
  border-bottom: 1.5px solid rgba(17, 24, 39, 0.28);
}

.quota-table td.q-lbl {
  border-right: none;
}
.quota-table td.q-val {
  border-left: none;
}

/* ===== Controls bar ===== */
.quota-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 10px 0 10px;
}

.quota-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.qpill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--q-line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: var(--q-ink);
}

.qpill strong {
  font-weight: 700;
}

.qpill--good {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.qpill--warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
}

.quota-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--q-line);
  color: var(--q-ink);
  background: #fff;
}

.qbtn--soft:hover {
  background: var(--q-head);
}

/* ===== Flight filter chips ===== */
.quota-flight-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

.qchip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--q-line);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--q-ink);
}

.qchip:hover {
  background: var(--q-head);
}

.qchip.is-active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

/* ===== Print behavior ===== */
@media print {
  .quota-controls,
  .quota-flight-filters,
  .quota-courses {
    display: none !important;
  } /* optional: hide course pills if you want */

  .quota-sheet {
    page-break-after: always;
  }
}

.quota-flight-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 18px;
}

.qchip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--q-line);
  background: #fff;
  color: var(--q-ink);
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
}

.qchip:hover {
  background: var(--q-head);
}

.qchip.is-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
