/* KlekSabí-reserveringen – SOAW colours */
:root {
  --rose: #C04A7A;
  --plum: #8C215A;
  --ink: #1A1A1A;
  --ink2: #333333;
  --mute: #666666;
  --line: #E6E6E6;
  --line2: #CCCCCC;
  --bg: #F7F5F6;
  --card: #FFFFFF;
  --ok: #1F7A4D;
  --ok-bg: #E7F4EC;
  --warn: #8A5A00;
  --warn-bg: #FFF4DC;
  --err: #A32121;
  --err-bg: #FCE9E9;
  --info: #23527C;
  --info-bg: #E8F1FA;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.45; }
a { color: var(--plum); }
h1 { font-size: 1.6rem; margin: .2rem 0 .8rem; color: var(--plum); }
h2 { font-size: 1.15rem; margin: .2rem 0 .7rem; }
.lead { font-size: 1.05rem; color: var(--ink2); margin-top: 0; }
.muted { color: var(--mute); }
.small { font-size: .875rem; }
code.big { font-size: 1.2rem; background: #fff; padding: .1rem .4rem; border-radius: 4px; }

/* layout */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .7rem 1.2rem; background: var(--plum); color: #fff; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.brand small { display: block; font-size: .75rem; opacity: .85; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, var(--rose), #f2b5cd); box-shadow: inset 0 0 0 3px rgba(255,255,255,.35); }
.user { display: flex; gap: 1rem; align-items: center; font-size: .9rem; flex-wrap: wrap; }
.user a { color: #fff; }
.mainnav { display: flex; gap: .2rem; padding: 0 1rem; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.mainnav a { padding: .8rem .9rem; text-decoration: none; color: var(--ink2); border-bottom: 3px solid transparent; white-space: nowrap; }
.mainnav a.active, .mainnav a:hover { color: var(--plum); border-bottom-color: var(--rose); }
.container { max-width: 1100px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.footer { text-align: center; color: var(--mute); font-size: .8rem; padding: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card.narrow { max-width: 620px; margin-left: auto; margin-right: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.actions-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: .6rem 0; }

/* forms */
form.stack { display: flex; flex-direction: column; gap: .8rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .95rem; }
input, select, textarea { font: inherit; padding: .6rem .7rem; border: 1px solid var(--line2); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 400; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--rose); outline-offset: 1px; border-color: var(--rose); }
label.check, label.radio { flex-direction: row; align-items: flex-start; gap: .55rem; font-weight: 400; }
label.check input, label.radio input { margin-top: .25rem; width: 1.15rem; height: 1.15rem; flex: none; }
label.check.strong { font-weight: 600; background: var(--warn-bg); padding: .7rem; border-radius: 8px; }
label.radio.disabled { color: var(--mute); }
fieldset.modes { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; display: flex; flex-direction: column; gap: .5rem; }
fieldset.modes legend { font-weight: 600; padding: 0 .3rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }
.row-form { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; }
.row-form label { flex: 1 1 180px; }
form.inline { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: .15rem 0; }
form.inline label.check { font-size: .85rem; }
form.inline select, form.inline input { padding: .35rem .5rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1rem; border: 1px solid var(--line2); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--rose); color: var(--plum); }
.btn.primary { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn.primary:hover { background: var(--plum); border-color: var(--plum); color: #fff; }
.btn.danger { background: #fff; border-color: var(--err); color: var(--err); }
.btn.small { padding: .35rem .65rem; font-size: .85rem; }
.btn.big { padding: .9rem 1.3rem; font-size: 1.05rem; }
.pill { background: var(--plum); color: #fff; border-radius: 999px; padding: 0 .5rem; font-size: .8rem; }

/* messages */
.flash { padding: .75rem 1rem; border-radius: 8px; margin: 0 0 1rem; border-left: 4px solid; }
.flash-ok { background: var(--ok-bg); border-color: var(--ok); }
.flash-info { background: var(--info-bg); border-color: var(--info); }
.flash-warn { background: var(--warn-bg); border-color: var(--warn); }
.flash-error { background: var(--err-bg); border-color: var(--err); }
.danger-zone { border-color: #f1c4c4; margin-top: 1rem; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .02em; color: var(--mute); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; }
tfoot th { color: var(--ink); }
tr.inactive td { opacity: .55; }
tr.done td { background: #f4fbf6; }
td.msg { font-size: .85rem; color: var(--ink2); max-width: 420px; }

/* badges */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--line); color: var(--ink2); }
.badge-gereserveerd { background: var(--info-bg); color: var(--info); }
.badge-wachtlijst { background: var(--warn-bg); color: var(--warn); }
.badge-verschenen { background: var(--ok-bg); color: var(--ok); }
.badge-niet_verschenen, .badge-afgemeld { background: var(--err-bg); color: var(--err); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }

/* training cards & seats */
.tcard { display: block; text-decoration: none; color: inherit; transition: border-color .15s; }
.tcard:hover { border-color: var(--rose); }
.tcard.today { border-left: 5px solid var(--rose); }
.tdate { font-weight: 700; color: var(--plum); }
.ttitle { font-size: 1.05rem; margin: .15rem 0; }
.tloc { font-size: .9rem; margin-bottom: .6rem; }
.seats { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.seats-fill { height: 100%; background: var(--ok); }
.seats.almost .seats-fill { background: #C98A00; }
.seats.full .seats-fill { background: var(--err); }
.seats-txt { font-size: .85rem; color: var(--ink2); margin-top: .3rem; }
.stats { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: .8rem 0 .2rem; font-size: .95rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; color: var(--ink2); }
.kpi span { display: block; font-size: 1.8rem; font-weight: 700; color: var(--plum); }
.kpi small { display: block; color: var(--mute); }
.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; }
.tabs a { padding: .4rem .9rem; border-radius: 999px; text-decoration: none; border: 1px solid var(--line2); color: var(--ink2); }
.tabs a.active { background: var(--plum); border-color: var(--plum); color: #fff; }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }

/* confirmation card */
.ticket { max-width: 520px; margin: 1rem auto; background: #fff; border: 2px solid var(--plum); border-radius: 14px; padding: 1.4rem 1.6rem; }
.ticket header { background: var(--plum); color: #fff; margin: -1.4rem -1.6rem 1rem; padding: 1rem 1.6rem; border-radius: 12px 12px 0 0; }
.ticket-brand { font-size: 1.8rem; font-weight: 800; letter-spacing: .01em; }
.ticket-sub { opacity: .9; }
.ticket h1 { color: var(--ink); font-size: 1.5rem; }
.ticket dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: 1.15rem; margin: 0 0 1rem; }
.ticket dt { color: var(--mute); font-size: .95rem; padding-top: .15rem; }
.ticket dd { margin: 0; font-weight: 700; }
.ticket-note { font-size: 1.1rem; background: var(--warn-bg); padding: .7rem .9rem; border-radius: 8px; }
.ticket-number { font-size: 1.1rem; }
.ticket footer { font-size: .8rem; color: var(--mute); border-top: 1px solid var(--line); padding-top: .6rem; margin-top: 1rem; }

@media print {
  body { background: #fff; }
  .no-print, .topbar, .mainnav, .footer { display: none !important; }
  .container { padding: 0; }
  .ticket { border-width: 1px; margin: 0 auto; }
  .ticket header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* small screens: list tables become stacked rows, actions on their own line */
@media (max-width: 640px) {
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr { display: block; width: 100%; }
  table.list tr { border-bottom: 1px solid var(--line); padding: .55rem 0; }
  table.list td { display: inline-block; border: none; padding: .15rem .6rem .15rem 0; }
  table.list td:first-child { display: block; font-weight: 600; }
  table.list td.actions { display: block; white-space: normal; padding-top: .4rem; }
  td.msg { display: block !important; max-width: none; }
  .topbar .user { font-size: .85rem; gap: .7rem; }
}

/* two-step verification */
.qr { width: 220px; max-width: 70vw; margin: .5rem auto 1rem; background: #fff; padding: 4px; border: 1px solid var(--line); border-radius: 8px; }
.qr svg { display: block; width: 100%; height: auto; }
.qr:empty { display: none; }
.steps { padding-left: 1.3rem; margin: .4rem 0; }
.steps li { margin: .25rem 0; }
.manual-key { margin: .3rem 0 1rem; }
.manual-key summary { cursor: pointer; color: var(--plum); }
code.secret { display: block; letter-spacing: .08em; word-break: break-all; margin-top: .3rem; }
.code-input { font-size: 1.6rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.small { font-size: .85rem; }

/* users table: stack the action buttons so nothing is cut off */
table.users td.actions { white-space: normal; width: 1%; }
table.users td.actions form.inline { display: block; margin: 0 0 .35rem; }
table.users td.actions .btn { width: 100%; white-space: nowrap; }
table.users td:nth-child(5) { min-width: 8.5rem; }

/* closing a training: who completed it */
fieldset.afgerond { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1rem .8rem; margin: .4rem 0 1rem; }
fieldset.afgerond legend { font-weight: 600; padding: 0 .3rem; }
fieldset.afgerond label.check { display: flex; margin: .3rem 0; }

/* figures table: many narrow number columns */
table.figures { font-size: .88rem; }
table.figures th, table.figures td { padding: .45rem .5rem; }
table.figures th.num { white-space: normal; vertical-align: bottom; }
.nowrap { white-space: nowrap; }
.purge-form { margin-top: 1rem; }
table.figures th { text-transform: none; letter-spacing: 0; font-size: .8rem; white-space: normal; line-height: 1.2; }
table.figures td:nth-child(2) { min-width: 7rem; }

/* a form button that looks like a link (logout) */
.linkbutton { background: none; border: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.topbar .user form.inline { display: inline; }
