/* Paal69 Team App — logo colours + black & white; red/amber/green only for status. */
:root {
  --yellow: #FFCC66;
  --orange: #FF9900;
  --coral: #F96D5E;
  --red: #F9542B;
  --ink: #111111;
  --ink2: #555555;
  --ink3: #8A8A8A;
  --line: #E6E6E6;
  --soft: #F7F7F5;
  --paper: #FFFFFF;
  --tint: #FFF6E5;          /* very light yellow for highlights */
  --ok: #2E9E5B;
  --warn: #E8A317;
  --bad: #D93B2B;
  --radius: 10px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); font: 14px/1.45 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
.boot { display: grid; place-items: center; height: 100vh; }
.muted { color: var(--ink2); } .faint { color: var(--ink3); } .small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 18px; padding: 10px 20px; max-width: 1400px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand b { font-family: var(--serif); font-size: 17px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 7px 11px; border-radius: 8px; text-decoration: none; color: var(--ink2); white-space: nowrap; font-weight: 500; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.on { background: var(--ink); color: #fff; }
.who { display: flex; align-items: center; gap: 8px; color: var(--ink2); white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--ink); text-decoration: none; }
main { max-width: 1400px; margin: 0 auto; padding: 20px 20px 90px; }
.pagehead { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pagehead h1 { flex: 1 1 auto; min-width: 200px; }
.pagehead > .row { flex: 0 1 auto; }
.who { margin-left: auto; }
.mobonly { display: none; }
.sub { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.sub a { padding: 9px 12px; text-decoration: none; color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.sub a.on { color: var(--ink); border-bottom-color: var(--red); }
.bottom { display: none; }

@media (max-width: 760px) {
  .top-in { padding: 8px 14px; }
  .nav, .who .name { display: none; }
  .mobonly { display: flex; }
  .pagehead > .row { flex: 1 1 100%; }
  main { padding: 14px 14px 96px; }
  h1 { font-size: 21px; }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--paper); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); overflow-x: auto; }
  .bottom a { flex: 1 0 auto; min-width: 62px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; text-decoration: none; color: var(--ink3); font-size: 10.5px; font-weight: 500; border-radius: 8px; }
  .bottom a .ic { font-size: 17px; line-height: 1; }
  .bottom a.on { color: var(--ink); background: var(--tint); }
}

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 500; text-decoration: none; white-space: nowrap; min-height: 36px; }
.btn:hover { border-color: var(--ink3); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #333; }
.btn.accent { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 4px 10px; min-height: 28px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); min-height: 36px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 80px; resize: vertical; }
.search { max-width: 280px; }
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); margin-bottom: 4px; }
.chk { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--red); }

/* ---------- status ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink3); flex: 0 0 8px; }
.dot.g { background: var(--ok); } .dot.a { background: var(--warn); } .dot.r { background: var(--bad); } .dot.x { background: #C8C8C8; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--soft); white-space: nowrap; }
.pill.g { background: #E6F4EC; color: #1D6B3D; } .pill.a { background: #FDF1D8; color: #8A5A00; } .pill.r { background: #FBE5E2; color: #A12A1D; } .pill.x { background: #EFEFEF; color: #777; text-decoration: line-through; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
.tag.hol { background: var(--yellow); } .tag.school { background: #FFE4B8; } .tag.fest { background: var(--coral); color: #fff; } .tag.other { background: var(--soft); }

/* ---------- cards & tables ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--paper); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; display: block; }
.stat b { display: block; font-size: 24px; font-family: var(--serif); }
.stat span { color: var(--ink2); font-size: 12.5px; }
.stat.alert { border-color: var(--red); background: #FFF4F1; }
.tablewrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink2); background: var(--soft); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; cursor: pointer; user-select: none; }
.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; max-width: 340px; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { cursor: pointer; }
.t tbody tr:hover td { background: var(--tint); }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t td .clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t tfoot td { font-weight: 600; background: var(--soft); }
.empty { padding: 30px; text-align: center; color: var(--ink3); }
.list { display: flex; flex-direction: column; }
.li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }

/* ---------- agenda ---------- */
.month { margin-bottom: 26px; }
.month h2 { position: sticky; top: 54px; background: var(--paper); padding: 8px 0; z-index: 5; border-bottom: 2px solid var(--ink); margin-bottom: 4px; }
.day { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.day.weekend { background: linear-gradient(90deg, var(--tint), transparent 60%); }
.day.today { box-shadow: inset 3px 0 0 var(--red); }
.dnum { font-family: var(--serif); font-size: 20px; line-height: 1; padding-left: 6px; }
.dnum small { display: block; font-family: var(--sans); font-size: 11px; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; }
.dbody { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dmarks { display: flex; gap: 6px; flex-wrap: wrap; }
.ev { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 8px; cursor: pointer; background: var(--paper); }
.ev:hover { border-color: var(--ink3); border-left-color: var(--red); }
.ev.ext { border-left-color: var(--coral); } .ev.well { border-left-color: var(--yellow); } .ev.grp { border-left-color: var(--ink); } .ev.cancel { opacity: .5; }
.ev .tm { font-variant-numeric: tabular-nums; color: var(--ink2); font-size: 12.5px; min-width: 82px; }
.ev .ti { font-weight: 600; }
.ev .lu { color: var(--ink2); font-size: 12.5px; white-space: pre-line; }
.addday { color: var(--ink3); font-size: 12.5px; cursor: pointer; padding: 2px 0; border: 0; background: none; text-align: left; }
.addday:hover { color: var(--red); }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--soft); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.kcol h3 { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink2); display: flex; justify-content: space-between; margin-bottom: 8px; }
.kcard { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; cursor: pointer; }
.kcard:hover { border-color: var(--ink3); }

