/* =====================================================================
   PicklePlay Court Club — stylesheet
   Palette is taken from the courts themselves: deep green playing surface,
   chalk-white lines, optic-yellow ball, warm sand for the surrounds.
   ===================================================================== */

:root {
  --court:  #10403B;   /* playing surface */
  --deep:   #082A27;   /* shaded court, headers */
  --chalk:  #F4F8F5;   /* court lines, page background */
  --sand:   #E8E2D2;   /* surrounds */
  --ball:   #D9F20B;   /* optic yellow ball */
  --ink:    #14201E;
  --muted:  #5C6F6B;
  --danger: #B23A2E;
  --ok:     #23795B;
  --warn:   #B8791B;

  --radius: 10px;
  --shadow: 0 10px 30px rgba(8, 42, 39, .10);
  --wrap: 1120px;
  --font-head: 'Archivo', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--chalk);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  font-weight: 700;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; max-width: 68ch; }
a { color: var(--court); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--deep);
  color: var(--chalk);
}
.nav-inner {
  display: flex; align-items: center; gap: 1.25rem;
  padding: .85rem 0;
}
.brand {
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem;
  color: var(--chalk); text-decoration: none; display: flex; align-items: center; gap: .55rem;
}
.brand .dot {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--ball);
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .18);
}
.nav-links { display: flex; gap: 1.1rem; align-items: center; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  color: #C9D8D3; text-decoration: none; font-size: .95rem; padding: .3rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a.active { color: #fff; border-bottom-color: var(--ball); }
.nav-toggle {
  display: none; background: none; border: 1px solid #2F5450; color: var(--chalk);
  border-radius: 8px; padding: .35rem .6rem; font-size: 1.1rem; cursor: pointer;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-family: var(--font-head); font-weight: 600; font-size: .95rem;
  padding: .7rem 1.3rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ball); color: var(--deep); }
