/* PicklePinas — shared styles for the public site and the admin page */
:root {
  --brand: #14403a;
  --brand-2: #1e5a51;
  --brand-soft: #e4efe9;
  --accent: #c8f05a;
  --accent-ink: #1f3a05;
  --bg: #f6f5ef;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --ink: #142320;
  --muted: #5b6a66;
  --line: #e2e0d6;
  --ok: #067647;  --ok-bg: #dcfae6;
  --warn: #93370d; --warn-bg: #fef0c7;
  --bad: #b42318;  --bad-bg: #fee4e2;
  --info: #175cd3; --info-bg: #dbeafe;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 35, 32, .06), 0 6px 20px rgba(20, 35, 32, .06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--brand-2); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: .01em; }
.logo-mark { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; flex: none; }
.logo-mark svg { width: 20px; height: 20px; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a { color: #e6f1ec; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a.active { background: rgba(255, 255, 255, .12); color: #fff; }
.nav .btn { margin-left: 6px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 10px; padding: 7px 10px; font: inherit; cursor: pointer; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--brand); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; gap: 2px; }
  .nav.open { display: flex; }
  .nav .btn { margin: 8px 0 0; }
}

.demo-bar { background: var(--warn-bg); color: var(--warn); font-size: .88rem; text-align: center; padding: 8px 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 10px 18px; font: 600 .95rem/1.2 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #b9e443; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c9c6b8; }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #f3c3be; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }

/* Hero */
.hero { background: radial-gradient(1200px 400px at 85% -10%, rgba(200,240,90,.28), transparent 60%), var(--brand); color: #fff; padding: 56px 0 72px; }
.hero h1 { max-width: 720px; }
.hero p { color: #d3e6de; font-size: 1.08rem; max-width: 620px; }
.hero-search { margin-top: 24px; background: var(--surface); border-radius: 18px; padding: 10px; display: grid; grid-template-columns: 1.6fr 1fr auto; gap: 8px; max-width: 760px; box-shadow: var(--shadow); }
.hero-search input, .hero-search select { border: 0; background: var(--surface-2); }
@media (max-width: 640px) { .hero-search { grid-template-columns: 1fr; } }
.hero-stats { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 1.5rem; color: var(--accent); }
.hero-stats span { color: #cfe2da; font-size: .9rem; }

/* Sections and cards */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 16px 18px; }
.card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(20,35,32,.12); }
.card-link h3 { margin-bottom: 4px; }
.thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--brand-2), var(--brand)); position: relative; overflow: hidden; display: grid; place-items: center; color: var(--accent); font-weight: 800; font-size: 2rem; }
.thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.thumb .tag { position: absolute; top: 10px; left: 10px; }
.thumb-court { background-image: linear-gradient(90deg, transparent 49.4%, rgba(255,255,255,.35) 49.4%, rgba(255,255,255,.35) 50.6%, transparent 50.6%), linear-gradient(0deg, transparent 32%, rgba(255,255,255,.22) 32%, rgba(255,255,255,.22) 33%, transparent 33%, transparent 67%, rgba(255,255,255,.22) 67%, rgba(255,255,255,.22) 68%, transparent 68%), linear-gradient(135deg, #2b7a5f, #14403a); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: .88rem; }
.price { font-weight: 800; color: var(--brand); }
.price small { font-weight: 500; color: var(--muted); }
.card-foot { margin-top: auto; padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; background: #eceae2; color: #444; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-accent { background: var(--accent); color: var(--accent-ink); }
.stars { color: #e3a008; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #d6d3c8; }

/* Forms */
label { font-weight: 600; font-size: .88rem; display: block; margin-bottom: 5px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 42px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid rgba(200,240,90,.7); outline-offset: 1px; border-color: var(--brand-2); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
.field { margin-bottom: 14px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: .92rem; }
.alert-bad { background: var(--bad-bg); color: var(--bad); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-info { background: var(--brand-soft); color: var(--brand); }

/* Filters */
.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } .filters .grow { grid-column: 1 / -1; } }

/* Profile page */
.profile-hero { position: relative; border-radius: var(--radius); overflow: hidden; }
.profile-hero .thumb { aspect-ratio: 21 / 8; font-size: 3rem; }
@media (max-width: 640px) { .profile-hero .thumb { aspect-ratio: 16 / 9; } }
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; margin-top: 24px; align-items: start; }
@media (max-width: 900px) { .profile { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 84px; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.facts li:last-child { border-bottom: 0; }
.facts span:first-child { color: var(--muted); }
.facts span:last-child { text-align: right; font-weight: 600; }
.review { padding: 14px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.crumbs { font-size: .88rem; margin: 18px 0 12px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--brand); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.coach-card { display: flex; gap: 14px; align-items: center; }

/* Event list */
.event { display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; align-items: center; padding: 14px 18px; }
.event + .event { border-top: 1px solid var(--line); }
.datebox { background: var(--brand-soft); color: var(--brand); border-radius: 12px; text-align: center; padding: 8px 4px; line-height: 1.1; }
.datebox b { display: block; font-size: 1.5rem; }
.datebox span { font-size: .75rem; font-weight: 700; text-transform: uppercase; }
@media (max-width: 640px) { .event { grid-template-columns: 60px 1fr; } .event > :last-child { grid-column: 1 / -1; } }

/* Booking */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slots > span, .slots > div { grid-column: 1 / -1; }
.slot { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 6px; text-align: center; cursor: pointer; font: 600 .9rem var(--font); color: var(--ink); }
.slot small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }
.slot:hover:not(:disabled) { border-color: var(--brand-2); }
.slot.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.slot.on small { color: #cfe2da; }
.slot.in { background: var(--brand-soft); border-color: var(--brand-2); }
.slot:disabled { background: #f0eee7; color: #a09d92; cursor: not-allowed; text-decoration: line-through; }
.rental-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rental-row input { width: 76px; }
.summary-line { display: flex; justify-content: space-between; padding: 5px 0; font-size: .92rem; }
.summary-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 1.1rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; margin-bottom: 10px; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.site-footer { background: #0f2f2a; color: #b9cfc8; padding: 32px 0; margin-top: 40px; font-size: .9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: #e6f1ec; }
.site-footer .links { display: flex; gap: 14px; flex-wrap: wrap; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; font-size: .92rem; max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); }

/* Dialog */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(680px, calc(100% - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(15, 30, 27, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg-head h3 { margin: 0; }
.dlg-body { padding: 18px 20px; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); flex-wrap: wrap; }
.dlg-foot .left { margin-right: auto; }
.x { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 10px; }
.side a { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .93rem; margin-bottom: 2px; }
.side a:hover { background: var(--surface-2); }
.side a.active { background: var(--brand-soft); color: var(--brand); }
.side .count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: .75rem; padding: 1px 8px; }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 10px 4px; }
.admin-main { padding: 24px; min-width: 0; }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .side { display: flex; overflow-x: auto; gap: 4px; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); position: sticky; top: 64px; z-index: 5; }
  .side a { white-space: nowrap; margin: 0; gap: 6px; }
  .side hr { display: none; }
  .admin-main { padding: 16px; }
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat .value { font-size: 1.8rem; font-weight: 800; color: var(--brand); line-height: 1.2; margin-top: 4px; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; flex: 1 1 160px; max-width: 280px; }
.toolbar .spacer { flex: 1; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
td .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.login-box { max-width: 400px; margin: 60px auto; padding: 28px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.list-item { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.list-item:last-child { border-bottom: 0; }
.court-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 180px; overflow: auto; }
