:root {
  --brand: #1463d5;
  --brand-dark: #0a4296;
  --brand-soft: #eaf2ff;
  --surface: #ffffff;
  --page: #f5f8fd;
  --ink: #15233d;
  --muted: #596981;
  --border: #d5e0f0;
  --focus: #c77a00;
  --danger: #b42318;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: radial-gradient(circle at top right, #e9f2ff 0, transparent 30rem), var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: var(--brand-dark); text-underline-offset: .16em; }
a:hover { color: #06357a; }
h1, h2, h3 { color: #102f62; font-weight: 750; letter-spacing: -.018em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.25rem); }

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus-visible {
  position: fixed;
  z-index: 2000;
  top: .75rem;
  left: .75rem;
  width: auto;
  height: auto;
  margin: 0;
  padding: .65rem .9rem;
  overflow: visible;
  clip: auto;
  background: #fff;
  border: 2px solid var(--brand-dark);
  border-radius: .5rem;
  box-shadow: 0 6px 18px #102f6233;
}

.bg-brand { background: linear-gradient(118deg, #083a87, var(--brand)) !important; }
.navbar { min-height: 68px; box-shadow: 0 3px 18px #0c39732e; }
.navbar-brand { font-size: 1.35rem; letter-spacing: .02em; }
.navbar-toggler { min-width: 44px; min-height: 44px; padding: .48rem .62rem; border-color: #ffffffa8; }
.navbar-toggler:focus { box-shadow: 0 0 0 .22rem #ffffff80; }
.navbar-nav { gap: .1rem; }
.nav-link { padding: .55rem .72rem !important; font-weight: 600; border-radius: .45rem; }
.nav-link:hover, .nav-link:focus-visible { background: #ffffff22; }
.nav-link.btn-link { border: 0; }

main { padding-bottom: 3rem !important; }
.btn {
  min-height: 44px;
  padding: .56rem 1rem;
  border-radius: .58rem;
  font-weight: 650;
  line-height: 1.35;
}
.btn-sm { min-height: 36px; }
.btn-brand, .btn-success { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus, .btn-success:hover, .btn-success:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { border-color: var(--brand); color: var(--brand); }
.btn-outline-brand:hover, .btn-outline-brand:focus { background: var(--brand); color: #fff; }
.btn + .btn { margin-left: .35rem; }

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea, .form-control, .form-select {
  width: 100%;
  min-height: 46px;
  padding: .62rem .75rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b8c9e0;
  border-radius: .56rem;
}
textarea { min-height: 104px; }
input[type="checkbox"], input[type="radio"] { width: 1.1em; height: 1.1em; accent-color: var(--brand); }
.form-label { margin-bottom: .42rem; color: #243b60; font-weight: 700; }
.form-text { color: var(--muted); }
.field-error { margin: .42rem 0 0; color: var(--danger); font-weight: 600; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #e5a33a;
  outline: 3px solid color-mix(in srgb, var(--focus) 72%, transparent);
  outline-offset: 2px;
}
.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
  border-color: #548ce0;
  box-shadow: 0 0 0 .25rem #1463d52e;
}

.auth-card, .form-card {
  max-width: 540px;
  margin: clamp(1.5rem, 6vh, 4.5rem) auto;
  padding: clamp(1.35rem, 4vw, 2.35rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 14px 36px #1a4a8a16;
}
.auth-card h1 { margin-bottom: .28rem; }
.eyebrow { margin: 0 0 .28rem; color: var(--brand-dark); font-size: .85rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.card, .list-group-item, .modal-content { border-color: var(--border); box-shadow: 0 4px 15px #1a4a8a0d; }
.card { border-radius: .85rem; }
.card-header { background: #f9fbff; border-bottom-color: var(--border); font-weight: 700; }
.list-group-item-action:hover { background: var(--brand-soft); color: var(--ink); }
.metric {
  height: 100%;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .9rem;
  box-shadow: 0 5px 18px #1a4a8a12;
}
.metric span { display: block; color: var(--muted); font-weight: 600; }
.metric strong { color: var(--brand-dark); font-size: clamp(1.5rem, 3vw, 2rem); }
.change-box { margin-bottom: 1rem; padding: 1rem; background: var(--brand-soft); border: 1px solid #bfd6fb; border-radius: .75rem; }
.change-box strong { display: block; color: var(--brand-dark); font-size: 2rem; }

.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .72rem .75rem; border-color: var(--border); vertical-align: middle; }
.table thead th { background: #edf4ff; color: #26466f; font-size: .88rem; font-weight: 800; letter-spacing: .02em; }
.table-responsive { border: 1px solid var(--border); border-radius: .75rem; }
.pagination { --bs-pagination-color: var(--brand); --bs-pagination-border-color: var(--border); --bs-pagination-hover-color: var(--brand-dark); --bs-pagination-hover-bg: var(--brand-soft); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); }
.alert { border-radius: .7rem; font-weight: 550; }
.alert-info { background: var(--brand-soft); border-color: #bfd6fb; color: #123d78; }

.leave-calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.calendar-day { min-height: 132px; padding: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: .75rem; }
.calendar-day--weekend { background: #f0f5fc; }
.calendar-day--overlap { border: 2px solid #e49a24; }
.calendar-day__date { color: #26466f; font-weight: 800; }
.calendar-entry { margin-top: .55rem; padding: .45rem .55rem; background: var(--brand-soft); border-radius: .45rem; font-size: .88rem; }
.calendar-entry strong, .calendar-entry span { display: block; }
.calendar-entry span, .calendar-empty { color: var(--muted); }
.calendar-warning { margin: .4rem 0 0; color: #865300; font-size: .82rem; font-weight: 700; }
.annual-plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .85rem; }
.annual-month { min-height: 158px; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: .8rem; }
.annual-month h2 { color: var(--brand-dark); text-transform: capitalize; }
.annual-month__entries { display: grid; gap: .45rem; }
.annual-entry { padding: .5rem .6rem; background: var(--brand-soft); border-left: 3px solid var(--brand); border-radius: .3rem; font-size: .88rem; }
.annual-entry strong, .annual-entry span { display: block; }
.annual-entry span { color: var(--muted); }

@media (max-width: 991.98px) {
  .navbar-nav { padding: .65rem 0 .35rem; }
  .navbar-nav .nav-link { padding: .66rem .72rem !important; }
  .btn + .btn { margin-left: 0; margin-top: .4rem; }
}
@media (max-width: 575.98px) {
  main { padding-top: 1.25rem !important; }
  .auth-card, .form-card { margin-top: 1rem; border-radius: .8rem; }
  .table > :not(caption) > * > * { padding: .6rem; }
  .leave-calendar, .annual-plan { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
