:root {
  color-scheme: light;
  --ink: #0c0a0b;
  --ink-soft: #171315;
  --metal: #c5b9aa;
  --metal-light: #eee8df;
  --metal-dark: #8d8175;
  --plum: #4b394b;
  --plum-light: #80647c;
  --cream: #eeeae4;
  --white: #fff;
  --muted: #716a66;
  --line: rgba(65, 52, 53, 0.17);
  --panel: #ffffff;
  --page: #eeeae4;
  --brand-dark: #0c0a0b;
  --brand-steel: #171315;
  --accent: #c5b9aa;
  --accent-strong: #8d8175;
  --accent-soft: #f7f3ed;
  --warning: #b4472e;
  --soft: #f7f3ed;
  --metal-gradient: linear-gradient(115deg, #84796e 0%, #f1ece4 27%, #aaa095 52%, #f7f3ed 72%, #887d72 100%);
  --shadow: 0 18px 44px rgba(12, 10, 11, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 20%, rgba(128, 100, 124, 0.08), transparent 28%),
    var(--page);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(18px, 4vw, 48px);
  background: linear-gradient(135deg, rgba(12, 10, 11, 0.98), rgba(23, 19, 21, 0.98));
  border-bottom: 3px solid transparent;
  border-image: var(--metal-gradient) 1;
  color: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: contrast(1.12) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.65));
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.role-badge {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(197, 185, 170, 0.16);
  border: 1px solid rgba(238, 232, 223, 0.28);
  color: var(--metal-light);
  font-size: 0.84rem;
  font-weight: 750;
}

.top-language {
  display: grid;
  grid-template-columns: auto 74px;
  align-items: center;
  gap: 8px;
  color: var(--metal-light);
  font-size: 0.84rem;
  font-weight: 750;
}

.top-language select {
  min-height: 38px;
  padding: 6px 8px;
  border-color: rgba(238, 232, 223, 0.32);
  background: rgba(255,255,255,0.96);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  color: inherit;
}

h2 {
  font-size: 1.45rem;
}

h3 {
  font-size: 1.05rem;
}

h4 {
  font-size: 0.98rem;
}

.shell {
  display: grid;
  grid-template-columns: minmax(340px, 520px) minmax(0, 1fr);
  gap: 18px;
  padding: 24px clamp(18px, 4vw, 48px) 44px;
}

.shell.manager-mode {
  grid-template-columns: 1fr;
  padding-left: clamp(12px, 2vw, 24px);
  padding-right: clamp(12px, 2vw, 24px);
}

.shell.manager-mode #entryPanel {
  display: none !important;
}

.shell.manager-mode .dashboard {
  max-width: none;
  width: 100%;
  margin: 0;
}

.auth-shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 420px));
  justify-content: center;
  gap: 22px;
  padding: 48px clamp(18px, 4vw, 48px);
}

.auth-single {
  grid-template-columns: minmax(280px, 520px);
}

.entry-panel,
.dashboard,
.language-panel,
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.language-panel {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(862px, 100%);
  padding: 14px 18px;
  border-top: 5px solid var(--accent);
}

.language-panel label {
  grid-template-columns: auto minmax(180px, 260px);
  align-items: center;
}

.entry-panel,
.auth-panel {
  align-self: start;
  padding: 20px;
  border-top: 5px solid var(--accent);
}

.account-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.account-switch-compact {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.link-button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--plum);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover {
  border: 0;
  color: var(--ink);
}

.signup-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.signup-box h2 {
  margin-bottom: 14px;
}

.inline-message {
  display: none;
  padding: 11px 12px;
  border: 1px solid rgba(197, 185, 170, 0.55);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--brand-dark);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.35;
}

.inline-message.is-visible {
  display: block;
}

.inline-message.is-error {
  border-color: rgba(180, 71, 46, 0.35);
  background: #fff7f4;
  color: var(--warning);
}

.helper-text {
  color: var(--muted);
  line-height: 1.45;
}

.dashboard {
  overflow: hidden;
}

.dashboard-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #ffffff, #f7f8fa);
}

.manager-mode .dashboard-title,
.dashboard:first-child .dashboard-title {
  align-items: center;
}

.dashboard-title span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.section-head,
.lines-head,
.line-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.section-head {
  margin-bottom: 22px;
}

.lines-head {
  align-items: center;
  margin: 14px 0 10px;
}

.date-pill {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid rgba(197, 185, 170, 0.45);
  font-size: 0.84rem;
  font-weight: 700;
}

.form-grid,
.line-grid {
  display: grid;
  gap: 14px;
}

#voucherForm > .form-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.35fr) minmax(130px, 0.8fr);
  gap: 10px 12px;
  align-items: end;
}

#voucherForm > .form-grid #homeAddressLabel {
  grid-column: span 2;
}

