/* Issues-ControlTower-001 — day board: Reef/Bay × Left/Right grid, print-first */
.ct-main { padding: 18px 22px 40px; max-width: 1400px; margin: 0 auto; }
.ct-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.ct-title h1 { margin: 0; }
.ct-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; }
.ct-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }
.ct-head h2 { margin: 0; font-size: 20px; }
.ct-head .ct-meta { font-size: 12.5px; color: #64748b; }
.ct-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0 0 14px; }
.ct-total { background: #fff; border: 1px solid var(--ik-line, #e2e8f0); border-radius: 12px; padding: 10px 12px; }
.ct-total .n { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; }
.ct-total .l { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-top: 2px; }
.ct-total .cap { font-size: 12px; color: #94a3b8; font-weight: 500; }
.ct-total .pct { font-size: 14px; font-weight: 700; color: #0f766e; margin-left: 8px; }   /* owner 2026-10-12: occupancy percent */
.ct-total.reef { border-left: 5px solid #0ea5e9; }
.ct-total.bay { border-left: 5px solid #22c55e; }
.ct-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--ik-line, #e2e8f0); border-radius: 12px; }
table.ct-grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ct-grid th, .ct-grid td { border: 1px solid #e2e8f0; padding: 8px 10px; vertical-align: top; text-align: left; }
.ct-grid thead th { background: #f1f5f9; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #334155; }
.ct-grid thead th.reef { background: #e0f2fe; }
.ct-grid thead th.bay { background: #dcfce7; }
.ct-grid td.time { white-space: nowrap; font-weight: 700; width: 92px; }
.ct-grid td.time small { display: block; font-weight: 400; color: #64748b; }
.ct-grid td.rowtotal, .ct-grid tfoot td { font-weight: 700; background: #f8fafc; }
.ct-grid td.empty { color: #cbd5e1; text-align: center; }
.ct-grid tr.past td { opacity: .55; }
.ct-grid tr.now td { background: #fffbeb; }
.ct-grid tr.now td.time { color: #b45309; }
.ct-cell { display: block; margin-bottom: 6px; }
.ct-cell:last-child { margin-bottom: 0; }
.ct-cell .name { display: block; font-weight: 600; }
.ct-cell .name .tag { font-weight: 500; font-size: 11px; color: #64748b; margin-left: 4px; }
.ct-cell .hc { display: block; font-size: 12.5px; color: #334155; }
.ct-cell .hc b { font-size: 15px; }
.ct-cell .hc .in { color: #15803d; }
.ct-cell .hc .cart { color: #b45309; }
.ct-cell.full .hc b { color: #b91c1c; }
/* Owner 2026-09-29: a closed (blocked) session - greyed, "Closed" instead of a head count */
.ct-cell.closed { opacity: 0.6; }
.ct-cell.closed .name { font-weight: 500; text-decoration: line-through; color: #64748b; }
.ct-cell.closed .hc b { font-size: 13px; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
.ct-unassigned { margin-top: 12px; font-size: 12.5px; color: #64748b; }

@media print {
    @page { size: landscape; margin: 10mm; }
    body { background: #fff !important; }
    /* This page reuses intake.css, whose print rule
       `body > *:not(#ikPrintSheet){display:none}` hides every body child except
       the intake print sheet — which this page does not have — so the whole
       board printed blank. Restore the shell in place. The `:not(#ikPrintSheet)`
       gives this selector id-level specificity so it beats that rule. */
    body.ct-body > .ik-shell:not(#ikPrintSheet) { display: block !important; }
    .ct-noprint { display: none !important; }
    .ct-main { padding: 0; max-width: none; }
    .ct-totals { gap: 6px; }
    .ct-total { border-radius: 4px; padding: 5px 8px; }
    .ct-total .n { font-size: 18px; }
    .ct-wrap { border: 0; border-radius: 0; overflow: visible; }
    table.ct-grid { font-size: 11.5px; }
    .ct-grid th, .ct-grid td { border-color: #999; padding: 4px 6px; }
    .ct-grid thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ct-grid tr.past td { opacity: 1; }
    .ct-grid tr.now td { background: #fff; }
    .ct-grid tr { break-inside: avoid; page-break-inside: avoid; }
}

/* Owner 2026-09-10: rash guard counts (1 per surfer, by color per column) */
.ct-rg { margin-top: -4px; }
.ct-total.rg-head { border-left: 5px solid #f59e0b; }
.ct-total.rg .n { font-size: 20px; }
.ct-grid th small.rg-col { display: block; font-size: 10px; font-weight: 600; color: #b45309; text-transform: none; letter-spacing: 0; }
.ct-cell .rg-line { display: block; font-size: 11px; color: #b45309; margin-top: 2px; }
/* Owner 2026-09-11: rash guard colors actually issued to the cell's checked-in surfers */
.ct-cell .rg-issued { display: block; font-size: 11px; color: #15803d; margin-top: 2px; }
.ct-cell .rg-chip { display: inline-block; padding: 0 5px; border-radius: 8px; border: 1px solid #cbd5e1; background: #f8fafc; color: #0f172a; margin-right: 3px; font-weight: 600; }
.ct-cell .rg-chip[data-color="red"] { border-color: #dc2626; } .ct-cell .rg-chip[data-color="blue"] { border-color: #2563eb; }
.ct-cell .rg-chip[data-color="yellow"] { border-color: #ca8a04; } .ct-cell .rg-chip[data-color="green"] { border-color: #16a34a; }
.ct-cell .rg-chip[data-color="black"] { background: #111827; color: #fff; border-color: #111827; }
.ct-cell .rg-chip[data-color="grey"], .ct-cell .rg-chip[data-color="gray"] { background: #6b7280; color: #fff; border-color: #6b7280; }
.ct-cell .rg-none { color: #b91c1c; font-weight: 600; }
@media print { .ct-cell .rg-line, .ct-cell .rg-issued, .ct-grid th small.rg-col { color: #000; } .ct-cell .rg-chip { background: #fff !important; color: #000 !important; } }

/* Issues-ControlTowerScroll-001: the shared POS/intake shell makes .ik-shell a
   100dvh flex column and body overflow:hidden, so a long day board overflowed the
   shell and was clipped with no scroll. Make .ct-main the internal vertical scroller
   (fills the height below the top bar, scrolls its own content) -- the intake pattern. */
body.ct-body .ct-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* Owner 2026-10-10: surfer drilldown — click a time row, modal lists the surfers per session */
.ct-grid tr.ct-row { cursor: pointer; }
.ct-grid tr.ct-row:hover td, .ct-grid tr.ct-row:focus-visible td { background: #f1f5f9; }
.ct-grid tr.ct-row:focus-visible { outline: 2px solid #0ea5e9; outline-offset: -2px; }
.ik-modal.ct-sf-modal { width: min(760px, 96vw); }
.ct-sf-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ct-sf-head h3 { margin: 0; }
.ct-sf-sub { font-size: 12.5px; color: #64748b; margin-bottom: 10px; }
.ct-sf-session { margin-top: 12px; }
.ct-sf-title { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 8px; background: #f1f5f9; }
.ct-sf-title.reef { background: #e0f2fe; }
.ct-sf-title.bay { background: #dcfce7; }
.ct-sf-count { margin-left: auto; font-size: 12.5px; color: #334155; white-space: nowrap; }
.ct-sf-none { padding: 6px 10px; font-size: 12.5px; color: #64748b; }
table.ct-sf-list { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.ct-sf-list th:nth-child(1) { width: 40%; } .ct-sf-list th:nth-child(2) { width: 17%; } .ct-sf-list th:nth-child(3) { width: 17%; } .ct-sf-list th:nth-child(4) { width: 12%; }
.ct-sf-list th, .ct-sf-list td { padding: 6px 10px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
.ct-sf-list th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.ct-sf-list td small { display: block; color: #64748b; }
.ct-sf-list .tag { font-size: 11px; color: #64748b; margin-left: 6px; }
.ct-sf-list .st { color: #64748b; }
.ct-sf-list .st.in { color: #15803d; font-weight: 600; }
.ct-sf-list .st.no { color: #b91c1c; font-weight: 600; }
.ct-sf-list .muted { color: #cbd5e1; }
.ct-sf-list .rg-chip { display: inline-block; padding: 0 6px; border-radius: 8px; border: 1px solid #cbd5e1; background: #f8fafc; color: #0f172a; font-weight: 600; font-size: 12px; }
.ct-sf-list .rg-chip[data-color="red"] { border-color: #dc2626; } .ct-sf-list .rg-chip[data-color="blue"] { border-color: #2563eb; }
.ct-sf-list .rg-chip[data-color="yellow"] { border-color: #ca8a04; } .ct-sf-list .rg-chip[data-color="green"] { border-color: #16a34a; }
.ct-sf-list .rg-chip[data-color="black"] { background: #111827; color: #fff; border-color: #111827; }
.ct-sf-list .rg-chip[data-color="grey"], .ct-sf-list .rg-chip[data-color="gray"] { background: #6b7280; color: #fff; border-color: #6b7280; }

/* Issues-TowerWaiverLink-001: the waiver cell opens the signed waiver (staff only). */
.ct-wv-link { background: none; border: 0; padding: 0; font: inherit; color: #0661f2; text-decoration: underline; cursor: pointer; }
.ct-wv-link:hover { color: #0b4fc4; }
#ctWaiver { z-index: 10001; }
.ik-modal.ct-wv-modal { width: min(520px, 94vw); }
table.ct-wv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
.ct-wv-table th { width: 38%; text-align: left; font-weight: 600; color: #64748b; padding: 7px 10px 7px 0; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.ct-wv-table td { padding: 7px 0; border-bottom: 1px solid #e2e8f0; color: #0f172a; word-break: break-word; }

/* Issues-TowerGuestDetails-001: guest details above the waiver in the tower dialog; the surfer name opens it. */
.ct-wv-link.ct-wv-name { color: inherit; text-decoration: none; text-align: left; }
.ct-wv-link.ct-wv-name:hover b { text-decoration: underline; color: #0661f2; }
.ct-wv-h { margin: 14px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.ik-modal.ct-wv-modal { max-height: 88vh; overflow-y: auto; }

/* Issues-TowerStaffNotes-001 (owner 2026-10-14): Staff notes button + block on the guest dialog */
.ct-wv-actions { display: flex; gap: 8px; }
.ct-wv-notes-wrap { display: none; }
.ct-wv-notes-wrap.open { display: block; }
.ct-wv-note-h { margin: 10px 0 4px; font-size: 13px; font-weight: 600; color: #0f172a; }
.ct-wv-note { padding: 6px 0; border-bottom: 1px solid #e2e8f0; }
.ct-wv-note-meta { font-size: 11px; color: #64748b; }
.ct-wv-note-text { font-size: 13.5px; color: #0f172a; white-space: pre-wrap; overflow-wrap: anywhere; }
.ct-wv-note-add { margin-top: 8px; }
.ct-wv-note-input { width: 100%; box-sizing: border-box; font: inherit; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; resize: vertical; margin-bottom: 6px; }
.ct-wv-note-err { font-size: 12px; margin-left: 8px; color: #b91c1c; }
.ct-wv-notes .pon textarea { margin-bottom: 6px; }


/* ── Issues-TowerMobile-001 (owner 2026-10-15): phone layout. The day board becomes one card per start time
   (time on top, the four sections in a 2-column grid, row total underneath), the surfer list stacks one card per
   surfer, the dialogs go full screen, every control is a 44 px touch target. Desktop, tablet and print are untouched. ── */
@media (max-width: 760px) {
    body.ct-body .ik-topbar { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
    body.ct-body .ik-brand { font-size: 14px; }
    body.ct-body .ik-top-right { margin-left: auto; }
    body.ct-body .ik-top-right .cashier-name { display: none; }
    body.ct-body .ik-logout { min-height: 40px; }
    body.ct-body .ik-topnav { order: 3; flex: 1 1 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
    body.ct-body .ik-topnav a { flex: 0 0 auto; padding: 8px 12px; white-space: nowrap; }
    body.ct-body .ct-main { padding: 12px 12px 32px; }
    .ct-title h1 { font-size: 20px; }
    .ct-title p { font-size: 13px; margin: 2px 0 8px; }
    .ct-main .ik-toolbar { gap: 8px; }
    .ct-main .ik-dategroup { display: flex; flex: 1 1 100%; gap: 6px; }
    .ct-main .ik-dategroup input[type="date"] { flex: 1 1 auto; min-width: 0; min-height: 44px; font-size: 16px; }   /* 16px: no iOS zoom */
    .ct-main .ik-daynav { min-width: 44px; min-height: 44px; }
    .ct-main .ik-toolbar > .ik-btn { flex: 1 1 calc(33% - 6px); min-height: 44px; }
    .ct-main .ct-check { flex: 1 1 100%; min-height: 32px; }
    .ct-head { flex-direction: column; align-items: flex-start; gap: 2px; }
    .ct-head h2 { font-size: 18px; }
    .ct-head .ct-meta { font-size: 12px; line-height: 1.4; }
    .ct-totals { grid-template-columns: 1fr 1fr; gap: 8px; }
    .ct-total .n { font-size: 20px; }
    .ct-total .pct { font-size: 12px; margin-left: 6px; }

    /* the board: cards instead of a 6-column table */
    .ct-wrap { overflow: visible; background: transparent; border: 0; border-radius: 0; }
    table.ct-grid, .ct-grid tbody, .ct-grid tfoot, .ct-grid tr, .ct-grid td { display: block; }
    .ct-grid thead { display: none; }
    .ct-grid tr.ct-row, .ct-grid tfoot tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #fff; border: 1px solid var(--ik-line, #e2e8f0); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
    .ct-grid th, .ct-grid td { border: 0; padding: 0; }
    .ct-grid td.time { grid-column: 1 / -1; width: auto; display: flex; align-items: baseline; gap: 8px; font-size: 16px; padding-bottom: 6px; border-bottom: 1px solid #e2e8f0; }
    .ct-grid td.time small { display: inline; }
    .ct-grid td[data-col] { background: #f8fafc; border-radius: 8px; padding: 8px 10px; min-width: 0; }
    .ct-grid td[data-col]::before { content: attr(data-col); display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-bottom: 3px; }
    .ct-grid td[data-col^="Reef"] { background: #eff8ff; }
    .ct-grid td[data-col^="Bay"] { background: #f0fdf4; }
    .ct-grid td.empty { text-align: left; color: #94a3b8; }
    .ct-grid td.rowtotal { grid-column: 1 / -1; background: #f1f5f9; }
    .ct-grid tr.past { opacity: .6; }
    .ct-grid tr.past td { opacity: 1; }
    .ct-grid tr.now { border-color: #f59e0b; box-shadow: 0 0 0 2px #fde68a inset; }
    .ct-grid tr.now td { background: inherit; }
    .ct-grid tr.now td.time { color: #b45309; }
    .ct-grid tr.ct-row:hover td, .ct-grid tr.ct-row:focus-visible td { background: inherit; }
    .ct-grid tr.ct-row:focus-visible { outline-offset: 0; }
    .ct-cell .name { font-size: 14px; }
    .ct-cell .hc b { font-size: 16px; }
    .ct-unassigned { font-size: 12px; }

    /* dialogs: full screen, scrolling inside */
    .ik-modal-overlay { align-items: stretch; }
    .ik-modal.ct-sf-modal, .ik-modal.ct-wv-modal { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; box-sizing: border-box; overflow-y: auto; padding: 14px 12px 24px; }
    .ct-sf-head { position: sticky; top: -14px; background: #fff; padding: 6px 0; z-index: 1; }
    .ct-sf-head h3 { font-size: 17px; }
    .ct-sf-head .ik-btn, .ct-wv-actions .ik-btn { min-height: 44px; }
    .ct-sf-title { flex-wrap: wrap; }
    .ct-sf-count { margin-left: 0; flex: 1 1 100%; }
    table.ct-sf-list, .ct-sf-list tbody, .ct-sf-list tr, .ct-sf-list td { display: block; table-layout: auto; }
    .ct-sf-list thead { display: none; }
    .ct-sf-list tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
    .ct-sf-list td { padding: 0; border: 0; min-width: 0; }
    .ct-sf-list td.sf-name { grid-column: 1 / -1; font-size: 15px; }
    .ct-sf-list td.sf-name .ct-wv-name { min-height: 44px; display: inline-flex; align-items: center; }
    .ct-sf-list td[data-col]:not(.sf-name)::before { content: attr(data-col) ": "; color: #64748b; font-size: 11.5px; }
    .ct-sf-list .ct-wv-link:not(.ct-wv-name) { min-height: 32px; display: inline-flex; align-items: center; }
    .ct-wv-table th { width: 42%; }
    .ct-wv-note-input { font-size: 16px; }
}
