:root {
  --ink: #101413;
  --muted: #65706c;
  --line: #dde4e0;
  --panel: #ffffff;
  --bg: #f6f8f7;
  --soft: #eef3f1;
  --emerald: #008671;
  --danger: #a94442;
  --warn: #8a6417;
  --ok: #146b4d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

body.locked .app-header,
body.locked .workspace {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #ffffff, #eef3f1);
}

.login-screen.is-hidden {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(16, 20, 19, 0.12);
}

.auth-logo {
  width: 64px;
  height: 60px;
  object-fit: contain;
}

.login-card p {
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--soft);
  border-radius: 8px;
}

.auth-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.auth-tabs button.active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 1px 8px rgba(16, 20, 19, 0.08);
}

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

.auth-form.is-hidden {
  display: none;
}

.password-field {
  position: relative;
  display: block;
  margin-top: 6px;
}

.password-field input {
  padding-right: 64px;
}

.password-field button {
  position: absolute;
  top: 50%;
  right: 6px;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--emerald);
  background: var(--soft);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transform: translateY(-50%);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--emerald);
}

.form-help {
  margin: -4px 0 0;
  font-size: 12px;
}

.form-message {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.form-message.success {
  color: var(--ok);
}

.form-message.import-feedback {
  display: grid;
  gap: 4px;
  min-height: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: 8px;
  background: #fff7f7;
  color: var(--danger);
  line-height: 1.35;
}

.form-message.import-feedback.success {
  border-color: rgba(27, 109, 67, 0.2);
  background: #f2fbf6;
  color: #1b6d43;
}

.form-message.import-feedback strong {
  font-size: 13px;
}

.form-message.import-feedback span {
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.link-button {
  width: fit-content;
  min-height: 0;
  border: 0;
  padding: 0;
  color: var(--emerald);
  background: transparent;
  font-weight: 900;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

button,
input,
select {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 20, 19, 0.36);
}

.modal.is-hidden {
  display: none;
}

.modal-card {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(16, 20, 19, 0.22);
}

.check-preview-modal-card {
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 0;
  gap: 0;
}

.check-preview-modal-card > .panel-header {
  padding: 20px 24px 16px;
}

.check-preview-summary,
.check-preview-lines {
  padding: 0 24px;
}

.check-preview-lines {
  padding-bottom: 24px;
}

.check-preview-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 16px;
  align-items: start;
  padding: 18px 24px;
  margin: 0 -24px;
  background: #f6f7fa;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.check-preview-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 14px;
}

.check-preview-facts article,
.check-preview-memo {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.check-preview-facts article:first-child {
  grid-column: 1 / -1;
}

.check-preview-facts span,
.check-preview-total span,
.check-lines-table th,
.check-preview-memo span,
.check-total-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.check-preview-facts strong,
.check-preview-facts input,
.check-preview-memo strong,
.check-preview-memo textarea {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  background: #ffffff;
  border: 1px solid #c7cecd;
  border-radius: 4px;
  font-size: 15px;
  font: inherit;
  font-weight: 800;
}

.check-preview-facts input,
.check-preview-memo textarea,
.check-lines-table select,
.check-lines-table input {
  width: 100%;
  color: var(--ink);
}

.check-preview-total {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 6px;
  padding-top: 2px;
}

.check-preview-total strong {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}

.check-preview-lines {
  display: grid;
  gap: 14px;
}

.check-lines-section {
  display: grid;
  gap: 12px;
  padding-top: 18px;
}

.check-lines-scroll {
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: auto;
}

.check-lines-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  table-layout: fixed;
}

.check-lines-table col.check-line-project {
  width: 28%;
}

.check-lines-table col.check-line-hours {
  width: 14%;
}

.check-lines-table col.check-line-description {
  width: 40%;
}

.check-lines-table col.check-line-amount {
  width: 18%;
}

.check-lines-table thead {
  display: table-header-group;
}

.check-lines-table tbody {
  display: table-row-group;
}

.check-lines-table tr {
  display: table-row;
}

.check-lines-table th,
.check-lines-table td {
  display: table-cell;
  padding: 10px 12px;
  text-align: left;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.check-lines-table select,
.check-lines-table input {
  min-height: 36px;
  padding: 7px 9px;
  background: #ffffff;
  border: 1px solid #c7cecd;
  border-radius: 4px;
  font: inherit;
}

.check-lines-table input {
  text-align: right;
}

.check-lines-table th {
  background: #eef2f1;
  border-bottom-color: #c7cecd;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.check-lines-table th:last-child,
.check-lines-table td:last-child {
  border-right: 0;
}

.check-lines-table th:nth-child(2),
.check-lines-table td:nth-child(2),
.check-lines-table th:nth-child(4),
.check-lines-table td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.check-lines-table tbody tr:last-child td {
  border-bottom: 0;
}

.check-preview-footer {
  display: grid;
  grid-template-columns: minmax(220px, 420px) minmax(160px, 1fr);
  gap: 18px;
  align-items: start;
}

.check-total-row {
  display: grid;
  justify-items: end;
  gap: 6px;
  padding-top: 2px;
}

.check-total-row strong {
  font-size: 22px;
}

.check-preview-memo strong {
  min-height: 74px;
  align-items: flex-start;
}

.check-preview-memo textarea {
  resize: vertical;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--emerald);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.1;
}

.signed-in {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.header-actions,
.panel-header,
.period-panel,
.segmented-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-button,
.icon-button,
.small-button,
.row-button,
.segmented-control button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

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

.primary-button {
  color: #ffffff;
  background: var(--ink);
  border-color: var(--ink);
}

.small-button {
  min-height: 34px;
}

.row-button {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 14px;
  width: min(1320px, calc(100% - 32px));
  margin: 14px auto 36px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar-brand {
  display: grid;
  gap: 2px;
  padding: 2px 4px 8px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-brand strong {
  font-size: 16px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.nav-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-nav button.active,
.sidebar-nav button:hover {
  color: var(--ink);
  background: var(--soft);
}

.content-shell {
  min-width: 0;
}

.view {
  display: none;
  gap: 12px;
}

.view.active {
  display: grid;
}

.view-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.view-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.view-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.period-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.period-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) minmax(150px, 0.75fr);
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
}

.field {
  display: grid;
  gap: 6px;
}

.cycle-action span {
  color: var(--muted);
  font-size: 12px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
}

.file-input {
  max-width: 260px;
  padding: 6px;
}

.batch-status {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 4px;
}

.batch-status span {
  color: var(--warn);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.batch-status strong {
  font-size: 24px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kpi-grid article {
  padding: 12px;
  border-right: 1px solid var(--line);
}

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

.kpi-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kpi-grid strong {
  font-size: 22px;
}

.simple-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
}

.pay-period-manager {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.run-name-panel {
  padding: 12px 16px;
}

.run-name-panel label {
  display: grid;
  grid-template-columns: minmax(120px, 0.22fr) minmax(220px, 1fr);
  align-items: center;
  gap: 12px;
}

.run-name-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.run-name-panel small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}

.pay-period-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.pay-period-chip {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
}

.pay-period-chip.active {
  border-color: var(--avian-accent);
  box-shadow: 0 0 0 3px rgba(49, 113, 100, 0.14);
}

.pay-period-select {
  display: grid;
  justify-items: start;
  gap: 6px;
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.pay-period-chip strong {
  font-size: 16px;
  line-height: 1.2;
}

.pay-period-select span:not(.status),
.pay-period-select small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pay-period-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.selected-run-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-left: 5px solid var(--avian-accent);
}

.selected-run-panel h2 {
  margin-bottom: 6px;
  color: var(--avian-deeper);
  font-size: 22px;
}

.selected-run-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.selected-run-panel .primary-button {
  min-width: 180px;
}

.selected-run-panel.complete {
  border-left-color: #20845f;
}

.danger {
  color: #8f2f28;
}

.payroll-card,
.next-action-card,
.attention-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.payroll-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.payroll-card h2 {
  font-size: 26px;
}

.plain-detail {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
}

.payroll-total {
  display: grid;
  gap: 5px;
  min-width: 160px;
  justify-items: end;
}

.payroll-total span {
  color: var(--warn);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.payroll-total strong {
  font-size: 32px;
}

.simple-dashboard.no-payroll-data .payroll-total,
.simple-dashboard.no-payroll-data .simple-metrics {
  display: none;
}

.simple-dashboard.no-payroll-data .payroll-card {
  min-height: 190px;
}

.next-action-card {
  display: grid;
  gap: 12px;
  align-content: center;
  padding: 22px;
  background: #101413;
  color: #ffffff;
}

.next-action-card span {
  color: #a9beb7;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.next-action-card strong {
  font-size: 26px;
  line-height: 1.15;
}

.next-action-card p {
  margin: 0;
  color: #d9e3df;
  font-size: 16px;
  line-height: 1.45;
}

.next-action-card .primary-button {
  min-height: 54px;
  width: 100%;
  margin-top: 4px;
  color: var(--ink);
  background: #ffffff;
  border-color: #ffffff;
  font-size: 18px;
}

.next-action-card .form-message {
  min-height: 0;
  margin: 0;
}

.simple-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-column: 1 / -1;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.simple-metrics article {
  padding: 18px;
  border-right: 1px solid var(--line);
}

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

.simple-metrics span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.simple-metrics strong {
  font-size: 30px;
}

.dashboard-alert {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(138, 100, 23, 0.28);
  border-left: 5px solid var(--warn);
  border-radius: 8px;
  padding: 16px 18px;
  color: var(--ink);
  background: #fff8e8;
  text-align: left;
  cursor: pointer;
}

.dashboard-alert:hover,
.dashboard-alert:focus {
  background: #fff2cf;
  outline: none;
}

.dashboard-alert-count {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--warn);
  font-size: 22px;
  font-weight: 900;
  flex: 0 0 auto;
}

.dashboard-alert strong,
.dashboard-alert small {
  display: block;
}

.dashboard-alert strong {
  font-size: 17px;
}

.dashboard-alert small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.plain-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-column: 1 / -1;
  gap: 12px;
}

.plain-actions button {
  display: grid;
  gap: 6px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.plain-actions button:hover,
.plain-actions button:focus {
  border-color: #9bc9bd;
  background: #edf8f5;
  outline: none;
}

.plain-actions strong {
  font-size: 18px;
}

.plain-actions span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.attention-panel {
  padding: 18px;
}

.inquiries-panel {
  display: grid;
  gap: 18px;
}

.inquiry-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.inquiry-summary article {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: #ffffff;
}

.inquiry-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.inquiry-summary strong {
  font-size: 26px;
}

.inquiry-list {
  display: grid;
  gap: 12px;
}

.inquiry-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: #ffffff;
}

.inquiry-card.new {
  border-left-color: var(--warn);
}

.inquiry-card.reviewed {
  border-left-color: var(--ok);
}

.inquiry-card-main {
  display: grid;
  gap: 9px;
}

.inquiry-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inquiry-card-title > span:last-child,
.muted-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inquiry-contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--emerald);
  font-weight: 900;
}

.inquiry-card p {
  margin: 0;
  color: var(--muted);
}

.inquiry-message-text {
  max-width: 820px;
  color: var(--ink) !important;
  line-height: 1.5;
}

.inline-file-link {
  display: inline-flex;
  margin-left: 8px;
  color: var(--emerald);
  font-weight: 900;
  text-decoration: underline;
}

.inquiry-card-actions {
  display: flex;
  align-items: start;
  gap: 8px;
}

.dashboard-hidden-controls {
  display: none;
}

.flow-steps {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px;
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 8px;
}

.flow-step span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.flow-step strong {
  font-size: 12px;
}

.flow-step small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.flow-step.done span,
.flow-step.active span {
  color: #ffffff;
  background: var(--emerald);
  border-color: var(--emerald);
}

.flow-step.active {
  background: #edf8f5;
  border-color: #b8d8cf;
}

.flow-step.pending {
  opacity: 0.68;
}

.secondary-actions {
  opacity: 0.72;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-support {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
}

.support-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status-panel {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 12px;
}

.status-panel > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-panel strong {
  font-size: 16px;
}

.status-panel p {
  min-height: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.status-panel .link-button {
  margin-top: 2px;
  font-size: 12px;
  text-decoration: none;
}

.reference-panel {
  display: grid;
  gap: 14px;
}

.reference-summary {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr repeat(3, minmax(90px, 0.7fr));
  gap: 8px;
}

.reference-summary article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}

.reference-summary span,
.employee-rate-table td span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reference-summary strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.employee-rate-wrap {
  max-height: 320px;
}

.employee-rate-table td:first-child {
  display: grid;
  gap: 4px;
}

.employee-rate-table input {
  max-width: 140px;
}

.reference-lists {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reference-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.reference-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: var(--soft);
  border-radius: 8px;
}

.reference-row strong {
  font-size: 13px;
}

.reference-row span {
  color: var(--muted);
  font-size: 12px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mapping-grid h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.mapping-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mapping-list {
  display: grid;
  gap: 8px;
}

.mapping-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--soft);
  border-radius: 8px;
}

.mapping-row span {
  color: var(--ink);
  font-size: 13px;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-header {
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-header.compact {
  margin-bottom: 10px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td.money {
  min-width: 88px;
  font-variant-numeric: tabular-nums;
}

.strong {
  font-weight: 900;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}

.status.ready {
  color: var(--ok);
  background: #e7f4ee;
}

.status.warn {
  color: var(--warn);
  background: #fff4db;
}

.status.error {
  color: var(--danger);
  background: #fcebea;
}

.side-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.check-list,
.verification-list {
  display: grid;
  gap: 8px;
}

.check-item,
.verification-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  background: var(--soft);
  border-radius: 8px;
}

.check-item span,
.verification-item span {
  color: var(--muted);
  font-size: 12px;
}

.check-item strong,
.verification-item strong {
  font-size: 13px;
}

.review-panel {
  min-height: 260px;
}

.audit-panel {
  min-height: 180px;
}

.segmented-control {
  padding: 3px;
  background: var(--soft);
  border-radius: 8px;
}

.segmented-control button {
  min-height: 32px;
  border: 0;
  background: transparent;
}

.segmented-control button.active {
  background: #ffffff;
  box-shadow: 0 1px 8px rgba(16, 20, 19, 0.08);
}

.review-output {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.check-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}

.check-card.review-clickable {
  width: 100%;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: left;
}

.check-card.review-clickable:hover,
.check-card.review-clickable:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 10px 24px rgba(16, 20, 19, 0.08);
  outline: none;
}

.line-item-card {
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1fr) minmax(120px, auto);
}

.raw-rows-table-wrap {
  max-height: min(56vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.raw-rows-table {
  min-width: 720px;
}

.raw-rows-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f1;
  border-bottom-color: #c7cecd;
  color: var(--ink);
}

.raw-rows-table td:first-child,
.raw-rows-table th:first-child {
  width: 56px;
  color: var(--muted);
  text-align: center;
}

.previewable-entry-row {
  cursor: pointer;
}

.previewable-entry-row:hover {
  background: #edf7f6;
}

.check-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.check-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.line-list {
  display: grid;
  gap: 5px;
}

.line-list span {
  color: var(--muted);
  font-size: 13px;
}

.report-output {
  display: grid;
  gap: 10px;
}

.report-recipient-fields {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.report-recipient-fields span {
  color: var(--muted);
  font-size: 12px;
}

.report-empty,
.report-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}

.report-empty {
  align-items: flex-start;
  flex-direction: column;
}

.report-empty.ready {
  border: 1px solid #b8d8cf;
  background: #edf8f5;
}

.report-card > div:first-child {
  display: grid;
  gap: 5px;
}

.report-card span,
.report-empty span,
.report-history a {
  color: var(--muted);
  font-size: 13px;
}

.report-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-links a,
.report-history a {
  text-decoration: none;
}

.report-history {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.audit-list.compact .audit-item {
  grid-template-columns: minmax(130px, 0.5fr) 1fr;
}

.audit-item {
  display: grid;
  grid-template-columns: minmax(140px, 0.3fr) 1fr minmax(160px, 0.35fr);
  gap: 12px;
  padding: 10px;
  background: var(--soft);
  border-radius: 8px;
  font-size: 13px;
}

.audit-item span {
  color: var(--muted);
}

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

  .sidebar {
    position: static;
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .sidebar-nav button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .main-grid,
  .period-panel,
  .dashboard-command,
  .simple-dashboard,
  .simple-metrics,
  .plain-actions,
  .dashboard-support,
  .support-stack,
  .reference-summary,
  .mapping-grid,
  .mapping-row,
  .dashboard-grid,
  .reference-lists {
    grid-template-columns: 1fr;
  }

  .flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-status {
    justify-items: start;
  }
}

@media (max-width: 760px) {
  .app-header,
  .header-actions,
  .view-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-card,
  .runner-side-card .panel-header,
  .command-title {
    align-items: stretch;
    flex-direction: column;
  }

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

  .payroll-total {
    justify-items: start;
  }

  .flow-steps {
    grid-template-columns: 1fr;
  }

  .check-card {
    grid-template-columns: 1fr;
  }

  .check-preview-top,
  .check-preview-facts,
  .check-preview-footer {
    grid-template-columns: 1fr;
  }

  .check-preview-total,
  .check-total-row {
    justify-items: start;
  }

  .review-mode-toggle {
    margin-left: 0;
  }

  .report-card {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-item {
    grid-template-columns: 1fr;
  }
}

/* Polished Avian dashboard treatment */
:root {
  --avian-deep: #2d3434;
  --avian-deeper: #111414;
  --avian-mint: #edf1f1;
  --avian-mint-2: #f7f9f9;
  --avian-accent: #007f82;
  --avian-teal: #007f82;
  --avian-silver: #c8cfcf;
  --shadow-soft: 0 22px 64px rgba(17, 20, 20, 0.1);
  --shadow-card: 0 12px 32px rgba(17, 20, 20, 0.07);
}

body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, #eef2f2 0%, #f7f8f8 46%, #e0e6e6 100%);
}

.app-header {
  width: calc(100% - clamp(24px, 4vw, 56px));
  margin: 22px auto 0;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(201, 208, 208, 0.5);
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(13, 15, 15, 0.06);
  backdrop-filter: blur(18px);
}

.app-header h1 {
  color: var(--avian-deeper);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-brand img {
  flex: 0 0 auto;
  width: 46px;
  height: 43px;
  object-fit: contain;
}

.workspace {
  grid-template-columns: clamp(210px, 17vw, 260px) minmax(0, 1fr);
  gap: clamp(18px, 2.4vw, 34px);
  width: calc(100% - clamp(24px, 4vw, 56px));
  margin-top: 22px;
  padding: clamp(14px, 1.5vw, 22px);
  background: rgba(249, 250, 250, 0.86);
  border: 1px solid rgba(201, 208, 208, 0.46);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.sidebar {
  top: 112px;
  position: sticky;
  gap: 18px;
  min-height: calc(100vh - 170px);
  padding: 24px 14px 20px;
  color: var(--avian-deeper);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(200, 207, 207, 0.58);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, transparent, var(--avian-accent), transparent);
  border-radius: 22px 0 0 22px;
}

.sidebar-profile {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 8px 8px 22px;
  text-align: center;
  border-bottom: 1px solid rgba(200, 207, 207, 0.45);
}

.profile-logo {
  width: 72px;
  height: 68px;
  padding: 6px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid rgba(0, 127, 130, 0.24);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(17, 20, 20, 0.1);
}

.sidebar-profile strong {
  font-size: 17px;
  letter-spacing: 0;
}

.sidebar-profile span,
.sidebar-brand span {
  color: #697575;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-brand {
  display: none;
}

.sidebar-nav {
  gap: 8px;
}

.sidebar-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border-radius: 999px;
  padding: 10px 14px;
  color: #596464;
  font-size: 13px;
  letter-spacing: 0;
}

.sidebar-nav button.active,
.sidebar-nav button:hover {
  color: var(--avian-deeper);
  background: #f2f7f7;
}

.sidebar-nav button.active .nav-icon,
.sidebar-nav button:hover .nav-icon {
  color: var(--avian-accent);
}

.content-shell {
  padding: 4px 2px;
}

.view {
  gap: 18px;
}

.view-heading {
  padding: 2px 2px 0;
}

.view-heading h2 {
  color: var(--avian-deeper);
  font-size: 25px;
}

.view-subtitle,
.signed-in {
  color: #5f7772;
}

.eyebrow {
  color: var(--avian-accent);
  letter-spacing: 0.08em;
}

.simple-dashboard {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
  gap: clamp(16px, 1.8vw, 28px);
}

.payroll-card,
.next-action-card,
.simple-metrics,
.plain-actions button,
.attention-panel,
.panel,
.period-panel {
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.payroll-card {
  position: relative;
  min-height: 180px;
  padding: clamp(24px, 2.2vw, 36px);
  overflow: hidden;
  color: var(--avian-deeper);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 247, 0.98)),
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(17, 20, 20, 0.018) 14px 15px);
  border: 1px solid rgba(200, 207, 207, 0.45);
}

.payroll-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--avian-accent);
}