#voucherForm > .form-grid .date-field,
#voucherForm > .form-grid .voucher-field,
#voucherForm > .form-grid .vehicle-field {
  margin-top: 2px;
}

.line-grid {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.route-start-info {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.time-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr 0.85fr;
  gap: 10px;
}

.note-field {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: #303946;
  font-size: 0.9rem;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd5de;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

input[readonly] {
  background: #f8f4ec;
  color: var(--accent-strong);
  font-weight: 750;
}

.distance-control {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
}

.distance-control button {
  min-height: 44px;
  padding: 0 12px;
  white-space: nowrap;
}

.distance-status {
  display: block;
  min-height: 0;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.distance-status.is-error {
  color: #a94635;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(128, 100, 124, 0.15);
  outline: 0;
}

.project-lines {
  display: grid;
  gap: 12px;
}

.project-line {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  border-left: 4px solid var(--plum);
}

.line-top {
  align-items: center;
  margin-bottom: 8px;
}

.bon-total {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.bon-total div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(197, 185, 170, 0.55);
  border-radius: 8px;
  background: var(--accent-soft);
}

.bon-total span,
.stats span,
.stats small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.bon-total strong {
  display: block;
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 1.1rem;
}

.form-actions,
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-actions {
  margin-top: 18px;
}

button {
  min-height: 42px;
  border: 1px solid #cfd5de;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 9px 14px;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
  filter: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary {
  position: relative;
  overflow: hidden;
  border-color: transparent;
  background: var(--metal-gradient);
  color: var(--ink);
}

.primary::before {
  position: absolute;
  top: -80%;
  left: -35%;
  width: 25%;
  height: 260%;
  background: rgba(255, 255, 255, 0.55);
  content: "";
  transform: rotate(25deg);
  transition: left 0.55s ease;
}

.primary:hover::before {
  left: 120%;
}

.primary:hover {
  border-color: var(--metal-light);
  background: var(--metal-gradient);
}

.icon-button {
  min-width: 48px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.remove-line,
.delete-row,
.approve-row,
.correct-row,
.reject-row {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  line-height: 1;
}

.delete-row {
  color: var(--warning);
  background: #fff;
  border: 1px solid rgba(180, 71, 46, 0.25);
}

.voucher-delete-inline {
  display: block;
  width: fit-content;
  min-width: 0;
  min-height: 30px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
}

.voucher-view-inline {
  display: block;
  width: fit-content;
  min-width: 0;
  min-height: 30px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid rgba(197, 185, 170, 0.65);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.approve-row {
  min-width: 44px;
  color: var(--ink);
  background: var(--accent-soft);
  border: 1px solid rgba(197, 185, 170, 0.45);
}

.correct-row {
  min-width: 54px;
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(197, 185, 170, 0.7);
}

.reject-row {
  min-width: 62px;
  padding: 0 8px;
  color: var(--warning);
  background: #fff7f4;
  border: 1px solid rgba(180, 71, 46, 0.25);
}

.status-rejected {
  color: var(--warning);
}

.rejection-reason {
  display: block;
  margin-top: 5px;
  color: var(--warning);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.stats article {
  min-height: 92px;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  position: relative;
}

.stats article::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  width: 42px;
  height: 4px;
  background: var(--metal-gradient);
}

.stats article:last-child {
  border-right: 0;
}

.stats strong {
  display: block;
  margin-top: 6px;
  font-size: 1.75rem;
  line-height: 1;
}

.approval-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.approval-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--metal-dark);
  background: #fbfaf8;
  text-align: left;
}

.approval-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.approval-card strong {
  color: var(--ink);
  font-size: 1.65rem;
  line-height: 1;
}

.approval-card.is-active {
  border-color: rgba(75, 57, 75, 0.32);
  border-left-color: var(--plum);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(197, 185, 170, 0.35);
}

.toolbar {
  align-items: end;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8f9fb;
}

.toolbar label {
  min-width: 180px;
  flex: 1 1 180px;
}

.people-panel {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.selection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}

.selection-summary strong {
  color: var(--ink);
}

.selection-summary div {
  display: grid;
  gap: 3px;
}

.selection-summary span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.selection-summary button {
  min-height: 34px;
  padding: 6px 12px;
}

.inline-details {
  margin: -2px 0 8px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--metal);
  border-radius: 0 0 8px 8px;
  background: #fff;
  overflow: hidden;
}

.inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}

.inline-head div {
  display: grid;
  gap: 3px;
}

.inline-head strong {
  color: var(--ink);
}

.inline-head span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.inline-close {
  min-height: 34px;
  padding: 6px 12px;
}

.inline-table-wrap {
  border: 0;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.period-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfaf8;
}

.period-tabs button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 6px 12px;
  font-size: 0.82rem;
}

.period-tabs button.is-active {
  background: var(--ink);
  color: #fff;
}

.manager-workspace {
  display: block;
}

.manager-mode .manager-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 14px;
}

