:root {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  color: #182d39;
  background: #f4f7f8;
  font-size: 16px;
  --accent: #176a64;
  --muted: #526875;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  background: #fff;
  border-bottom: 1px solid #d9e3e5;
  padding: 20px max(20px, calc((100vw - 1280px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
header > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  background: var(--accent);
  color: white;
  border-radius: 10px;
  padding: 10px;
  font-weight: 800;
}
.year {
  color: var(--muted);
}
main {
  max-width: 1280px;
  margin: auto;
  padding: 28px 20px 60px;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 12px 0;
}
h2 {
  font-size: 1.2rem;
  margin-top: 0;
}
h3 {
  font-size: 1rem;
}
p {
  line-height: 1.6;
}
.muted,
small {
  color: var(--muted);
}
.banner {
  background: #fff4d9;
  border: 1px solid #d4b570;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.9rem;
}
.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card {
  background: white;
  border: 1px solid #d9e3e5;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 18px;
}
.login {
  max-width: 520px;
  margin: 32px auto;
}
.login form {
  display: grid;
  gap: 16px;
}
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
}
button,
select,
input,
textarea {
  font: inherit;
  border: 1px solid #a4b6be;
  border-radius: 8px;
  padding: 10px 12px;
  max-width: 100%;
  background: white;
  color: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
}
button.primary,
nav button[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.danger {
  color: #9b2639;
}
button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
}
header select {
  width: auto;
}
label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}
label.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
label.check input {
  width: 22px;
  min-height: 22px;
}
textarea {
  min-height: 80px;
  resize: vertical;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.wide {
  grid-column: 1/-1;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.stats .card {
  margin: 0;
}
.stat {
  font-size: 1.7rem;
  font-weight: 700;
  display: block;
}
.months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.month {
  padding: 16px;
  margin: 0;
}
.month h2 {
  text-transform: capitalize;
}
.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.weekday {
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 8px 0;
}
.day {
  min-height: 38px;
  padding: 3px 0;
  position: relative;
  border: 0;
  font-size: 0.8rem;
  border-radius: 6px;
  background: #f3f6f7;
}
.day.holiday {
  box-shadow: inset 0 0 0 1px #9e7d36;
}
.day.submitted {
  background: #fff0c4;
  color: #674700;
}
.day.approved {
  background: #d0ebe6;
  color: #165249;
}
.day.conflict {
  outline: 2px solid #b5324c;
  outline-offset: -2px;
}
.day small {
  display: block;
  font-size: 0.6rem;
  line-height: 1;
}
.day[aria-pressed="true"] {
  box-shadow: inset 0 0 0 3px #244fbb;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 24px;
  font-size: 0.85rem;
}
.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 6px;
  background: #eef2f4;
  font-size: 0.8rem;
}
.badge.approved {
  background: #d0ebe6;
}
.badge.submitted {
  background: #fff0c4;
}
.badge.rejected {
  background: #fbe0e6;
}
.badge.cancelled {
  background: #e7e9ed;
}
.warning {
  color: #9d263b;
}
.request {
  border-left: 4px solid #b9cbcc;
}
.request.approved {
  border-left-color: #176a64;
}
.request.submitted {
  border-left-color: #bc8a24;
}
.entry {
  padding: 14px 0;
  border-bottom: 1px solid #e1e8eb;
}
.entry:last-child {
  border: 0;
}
.employee-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.employee-grid .card {
  margin: 0;
}
.inline {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.inline label {
  flex: 1;
}
.explain {
  background: #edf6f3;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}
.empty {
  text-align: center;
  padding: 30px;
  color: var(--muted);
}
details {
  margin-top: 10px;
}
summary {
  cursor: pointer;
  padding: 8px 0;
}
dl {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 3fr;
  gap: 7px;
  font-size: 0.9rem;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
#message:not(:empty) {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #182d39;
  color: #fff;
  box-shadow: 0 4px 24px #0003;
  padding: 16px 24px;
  border-radius: 12px;
  max-width: 90vw;
  z-index: 5;
}
#message.error {
  background: #8b2237;
}
footer {
  text-align: center;
  color: var(--muted);
  padding: 20px;
  font-size: 0.8rem;
}
a {
  color: #176a64;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #245dc8;
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.title-note {
  max-width: 850px;
}
.login small {
  line-height: 1.6;
}
hr {
  border: 0;
  border-top: 1px solid #e1e8eb;
  margin: 24px 0;
}
@media (min-width: 1100px) {
  .months {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 760px) {
  .months {
    grid-template-columns: repeat(2, 1fr);
  }
  .employee-grid {
    grid-template-columns: 1fr;
  }
  header {
    padding: 14px 16px;
  }
  main {
    padding: 18px 14px 50px;
  }
  .card {
    padding: 16px;
  }
  .month {
    padding: 12px;
  }
  header strong {
    font-size: 0.9rem;
  }
}
@media (max-width: 440px) {
  .months {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 6px;
  }
  .stats .card {
    padding: 12px;
    font-size: 0.8rem;
  }
  .stat {
    font-size: 1.4rem;
  }
  .year {
    display: none;
  }
  nav button {
    flex: 1 1 40%;
  }
  dl {
    grid-template-columns: 1fr;
  }
  header {
    gap: 8px;
  }
  .day {
    min-height: 42px;
  }
}

.history-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.history-records {
  max-height: 460px;
  overflow: auto;
  padding-right: 8px;
}
.history-records article:has(details[open]) {
  padding-bottom: 20px;
}
[hidden] {
  display: none !important;
}
#priorities .employee-grid {
  gap: 20px;
}
@media (max-width: 760px) {
  .history-forms {
    grid-template-columns: 1fr;
  }
  .history-records {
    max-height: 380px;
  }
}

/* Availability is distinct from the public-holiday star and own leave border. */
.day.availability-free,.badge.availability-free {background:#d0f3dc;color:#064a27}
.day.availability-competition,.badge.availability-competition {background:#ffe585;color:#583600}
.day.availability-full,.badge.availability-full {background:#fbb8c1;color:#6d1024}
.day.holiday {outline:3px solid #a60a75;outline-offset:-3px;font-weight:800}
.day.approved {box-shadow:inset 0 0 0 3px #115d56}
.day[aria-pressed=true] {outline:3px solid #1749bc;outline-offset:2px}

.table-scroll{overflow-x:auto;margin:16px 0}table{border-collapse:collapse;min-width:680px;width:100%}th,td{border:1px solid #c7d5da;padding:8px;text-align:center}th:first-child{text-align:left}