.payroll-card .eyebrow,
.payroll-card .plain-detail,
.payroll-total span {
  color: #667272;
}

.payroll-card h2 {
  position: relative;
  z-index: 1;
  max-width: 560px;
  color: var(--avian-deeper);
  font-size: 32px;
}

.plain-detail {
  position: relative;
  z-index: 1;
  font-size: 16px;
}

.payroll-total {
  position: relative;
  z-index: 1;
}

.payroll-total strong {
  color: var(--avian-deeper);
  font-size: 36px;
}

.next-action-card {
  min-height: 180px;
  padding: clamp(24px, 2vw, 34px);
  color: var(--avian-deeper);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(200, 207, 207, 0.45);
}

.next-action-card span {
  color: var(--avian-accent);
}

.next-action-card strong {
  color: var(--avian-deeper);
  font-size: 25px;
}

.next-action-card p {
  color: #617a74;
}

.next-action-card .primary-button,
.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, #007f82, #00686a);
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(0, 104, 106, 0.16);
}

.next-action-card .primary-button {
  color: #ffffff;
  font-size: 17px;
}

.icon-button,
.small-button,
.row-button,
.segmented-control button {
  border-color: rgba(53, 88, 84, 0.12);
  color: var(--avian-deeper);
  background: rgba(255, 255, 255, 0.82);
}

