/* Gigdesk: one stylesheet for the app, the DJ page, the avails link and sign in. Light by default, dark when the
   device is. Large text, big touch areas, flat status badges that never look like buttons. */
:root {
  --bg: #f6f6f8; --panel: #ffffff; --raised: #f1f1f5; --line: #e2e2ea; --text: #16161d; --muted: #5b5b6b; --faint: #8a8a99;
  --accent: #4f46e5; --accent-ink: #ffffff; --accent-soft: #eceafe;
  --good: #137a3f; --good-soft: #e3f5ea; --warn: #9a5b00; --warn-soft: #fdf1dc; --bad: #b42318; --bad-soft: #fde8e6;
  --radius: 14px; --shadow: 0 10px 30px rgba(20, 20, 40, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e12; --panel: #17171d; --raised: #20202a; --line: #2c2c38; --text: #f2f2f6; --muted: #b4b4c2; --faint: #8a8a99;
    --accent: #8b85ff; --accent-ink: #0e0e12; --accent-soft: #24223f;
    --good: #5fd38a; --good-soft: #15291d; --warn: #f2b45a; --warn-soft: #2d2313; --bad: #ff8a80; --bad-soft: #321716;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e12; --panel: #17171d; --raised: #20202a; --line: #2c2c38; --text: #f2f2f6; --muted: #b4b4c2; --faint: #8a8a99;
  --accent: #8b85ff; --accent-ink: #0e0e12; --accent-soft: #24223f;
  --good: #5fd38a; --good-soft: #15291d; --warn: #f2b45a; --warn-soft: #2d2313; --bad: #ff8a80; --bad-soft: #321716;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; } h2 { font-size: 21px; } h3 { font-size: 17px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 14px; }
.hidden { display: none !important; }

/* controls */
button, .btn { font: inherit; cursor: pointer; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 10px 16px; min-height: 44px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
button:hover, .btn:hover { border-color: var(--faint); }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.danger { color: var(--bad); }
.ghost { background: transparent; border-color: transparent; }
.ghost:hover { background: var(--raised); border-color: transparent; }
.link { background: none; border: 0; color: var(--accent); padding: 8px 4px; min-height: 0; font-weight: 600; }
.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
label { display: block; font-size: 14px; color: var(--muted); font-weight: 600; }
label > input, label > select, label > textarea { display: block; margin-top: 6px; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; min-height: 44px; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 120px; resize: vertical; }
.check { display: flex; flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-weight: 500; }
.check > input { margin-top: 0; }
.check input { width: 22px; height: 22px; min-height: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.err { color: var(--bad); font-size: 14px; }

/* badges: flat and squared */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; background: var(--raised); color: var(--muted); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* a slim notice under the tabs: the trial, or a paused side */
.banner { max-width: 1100px; margin: 12px auto 0; padding: 10px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 15px; }
.banner.warn { background: var(--warn-soft); }
.banner .link { padding: 0 4px; }
@media (max-width: 1132px) { .banner { margin: 12px 16px 0; } }

/* layout */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--panel); border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top)) 16px 0; }
.topbar .bar { display: flex; align-items: center; gap: 12px; max-width: 1100px; margin: 0 auto; }
.brand { font-weight: 800; font-size: 18px; }
.orgname { font-weight: 700; }
.tabs { display: flex; gap: 4px; overflow-x: auto; max-width: 1100px; margin: 8px auto 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; border-radius: 0; background: none; padding: 10px 14px; min-height: 46px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 120px; }
.modebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.modebar .seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; max-width: 420px; background: var(--raised); padding: 5px; border-radius: 14px; }
.modebar button { border: 0; background: none; min-height: 48px; font-size: 16px; color: var(--muted); }
.modebar button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.pagehead { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pagehead p { margin: 4px 0 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.empty { text-align: center; padding: 34px 18px; }
.empty h3 { margin-bottom: 6px; }
.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); width: 100%; text-align: left;
  background: none; border-left: 0; border-right: 0; border-bottom: 0; border-radius: 0; min-height: 60px; font-weight: 400; }
.item:first-child { border-top: 0; }
button.item:hover { background: var(--raised); }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 700; }
.item .sub { color: var(--muted); font-size: 14px; }

