:root {
  color-scheme: light;
  --ink: #172b4d;
  --muted: #6b7a90;
  --line: #e2e8f0;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --navy: #112b4a;
  --blue: #2463eb;
  --blue-soft: #eaf1ff;
  --green: #16805d;
  --green-soft: #e7f6ef;
  --red: #c23b45;
  --red-soft: #fff0f0;
  --amber: #a56410;
  --amber-soft: #fff6df;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
.topbar {
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  gap: 28px;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 4px 14px #112b4a1a;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: #fff;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.03em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand span { color: #a8c6ff; font-size: 10px; letter-spacing: .16em; }
.nav { display: flex; align-items: center; gap: 20px; flex: 1; }
.nav a { color: #d8e4f4; font-size: 13px; font-weight: 600; white-space: nowrap; }
.nav a:hover { color: #fff; text-decoration: none; }
.user-chip {
  padding: 7px 11px;
  border: 1px solid #ffffff33;
  border-radius: 999px;
  color: #d8e4f4;
  font-size: 12px;
  white-space: nowrap;
}
.page { width: min(1240px, 100%); margin: 0 auto; padding: 34px 24px 60px; }
.footer { padding: 18px 24px 30px; color: #9aa7b8; text-align: center; font-size: 12px; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(28px, 3vw, 36px); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin-bottom: 14px; font-size: 19px; letter-spacing: -.02em; }
h3 { margin-bottom: 8px; font-size: 17px; line-height: 1.3; }
.eyebrow { margin-bottom: 8px; color: #7184a1; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.muted { color: var(--muted); }
.date-title { color: #6b7a90; font-size: .6em; font-weight: 550; letter-spacing: 0; vertical-align: .2em; }
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover { text-decoration: none; filter: brightness(.97); }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 3px 8px #2463eb26; }
.button-light { color: var(--ink); background: #fff; border-color: var(--line); }
.button-small { min-height: 34px; padding: 7px 11px; border-color: var(--line); color: var(--ink); background: #fff; font-size: 12px; }
.button-danger { color: var(--red); border-color: #f3c7cb; background: #fff; }
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.date-tab {
  display: inline-flex;
  align-items: center;
  min-height: 35px;
  padding: 7px 13px;
  border-radius: 9px;
  color: #546780;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.date-tab.selected { color: #1c55cf; background: var(--blue-soft); }
.date-picker { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.date-picker label, .toolbar label { color: var(--muted); font-size: 12px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid #d8e0ea;
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: #7ca3f8; box-shadow: 0 0 0 3px #2463eb16; }
input[type="checkbox"] { width: 17px; min-height: 17px; margin: 0; accent-color: var(--blue); }
label { display: flex; flex-direction: column; gap: 6px; color: #52647c; font-size: 12px; font-weight: 650; }
.section-block { margin-top: 30px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.section-heading h2 { margin: 0; }
.text-link { font-size: 13px; font-weight: 650; white-space: nowrap; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th { padding: 12px 14px; border-bottom: 1px solid var(--line); color: #718097; background: #f9fbfd; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
.row-shortage { background: #fff8f7; }
.row-shortage td:first-child { box-shadow: inset 3px 0 var(--red); }
.row-shortage td:nth-child(6) strong { color: var(--red); }
.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 4px 14px #1d34520a;
}
.narrow { max-width: 520px; }
.login-card {
  width: min(440px, 100%);
  margin: 55px auto 90px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 16px 48px #17355b15;
}
.login-card h1 { font-size: 30px; }
.stack { display: grid; gap: 16px; margin-top: 23px; }
.stack .button { width: 100%; margin-top: 3px; }
.alert { margin: 0 0 18px; padding: 13px 15px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; }
.alert ul { margin: 7px 0 0; padding-left: 21px; }
.alert-error { color: #8d2029; border-color: #f1c3c7; background: var(--red-soft); }
.alert-warning { color: #79500c; border-color: #f3ddaa; background: var(--amber-soft); }
.alert-success { color: #176348; border-color: #b8e4d0; background: var(--green-soft); }
.request-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.request-card { padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 4px 14px #1d345208; }
.request-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; }
.request-meta { margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.progress-line { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.progress-line span { color: var(--muted); }
.checklist-counts { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.checklist-counts span { padding: 5px 8px; border: 1px solid #e8edf3; border-radius: 999px; color: #52647c; background: #f8fafc; font-size: 11px; white-space: nowrap; }
.checklist-panel { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 999px; color: #5d6c80; background: #edf1f5; font-size: 11px; font-weight: 750; white-space: nowrap; }
.pill-open { color: #176348; background: var(--green-soft); }
.pill-status { color: #31558e; background: #eef3fc; }
.empty-state { padding: 22px; border: 1px dashed #cbd5e1; border-radius: 13px; color: #77869a; background: #ffffff9c; text-align: center; font-size: 13px; }
.filter-bar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.filter-bar label { min-width: 150px; flex: 1; }
.form-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-layout.compact { max-width: 920px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 14px; }
.form-section h2 { grid-column: 1 / -1; }
.form-wide { grid-column: 1 / -1; }
.confirm-box { display: flex; flex-direction: row; align-items: center; gap: 10px; color: var(--ink); }
.form-actions { display: flex; gap: 10px; }
.form-section textarea { resize: vertical; }
.detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
.details { display: grid; grid-template-columns: 155px 1fr; gap: 9px 14px; margin: 0; font-size: 13px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.timeline { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.timeline li { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 2px solid #cad9f5; }
.timeline span { color: var(--muted); font-size: 11px; }
.inline-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.inline-form label { min-width: 145px; flex: 1; }
.inline-form .grow { flex: 2; }
.status-action { margin-top: 15px; }
.shift-panel { margin-top: 16px; }
.assignment-list { display: grid; }
.assignment-row { display: grid; grid-template-columns: minmax(190px, 1fr) 120px minmax(390px, 1.7fr); align-items: center; gap: 13px; padding: 13px 0; border-top: 1px solid #edf1f5; }
.assignment-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.assignment-person div { display: flex; flex-direction: column; min-width: 0; }
.assignment-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignment-person small { color: var(--muted); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #2854a4; background: #e9f0ff; font-weight: 750; }
.attendance-form { display: flex; align-items: center; gap: 7px; }
.attendance-form select { min-width: 120px; }
.attendance-form .late-input { width: 70px; }
.confirm-label { display: flex; flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.user-actions { min-width: 250px; }
.inline-mini { display: flex; gap: 6px; margin-bottom: 6px; }
.inline-mini input { min-width: 150px; }
.login-card .eyebrow { color: var(--blue); }
.portal-folder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.portal-folder-card, .portal-page-card { padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 4px 14px #1d345208; }
.portal-folder-title, .portal-folder-meta, .portal-page-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.portal-folder-card h2, .portal-page-card h2 { margin: 3px 0 0; }
.portal-folder-meta { margin-top: 18px; color: var(--muted); font-size: 12px; }
.portal-count { padding: 5px 9px; border-radius: 999px; color: #31558e; background: #eef3fc; font-size: 11px; font-weight: 750; white-space: nowrap; }
.portal-page-list { display: grid; gap: 10px; }
.portal-page-card .muted { margin: 5px 0 0; font-size: 12px; }
.portal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-article { max-width: 900px; }
.portal-updated { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.portal-body { overflow-wrap: anywhere; line-height: 1.7; }
.portal-body p { margin: 0 0 1em; }
.portal-body p:last-child { margin-bottom: 0; }
.portal-body ul { margin: 0 0 1em; padding-left: 24px; }
.portal-delete-form { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.portal-form { display: grid; gap: 16px; max-width: 900px; }
.portal-form textarea { min-height: 260px; resize: vertical; line-height: 1.5; }
.portal-folder-fields { max-width: 650px; }

@media (max-width: 900px) {
  .topbar { gap: 16px; padding: 0 18px; flex-wrap: wrap; }
  .nav { gap: 13px; }
  .user-chip { display: none; }
  .assignment-row { grid-template-columns: 1fr; align-items: start; gap: 9px; }
  .attendance-form { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar { min-height: auto; padding: 14px 16px 12px; gap: 11px; }
  .brand { width: 100%; font-size: 18px; }
  .nav { width: 100%; flex: none; gap: 16px; overflow-x: auto; padding: 2px 0 5px; }
  .nav a { font-size: 12px; }
  .page { padding: 24px 15px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 13px; margin-bottom: 18px; }
  .page-heading .button { align-self: stretch; }
  h1 { font-size: 28px; }
  h2 { font-size: 17px; }
  .toolbar { flex-wrap: wrap; padding: 9px; gap: 4px; }
  .date-picker { width: 100%; margin: 9px 0 0; padding-top: 9px; border-top: 1px solid var(--line); }
  .date-picker label { display: none; }
  .date-picker input { flex: 1; min-width: 0; }
  .request-grid, .detail-grid, .form-layout, .form-layout.compact { grid-template-columns: 1fr; }
  .portal-folder-grid { grid-template-columns: 1fr; }
  .portal-page-card, .portal-folder-title, .portal-folder-meta { align-items: flex-start; }
  .portal-page-card, .portal-folder-meta { flex-direction: column; }
  .portal-page-card .text-link { align-self: flex-start; }
  .panel { padding: 17px; }
  .form-section { grid-template-columns: 1fr; }
  .form-section h2, .form-wide { grid-column: 1; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label { min-width: 0; }
  .filter-bar .button { width: 100%; }
  .section-heading { align-items: flex-start; }
  .section-heading .text-link { align-self: center; }
  .details { grid-template-columns: 115px 1fr; gap: 8px 10px; }
  .request-card { padding: 16px; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .inline-form label { min-width: 0; }
  .inline-form .button { width: 100%; }
  .attendance-form { display: grid; grid-template-columns: 1fr auto; }
  .attendance-form select { grid-column: 1 / -1; }
  .attendance-form .late-input { width: 82px; }
  .assignment-row { padding: 14px 0; }
  .checklist-counts { gap: 5px; }
  .checklist-counts span { font-size: 10px; }
  .login-card { margin: 32px auto 60px; padding: 25px 20px; }
}
