/* Cambridge Sport camp portal */
:root {
  --navy: #06384F;
  --navy-2: #0b4a66;
  --lime: #C7F20D;
  --blue: #0077A3;
  --bg: #F3F6F7;
  --card: #ffffff;
  --line: #dde5e8;
  --text: #13262f;
  --muted: #5d7079;
  --red: #c0392b;
  --red-bg: #fdecea;
  --amber: #a86400;
  --amber-bg: #fff4dd;
  --green: #1d7a46;
  --green-bg: #e5f6ec;
  --radius: 14px;
  --head: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; color: var(--navy); margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand img { width: 180px; display: block; margin: 0 6px 18px; }
.navtoggle, .navlabel { display: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { color: #d7e6ec; padding: 6px 12px; border-radius: 10px; font-weight: 500; }
.side nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.side nav a.on { background: var(--lime); color: var(--navy); }
.side nav .navhead { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #8fb3c2; margin: 14px 12px 4px; }
.me { border-top: 1px solid rgba(255,255,255,.15); padding: 14px 8px 0; margin-top: 14px; font-size: .9rem; }
.me strong { display: block; }
.me span { color: #9fc1cf; }
.me form { margin-top: 8px; }
.me button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); }
.main { padding: 28px 32px 60px; max-width: 1200px; width: 100%; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead p { margin: 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card > h2:first-child { margin-bottom: 12px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 18px; }

/* week cards */
.weekcard { border-top: 5px solid var(--lime); }
.weekcard .count { font-family: var(--head); font-size: 2.4rem; font-weight: 700; color: var(--navy); line-height: 1; }
.weekcard .count small { font-size: .9rem; font-weight: 500; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: .9rem; }
.stats b { display: block; font-family: var(--head); font-size: 1.15rem; color: var(--navy); }
progress { width: 100%; height: 10px; border: 0; border-radius: 99px; background: #e6eef1; overflow: hidden; appearance: none; margin: 10px 0 2px; }
progress::-webkit-progress-bar { background: #e6eef1; border-radius: 99px; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--blue); border-radius: 99px; }

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); }

/* task list */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .title { font-weight: 600; color: var(--text); }
.task .meta { font-size: .84rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.task .due { font-size: .85rem; white-space: nowrap; text-align: right; color: var(--muted); }
.task.late .due { color: var(--red); font-weight: 600; }
.tick { margin: 0; }
.tick button { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #9fb4bd; background: #fff; padding: 0; cursor: pointer; font-size: 14px; line-height: 1; color: transparent; }
.tick button:hover { border-color: var(--blue); }
.tick button.isdone { background: var(--green); border-color: var(--green); color: #fff; }
.tick button.doing { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.group-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 4px; }
.group-h h3 { margin: 0; }
.group-h.overdue h3 { color: var(--red); }
details.donegroup > summary { cursor: pointer; font-family: var(--head); font-weight: 600; color: var(--muted); margin-top: 18px; }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; background: #e8eff2; color: var(--navy); white-space: nowrap; }
.b-red { background: var(--red-bg); color: var(--red); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-green { background: var(--green-bg); color: var(--green); }
.b-lime { background: var(--lime); color: var(--navy); }
.b-navy { background: var(--navy); color: #fff; }

/* issue lists */
.issues { list-style: none; padding: 0; margin: 0; }
.issues li { padding: 4px 0 4px 22px; position: relative; font-size: .9rem; }
.issues li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.issues li.error::before { background: var(--red); }
.issues li.ok::before { background: var(--green); }

/* forms */
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 4px; color: var(--navy); }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number],
input[type=url], input[type=tel], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c4d2d8; border-radius: 10px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(0,119,163,.25); border-color: var(--blue); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--text); }
.check input { width: 18px; height: 18px; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.formgrid .full { grid-column: 1 / -1; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline .field { margin-bottom: 0; }
.inline input, .inline select { width: auto; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; }
.filters select { width: auto; min-width: 140px; }

button, .btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff; font: 600 .9rem var(--body); cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.btn-lime { background: var(--lime); border-color: var(--lime); color: var(--navy); }
.btn-lime:hover { background: #b5dc0a; color: var(--navy); }
.btn-ghost { background: #fff; color: var(--navy); border-color: #c4d2d8; }
.btn-ghost:hover { background: #eef4f6; color: var(--navy); }
.btn-danger { background: #fff; color: var(--red); border-color: #e7b6b0; }
.btn-danger:hover { background: var(--red-bg); color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.btn-big { padding: 14px 22px; font-size: 1.05rem; }
form.inline-form { display: inline; }

details.edit > summary { cursor: pointer; color: var(--blue); font-size: .85rem; font-weight: 600; list-style: none; display: inline-block; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] { background: #f7fafb; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 6px 0; }
details.edit[open] > summary { margin-bottom: 10px; }

/* flash messages */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-weight: 500; border: 1px solid; }
.flash.success { background: var(--green-bg); color: var(--green); border-color: #bfe5cd; }
.flash.error { background: var(--red-bg); color: var(--red); border-color: #f2c4bf; }
.flash.info { background: #e6f3f9; color: var(--navy); border-color: #bcdcea; }

/* announcements */
.announce { border-left: 5px solid var(--blue); padding: 10px 14px; background: #f5fafc; border-radius: 0 10px 10px 0; margin-bottom: 10px; }
.announce.urgent { border-color: var(--red); background: var(--red-bg); }
.announce h3 { margin: 0 0 2px; }
.announce p { margin: 0; white-space: pre-line; }

/* clock */
.clock { background: var(--navy); color: #fff; border: 0; }
.clock h2 { color: var(--lime); }
.clock p { color: #cfe2ea; }

/* sign-in pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--navy); }
.auth .box { background: #fff; border-radius: 18px; padding: 32px; width: 100%; max-width: 420px; }
.auth .logo { display: block; width: 110px; margin: 0 auto 14px; }
.auth h1 { text-align: center; font-size: 1.4rem; }
.auth .sub { text-align: center; color: var(--muted); margin-bottom: 20px; }
.auth button { width: 100%; justify-content: center; padding: 12px; }
.codeinput { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-family: var(--head); }
.qr { display: block; width: 210px; height: 210px; margin: 10px auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 1.05rem; background: #f1f5f7; padding: 10px; border-radius: 8px; text-align: center; word-break: break-all; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: 6px; }

.pw-box { background: var(--lime); color: var(--navy); border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; }
.pw-box code { font-size: 1.2rem; font-weight: 700; background: #fff; padding: 2px 8px; border-radius: 6px; }

.empty { color: var(--muted); padding: 14px 0; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* phones and tablets */
@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; padding: 10px 14px; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .brand img { width: 140px; margin: 0; }
  .navlabel { display: inline-flex; color: var(--navy); background: var(--lime); padding: 8px 14px; border-radius: 10px; font-weight: 700; cursor: pointer; margin: 0; }
  .side nav, .me { display: none; width: 100%; }
  .navtoggle:checked ~ nav, .navtoggle:checked ~ .me { display: flex; }
  .side nav { padding-top: 10px; max-height: 70vh; overflow-y: auto; }
  .me { flex-direction: column; }
  .main { padding: 18px 14px 50px; }
  .g2, .g3, .formgrid { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .g4 > .card { padding: 12px 14px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  h1 { font-size: 1.4rem; }
}

@media print {
  .side, .actions, form, details.edit { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .card { border: 0; padding: 0; }
}

a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--blue); box-shadow: 0 4px 14px rgba(6,56,79,.08); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.b-blue { background: #e1f1f8; color: var(--blue); }
.b-purple { background: #efe8fb; color: #5b3aa0; }
.alert-box { border: 2px solid var(--red); background: var(--red-bg); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.alert-box h2 { color: var(--red); }
.warn-box { border: 2px solid var(--amber); background: var(--amber-bg); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.warn-box h2 { color: var(--amber); }
.health { background: #fff8f7; border: 1px solid #f2c4bf; border-radius: 10px; padding: 12px 14px; }
.health dt { color: var(--red); font-weight: 600; }
.reg { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.reg:last-child { border-bottom: 0; }
.reg .who b { font-size: 1.02rem; }
.reg .state { font-size: .86rem; color: var(--muted); }
.reg form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.reg select, .reg input[type=text] { width: auto; padding: 6px 8px; font-size: .88rem; }
.reg.in { background: linear-gradient(90deg, var(--green-bg), transparent 40%); }
.reg.out { opacity: .6; }
.reg.absent { opacity: .5; }
.bigred { display: block; text-align: center; background: var(--red); color: #fff; border-radius: var(--radius); padding: 14px; font-weight: 700; font-size: 1.05rem; }
.bigred:hover { background: #a93226; color: #fff; text-decoration: none; }
.side nav a.concern { background: rgba(199,242,13,.12); color: var(--lime); }
.sheet-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; break-inside: avoid; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.weather { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; text-align: center; font-size: .85rem; }
.weather div { background: #f3f8fa; border-radius: 10px; padding: 8px 4px; }
.weather b { display: block; font-size: 1.05rem; color: var(--navy); }
.weather .wet { background: #e1f1f8; }
.cert { width: 100%; max-width: 1000px; aspect-ratio: 1.414; margin: 0 auto 30px; background: #fff; border: 14px solid var(--navy); outline: 4px solid var(--lime); outline-offset: -26px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 50px; break-after: page; }
.cert img { width: 120px; margin-bottom: 12px; }
.cert .kicker { letter-spacing: .25em; text-transform: uppercase; color: var(--blue); font-weight: 700; font-size: .9rem; }
.cert h1 { font-size: 3rem; margin: 10px 0; }
.cert .name { font-family: var(--head); font-size: 2.4rem; color: var(--navy); border-bottom: 3px solid var(--lime); padding: 0 30px 6px; margin: 14px 0; }
.cert .reason { font-size: 1.15rem; max-width: 640px; }
.cert .foot { margin-top: 30px; color: var(--muted); }
.printbar { margin-bottom: 14px; }
@media (max-width: 900px) {
  .reg { grid-template-columns: 1fr; }
  .reg form { justify-content: flex-start; }
  .sheet-grid { grid-template-columns: 1fr; }
  .weather { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media print {
  .printbar, .flash { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .sheet-grid { grid-template-columns: 1fr 1fr; }
  .cert { border-width: 10px; margin: 0; }
}
