/* Colors and fonts come from /brand.css (generated from tenant.json).
   Every color here is a variable, so one tenant file restyles everything. */
:root {
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-strong); }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: var(--display-weight);
  text-transform: var(--display-transform);
  line-height: 1.05;
  letter-spacing: .01em;
  margin: 0 0 .5em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.bar { background: var(--bar); color: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.bar-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 16px; height: 60px;
  display: flex; align-items: center; gap: 16px;
}
.bar img { height: 30px; width: auto; display: block; }
.bar .who { margin-left: auto; font-size: 14px; color: rgba(255,255,255,.75); text-align: right; min-width: 0; }
.bar .who strong { color: #fff; font-weight: 600; }
.bar a, .bar button.link { color: rgba(255,255,255,.85); }
.bar-tag {
  font-family: var(--display); font-weight: var(--display-weight); text-transform: uppercase; letter-spacing: .06em;
  font-size: 15px; color: var(--accent); white-space: nowrap;
}

/* ---------- buttons & forms ---------- */
button, .btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 999px; padding: 12px 20px;
  background: var(--surface-2); color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { opacity: .55; cursor: wait; }
button.primary, .btn.primary { background: var(--accent); color: var(--on-accent); }
button.primary:hover { background: var(--accent-hi); }
button.ghost, .btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
button.danger { background: var(--err); color: var(--on-accent); }
button.small, .btn.small { padding: 6px 12px; font-size: 14px; }
button.link {
  background: none; padding: 0; border-radius: 0; font-weight: 500; color: var(--accent-strong);
  text-decoration: underline; text-underline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 14px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-size: 16px; /* 16px stops iOS zooming in */
  padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text);
}
textarea { min-height: 70px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 160px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.msg { min-height: 1.5em; margin: 12px 0; font-weight: 600; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); }
.muted { color: var(--muted); }
.small-print { font-size: 13px; color: var(--muted); }

/* ---------- sign-in ---------- */
.narrow { max-width: 420px; margin: 0 auto; padding: 32px 16px 48px; }
.narrow .card { padding: 24px; }
.narrow button[type=submit] { width: 100%; margin-top: 6px; }

/* ---------- employee clock ---------- */
.clock { max-width: 480px; margin: 0 auto; padding: 20px 16px 48px; }
.status {
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px;
  text-align: center; position: relative; overflow: hidden;
}
.status::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--muted); }
.status.in::before { background: var(--accent); }
.status.meal::before, .status.rest::before { background: var(--warn); }
.status-label { font-family: var(--display); font-weight: var(--display-weight); font-size: 2.1rem; text-transform: var(--display-transform); line-height: 1; }
.status-since { color: var(--text-2); margin-top: 6px; }
.status-timer { font-variant-numeric: tabular-nums; font-size: 2.6rem; font-weight: 700; margin-top: 10px; letter-spacing: .02em; }
.status.out .status-timer { display: none; }
.status-warn { margin-top: 12px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-strong); border-radius: 10px; padding: 8px 10px; font-size: 14px; }

.actions { display: grid; gap: 12px; margin-top: 18px; }
.actions button { width: 100%; padding: 20px; font-size: 1.15rem; border-radius: 16px; }
.actions .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions .pair button { padding: 16px 10px; font-size: 1rem; }
.actions button.confirming { background: var(--err); color: var(--on-accent); }

.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 20px; }
.totals div:nth-child(3) { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.totals div:nth-child(3) span { flex-basis: 100%; }
.totals small { color: var(--muted); font-size: 13px; }
.totals div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.totals span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.totals strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }

.recent { list-style: none; margin: 0 0 20px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.recent li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--surface-2); }
.recent li:first-child { border-top: 0; }
.recent .when { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.recent .empty { color: var(--muted); }

/* ---------- manager ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a {
  padding: 10px 14px; text-decoration: none; color: var(--text-2); font-weight: 600; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tabs a[aria-current=page] { color: var(--text); border-color: var(--accent); }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; border-left: 5px solid var(--line); }
.person.in { border-left-color: var(--accent); }
.person.meal, .person.rest { border-left-color: var(--warn); }
.person h3 { font-family: var(--body); text-transform: none; font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; }
.person p { margin: 2px 0; font-size: 14px; }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill.in { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-strong); }
.pill.meal, .pill.rest { background: var(--warn-bg); color: var(--warn); }
.pill.fix { background: var(--err-bg); color: var(--err); }
.pill.review { background: var(--warn-bg); color: var(--warn); }
.pill.info { background: var(--surface-2); color: var(--text-2); }
.pill.ot { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-strong); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.toolbar label { margin: 0; flex: 0 1 170px; }
.toolbar .presets, .toolbar .exports { display: flex; gap: 6px; flex-wrap: wrap; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--surface-2); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 24px; }

.sheet { margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sheet > summary { cursor: pointer; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; list-style: none; }
.sheet > summary::-webkit-details-marker { display: none; }
.sheet > summary::before { content: "▸"; color: var(--muted); }
.sheet[open] > summary::before { content: "▾"; }
.sheet > summary strong { font-size: 1.05rem; }
.sheet .body { padding: 0 16px 16px; }
.sheet table { border: 1px solid var(--surface-2); }

.punch {
  background: none; color: var(--text); padding: 2px 6px; margin: -2px -6px; border-radius: 6px;
  font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.punch:hover { background: var(--surface-2); }
.punch .edited { color: var(--accent-strong); font-weight: 800; margin-left: 2px; }
.loc { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.flags { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.issues { margin: 12px 0 0; }
.issues li { margin: 4px 0; }

dialog { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(7,9,15,.55); }
dialog form { padding: 22px; }
dialog .buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 8px; }
dialog .buttons .spacer { flex: 1; }
.history { font-size: 14px; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; }
.history ol { margin: 6px 0 0; padding-left: 20px; }

.notice { background: var(--ok-bg); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.notice code { font-size: 1.1rem; font-weight: 700; background: var(--bg); padding: 2px 8px; border-radius: 6px; user-select: all; }
.signin-note:empty { display: none; }

@media (max-width: 560px) {
  .bar .who .name-full { display: none; }
  h1 { font-size: 1.7rem; }
}
.spaced { margin-bottom: 20px; }

/* ---------- hub ---------- */
.launcher { display: grid; gap: 12px; margin: 8px 0 24px; }
.tool {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  text-decoration: none; color: var(--text); border-left: 5px solid var(--accent);
}
.tool:hover { border-color: var(--accent); }
.tool strong { font-family: var(--display); font-weight: var(--display-weight); font-size: 1.5rem; text-transform: var(--display-transform); display: block; line-height: 1; }
.tool span.role { color: var(--muted); font-size: 14px; }
.tool .go { font-weight: 700; color: var(--accent-strong); white-space: nowrap; }
.tool.off { border-left-color: var(--line); opacity: .7; }
.access-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.check input { width: auto; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; }
.notice.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.notice.err { background: var(--err-bg); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
td .row { gap: 6px; }
details.edit > summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; font-size: 14px; list-style: none; }
details.edit[open] { background: var(--bg); border-radius: 10px; padding: 10px; margin-top: 6px; }

/* ---------- brand mark and "powered by" ---------- */
.brand-mark { display: flex; align-items: center; }
main { flex: 1 0 auto; width: 100%; }
.powered {
  text-align: center; font-size: 12px; color: var(--muted); padding: 24px 16px 28px;
}
.powered a { color: var(--muted); }
.powered a:hover { color: var(--text-2); }
