:root {
  --navy: #1C2539;
  --ink: #10151F;
  --text: #353535;
  --muted: #5D666F;
  --rule: #E9E9E9;
  --rule-2: #D5D8DC;
  --bg: #F6F6F9;
  --paper: #FFFFFF;
  --orange: #DE4300;
  --orange-hover: #C23A00;
  --orange-tint: #FFF4EE;
  --green: #1B7F4B;
  --green-tint: #E8F6EE;
  --amber: #9A6200;
  --amber-tint: #FFF6E0;
  --red: #C0272D;
  --red-tint: #FDECEC;
  --grey-tint: #EFF0F2;
  --display: "Red Hat Display", "DM Sans", system-ui, sans-serif;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); }
h1, h2 { font-family: var(--display); color: var(--ink); margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.over { color: var(--red); font-weight: 600; }
.wait { color: var(--amber); font-weight: 600; }
.wait-num { color: var(--amber); }

/* Top bar */
.top { background: var(--navy); color: #fff; }
.top-in { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { font: 800 19px var(--display); color: #fff; }
.brand:hover { text-decoration: none; }
.brand span { color: #FF7A3D; font-weight: 600; }
.brand-dark { color: var(--ink); margin-bottom: 18px; }
.brand-dark span { color: var(--orange); }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a { color: #C9CFDB; padding: 8px 12px; border-radius: 6px; font-weight: 500; }
.nav a:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, .08); }
.nav a.on { color: #fff; background: rgba(255, 255, 255, .14); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 2px; border-radius: 10px; background: #FF7A3D; color: var(--ink); font-size: 12px; text-align: center; }
.who { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 14px; }
.who a { color: #fff; }
.who .link { color: #C9CFDB; }
.who form { margin: 0; }

/* Layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 56px; }
.wrap-narrow { max-width: 420px; margin: 0 auto; padding: 8vh 16px 40px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head h2 { margin: 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
main > h1 { margin-bottom: 16px; }
.crumb { margin-bottom: 6px; font-size: 14px; }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.card-accent { border-color: var(--orange); background: var(--orange-tint); }
.narrow { max-width: 440px; }
.narrow h1 { margin-bottom: 10px; }
.split { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.login h1 { margin-bottom: 18px; }
.login .small { margin: 14px 0 0; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; }
.tile-label { font-weight: 600; color: var(--ink); font-size: 14px; }
.tile-num { font: 800 34px/1.15 var(--display); color: var(--ink); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile-num.over { color: var(--red); }
.tile-num.wait-num { color: var(--amber); }
.tile-sub { color: var(--muted); font-size: 13px; }
.tile-sub.wait { color: var(--amber); }

/* Forms */
.stack { display: grid; gap: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: block; font-weight: 500; font-size: 14px; color: var(--ink); }
label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=number], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--rule-2); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; min-height: 40px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
input.short { max-width: 110px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--orange); margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check[hidden] { display: none; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; font-weight: 500; font-size: 14px; color: var(--ink); margin-bottom: 6px; }
.weekdays { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hint { margin: 0; font-weight: 600; color: var(--ink); min-height: 0; }
.hint:empty { display: none; }
.hint.bad { color: var(--red); }
.btn { display: inline-block; padding: 9px 16px; border: 1px solid var(--orange); border-radius: 6px; background: var(--orange); color: #fff; font: 600 14px var(--font); cursor: pointer; min-height: 40px; }
.btn:hover { background: var(--orange-hover); border-color: var(--orange-hover); text-decoration: none; }
.btn-quiet { background: #fff; color: var(--ink); border-color: var(--rule-2); }
.btn-quiet:hover { background: var(--grey-tint); border-color: var(--rule-2); }
.btn-wide { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--orange); font: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--red); }
.inline-filter { margin: 0; }
.inline-filter label { display: flex; align-items: center; gap: 8px; }
.inline-filter select { width: auto; margin: 0; min-height: 36px; padding: 5px 8px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.reset-form { margin: 14px 0 0; }

/* Tables and lists */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table input { margin: 0; }
.reason { min-width: 140px; max-width: 320px; overflow-wrap: anywhere; }
.actions form { margin: 0; }
.empty { color: var(--muted); margin: 0; padding: 8px 0; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.plain li:last-child { border-bottom: 0; }
.row-end { display: flex; align-items: center; gap: 12px; }
.row-end form { margin: 0; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-pending { background: var(--amber-tint); color: var(--amber); }
.pill-approved { background: var(--green-tint); color: var(--green); }
.pill-rejected { background: var(--red-tint); color: var(--red); }
.pill-cancelled { background: var(--grey-tint); color: var(--muted); }
.pill-today { background: var(--orange-tint); color: var(--orange); margin-left: 4px; }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; overflow-wrap: anywhere; }
.flash-ok { background: var(--green-tint); color: #125C36; }
.flash-err { background: var(--red-tint); color: #9C1C22; }
.flash-warn { background: var(--amber-tint); color: #7A4E00; }
.copybox { background: #fff; border: 1px solid var(--rule-2); border-radius: 6px; padding: 12px; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 12px; }

/* Approvals */
.approval { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.approval:first-child { padding-top: 0; }
.approval:last-child { border-bottom: 0; padding-bottom: 0; }
.approval input { margin: 0; }
.approval-btns { display: flex; gap: 8px; }

/* Months */
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.month { background: var(--bg); border-radius: 6px; padding: 8px 4px; text-align: center; color: var(--muted); font-size: 12px; }
.month b { display: block; font: 700 17px var(--display); color: var(--muted); margin-top: 2px; }
.month.has { background: var(--orange-tint); color: var(--ink); }
.month.has b { color: var(--orange); }

/* Holidays */
.holiday-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }

/* Calendar */
.cal { border-collapse: separate; border-spacing: 2px; font-size: 12px; min-width: 100%; }
.cal th, .cal td { text-align: center; min-width: 26px; height: 28px; padding: 0; border-radius: 4px; font-weight: 500; }
.cal thead th { font-weight: 600; color: var(--ink); line-height: 1.2; padding: 2px 0; }
.cal thead th span { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.cal thead th.now { background: var(--navy); color: #fff; }
.cal thead th.now span { color: #C9CFDB; }
.cal td { background: #FAFAFB; }
.cal .cal-name { text-align: left; min-width: 150px; padding-right: 10px; font-size: 14px; white-space: nowrap; background: var(--paper); position: sticky; left: 0; z-index: 1; font-weight: 500; }
.cal .off, .legend .off { background: var(--grey-tint); }
.cal thead th.off { background: var(--grey-tint); }
.cal .hol, .legend .hol { background: #DCE6F7; }
.cal .leave, .legend .leave { background: var(--orange); color: #fff; font-weight: 700; }
.cal .leave-pending, .legend .leave-pending { background: repeating-linear-gradient(45deg, #FFD9C4, #FFD9C4 3px, #FFF0E8 3px, #FFF0E8 6px); color: var(--ink); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }

@media (max-width: 860px) {
  .split, .split.even { grid-template-columns: minmax(0, 1fr); }
  .approval { grid-template-columns: minmax(0, 1fr); }
  .months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .holiday-add { grid-template-columns: minmax(0, 1fr); }
  .top-in { gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
  .who { order: 2; }
  .nav { order: 3; flex: 1 0 100%; margin: 0 -12px; }
  h1 { font-size: 23px; }
}