.btn-primary:hover { background: #E6FF3D; }
.btn-dark { background: var(--court); color: var(--chalk); }
.btn-dark:hover { background: var(--deep); }
.btn-ghost { border-color: currentColor; color: var(--court); background: transparent; }
.btn-ghost:hover { background: rgba(16, 64, 59, .07); }
.btn-sm { padding: .38rem .8rem; font-size: .84rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero { background: var(--court); color: var(--chalk); padding: 4rem 0 4.5rem; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero h1 { color: #fff; }
.hero p { color: #CFE0DA; font-size: 1.05rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-stats { display: flex; gap: 2rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero-stats div span { display: block; font-family: var(--font-head); font-size: 1.8rem; color: var(--ball); }
.hero-stats div small { color: #A9C2BB; }

/* the court drawing: the most characteristic object in this business */
.court-art {
  aspect-ratio: 4 / 3; width: 100%; border-radius: var(--radius);
  background: #14514A; border: 3px solid rgba(244, 248, 245, .9);
  position: relative; box-shadow: var(--shadow);
}
.court-art::before, .court-art::after {
  content: ''; position: absolute; background: rgba(244, 248, 245, .85);
}
.court-art::before { left: 0; right: 0; top: 50%; height: 3px; }     /* net line */
.court-art::after  { top: 8%; bottom: 8%; left: 50%; width: 3px; }   /* center line */
.kitchen {
  position: absolute; left: 6%; right: 6%; top: 36%; height: 28%;
  border-top: 3px solid rgba(244, 248, 245, .85);
  border-bottom: 3px solid rgba(244, 248, 245, .85);
  background: rgba(217, 242, 11, .08);
}
.ball {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ball); right: 16%; top: 18%;
  box-shadow: inset -5px -5px 0 rgba(0, 0, 0, .15);
}

/* ---------- sections ---------- */
.section { padding: 3.5rem 0; }
.section-dark { background: var(--deep); color: var(--chalk); }
.section-sand { background: var(--sand); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.lead { font-size: 1.05rem; color: var(--muted); }
.section-dark .lead { color: #A9C2BB; }
.eyebrow {
  display: inline-block; margin-bottom: .9rem; color: var(--ball);
  font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.about-hero { padding: 5.5rem 0 5rem; }
.about-hero h1 { max-width: 760px; margin-bottom: .8rem; }
.about-hero .lead { max-width: 620px; font-size: 1.15rem; }
.about-story { background: #fff; }
.about-intro { max-width: 760px; margin-bottom: 2rem; }
.about-intro h2, .about-card h2 { margin-bottom: .8rem; }
.about-intro p { font-size: 1.08rem; color: var(--muted); }
.about-values { margin-top: 1.5rem; }
.about-card {
  background: #fff; border: 1px solid #DCE6E1; border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow);
}
.about-card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.2rem; margin-bottom: .9rem;
  border-radius: 50%; background: var(--ball); color: var(--deep);
  font-family: var(--font-head); font-size: 1.3rem;
}
.about-card p { color: var(--muted); }
.about-details .about-card { height: 100%; }
.about-list p {
  margin: 0; padding: .7rem 0; border-bottom: 1px solid #E5ECE8;
  color: var(--ink);
}
.about-list p:last-child { border-bottom: 0; padding-bottom: 0; }
.about-visit { background: var(--court); color: var(--chalk); }
.about-visit .lead { color: #CFE0DA; }
.contact-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.5rem; margin-top: 2rem; }
.contact-details p { color: #CFE0DA; margin: 0; }
.contact-details strong { color: var(--ball); font-family: var(--font-head); }
.contact-details a { color: #CFE0DA; }
.about-map iframe { display: block; min-height: 340px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid #DCE6E1; border-radius: var(--radius);
  padding: 1.25rem;
}
.card h3 { margin-bottom: .35rem; }
.card .price { font-family: var(--font-head); font-size: 1.35rem; color: var(--court); }
.card .unit { color: var(--muted); font-size: .85rem; }

.court-card { border-left: 6px solid var(--ball); }
.court-card .rate { font-family: var(--font-head); font-size: 1.4rem; }
.court-image-link { display: block; margin: -1.25rem -1.25rem 1rem; }
.court-image-link:focus-visible { outline: 3px solid rgba(217, 242, 11, .8); outline-offset: 2px; }
.court-image { display: block; width: 100%; height: 180px; object-fit: cover; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }

.tag {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  padding: .2rem .6rem; border-radius: 999px; background: var(--sand); color: var(--deep);
}

/* ---------- status pills ---------- */
.pill { display: inline-block; padding: .22rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.pill-Submitted   { background: #E4EEF8; color: #1D4E7C; }
.pill-Approved    { background: #E0F3E9; color: var(--ok); }
.pill-InProgress  { background: #FBF3D8; color: var(--warn); }
.pill-Completed   { background: #E3E9E7; color: var(--deep); }
.pill-Cancelled,
.pill-Rejected,
.pill-Noshow      { background: #F7E2DF; color: var(--danger); }
.pill-Paid        { background: #E0F3E9; color: var(--ok); }
.pill-Unpaid      { background: #F7E2DF; color: var(--danger); }
.pill-Active      { background: #E0F3E9; color: var(--ok); }
.pill-Pending     { background: #FBF3D8; color: var(--warn); }
.pill-Inactive    { background: #E3E9E7; color: var(--muted); }
.pill-Declined    { background: #F7E2DF; color: var(--danger); }

/* ---------- forms ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; color: var(--deep); }
input, select, textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid #C6D4CF; border-radius: 8px;
  font-family: inherit; font-size: .95rem; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 3px solid rgba(217, 242, 11, .55); outline-offset: 2px; border-color: var(--court);
}
textarea { min-height: 110px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.help { font-size: .82rem; color: var(--muted); }

.auth-wrap { display: grid; place-items: center; padding: 3rem 0; }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; width: min(100%, 460px); }
.auth-card.wide { width: min(100%, 640px); }

/* ---------- alerts ---------- */
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; border: 1px solid transparent; }
.alert-error   { background: #F9E5E2; color: #7E2318; border-color: #E5BDB7; }
.alert-ok      { background: #E0F3E9; color: #14543D; border-color: #B6DECB; }
.alert-info    { background: #E8F0F8; color: #1D4E7C; border-color: #C3D8EA; }
.alert-warn    { background: #FBF3D8; color: #7A5210; border-color: #E6D5A0; }
.alert[hidden] { display: none; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #DCE6E1; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .7rem .85rem; text-align: left; border-bottom: 1px solid #EBF1EE; white-space: nowrap; }
th { background: #F1F6F3; font-family: var(--font-head); font-size: .82rem; color: var(--deep); }
tbody tr:hover { background: #FAFCFA; }
td.actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }

.pager { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; padding: .75rem; }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 62px); }
.side { background: var(--deep); color: #C9D8D3; padding: 1.5rem 0; }
.side h4 { color: #7FA79E; font-size: .78rem; font-family: var(--font-body); font-weight: 600; padding: 0 1.25rem; margin: 1.2rem 0 .4rem; }
.side button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: #C9D8D3; padding: .6rem 1.25rem; font: inherit; font-size: .92rem; cursor: pointer;
  border-left: 3px solid transparent;
}
.side button:hover { background: #0C3733; color: #fff; }
.side button.active { background: #0C3733; color: #fff; border-left-color: var(--ball); }
.main { padding: 1.75rem; background: var(--chalk); }
.panel { background: #fff; border: 1px solid #DCE6E1; border-radius: var(--radius); padding: 1.35rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: 1.35rem; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.toolbar .field { margin-bottom: 0; }
.toolbar input, .toolbar select { min-width: 150px; }

.reports-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.report-card { min-width: 0; border: 1px solid #DCE6E1; border-radius: var(--radius); padding: 1rem; background: #FCFEFD; }
.report-card h3 { font-size: 1rem; }
.report-chart { height: 260px; position: relative; }
.report-analysis { color: var(--muted); font-size: .86rem; margin: .75rem 0 0; }
.report-list { list-style: none; padding: 0; margin: 0; }
.report-list li { display: flex; justify-content: space-between; gap: .75rem; border-bottom: 1px solid #E4ECE8; padding: .55rem 0; font-size: .9rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: #fff; border: 1px solid #DCE6E1; border-radius: var(--radius); padding: 1rem 1.1rem; border-top: 4px solid var(--ball); }
.stat b { display: block; font-family: var(--font-head); font-size: 1.9rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }

.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }
.report-chart { border: 1px solid #DCE6E1; border-radius: var(--radius); padding: 1.1rem; background: #FCFEFD; }
.report-chart h3 { font-size: 1rem; }
.bar-chart { height: 250px; display: flex; align-items: end; gap: .35rem; padding: 1.5rem .25rem 0; border-bottom: 1px solid #C6D4CF; }
.bar-column { min-width: 0; flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: .35rem; }
.bar-value { color: var(--muted); font-size: .68rem; white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.bar-track { width: 100%; height: 78%; display: flex; align-items: end; background: #EEF4F1; border-radius: 5px 5px 0 0; }
.bar-fill { width: 100%; min-height: 0; background: var(--court); border-radius: 5px 5px 0 0; }
.bar-label { color: var(--muted); font-size: .72rem; }
.report-table-title { margin-top: 1.75rem; font-size: 1.1rem; }

/* ---------- time slot grid ---------- */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.slot {
  padding: .55rem .4rem; border-radius: 8px; border: 1px solid #C6D4CF; background: #fff;
  font-size: .85rem; text-align: center; cursor: pointer; font-family: var(--font-head);
}
.slot small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .7rem; color: var(--muted); }
.slot:hover:not(:disabled) { border-color: var(--court); }
.slot.selected { background: var(--ball); border-color: var(--deep); color: var(--deep); }
.slot.booked { background: #F7E2DF; color: #8A3226; cursor: not-allowed; border-color: #E5BDB7; }
.slot.blocked { background: #E3E9E7; color: var(--muted); cursor: not-allowed; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: .75rem 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: middle; }
.availability-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.availability-card { margin-bottom: 0; }
.availability-card-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.availability-card-head h3 { margin-bottom: .2rem; }
.availability-open { color: var(--ok); font-size: .9rem; white-space: nowrap; }
.availability-full { color: var(--danger); font-size: .9rem; white-space: nowrap; }

/* ---------- bill ---------- */
.bill { border: 1px solid #DCE6E1; border-radius: var(--radius); padding: 1rem; background: #FAFCFA; }
.bill-line { display: flex; justify-content: space-between; padding: .3rem 0; font-size: .92rem; }
.bill-total { display: flex; justify-content: space-between; border-top: 2px solid var(--deep); margin-top: .5rem; padding-top: .5rem; font-family: var(--font-head); font-size: 1.15rem; }

/* ---------- timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid #DCE6E1; }
.timeline li { position: relative; padding: 0 0 1rem 1.1rem; font-size: .9rem; }
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px;
  border-radius: 50%; background: var(--ball); border: 2px solid #fff;
}
.timeline time { display: block; color: var(--muted); font-size: .78rem; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 42, 39, .55); display: grid; place-items: center;
  padding: 1rem; z-index: 60;
}
.modal-backdrop[hidden] { display: none; }
.modal { background: #fff; border-radius: var(--radius); padding: 1.5rem; width: min(100%, 540px); max-height: 90vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-head h3 { margin: 0; }
.icon-btn { background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: var(--muted); line-height: 1; }

/* ---------- daily board ---------- */
.board { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.board-col { background: #fff; border: 1px solid #DCE6E1; border-radius: var(--radius); overflow: hidden; }
.board-col header { background: var(--court); color: var(--chalk); padding: .6rem .9rem; font-family: var(--font-head); }
.board-col ul { list-style: none; margin: 0; padding: .6rem; display: grid; gap: .5rem; }
.board-col li { border: 1px solid #E4ECE8; border-left: 4px solid var(--ball); border-radius: 6px; padding: .5rem .6rem; font-size: .85rem; }
.board-col li.block { border-left-color: var(--muted); background: #F4F6F5; }

/* ---------- footer ---------- */
.footer { background: var(--deep); color: #9FB8B2; padding: 2.5rem 0 1.5rem; font-size: .9rem; }
.footer a { color: #CFE0DA; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 1.5rem; }
.footer h4 { color: var(--chalk); font-family: var(--font-head); margin-bottom: .5rem; }
.footer-bottom { border-top: 1px solid #143F3A; padding-top: 1rem; }

/* ---------- receipt ---------- */
.receipt { background: #fff; max-width: 620px; margin: 2rem auto; padding: 2rem; border: 1px solid #DCE6E1; border-radius: var(--radius); }
.receipt h2 { margin-bottom: .2rem; }
.receipt table { font-size: .9rem; }
.receipt th, .receipt td { white-space: normal; }

@media print {
  .nav, .footer, .no-print { display: none !important; }
  body { background: #fff; }
  .receipt { border: 0; box-shadow: none; margin: 0; max-width: none; }
  .side, .report-filters, .report-actions { display: none !important; }
  .reports-grid { grid-template-columns: 1fr 1fr; }
  .report-card { break-inside: avoid; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .grid-3, .grid-4, .footer-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .report-grid, .reports-grid { grid-template-columns: 1fr; }
  .dash { grid-template-columns: 1fr; }
  .side { display: flex; overflow-x: auto; padding: .5rem; gap: .25rem; }
  .side h4 { display: none; }
  .side button { width: auto; white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; border-radius: 6px; }
  .side button.active { border-left: 0; border-bottom-color: var(--ball); }
}
@media (max-width: 680px) {
  .grid-2, .grid-4, .form-row { grid-template-columns: 1fr; }
  .bar-chart { gap: .15rem; }
  .bar-value { font-size: .58rem; }
  .nav-toggle { display: block; margin-left: auto; }
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: .25rem; padding-bottom: .75rem; }
  .nav-links.open { display: flex; }
  .nav-inner { flex-wrap: wrap; }
  .main { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