.manager-mode .people-panel {
  position: sticky;
  top: 12px;
  align-self: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(36, 31, 32, 0.06);
}

.manager-mode .toolbar #employeeFilterLabel {
  display: none;
}

.people-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.person-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  border-left: 4px solid var(--plum);
  cursor: pointer;
}

.person-row.is-open {
  border-color: rgba(75, 57, 75, 0.35);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(36, 31, 32, 0.08);
}

.person-main {
  display: grid;
  gap: 2px;
}

.person-main span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.person-status {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: normal;
}

.person-status button,
.person-status span,
.person-status b {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.person-status button {
  border: 1px solid rgba(75, 57, 75, 0.25);
  background: var(--accent-soft);
  color: var(--ink);
}

.person-status span {
  border: 1px solid rgba(75, 57, 75, 0.25);
  background: var(--accent-soft);
  color: var(--ink);
}

.person-status b {
  background: var(--ink);
  color: #ffffff;
}

.manager-row {
  background: linear-gradient(135deg, rgba(12, 10, 11, 0.96), rgba(23, 19, 21, 0.96));
  border-color: rgba(197, 185, 170, 0.32);
  border-left-color: var(--metal);
  color: #ffffff;
}

.manager-row .person-main span {
  color: var(--metal);
}

.manager-row .person-status button,
.manager-row .person-status span {
  border-color: rgba(238, 232, 223, 0.25);
  background: rgba(238, 232, 223, 0.08);
  color: var(--metal-light);
}

.manager-row .person-status b {
  background: var(--metal-gradient);
  color: var(--ink);
}

.table-wrap {
  position: relative;
  overflow-x: auto;
}

.manager-mode .table-wrap {
  min-height: 180px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--ink);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  font-size: 0.9rem;
  background: #ffffff;
}

tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

.voucher-detail-row td {
  padding: 0;
  background: #fff !important;
}

.voucher-detail-row td::before {
  display: none;
}

.voucher-detail-card {
  margin: 0;
  padding: 14px;
  border-top: 1px solid rgba(197, 185, 170, 0.45);
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}

.voucher-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.voucher-detail-head > div {
  display: grid;
  gap: 2px;
}

.voucher-detail-head strong {
  font-size: 0.95rem;
}

.voucher-detail-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.voucher-detail-meta {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(180px, 1.4fr) minmax(80px, 0.6fr) minmax(90px, 0.7fr);
  gap: 8px;
  margin-bottom: 10px;
}

.voucher-detail-meta div,
.voucher-detail-empty {
  padding: 9px;
  border: 1px solid rgba(197, 185, 170, 0.55);
  border-radius: 7px;
  background: #fff;
}

.voucher-detail-meta dt,
.voucher-detail-meta dd {
  margin: 0;
}

.voucher-detail-meta dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.voucher-detail-meta dd {
  margin-top: 3px;
  font-weight: 850;
}

.voucher-detail-grid {
  display: grid;
  gap: 8px;
}

.voucher-detail-line {
  padding: 10px;
  border: 1px solid rgba(197, 185, 170, 0.55);
  border-radius: 7px;
  background: #fff;
}

.voucher-detail-line > div {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}

.voucher-detail-line span,
.voucher-detail-line small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.voucher-detail-line small b {
  color: var(--ink);
}

.voucher-detail-line dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 8px;
}

.voucher-detail-line dl div {
  padding: 7px;
  border-radius: 6px;
  background: #fbfaf8;
}

.voucher-detail-line dt,
.voucher-detail-line dd {
  margin: 0;
}

.voucher-detail-line dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.voucher-detail-line dd {
  margin-top: 2px;
  font-weight: 850;
}

.voucher-detail-reason {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(180, 71, 46, 0.25);
  border-radius: 7px;
  background: #fff7f4;
  color: var(--warning);
  font-weight: 800;
}

.project-summary {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}

.project-summary:last-child {
  margin-bottom: 0;
}

.project-summary span {
  color: var(--muted);
  font-size: 0.86rem;
}

.row-actions {
  width: 56px;
  text-align: right;
}