.simple-metrics {
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: 16px;
}

.simple-metrics article {
  min-height: 118px;
  padding: clamp(18px, 1.6vw, 26px);
  background: #ffffff;
  border: 1px solid rgba(200, 207, 207, 0.42);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.simple-metrics article:nth-child(2) {
  background: linear-gradient(135deg, #ffffff, #eef4f4);
}

.simple-metrics article:nth-child(4) {
  color: var(--avian-deeper);
  background: linear-gradient(135deg, #ffffff, #eef4f4);
}

.simple-metrics article:nth-child(4) span,
.simple-metrics article:nth-child(4) strong {
  color: var(--avian-deeper);
}

.simple-metrics span {
  color: #6c817c;
  font-size: 13px;
}

.simple-metrics strong {
  color: var(--avian-deeper);
  font-size: 31px;
}

.plain-actions {
  gap: 16px;
}

.plain-actions button {
  min-height: 120px;
  padding: clamp(18px, 1.5vw, 24px);
  background: #ffffff;
  border: 1px solid rgba(200, 207, 207, 0.42);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.plain-actions button:hover,
.plain-actions button:focus {
  border-color: transparent;
  background: #f7fafa;
  box-shadow: 0 20px 44px rgba(13, 15, 15, 0.1);
  transform: translateY(-2px);
}

.plain-actions strong {
  color: var(--avian-deeper);
}

.plain-actions span {
  color: #667b76;
}

.attention-panel,
.panel {
  background: rgba(255, 255, 255, 0.92);
}

.check-item,
.verification-item,
.reference-row,
.mapping-row,
.audit-item,
.report-history {
  background: var(--avian-mint-2);
  border-radius: 14px;
}

.status.ready {
  color: var(--avian-deeper);
  background: rgba(33, 184, 167, 0.18);
}

.status.warn {
  color: #526060;
  background: rgba(201, 208, 208, 0.28);
}

input,
select {
  border-color: rgba(53, 88, 84, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(0, 139, 139, 0.24);
  outline-offset: 2px;
}

.segmented-control {
  background: var(--avian-mint-2);
  border-radius: 14px;
}

.segmented-control button {
  border-radius: 12px;
}

.segmented-control button.active {
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 65, 61, 0.1);
}

th {
  color: #72847f;
}

td {
  border-bottom-color: rgba(53, 88, 84, 0.1);
}

@media (max-width: 1050px) {
  .app-header,
  .workspace {
    width: calc(100% - 28px);
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 14px;
  }

  .sidebar {
    min-height: 0;
  }

  .sidebar-profile {
    display: none;
  }

  .sidebar-nav button {
    padding: 10px 16px 10px 42px;
  }

  .simple-dashboard,
  .main-grid,
  .dashboard-support,
  .mapping-grid {
    grid-template-columns: 1fr;
  }

  .simple-metrics,
  .plain-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payroll-card,
  .next-action-card {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(135deg, #eef2f2 0%, #f7f8f8 58%, #e0e6e6 100%);
  }

  .app-header {
    margin-top: 12px;
  }

  .workspace {
    width: calc(100% - 20px);
    padding: 10px;
    border-radius: 20px;
  }

  .payroll-card,
  .next-action-card {
    min-height: 0;
    padding: 22px;
  }

  .simple-metrics,
  .plain-actions,
  .mapping-row {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 10px;
    border-radius: 18px;
  }

  .sidebar-nav {
    gap: 8px;
  }

  .sidebar-nav button {
    min-height: 42px;
    padding-right: 18px;
  }

  .payroll-card h2 {
    font-size: 25px;
  }
}

/* Run Payroll workflow */
.payroll-runner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.runner-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: clamp(18px, 1.8vw, 26px);
}

.payroll-wizard-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.payroll-wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  color: #64726e;
  text-align: left;
  background: #ffffff;
  border: 1px solid rgba(0, 127, 130, 0.14);
  border-radius: 8px;
  cursor: pointer;
}

.payroll-wizard-step span {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  background: #8a9995;
  border-radius: 999px;
}

.payroll-wizard-step strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-wizard-step.active {
  color: var(--avian-deeper);
  border-color: rgba(0, 127, 130, 0.32);
  background: #f7fafa;
}

.payroll-wizard-step.active span,
.payroll-wizard-step.done span {
  background: var(--accent);
}

.payroll-wizard-step.done {
  color: var(--accent);
  border-color: rgba(0, 134, 113, 0.34);
  background: #f1fbf7;
}

.payroll-wizard-step.done span {
  font-size: 14px;
  line-height: 1;
}

.payroll-wizard-step.done strong {
  color: #146b4d;
}

.payroll-wizard-step:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.payroll-step-panel {
  display: none;
}

.payroll-step-panel.active {
  display: grid;
}

.primary-runner-card {
  gap: 18px;
  align-items: start;
  border: 2px solid rgba(0, 127, 130, 0.18);
  background: #ffffff;
}

.primary-runner-card .panel-header {
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(53, 88, 84, 0.1);
}

.primary-runner-card .panel-header h2 {
  margin-top: 4px;
}

.runner-methods {
  display: grid;
  gap: 10px;
}

.runner-methods > h3 {
  margin: 0;
  color: #64726e;
  font-size: 14px;
  font-weight: 900;
}

.runner-option {
  display: grid;
  gap: 12px;
  align-content: space-between;
  min-width: 0;
  padding: 14px;
  background: #ffffff;
  border: 1px solid rgba(0, 127, 130, 0.18);
  border-radius: 10px;
}

.runner-option h4 {
  margin: 0;
  color: var(--avian-deeper);
  font-size: 18px;
}

.upload-option {
  max-width: 760px;
  background: #f7fafa;
}

.upload-option .primary-button {
  min-height: 52px;
}

.runner-upload {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.36fr);
  gap: 12px;
  align-items: center;
  align-content: center;
}

.runner-upload .primary-button {
  width: 100%;
  min-height: 52px;
}

.payroll-runner .mapping-list,
.payroll-runner .review-output,
.payroll-runner .verification-list {
  max-height: min(58vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.payroll-runner .table-wrap {
  max-height: min(62vh, 560px);
  overflow: auto;
}

.payroll-runner .entry-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafa;
}

.quiet-action {
  opacity: 0.72;
}

.quiet-action:hover,
.quiet-action:focus {
  opacity: 1;
}

.payroll-runner h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.compact-toggle {
  justify-self: start;
}

.review-mode-toggle {
  flex-wrap: nowrap;
  margin-left: auto;
}

.readonly-entry-row td,
.empty-table-row td {
  color: var(--muted);
  font-weight: 800;
}

.empty-table-row td {
  padding: 28px 18px;
}

.empty-table-row strong,
.empty-table-row span {
  display: block;
}

.empty-table-row strong {
  color: var(--ink);
  font-size: 17px;
}

.empty-table-row span {
  margin-top: 6px;
  line-height: 1.4;
}

@media (max-width: 1050px) {
  .payroll-runner {
    grid-template-columns: 1fr;
  }

  .payroll-wizard-steps {
    grid-template-columns: repeat(5, minmax(132px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .primary-runner-card .runner-upload {
    grid-column: auto;
    grid-row: auto;
  }

  .runner-upload {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 760px) {
  .selected-run-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .selected-run-panel .primary-button {
    width: 100%;
  }

  .runner-card {
    padding: 18px;
  }

  .runner-upload {
    min-height: 0;
  }

}

.project-cost-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.project-cost-list-panel,
.project-cost-detail-panel {
  min-width: 0;
  padding: 14px;
}

.project-cost-list-panel .panel-header {
  align-items: end;
}

.project-filter-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.project-cost-list-panel input[type="search"] {
  max-width: 260px;
}

.project-filter-controls select {
  min-width: 150px;
}

.project-cost-table-wrap,
.project-lines .table-wrap {
  max-height: min(64vh, 640px);
  overflow: auto;
}

.project-cost-table,
.project-line-table {
  width: 100%;
  border-collapse: collapse;
}

.project-cost-table th,
.project-cost-table td,
.project-line-table th,
.project-line-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}

.project-cost-table th,
.project-line-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-cost-table tbody tr {
  cursor: pointer;
}

.project-cost-table tbody tr:hover,
.project-cost-table tbody tr.selected {
  background: var(--soft);
}

.project-cost-table td:first-child {
  min-width: 190px;
}

.project-cost-table td:first-child strong,
.project-cost-table td:first-child span {
  display: block;
}

.project-cost-table td:first-child span,
.project-detail-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.strong {
  font-weight: 900;
}

.project-cost-detail {
  display: grid;
  gap: 14px;
}

.project-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-summary-grid article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-summary-grid article:nth-child(4n) {
  border-right: 0;
}

.project-summary-grid article:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.project-summary-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-summary-grid strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-profile-form,
.customer-paid-form {
  display: grid;
  gap: 10px;
}

.project-profile-form {
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.35fr) minmax(120px, 0.35fr) minmax(180px, 1fr) auto;
  align-items: end;
}

.customer-paid-form {
  grid-template-columns: 132px minmax(120px, 1fr) minmax(100px, 0.7fr) minmax(160px, 1.2fr) 116px minmax(120px, 1fr) auto;
  align-items: end;
  padding: 12px;
  background: #f7fafa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-lines {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.project-lines summary {
  padding: 11px 12px;
  color: var(--ink);
  background: #f7fafa;
  font-weight: 900;
  cursor: pointer;
}

.project-line-table input {
  min-width: 100px;
  min-height: 34px;
  padding: 6px 8px;
}

.project-line-table input[type="file"] {
  min-width: 180px;
  max-width: 220px;
  margin-top: 6px;
  font-size: 11px;
}

.receipt-link {
  display: block;
  max-width: 220px;
  overflow: hidden;
  color: var(--emerald);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted-cell {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.row-button.danger {
  color: var(--danger);
}

.project-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.project-alert-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.project-alert {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fbfcfc;
}

.project-alert.error {
  border-left-color: var(--danger);
}

.project-alert.warn {
  border-left-color: var(--warn);
}

.project-alert.ready {
  border-left-color: var(--emerald);
}

.project-alert span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.project-hub-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.project-hub-card-header,
.project-file-item,
.project-activity-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-hub-card-header h3 {
  margin: 0;
  font-size: 15px;
}

.project-hub-card-header span,
.project-file-item span,
.project-log-item span,
.project-activity-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.project-mini-form,
.project-work-item,
.project-contact-form,
.project-contact-item {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(100px, 0.6fr) minmax(110px, 0.5fr) minmax(100px, 0.5fr) auto;
  gap: 8px;
  align-items: end;
}

.project-contact-form {
  grid-template-columns: minmax(120px, 0.6fr) minmax(130px, 1fr) minmax(120px, 0.8fr) minmax(110px, 0.7fr) minmax(130px, 0.9fr) minmax(110px, 0.7fr) auto;
}

.project-log-form {
  grid-template-columns: 130px minmax(110px, 0.6fr) minmax(110px, 0.6fr) minmax(180px, 1fr) minmax(150px, 0.8fr) auto;
}

.project-work-list,
.project-log-list,
.project-file-list,
.project-contact-list,
.project-activity-list {
  display: grid;
  gap: 8px;
}

.project-work-item {
  grid-template-columns: minmax(110px, 0.6fr) minmax(160px, 1fr) minmax(100px, 0.6fr) minmax(120px, 0.6fr) minmax(90px, 0.4fr) auto auto;
  padding: 8px;
  background: var(--soft);
  border-radius: 8px;
}

.project-contact-item {
  grid-template-columns: minmax(110px, 0.6fr) minmax(130px, 1fr) minmax(110px, 0.8fr) minmax(100px, 0.7fr) minmax(130px, 1fr) minmax(100px, 0.8fr) auto auto;
  padding: 8px;
  background: var(--soft);
  border-radius: 8px;
}

.project-log-item {
  display: grid;
  grid-template-columns: minmax(130px, 0.4fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 0.8fr) auto;
  gap: 8px;
  align-items: start;
  padding: 8px;
  background: var(--soft);
  border-radius: 8px;
}

.project-log-item > div,
.project-file-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-log-item textarea {
  resize: vertical;
}

.daily-log-files {
  display: grid;
  gap: 6px;
}

.daily-log-files span,
.daily-log-upload {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.daily-log-files a {
  overflow: hidden;
  color: var(--emerald);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-log-upload input[type="file"] {
  min-width: 0;
  max-width: 160px;
  font-size: 11px;
}

.project-file-item,
.project-activity-list article {
  padding: 8px 10px;
  background: var(--soft);
  border-radius: 8px;
}

.project-file-item a {
  overflow: hidden;
  color: var(--emerald);
  font-weight: 900;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .project-cost-layout {
    grid-template-columns: 1fr;
  }

  .project-hub-grid {
    grid-template-columns: 1fr;
  }

  .project-alert-list {
    grid-template-columns: 1fr;
  }

  .project-mini-form,
  .project-work-item,
  .project-contact-form,
  .project-contact-item,
  .project-log-item {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-paid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .project-profile-form,
  .customer-paid-form,
  .project-mini-form,
  .project-work-item,
  .project-contact-form,
  .project-contact-item,
  .project-log-item,
  .project-summary-grid {
    grid-template-columns: 1fr;
  }

  .project-summary-grid article,
  .project-summary-grid article:nth-child(4n),
  .project-summary-grid article:nth-last-child(-n + 4) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-summary-grid article:last-child {
    border-bottom: 0;
  }

  .project-cost-list-panel .panel-header {
    display: grid;
    align-items: stretch;
  }

  .project-cost-list-panel input[type="search"],
  .project-filter-controls select {
    max-width: none;
    width: 100%;
  }

  .project-filter-controls {
    justify-content: stretch;
  }
}

.shipment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.shipment-list-panel,
.shipment-detail-panel {
  min-width: 0;
  padding: 14px;
}

.shipment-list-panel {
  width: 100%;
}

.shipment-detail-drawer {
  --shipment-modal-gutter: clamp(14px, 2.5vh, 24px);
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 24px var(--shipment-modal-gutter) 96px;
  background: rgba(16, 20, 19, 0.24);
}

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

.shipment-detail-drawer .shipment-detail-panel {
  width: min(900px, calc(100vw - (var(--shipment-modal-gutter) * 2)));
  height: clamp(420px, calc(100vh - 220px), 620px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  overscroll-behavior: contain;
  padding: 16px 22px 18px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(16, 20, 19, 0.22);
}

.shipment-modal-close {
  justify-self: end;
  width: 42px;
  min-height: 42px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.shipment-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.shipment-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shipment-summary article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
}

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

.shipment-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.shipment-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipment-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(5, minmax(128px, 0.65fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.shipment-table-wrap {
  max-height: min(64vh, 640px);
  overflow: auto;
}

.shipment-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.shipment-kanban-column {
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr);
  min-width: 220px;
  overflow: hidden;
  background: #f7fafa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shipment-kanban-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.shipment-kanban-heading div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.shipment-kanban-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.shipment-kanban-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.shipment-kanban-cards {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding: 8px;
}

.shipment-kanban-card {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 132px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
  border: 1px solid rgba(0, 127, 130, 0.14);
  border-radius: 8px;
  cursor: pointer;
}

.shipment-kanban-card:hover,
.shipment-kanban-card.selected {
  border-color: rgba(0, 127, 130, 0.34);
  box-shadow: 0 10px 24px rgba(37, 65, 61, 0.1);
}

.shipment-kanban-card.overdue {
  border-color: rgba(190, 65, 65, 0.35);
}

.shipment-kanban-card strong,
.shipment-kanban-card span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.shipment-kanban-card strong {
  font-size: 14px;
  white-space: nowrap;
}

.shipment-kanban-card > span:not(.status) {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.shipment-kanban-card > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.shipment-kanban-card b {
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.shipment-kanban-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.shipment-table {
  width: 100%;
  border-collapse: collapse;
}

.shipment-table th,
.shipment-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}

.shipment-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.shipment-table tbody tr {
  cursor: pointer;
}

.shipment-table tbody tr:hover,
.shipment-table tbody tr.selected {
  background: var(--soft);
}

.shipment-table td:first-child {
  min-width: 190px;
}

.shipment-table td:first-child strong,
.shipment-table td:first-child span,
.shipment-detail-heading span {
  display: block;
}

.shipment-table td:first-child span,
.shipment-detail-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.shipment-detail {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.shipment-detail-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  align-items: center;
  align-self: start;
  min-height: 46px;
  max-height: 46px;
  padding: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.shipment-detail-tabs button {
  width: 100%;
  min-height: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.shipment-detail-tabs button.active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(16, 20, 19, 0.08);
}

.shipment-form,
.shipment-tab-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.shipment-general-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}

.shipment-form label,
.shipment-item-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.shipment-form .span-3,
.shipment-form-actions {
  grid-column: 1 / -1;
}

.shipment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: 2px;
  padding-top: 8px;
  background: #ffffff;
  box-shadow: 0 -8px 18px rgba(255, 255, 255, 0.92);
}

.shipment-cost-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 12px;
  background: #f7fafa;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.shipment-cost-heading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.shipment-cost-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.shipment-cost-heading span {
  color: var(--avian-deeper, #2a6868);
  font-size: 12px;
  font-weight: 900;
}

.shipment-items-section {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 10px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.shipment-items-section .report-empty {
  min-height: 0;
  padding: 14px;
}

.shipment-item-list {
  display: grid;
  gap: 8px;
}

.shipment-item-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(160px, 1.4fr) minmax(72px, 0.45fr) minmax(88px, 0.55fr) minmax(84px, 0.55fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  background: #f7fafa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shipment-item-total {
  align-self: center;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.shipment-item-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.shipment-item-add-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(220px, 1.5fr) minmax(80px, 0.45fr) minmax(100px, 0.55fr) auto;
  gap: 6px 10px;
  align-items: end;
  padding: 10px;
  background: #f7fafa;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.shipment-item-add-field {
  display: grid;
  gap: 5px;
}

.shipment-item-add-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.shipment-form textarea {
  min-height: 56px;
  resize: vertical;
}

.shipment-file-form {
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #f7fafa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shipment-file-list {
  display: grid;
  gap: 8px;
}

.shipment-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.8fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shipment-file-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

/* Shipment board treatment copied from the Avian time app kanban. */
.shipment-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  align-items: flex-start;
  overflow-x: visible;
  padding-bottom: 4px;
}

.shipment-board.shipments-board--single {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 8px;
}

.shipments-column {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 12px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.shipments-column.drag-over {
  background: #f0fdfa;
  box-shadow:
    inset 0 0 0 2px #2a7f83,
    0 12px 28px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.shipments-column-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.shipments-column-title {
  color: var(--ink);
  font-weight: 700;
}

.shipments-column-count {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.shipments-column-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0;
  padding-top: 4px;
  padding-bottom: 40px;
}

.shipments-column-body .shipment-card {
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shipments-column-body .shipment-card + .shipment-card {
  margin-top: -120px;
}

.shipments-column-body .shipment-card:hover,
.shipments-column-body .shipment-card.selected {
  z-index: 2;
  transform: translateY(-4px);
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.18),
    0 0 0 1px var(--line);
}

.shipment-card {
  display: flex;
  flex-direction: column;
  overflow: auto;
  min-height: 210px;
  padding: 0;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
  border: 2px solid transparent;
  border-radius: 12px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 0 0 1px var(--line);
  cursor: pointer;
}

.shipment-card[draggable="true"] {
  cursor: grab;
}

.shipment-card.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.shipment-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
}

.shipment-card-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipment-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  color: #334155;
  font-size: 0.85rem;
}

.shipment-card-alert {
  margin-top: 6px;
  padding: 6px 8px;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
}

.shipments-column .empty-state {
  padding: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shipments-column.status-preorder { border-top: 3px solid #64748b; }
.shipments-column.status-ordered { border-top: 3px solid #2563eb; }
.shipments-column.status-transit { border-top: 3px solid #4f46e5; }
.shipments-column.status-forwarder { border-top: 3px solid #7c3aed; }
.shipments-column.status-sailed { border-top: 3px solid #0f766e; }
.shipments-column.status-arrived { border-top: 3px solid #16a34a; }
.shipments-column.status-clearance { border-top: 3px solid #f59e0b; }
.shipments-column.status-ready { border-top: 3px solid #06b6d4; }
.shipments-column.status-pickedup { border-top: 3px solid #15803d; }
.shipments-column.status-archived { border-top: 3px solid #6b7280; }

.shipment-card.status-preorder { border-color: #64748b; }
.shipment-card.status-ordered { border-color: #2563eb; }
.shipment-card.status-transit { border-color: #4f46e5; }
.shipment-card.status-forwarder { border-color: #7c3aed; }
.shipment-card.status-sailed { border-color: #0f766e; }
.shipment-card.status-arrived { border-color: #16a34a; }
.shipment-card.status-clearance { border-color: #f59e0b; }
.shipment-card.status-ready { border-color: #06b6d4; }
.shipment-card.status-pickedup { border-color: #15803d; }
.shipment-card.status-archived { border-color: #6b7280; }

.shipment-card.status-preorder .shipment-card-header { color: #ffffff; background: #64748b; }
.shipment-card.status-ordered .shipment-card-header { color: #ffffff; background: #2563eb; }
.shipment-card.status-transit .shipment-card-header { color: #ffffff; background: #4f46e5; }
.shipment-card.status-forwarder .shipment-card-header { color: #ffffff; background: #7c3aed; }
.shipment-card.status-sailed .shipment-card-header { color: #ffffff; background: #0f766e; }
.shipment-card.status-arrived .shipment-card-header { color: #ffffff; background: #16a34a; }
.shipment-card.status-clearance .shipment-card-header { color: #1f2937; background: #f59e0b; }
.shipment-card.status-ready .shipment-card-header { color: #0f172a; background: #06b6d4; }
.shipment-card.status-pickedup .shipment-card-header { color: #ffffff; background: #15803d; }
.shipment-card.status-archived .shipment-card-header { color: #ffffff; background: #6b7280; }

.status.status-preorder { color: #ffffff; background: #64748b; }
.status.status-ordered { color: #ffffff; background: #2563eb; }
.status.status-transit { color: #ffffff; background: #4f46e5; }
.status.status-forwarder { color: #ffffff; background: #7c3aed; }
.status.status-sailed { color: #ffffff; background: #0f766e; }
.status.status-arrived { color: #ffffff; background: #16a34a; }
.status.status-clearance { color: #1f2937; background: #f59e0b; }
.status.status-ready { color: #0f172a; background: #06b6d4; }
.status.status-pickedup { color: #ffffff; background: #15803d; }
.status.status-archived { color: #ffffff; background: #6b7280; }

@media (max-width: 1180px) {
  .shipment-layout {
    grid-template-columns: 1fr;
  }

  .shipment-filter-bar,
  .shipment-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shipment-summary article:nth-child(3) {
    border-right: 0;
  }
}

@media (max-width: 980px) {
  .shipment-general-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shipment-toolbar {
    display: grid;
  }

  .shipment-filter-bar,
  .shipment-summary,
  .shipment-general-panel,
  .shipment-cost-section,
  .shipment-item-row,
  .shipment-item-add-form,
  .shipment-file-form,
  .shipment-file-row {
    grid-template-columns: 1fr;
  }

  .shipment-item-actions {
    justify-content: flex-start;
  }

  .shipment-item-add-form .small-button {
    width: 100%;
  }

  .shipment-summary article,
  .shipment-summary article:nth-child(3) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .shipment-summary article:last-child {
    border-bottom: 0;
  }
}