/* the calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal > * { min-width: 0; }
.cal .dow { font-size: 13px; color: var(--muted); text-align: center; font-weight: 700; padding-bottom: 2px; }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-height: 78px; padding: 8px; text-align: left; display: flex;
  flex-direction: column; gap: 4px; align-items: stretch; justify-content: flex-start; font-weight: 400; }
.day .n { font-weight: 800; font-size: 15px; }
.day.out { opacity: .4; }
.day.today { border-color: var(--accent); }
.day.sel { outline: 2px solid var(--accent); }
.day .fill { font-size: 13px; color: var(--muted); }
.day.has { background: var(--accent-soft); border-color: transparent; }
.day.has.full { background: var(--good-soft); }
.day .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }
.night { margin-top: 16px; }
.slot { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; }
.slot .time { font-weight: 700; }
.slot .open { color: var(--warn); font-weight: 600; }

/* a show on the agency calendar: tap to open */
.day .chip { display: block; width: 100%; text-align: left; font-size: 12px; font-weight: 600; padding: 3px 6px; min-height: 0; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink); border: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day .chip.hold { background: var(--warn-soft); color: var(--warn); }
.day .chip.cx { background: var(--raised); color: var(--faint); text-decoration: line-through; }
div.day { cursor: default; }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(10, 10, 20, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--panel); width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); }
.modal .mhead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; position: sticky; top: -18px; background: var(--panel); padding: 4px 0 8px; z-index: 2; }
.mfoot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.mfoot .spacer { flex: 1 1 auto; }
@media (min-width: 720px) { .overlay { align-items: center; } .modal { border-radius: 20px; } }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; z-index: 60; font-weight: 600; max-width: 90vw; }

/* setup wizard */
.wizard { max-width: 620px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 18px 60px; }
.steps { display: flex; gap: 6px; margin: 0 0 20px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--accent); }
.choice { display: grid; gap: 10px; }
.choice button { justify-content: flex-start; text-align: left; padding: 16px; min-height: 72px; flex-direction: column; align-items: flex-start; gap: 2px; }
.choice button.on { border-color: var(--accent); background: var(--accent-soft); }
.choice button span { font-weight: 400; color: var(--muted); font-size: 14px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days button { padding: 8px 0; min-height: 48px; }
.days button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* one set in the weekly nights: room on top, start and finish side by side */
.slotrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.slotrow > select { grid-column: 1 / -1; }
.slotrow > button, .slotrow > span:last-child { grid-column: 1 / -1; justify-self: end; min-height: 32px; }
.slotrow > span:last-child:empty { display: none; }
.slotrow label { min-width: 0; }

/* tables (timesheets) */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
td.num, th.num { text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; }

/* sign in, the DJ page, the avails link */
.narrow { max-width: 460px; margin: 0 auto; padding: calc(36px + env(safe-area-inset-top)) 18px 60px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tile { flex-direction: column; min-height: 66px; gap: 0; font-weight: 400; }
.tile b { font-size: 13px; color: var(--muted); }
.tile.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tile.on b { color: var(--accent-ink); }

@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .day { min-height: 60px; padding: 6px; }
  .day .fill { font-size: 12px; }
  .slot { grid-template-columns: 1fr; gap: 4px; }
  h1 { font-size: 23px; }
}
@media print {
  .topbar, .modebar, .noprint, .toast { display: none !important; }
  main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card { border: 0; padding: 0; }
}

/* ---- branded pages (run sheet, advancing): three templates, the company's colour and logo ---- */
.brandhead { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.brand-logo { max-height: 52px; max-width: 180px; object-fit: contain; }
.tpl-classic .doc h1, .tpl-classic .doc h2, .tpl-classic .doc h3 { color: var(--brand); }
.tpl-bold .brandhead { background: var(--brand); color: var(--brand-ink); margin: -36px -18px 22px; padding: 28px 18px 24px; border-radius: 0 0 18px 18px; }
.tpl-bold .brandhead .muted { color: var(--brand-ink); opacity: .85; }
.tpl-minimal .doc { font-family: Georgia, "Times New Roman", serif; }
.tpl-minimal .doc .card { border: 0; border-top: 2px solid #111; border-radius: 0; padding: 14px 0; background: none; }
.tpl-minimal .doc .list { border: 0; border-radius: 0; }
.tpl-minimal .brandhead { border-bottom: 3px solid #111; padding-bottom: 14px; }
.doc .item { cursor: default; }
.doc .item .lab { width: 130px; flex: none; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .doc .item .lab { width: 96px; } }
.missing { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
@media print { .tpl-bold .brandhead { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
body.tpl-minimal { background: #ffffff; }
.tpl-minimal .doc .item { padding-left: 0; }