.empty-state {
  display: none;
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

.message {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: none;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(197, 185, 170, 0.55);
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-dark);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.message.is-visible {
  display: block;
}

.message.is-error {
  border-color: rgba(180, 71, 46, 0.35);
  color: var(--warning);
}

@media print {
  :root {
    --shadow: none;
  }

  body {
    background: #ffffff;
  }

  .topbar {
    padding: 0 0 14px;
    border-bottom: 2px solid #1b1f23;
    background: #ffffff;
    color: #1b1f23;
  }

  .brand-logo {
    filter: none;
  }

  .top-actions,
  .entry-panel,
  .toolbar,
  .row-actions,
  .message {
    display: none !important;
  }

  .shell {
    display: block;
    padding: 0;
  }

  .dashboard {
    border: 0;
    box-shadow: none;
  }

  .dashboard-title,
  .people-panel {
    padding: 14px 0;
  }

  .stats {
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid #d9dee7;
  }

  .stats article {
    min-height: auto;
    padding: 10px;
  }

  .people-list {
    grid-template-columns: repeat(2, 1fr);
  }

  table {
    min-width: 0;
    font-size: 11px;
  }

  th,
  td {
    padding: 7px;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    grid-template-columns: minmax(280px, 520px);
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  main {
    padding: 18px 10px 26px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 10px 12px;
    gap: 8px;
  }

  .brand {
    align-items: center;
    gap: 9px;
    min-width: 0;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .brand h1 {
    font-size: clamp(1.25rem, 6.4vw, 1.75rem);
    line-height: 1;
    white-space: normal;
  }

  .brand .eyebrow {
    font-size: 0.62rem;
    margin-bottom: 2px;
  }

  .top-actions {
    width: auto;
    justify-content: flex-end;
    gap: 6px;
  }

  .top-language {
    grid-template-columns: 1fr;
    gap: 2px;
    font-size: 0.68rem;
  }

  .top-language select {
    width: 66px;
    min-height: 34px;
    padding: 4px 6px;
  }

  .role-badge,
  .icon-button {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 10px 28px;
  }

  .language-panel {
    width: 100%;
  }

  .language-panel label {
    grid-template-columns: 1fr;
  }

  .entry-panel,
  .dashboard,
  .auth-panel {
    border-radius: 8px;
  }

  .entry-panel,
  .auth-panel {
    padding: 16px;
  }

  .section-head,
  .dashboard-title,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  input,
  select,
  button {
    min-height: 50px;
    font-size: 1rem;
  }

  #voucherForm > .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  #voucherForm > .form-grid #homeAddressLabel,
  #voucherForm > .form-grid .vehicle-field {
    grid-column: 1 / -1;
  }

  #voucherForm > .form-grid label:first-child {
    display: none;
  }

  #voucherForm > .form-grid .date-field,
  #voucherForm > .form-grid .voucher-field {
    grid-column: auto;
  }

  #voucherForm > .form-grid label {
    gap: 5px;
    font-size: 0.84rem;
  }

  #voucherForm > .form-grid input,
  #voucherForm > .form-grid select {
    min-height: 44px;
    padding: 9px 10px;
    font-size: 0.95rem;
  }

  #voucherForm > .form-grid .voucher-field input {
    font-size: 0.82rem;
    letter-spacing: 0;
  }

  .lines-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
  }

  .lines-head h3 {
    font-size: 1.05rem;
    line-height: 1.1;
  }

  .lines-head .eyebrow {
    font-size: 0.62rem;
  }

  #addProjectLine {
    min-height: 44px;
    padding: 9px 12px;
    font-size: 0.94rem;
    white-space: nowrap;
  }

  .line-grid,
  .approval-strip {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .time-row {
    grid-template-columns: 1fr 1fr 0.8fr;
    gap: 8px;
  }

  .time-row label:last-child {
    grid-column: auto;
  }

  .bon-total {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .bon-total div {
    padding: 8px 7px;
  }

  .project-line label {
    gap: 5px;
    font-size: 0.84rem;
  }

  .project-line input,
  .project-line select,
  .project-line button {
    min-height: 44px;
    font-size: 0.95rem;
    padding: 9px 10px;
  }

  .project-line {
    padding: 10px;
  }

  .line-top h4 {
    font-size: 1.08rem;
  }

  .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 18px -16px -16px;
    padding: 12px 16px;
    background: rgba(238, 234, 228, 0.96);
    border-top: 1px solid var(--line);
  }

  .form-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  .person-row {
    grid-template-columns: 1fr;
  }

  .person-status {
    flex-wrap: wrap;
    white-space: normal;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stats article:nth-child(2) {
    border-right: 0;
  }

  .stats article {
    min-height: auto;
    border-bottom: 1px solid var(--line);
  }

  .stats article:nth-child(3),
  .stats article:nth-child(4) {
    border-bottom: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  td {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px;
    border-bottom: 0;
    padding: 7px 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 750;
  }

  .row-actions {
    display: flex;
    justify-content: flex-end;
    width: auto;
  }

  .row-actions::before {
    content: "";
  }

  .voucher-view-inline,
  .voucher-delete-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    margin-right: 6px;
  }

  .voucher-detail-row {
    padding: 0;
  }

  .voucher-detail-card {
    margin: 0 -14px;
    padding: 12px;
  }

  .voucher-detail-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .voucher-detail-meta {
    grid-template-columns: 1fr;
  }

  .voucher-detail-line dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
