: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; }
@media (min-width: 1024px) {
  .page { width: 100%; max-width: none; padding-right: 24px; padding-left: 24px; }
}
.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%; max-height: calc(100vh - 150px); overflow: 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; }
thead th { position: sticky; top: 0; z-index: 2; background: #f9fbfd; }
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;
}
.shift-list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.shift-list-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.shift-list-card h3 { overflow-wrap: anywhere; }
.shift-list-card .muted { margin-bottom: 10px; }
.shift-list-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 10px 0; }
.shift-quota { font-weight: 600; }
.shift-quota-danger { color: #b42318; }
.shift-quota-ok { color: #067647; }
.shift-table-wrap { max-width: 100%; overflow-x: auto; }
.shift-confirmation-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.shift-confirmation-table th, .shift-confirmation-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.shift-list-text { min-height: 70px; resize: vertical; font-family: inherit; }
.shift-list-common { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.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; }
.pill-danger { color: #8d2029; background: var(--red-soft); }
.pill-call-review { color: #8a4b08; background: #fff0d1; }
.call-recording { padding: 16px 0; border-top: 1px solid var(--line); }
.call-recording:first-of-type { border-top: 0; }
.call-recording h3 { margin-bottom: 10px; }
.call-transcript { max-height: 420px; overflow: auto; white-space: pre-wrap; }
.call-mismatches { display: grid; gap: 12px; margin-top: 14px; }
.call-mismatch { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fffaf0; }
.call-mismatch p { margin: 7px 0; }
.call-mismatch blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid #d6a344; color: var(--muted); }
.call-mismatch.is-accepted { color: #687789; background: #f1f3f5; border-color: #e1e5e9; }
.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; }
.payroll-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 9px; margin-bottom: 17px; }
.payroll-filter { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 9px; margin-left: auto; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.payroll-filter label { min-width: 150px; }
.payroll-filter .check-label { display: flex; flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
.payroll-summary { display: grid; grid-template-columns: repeat(6, minmax(125px, 1fr)); gap: 10px; margin-bottom: 17px; }
.payroll-summary div { display: flex; flex-direction: column; gap: 4px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.payroll-summary span { color: var(--muted); font-size: 11px; }
.payroll-summary strong { font-size: 15px; }
.payroll-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 12px; color: var(--muted); font-size: 11px; }
.payroll-legend i { display: inline-block; width: 13px; height: 13px; margin-right: 4px; border: 1px solid var(--line); border-radius: 3px; vertical-align: -3px; }
.payroll-table { max-height: 72vh; }
.payroll-table table { min-width: 1900px; }
.payroll-table th, .payroll-table td { padding: 8px 9px; }
.payroll-table thead tr:nth-child(2) th { top: 35px; }
.payroll-table td { white-space: nowrap; }
.payroll-table small.block { display: block; white-space: normal; }
.shift-day { background: #f2f7ff; }
.shift-night { background: #f5f2ff; }
.shift-razgon { background: #edf9f4; }
.shift-none { background: #fbfcfd; }
.negative { color: var(--red) !important; font-weight: 750; }
.role-badge { display: inline-flex; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 750; }
.role-worker { color: #4d5d72; background: #edf1f5; }
.role-brigadier { color: #765209; background: #fff2cc; }
.role-coordinator { color: #1d4f91; background: #dceaff; }
.role-mini { display: inline-grid; width: 17px; height: 17px; place-items: center; margin-left: 5px; border-radius: 50%; font-size: 9px; font-weight: 800; vertical-align: 1px; }
.role-mini-brigadier { color: #765209; background: #fff2cc; }
.role-mini-coordinator { color: #1d4f91; background: #dceaff; }
.adjustment-list { min-width: 280px; margin: 8px 0; padding-left: 18px; }
.kind-breakdown { margin: 8px 0; white-space: normal; }
.adjustment-list li { margin-bottom: 8px; white-space: normal; }
.text-button { padding: 0; border: 0; color: var(--red); background: transparent; font-size: 11px; }
.adjustment-form { display: grid; gap: 8px; min-width: 250px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.adjustment-form label { min-width: 0; }
.payroll-note { margin-top: 12px; font-size: 12px; }
.rate-form { align-items: flex-end; }
.rate-form .button { flex: 0 0 auto; }
.rate-history { margin-top: 12px; }

/* menu is always collapsed behind the burger button */
.topbar { flex-wrap: wrap; gap: 12px; padding: 12px 18px; min-height: 60px; }
.brand { flex: 1; }
.user-chip { order: 2; }
.nav-toggle { order: 3; display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 40px; padding: 0 11px; border: 1px solid #ffffff40; border-radius: 10px; background: transparent; }
.nav-toggle span { display: block; height: 2px; border-radius: 2px; background: #fff; }
.nav { order: 4; display: none; width: 100%; flex: none; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 0 6px; }
.topbar.nav-open .nav { display: flex; }
.nav a { padding: 12px 6px; border-top: 1px solid #ffffff1a; font-size: 15px; }
@media (max-width: 900px) {
  .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 { padding: 10px 14px; }
  .brand { font-size: 18px; }
  .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; }
  .payroll-summary { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .payroll-filter { width: 100%; margin-left: 0; }
  .payroll-filter label { flex: 1; }
  .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; }
  .shift-list-grid { grid-template-columns: 1fr; }
  .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; }
}
