:root {
  --bg: #f7f5fa;
  --card: #ffffff;
  --ink: #2a2a2a;
  --muted: #6b6775;
  --line: #e5e0ec;
  --accent: #7357a4;
  --accent-ink: #ffffff;
  --box: #faf8fc;
  --warn: #b42318;
  --ok-bg: #f1ebfb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17151c;
    --card: #211e28;
    --ink: #eeecf2;
    --muted: #a49fae;
    --line: #35313e;
    --accent: #a78bdb;
    --accent-ink: #17151c;
    --box: #2a2632;
    --warn: #ff7b72;
    --ok-bg: #2c2538;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* Mother Puppers brand */
:root { --brand-purple: #7357a4; --brand-charcoal: #2a2a2a; --brand-tan: #d4a574; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 17px; margin-right: auto; }
.brand .logo { height: 46px; width: auto; display: block; }
.brand small { display: block; padding-left: 12px; border-left: 2px solid var(--brand-tan); font-weight: 500; font-size: 12px; color: var(--muted); }
.login-logo { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto 10px; }
@media (max-width: 520px) {
  .brand .logo { height: 36px; }
  .brand small { font-size: 11px; padding-left: 8px; }
}

.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.big { width: 100%; padding: 12px; font-size: 16px; margin-top: 8px; }
.btn:disabled { opacity: .5; cursor: default; }

.top { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 3px solid var(--brand-purple); }
.top-row { display: flex; align-items: center; gap: 10px; max-width: 980px; margin: 0 auto; padding: 10px 16px; flex-wrap: wrap; }
.me { white-space: nowrap; font-weight: 600; }

main { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card h2 { margin: 0 0 4px; font-size: 20px; color: var(--accent); }
.intro { margin: 0 0 12px; }
.note { background: var(--ok-bg); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; font-size: 14px; }

label, .label { display: block; font-weight: 700; margin: 16px 0 6px; }
input[type=text], input[type=password], textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--box); padding: 10px 12px;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.photo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.photo-box { margin: 0; width: 150px; height: 150px; border: 2px dashed var(--line); border-radius: 12px; background: var(--box);
  display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; cursor: pointer; font-weight: 500; color: var(--muted); padding: 8px; }
.photo-box.has { border-style: solid; border-color: var(--accent); padding: 0; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-side { flex: 1; min-width: 180px; }
.photo-side label.btn { margin: 0; font-weight: 600; }
.photo-side p { margin: 8px 0 0; }

.err { color: var(--warn); margin-top: 10px; min-height: 1em; font-weight: 600; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: 100%; max-width: 360px; }
.login h1 { margin: 0; }
.login p { text-align: center; color: var(--muted); margin: 0 0 8px; }
.login label { margin: 12px 0 4px; }
.login .btn { width: 100%; margin-top: 16px; padding: 10px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: calc(100% - 32px); }

/* ---- HR portal ---- */
.tabs { display: flex; gap: 2px; max-width: 980px; margin: 0 auto; padding: 0 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 9px 12px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--brand-tan); }
.admin-only { display: none; }
body.admin .admin-only { display: revert; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 11px; line-height: 18px; text-align: center; vertical-align: 1px; }

main h2 { margin: 0 0 10px; font-size: 20px; color: var(--accent); }
main h3 { margin: 18px 0 8px; font-size: 16px; }
.card + .card, .card + h2, .grid + .card { margin-top: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid .card { margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.btn.small, .btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.danger { color: var(--warn); }
.btn.ok { background: #1f7a4d; border-color: #1f7a4d; color: #fff; }
.alert { background: var(--ok-bg); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 14px; margin: 0 0 10px; }
.alert.warn { border-left-color: var(--warn); }
.alert a { color: var(--accent); font-weight: 600; }
.empty { color: var(--muted); font-style: italic; margin: 6px 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.ann h3 { margin: 0 0 2px; }
.ann .body { white-space: pre-wrap; margin-top: 6px; }
.pin { color: var(--brand-tan); }
.meta { color: var(--muted); font-size: 13px; }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: var(--box); border: 1px solid var(--line); }
.pill.pending { background: #fff4d6; color: #7a5600; border-color: #f0d68a; }
.pill.approved { background: #dff5e8; color: #1f6b43; border-color: #a6dcbc; }
.pill.denied { background: #fde2e1; color: #9b1c15; border-color: #f3b0ac; }
.pill.cancelled { color: var(--muted); text-decoration: line-through; }
@media (prefers-color-scheme: dark) {
  .pill.pending { background: #3d3317; color: #f1d27a; border-color: #5d4c1d; }
  .pill.approved { background: #193a29; color: #8fe0b3; border-color: #275a3e; }
  .pill.denied { background: #431c1a; color: #ff9d96; border-color: #6a2a26; }
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--box); }
.scroll { overflow-x: auto; }

.f label { margin: 12px 0 4px; font-size: 14px; }
.f .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { form.f .two { grid-template-columns: 1fr; } }
input[type=date], input[type=number], input[type=email], input[type=tel], input[type=file], select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--box); padding: 9px 12px; font: inherit; color: inherit;
}
textarea.short { min-height: 70px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
label.check input { width: auto; }
.help { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.privacy { font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); margin-top: 16px; padding-top: 10px; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: 11px; color: var(--muted); text-align: center; font-weight: 700; }
.cal .day { min-height: 64px; border: 1px solid var(--line); border-radius: 6px; padding: 3px; font-size: 11px; background: var(--card); }
.cal .day.other { opacity: .45; }
.cal .day.today { border-color: var(--accent); border-width: 2px; }
.cal .day .n { font-weight: 700; color: var(--muted); }
.cal .who { display: block; border-radius: 4px; padding: 0 4px; margin-top: 2px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .who.pend { opacity: .55; outline: 1px dashed currentColor; }

.doc { display: flex; gap: 12px; align-items: flex-start; }
.doc .ic { font-size: 24px; line-height: 1; }
.doc .grow { flex: 1; min-width: 0; }
.signed { color: #1f7a4d; font-weight: 700; font-size: 13px; }
.unsigned { color: var(--warn); font-weight: 700; font-size: 13px; }

dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--card); color: var(--ink); width: min(560px, calc(100% - 24px)); }
dialog::backdrop { background: rgba(20, 16, 28, .5); }
dialog form { padding: 20px; max-height: 85vh; overflow: auto; }
dialog h2 { margin: 0 0 8px; color: var(--accent); font-size: 19px; }
dialog .row.end { margin-top: 16px; }
.frame { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.back { display: inline-block; margin-bottom: 10px; color: var(--accent); font-weight: 600; text-decoration: none; }
.note-kind { font-weight: 700; }
.note-kind.Write-up { color: var(--warn); }
.note-kind.Praise { color: #1f7a4d; }
@media print { .top, .btn { display: none !important; } }
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: var(--accent-ink); }
.grid > div > .card + .card { margin-top: 16px; }

/* schedule */
h3.wk { margin: 16px 0 4px; font-size: 15px; }
h3.wk:first-of-type { margin-top: 8px; }
.list.sched > li { display: grid; grid-template-columns: 110px 150px 1fr; gap: 8px; padding: 7px 0; }
.list.sched > li.unavailable { color: var(--muted); }
.list.sched > li.past { opacity: .5; }
.list.sched > li.now .sd { color: var(--accent); font-weight: 700; }
.list.sched .sd { font-weight: 600; }
@media (max-width: 560px) { .list.sched > li { grid-template-columns: 1fr 1fr; } .list.sched .sj { grid-column: 1 / -1; } }
table.week th, table.week td { text-align: center; min-width: 62px; padding: 6px 3px; }
table.week th:first-child, table.week td:first-child { text-align: left; min-width: 110px; white-space: nowrap; }
table.week th:last-child, table.week td:last-child { min-width: 44px; white-space: nowrap; }
table.week td:first-child a { color: inherit; text-decoration: none; font-weight: 600; }
table.week .today { background: var(--ok-bg); }
.chip { font-size: 11px; border-left: 4px solid var(--accent); background: var(--box); border-radius: 4px; padding: 2px 4px; margin: 2px 0; white-space: nowrap; }
.chip.off { border-left-color: var(--line); color: var(--muted); font-style: italic; }
