:root {
  --navy: #0b3d5c;
  --navy-dark: #082c43;
  --navy-soft: #e8f0f6;
  --gold: #c8922a;
  --ink: #16232e;
  --muted: #64798a;
  --line: #dfe7ee;
  --bg: #f4f7f9;
  --card: #ffffff;
  --ok: #15784f;
  --ok-bg: #e6f5ee;
  --warn: #8a5b00;
  --warn-bg: #fdf3dd;
  --bad: #a3242c;
  --bad-bg: #fbeaea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 35, 50, .06), 0 6px 18px rgba(16, 35, 50, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .82rem; }

/* ---------------- layout ---------------- */

.site-header {
  background: var(--navy);
  color: #fff;
  padding: 12px 0;
}
.site-header a { color: #fff; text-decoration: none; }
.bar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.brand { font-weight: 600; font-size: 1.02rem; display: flex; align-items: center; gap: 9px; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--gold); color: var(--navy-dark);
  display: grid; place-items: center; font-weight: 800; font-size: .8rem;
}
.nav { margin-inline-start: auto; display: flex; gap: 16px; font-size: .9rem; flex-wrap: wrap; }
.nav a { opacity: .88; }
.nav a:hover, .nav a.on { opacity: 1; text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 26px 18px 64px; }
.wrap.narrow { max-width: 720px; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  padding: 18px;
  text-align: center;
}

/* ---------------- cards & lists ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card.tight { padding: 14px 16px; }
.card-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2, .card-head h1 { margin: 0; }
.card-head .spacer { margin-inline-start: auto; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.tile:hover { transform: translateY(-1px); border-color: var(--navy); }
.tile .t-title { font-weight: 600; margin-bottom: 3px; }
.tile .t-sub { color: var(--muted); font-size: .87rem; }

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.stat {
  flex: 1 1 150px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat .n { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  background: var(--navy); color: #fff; border: 1px solid var(--navy);
  border-radius: 9px; padding: 9px 16px; font-size: .92rem; font-weight: 500;
  text-decoration: none; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--navy-dark); border-color: var(--navy-dark); }
.btn.ghost { background: #fff; color: var(--navy); }
.btn.ghost:hover { background: var(--navy-soft); }
.btn.danger { background: #fff; color: var(--bad); border-color: #e6c3c5; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 5px 11px; font-size: .82rem; border-radius: 7px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ---------------- microsoft sign-in ---------------- */

.ms-btn {
  width: 100%;
  background: #fff;
  color: #1b1b1b;
  border: 1px solid #8c8c8c;
  border-radius: 9px;
  font-weight: 600;
  gap: 10px;
}
.ms-btn:hover { background: #f3f3f3; border-color: #5e5e5e; }

.or-rule {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 16px; color: var(--muted); font-size: .8rem;
}
.or-rule::before, .or-rule::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ---------------- forms ---------------- */

label { display: block; font-size: .85rem; font-weight: 600; color: #2f4354; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date],
input[type=time], input[type=number], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c9d6e0; border-radius: 8px;
  font: inherit; background: #fff; color: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #8fbada; outline-offset: 0; border-color: var(--navy); }
textarea { min-height: 92px; resize: vertical; }
.field { margin-bottom: 14px; }
.field .hint { color: var(--muted); font-size: .8rem; margin-top: 4px; font-weight: 400; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 9px; font-weight: 400; }
.check input { width: auto; margin-top: 3px; }
.check label { font-weight: 400; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0 0 16px; }
legend { font-weight: 600; font-size: .88rem; padding: 0 6px; }

/* ---------------- danger zone ---------------- */

.danger-zone { border-color: #e6c3c5; background: #fffafa; }
.danger-zone h2 { color: var(--bad); }
details > summary.btn { list-style: none; cursor: pointer; }
details > summary.btn::-webkit-details-marker { display: none; }

/* ---------------- department picker ---------------- */

.dept-picker {
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 340px;
  overflow: auto;
  background: #fff;
}
.dept-group { border-bottom: 1px solid var(--line); padding: 10px 14px; }
.dept-group:last-child { border-bottom: 0; }
.dept-head { margin-bottom: 4px; }
.dept-head input { width: auto; }
.dept-group summary { cursor: pointer; padding-inline-start: 26px; }
.dept-group details[open] summary { margin-bottom: 4px; }

/* ---------------- tables ---------------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: start; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafcfd; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafcfd; }

/* ---------------- badges & alerts ---------------- */

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; background: var(--navy-soft); color: var(--navy);
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.muted { background: #eef2f5; color: var(--muted); }

.alert { border-radius: 10px; padding: 12px 15px; margin-bottom: 18px; font-size: .92rem; border: 1px solid; }
.alert.success { background: var(--ok-bg); border-color: #bfe3d1; color: var(--ok); }
.alert.error { background: var(--bad-bg); border-color: #eec9cb; color: var(--bad); }
.alert.info { background: var(--navy-soft); border-color: #c6dbe9; color: var(--navy); }
.alert ul { margin: 6px 0 0; padding-inline-start: 18px; }

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; }

/* ---------------- slot picker ---------------- */

.day { margin-bottom: 24px; }
.day h3 {
  position: sticky; top: 0; background: var(--bg); padding: 8px 0;
  border-bottom: 1px solid var(--line); margin-bottom: 12px; z-index: 2;
}
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 9px; }
.slot button, .slot .taken {
  width: 100%; border-radius: 9px; padding: 11px 6px; font: inherit; font-size: .9rem;
  border: 1px solid #c9d6e0; background: #fff; cursor: pointer; text-align: center; color: var(--ink);
}
.slot button:hover { border-color: var(--navy); background: var(--navy-soft); }
.slot button.selected { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.slot .taken { background: #f1f4f6; color: #9aabb8; cursor: not-allowed; text-decoration: line-through; }
.slot .cap { display: block; font-size: .72rem; color: var(--muted); }
.slot button.selected .cap { color: #cfe3f0; }

.basket-bar {
  position: sticky; bottom: 0; background: #fff; border-top: 2px solid var(--navy);
  padding: 12px 18px; margin: 24px -18px -64px; display: flex; gap: 14px;
  align-items: center; flex-wrap: wrap; box-shadow: 0 -6px 18px rgba(16,35,50,.08);
}
.basket-bar .count { font-weight: 600; }

/* ---------------- compare grid ---------------- */

.compare { overflow-x: auto; }
.compare table { border-collapse: collapse; min-width: 100%; font-size: .88rem; }
.compare th, .compare td { border: 1px solid var(--line); padding: 6px; text-align: center; }
.compare th { background: #fafcfd; font-size: .8rem; }
.compare th.time-col, .compare td.time-col { background: #fafcfd; font-weight: 600; white-space: nowrap; }
.compare .cell-btn { width: 100%; border: 0; background: #eef7ee; color: #15784f; border-radius: 6px; padding: 7px 4px; cursor: pointer; font: inherit; font-size: .82rem; }
.compare .cell-btn:hover { background: #d8efe1; }
.compare .cell-btn.selected { background: var(--navy); color: #fff; font-weight: 600; }
.compare .cell-none { color: #c2ccd4; }

/* ---------------- steps ---------------- */

.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 6px; }

.instructions {
  background: var(--navy-soft); border: 1px solid #c6dbe9; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 18px; white-space: pre-wrap; font-size: .92rem;
}

/* ---------------- print ---------------- */

@media print {
  .site-header, .site-footer, .no-print, .basket-bar { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  table.data th { background: #eee !important; -webkit-print-color-adjust: exact; }
}

@media (max-width: 620px) {
  .bar { gap: 10px; }
  .nav { width: 100%; margin-inline-start: 0; }
  h1 { font-size: 1.35rem; }
}