/* ---------- staffing ---------- */
.week { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.sday { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.sday h3 { font-family: var(--sans); font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.sday .evs { font-size: 12px; color: var(--ink2); margin-bottom: 8px; }
.shift { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.shift.full { background: #F3FAF6; }
.shift.short { border-color: #F2C3BC; }
.people { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.person { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 4px 2px 8px; border-radius: 99px; background: var(--soft); }
.person.req { background: #FDF1D8; } .person.ok { background: #E6F4EC; }
.person button { border: 0; background: none; cursor: pointer; padding: 0 4px; font-size: 13px; color: var(--ink2); }
.person button:hover { color: var(--ink); }
.clockbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--ink); color: #fff; margin-bottom: 16px; }
.clockbar .btn { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; background: rgba(0,0,0,.28); }
.drawer[hidden] { display: none; }
.panel { width: min(720px, 100%); height: 100%; background: var(--paper); display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0,0,0,.12); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-body { flex: 1; overflow-y: auto; padding: 18px; }
.panel-foot { display: flex; gap: 8px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fgrid .wide { grid-column: 1 / -1; }
.fsec { grid-column: 1 / -1; font-family: var(--serif); font-size: 15px; font-weight: 600; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.fsec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.subrows { border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.subrow { display: grid; gap: 6px; align-items: center; margin-bottom: 6px; }
.calcbox { background: var(--tint); border-radius: var(--radius); padding: 12px 14px; }
.calcbox table { width: 100%; border-collapse: collapse; }
.calcbox td { padding: 3px 0; } .calcbox td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.calcbox tr.tot td { border-top: 1px solid var(--ink); font-weight: 700; padding-top: 6px; }
.filelink { display: inline-flex; gap: 6px; align-items: center; }
.hist { font-size: 12.5px; color: var(--ink2); }
.hist div { padding: 4px 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 760px) {
  .fgrid { grid-template-columns: 1fr; }
  .panel-body { padding: 14px; }
}

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--tint), #fff 55%); }
.login .box { width: min(380px, 100%); }
.login img { width: 84px; height: 84px; display: block; margin: 0 auto 14px; }
.login h1 { text-align: center; margin-bottom: 4px; }
.login p.lead { text-align: center; color: var(--ink2); margin: 0 0 22px; }
.login .card { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.err { color: var(--bad); font-size: 13px; }
.note { background: var(--tint); border-radius: 8px; padding: 10px 12px; font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 80; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }
@media (max-width: 760px) {
  .day { grid-template-columns: 42px 1fr; gap: 8px; }
  .dnum { padding-left: 2px; font-size: 18px; }
  .ev { flex-wrap: wrap; gap: 4px 8px; }
  .ev .tm { min-width: 0; }
  .ev .grow { flex-basis: 100%; }
}

/* ---------- mobile first: tables become cards, inputs never zoom ---------- */
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px !important; }       /* iOS zooms in on anything smaller */
  .btn { min-height: 42px; }
  .btn.small { min-height: 34px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat b { font-size: 20px; }
  .search { max-width: none; flex: 1 1 100%; }
  .row > select { flex: 1 1 45%; }
  .tablewrap { border: 0; overflow: visible; }
  table.t thead { display: none; }
  table.t, .t tbody, .t tfoot, .t tr, .t td { display: block; width: 100%; }
  .t tbody tr, .t tfoot tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 10px 12px; background: var(--paper); }
  .t tbody tr:active { background: var(--tint); }
  .t td { border: 0 !important; padding: 3px 0; display: flex; gap: 12px; justify-content: space-between; align-items: baseline; max-width: none; text-align: right; background: transparent !important; }
  .t td::before { content: attr(data-label); color: var(--ink3); font-size: 12px; text-align: left; flex: 0 0 auto; }
  .t td:first-child { font-size: 15px; font-weight: 600; text-align: left; justify-content: flex-start; }
  .t td:first-child::before { display: none; }
  .t td:empty, .t td.empty-cell { display: none; }
  .t td.num { text-align: right; }
  .t td .clip { text-align: right; }
  .t td.empty { display: block; text-align: center; }
  .t td.empty::before { display: none; }
  .kanban { grid-auto-columns: 82%; scroll-snap-type: x mandatory; }
  .kcol { scroll-snap-align: start; }
  .panel-head { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .clockbar { padding: 12px 14px; }
  .month h2 { top: 47px; }
  .sub a { padding: 10px 12px; }
}
@media (max-width: 760px) {
  .t td.blk { display: block; text-align: left; }
  .t td.blk::before { display: none; }
}

/* ---------- choice tiles (new event wizard) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; min-height: 92px; }
.tile:hover, .tile:active { border-color: var(--red); background: var(--tint); }
.tile b { font-size: 15px; }
.tile span { color: var(--ink2); font-size: 12.5px; }
.tile .tic { font-size: 20px; color: var(--red); }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } .tile { min-height: 84px; padding: 14px; } }
