@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Nunito+Sans:opsz,wght@6..12,400;6..12,600;6..12,700&display=swap');
:root {
  /* Sharkies Party Time: ocean blue, surf orange, sunny yellow, palm green */
  --navy: #0b4f8a; --ocean: #1088d0; --deep: #073a66; --surf: #f5821f; --surf-d: #d9650a; --sun: #ffc93c; --palm: #3aa655;
  --ink: #0f2a40; --mute: #557086; --line: #d6e7f1; --bg: #eef8fc; --card: #fff;
  --cyan: #0e9fc0; --cyan-soft: #e3f6fb; --pink: #e2458f; --green: #0a7d4f; --green-soft: #e3f5ec; --amber: #b86e00; --amber-soft: #fff3dc; --red: #c0392b; --red-soft: #fdeceb;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #e6eef6; --mute: #9aabbc; --line: #24425c; --bg: #071a2b; --card: #0e2a42; --cyan-soft: #0f3343; --green-soft: #0e3325; --amber-soft: #3a2a0c; --red-soft: #3a1714; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 'Nunito Sans', system-ui, sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3, .brand { font-family: Fredoka, system-ui, sans-serif; font-weight: 600; margin: 0; }
a { color: var(--cyan); }
button, input, textarea { font: inherit; color: inherit; }
input, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
label { display: block; font-size: 13px; font-weight: 700; color: var(--mute); margin-bottom: 4px; }
.btn { text-decoration: none; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.btn:hover { border-color: var(--mute); }
.btn.pri { background: var(--surf); color: #fff; border-color: var(--surf); box-shadow: 0 3px 0 var(--surf-d); }
.btn.pri:hover { background: var(--surf-d); border-color: var(--surf-d); }
.btn.go { background: var(--green); color: #fff; border-color: var(--green); }
.btn.warn { color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }

/* top bar: ocean with a wave edge, logo badge hanging over it */
.top { position: relative; background: linear-gradient(100deg, var(--deep) 0%, var(--navy) 45%, var(--ocean) 100%); color: #fff; padding-bottom: 14px; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 22px; background: var(--bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 22' preserveAspectRatio='none'%3E%3Cpath d='M0 12 C150 0 300 24 450 12 S750 0 900 12 S1100 24 1200 10 V22 H0Z'/%3E%3C/svg%3E") center/100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 22' preserveAspectRatio='none'%3E%3Cpath d='M0 12 C150 0 300 24 450 12 S750 0 900 12 S1100 24 1200 10 V22 H0Z'/%3E%3C/svg%3E") center/100% 100%; }
.top .in { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 18px; min-height: 74px; flex-wrap: wrap; position: relative; z-index: 1; }
.brand { font-size: 20px; display: flex; align-items: center; gap: 10px; line-height: 1.05; }
.brand .bt small { display: block; font-family: 'Nunito Sans', sans-serif; font-weight: 700; font-size: 12px; color: var(--sun); letter-spacing: .02em; }
.brand .logo { height: 66px; margin: 4px 0; filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); transition: transform .3s; }
.brand:hover .logo { transform: rotate(-4deg) scale(1.04); }
.login-logo { display: block; width: 150px; margin: 0 auto 4px; }
.login h1 { text-align: center; }
body.review .rlogo { display: block; width: 120px; margin: -6px auto 6px; }
.brand .dot { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(#ffc94d 0 25%, #e2458f 0 50%, #12b5d6 0 75%, #54c26a 0); }
.top nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.top nav a { color: #cfe0ee; text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 700; }
.top nav a.on, .top nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.top nav a.on { box-shadow: inset 0 -3px 0 var(--sun); }
.top .who { font-size: 13px; color: #cfe0ee; display: flex; gap: 10px; align-items: center; }
.top .who button { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
main.page { max-width: 1100px; margin: 0 auto; padding: 22px 16px 60px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.head h1 { font-size: 26px; }
.tabs { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 700; color: var(--mute); }
.tabs button.on { background: var(--ocean); color: #fff; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--surf); color: #fff; font-size: 12px; text-align: center; margin-left: 4px; }

/* booking list */
.month { font-family: Fredoka; font-weight: 600; color: var(--mute); margin: 22px 0 8px; }
.list { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 62px 1fr auto; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; text-align: left; width: 100%; }
.row:hover { border-color: var(--ocean); box-shadow: 0 4px 14px rgba(16,136,208,.12); }
.day { text-align: center; line-height: 1.1; border-radius: 10px; padding: 6px 0; background: var(--cyan-soft); }
.day b { display: block; font-family: Fredoka; font-size: 24px; }
.day small { font-size: 11px; font-weight: 700; color: var(--mute); text-transform: uppercase; }
.row h3 { font-size: 17px; }
.row .meta { color: var(--mute); font-size: 13px; }
.pill { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.pill.pending { background: var(--amber-soft); color: var(--amber); }
.pill.approved { background: var(--green-soft); color: var(--green); }
.pill.declined, .pill.cancelled { background: var(--red-soft); color: var(--red); }
.empty img { display: block; width: 120px; margin: 0 auto 10px; }
.empty { text-align: center; color: var(--mute); padding: 32px 10px; background: var(--card); border: 1px dashed var(--line); border-radius: 12px; }

/* panels and forms */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.f { margin-bottom: 12px; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.theme { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--card); cursor: pointer; display: flex; gap: 6px; align-items: center; font-weight: 700; font-size: 14px; }
.theme span { font-size: 20px; }
.theme[aria-pressed="true"] { border-color: var(--cyan); background: var(--cyan-soft); box-shadow: inset 0 0 0 1px var(--cyan); }
.detail { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.side .panel + .panel { margin-top: 12px; }
.preview { aspect-ratio: 16/9; width: 100%; border: 0; border-radius: 10px; background: #0a4e7a; }
.note { font-size: 13px; color: var(--mute); }
.err { color: var(--red); font-weight: 700; font-size: 14px; min-height: 1em; }
.ok { color: var(--green); font-weight: 700; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.status-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.secret { font-family: ui-monospace, monospace; background: var(--amber-soft); padding: 8px 10px; border-radius: 8px; user-select: all; display: inline-block; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dw { text-align: center; font-size: 12px; font-weight: 800; color: var(--mute); }
.cell { min-height: 84px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 6px; font-size: 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.cell .d { font-weight: 800; font-size: 13px; }
.cell.past { opacity: .45; cursor: default; }
.cell.today .d { color: var(--cyan); }
.cell .tag { border-radius: 6px; padding: 2px 5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .tag.approved { background: var(--green-soft); color: var(--green); }
.cell .tag.pending { background: var(--amber-soft); color: var(--amber); }
.cell .tag.blocked { background: var(--red-soft); color: var(--red); }
.cell:hover:not(.past) { border-color: var(--cyan); }
.calbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.calbar h2 { min-width: 170px; text-align: center; font-size: 20px; }
.daypop { margin-top: 14px; }
table.users { width: 100%; border-collapse: collapse; }
table.users td, table.users th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.checks label { display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--ink); font-size: 15px; }
.checks input { width: auto; }

/* sign in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(120% 80% at 50% 0%, #2bb3ee 0%, #0b4f8a 55%, #073a66 100%); }
.login .panel { border: 0; border-radius: 20px; box-shadow: 0 20px 50px rgba(0,30,60,.35); }
.login .panel { width: 100%; max-width: 380px; }
.login h1 { font-size: 26px; margin: 6px 0 14px; }

/* no-login review page (email button) */
body.review { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(120% 80% at 50% 0%, #2bb3ee 0%, #0b4f8a 55%, #073a66 100%); }
body.review .card { background: var(--card); max-width: 520px; width: 100%; border-radius: 18px; padding: 26px; }
body.review .eyebrow { margin: 0; color: var(--mute); font-weight: 700; }
body.review h1 { font-size: 28px; margin: 4px 0 8px; }
body.review .status { font-weight: 800; margin: 0 0 14px; }
body.review .status.pending { color: var(--amber); } body.review .status.approved { color: var(--green); } body.review .status.declined, body.review .status.cancelled { color: var(--red); }
body.review .status small { font-weight: 600; color: var(--mute); }
body.review .msg { background: var(--green-soft); color: var(--green); padding: 10px 12px; border-radius: 10px; font-weight: 700; }
body.review dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 18px; }
body.review dt { color: var(--mute); font-weight: 700; } body.review dd { margin: 0; white-space: pre-wrap; }
body.review .lbl { font-weight: 700; margin: 0 0 6px; }
body.review .times { margin-bottom: 16px; }
body.review .acts button { flex: 1; padding: 13px; border-radius: 10px; border: 0; font-weight: 800; font-size: 16px; cursor: pointer; }
body.review .acts .go { background: var(--green); color: #fff; }
body.review .acts .no { background: var(--red-soft); color: var(--red); }

/* custom controls (public/ui.js): no native selects or date popups */
.times { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.times > span { color: var(--mute); font-weight: 700; }
.pick { position: relative; }
.times .pick { flex: 1; min-width: 120px; }
.pick-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; font-weight: 700; text-align: left; transition: border-color .15s, box-shadow .15s; }
.pick-btn:hover:not(:disabled) { border-color: var(--ocean); }
.pick.on .pick-btn { border-color: var(--ocean); box-shadow: 0 0 0 3px rgba(16,136,208,.15); }
.pick-btn:disabled { opacity: .6; cursor: default; }
.pick-btn .pv { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-btn.empty .pv { color: var(--mute); font-weight: 600; }
.chev { width: 8px; height: 8px; border: solid var(--mute); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); flex: none; transition: transform .2s; }
.pick.on .pick-btn .chev { transform: rotate(-135deg) translate(-2px, 0); }
.cal-ic { width: 16px; height: 15px; border: 2px solid var(--ocean); border-top-width: 4px; border-radius: 4px; flex: none; }
.pick-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(7,58,102,.22); padding: 10px; width: 300px; max-width: calc(100vw - 32px); animation: pickIn .14s ease-out; }
@keyframes pickIn { from { opacity: 0; transform: translateY(-4px); } }
.pick-panel button { border: 0; background: none; cursor: pointer; border-radius: 8px; font-weight: 700; padding: 7px 0; }
.pick-panel button:hover:not(:disabled) { background: var(--cyan-soft); }
.pick-panel button[aria-selected="true"] { background: var(--surf); color: #fff; }
.pick-panel button:disabled { opacity: .3; cursor: default; }
.tp { max-height: 270px; overflow-y: auto; overscroll-behavior: contain; margin: -4px; padding: 4px; }
.tp-row { display: grid; grid-template-columns: 74px repeat(4, 1fr); gap: 2px; align-items: center; }
.tp-row + .tp-row { border-top: 1px dashed var(--line); }
.tp-h { font-family: Fredoka; font-weight: 600; color: var(--navy); font-size: 14px; }
@media (prefers-color-scheme: dark) { .tp-h { color: var(--sun); } }
.dp-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-bar b, .dp-title { font-family: Fredoka; font-weight: 600; font-size: 16px; }
.dp-title { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px !important; }
.pick-panel .nav { width: 34px; height: 34px; font-size: 22px; line-height: 1; padding: 0; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-grid .dw { font-size: 11px; font-weight: 800; color: var(--mute); padding: 4px 0; }
.dp-grid button.today:not([aria-selected="true"]) { box-shadow: inset 0 0 0 2px var(--cyan); }
.dp-years { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.dp-years button { padding: 12px 0; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.dp-foot button { padding: 6px 10px; color: var(--cyan); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 700; line-height: 1.2; text-align: left; transition: border-color .15s, background .15s; }
.chip small { display: block; font-weight: 600; font-size: 12px; color: var(--mute); }
.chip:hover:not(:disabled) { border-color: var(--ocean); }
.chip[aria-pressed="true"] { border-color: var(--cyan); background: var(--cyan-soft); box-shadow: inset 0 0 0 1px var(--cyan); }
.chip:disabled { cursor: default; opacity: .6; }

.stepper { display: flex; align-items: center; gap: 10px; background: var(--cyan-soft); border-radius: 16px; padding: 6px; width: max-content; max-width: 100%; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); color: var(--surf); font-size: 24px; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 2px 0 var(--line); transition: transform .1s; flex: none; }
.stepper button:hover:not(:disabled) { background: var(--surf); color: #fff; box-shadow: 0 2px 0 var(--surf-d); }
.stepper button:active:not(:disabled) { transform: scale(.92); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper .sv { margin: 0; display: flex; flex-direction: column; align-items: center; min-width: 74px; cursor: text; }
.stepper input { width: 70px; border: 0; background: none; padding: 0; text-align: center; font: 600 30px/1.1 Fredoka, sans-serif; color: var(--ink); }
.stepper input:focus { outline: none; }
.stepper:focus-within { box-shadow: 0 0 0 2px var(--cyan); }
.stepper .sv span { font-size: 12px; font-weight: 700; color: var(--mute); }
.stepper.empty input::placeholder { color: var(--mute); }

.toggle { display: flex; gap: 10px; align-items: center; font-weight: 600; color: var(--ink); font-size: 15px; margin: 0 0 10px; cursor: pointer; position: relative; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .sw { width: 40px; height: 24px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.toggle input:checked + .sw { background: var(--green); }
.toggle input:checked + .sw::after { transform: translateX(16px); }
.toggle input:focus-visible + .sw { outline: 2px solid var(--cyan); outline-offset: 2px; }
.toggle input:disabled + .sw { opacity: .5; }
.btn[data-sure] { background: var(--red); color: #fff; border-color: var(--red); }

@media (max-width: 760px) {
  .detail, .grid2, .grid3 { grid-template-columns: 1fr; }
  .cell { min-height: 58px; font-size: 11px; padding: 4px; }
  .cell .tag { padding: 1px 3px; }
  .row { grid-template-columns: 54px 1fr; }
  .row .pill { grid-column: 2; justify-self: start; }
  .top .in { gap: 6px 10px; }
  .top .who { margin-left: auto; }
  .top nav { order: 3; flex: 1 0 100%; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; }
  .top nav a { white-space: nowrap; padding: 6px 10px; }
  .brand .logo { height: 52px; }
  .brand { font-size: 17px; }
}
