:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #647084;
  --line: #d9dee8;
  --accent: #0f766e;
  --accent-dark: #115e59;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
.topbar {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 2;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  width: 118px;
  max-width: 118px;
  flex: 0 0 auto;
  overflow: hidden;
}
.brand-logo img {
  display: block;
  width: 118px;
  max-width: 118px;
  height: auto;
  max-height: 54px;
  object-fit: contain;
}
.main-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; }
.main-nav > a, .nav-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.main-nav > a:hover, .nav-menu summary:hover {
  background: #f1f5f9;
  color: var(--text);
}
.nav-menu { position: relative; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 12px;
}
.nav-menu[open] summary {
  background: #ecfdf5;
  color: var(--accent-dark);
}
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  min-width: 210px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  z-index: 20;
}
.nav-dropdown a {
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--text);
}
.nav-dropdown a:hover {
  background: #f1f5f9;
}
.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 22px;
}
.hero.compact { padding-bottom: 18px; }
h1, h2 { margin: 0 0 16px; letter-spacing: 0; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-title-row h1 { margin-bottom: 4px; }
.page-title-row p { margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 12px; }
.metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}
.metrics span { display: block; color: var(--muted); margin-bottom: 6px; }
.metrics strong { font-size: 22px; }
.grid { display: grid; gap: 22px; margin-bottom: 24px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.linked-finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 18px;
  align-items: start;
}
.linked-panel {
  min-width: 0;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfd;
}
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-title-row h2 { margin: 0; }
.compact-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.compact-fields label:last-child { grid-column: 1 / -1; }
.compact-fields input, .compact-fields select, .compact-fields textarea { width: 100%; min-width: 0; }
.finance-inline-rows { display: grid; gap: 12px; }
.finance-inline-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.finance-inline-row .wide { grid-column: 1 / span 4; }
.finance-inline-row label { min-width: 0; }
.finance-inline-row input, .finance-inline-row select { width: 100%; min-width: 0; }
.finance-inline-row .danger-button { width: 100%; min-width: 0; }
.income-inline-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(118px, 150px);
}
.income-inline-row .wide {
  grid-column: 1 / span 3;
}
.income-inline-row .remove-income-row {
  grid-column: 4;
}
.existing-income-inline-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: #f8fafc;
}
.existing-income-inline-row .wide {
  grid-column: 1 / -1;
}
.existing-income-inline-row .inline-balance {
  grid-column: 1;
}
.existing-income-inline-row .remove-income-row {
  grid-column: 2;
}
.expense-inline-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.expense-inline-row .wide {
  grid-column: 1 / span 4;
}
.expense-inline-row .remove-expense-row {
  grid-column: 5;
}
.existing-expense-inline-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: #f8fafc;
}
.existing-expense-inline-row .wide {
  grid-column: 1 / -1;
}
.existing-expense-inline-row .remove-existing-expense-row {
  grid-column: 2;
}
.selected-expense-summary {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 40px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}
.selected-expense-summary span {
  color: var(--muted);
  font-size: 13px;
}
.selected-expense-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}
.inline-balance {
  align-self: end;
  justify-self: stretch;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 700;
  white-space: normal;
}
.inline-balance.is-negative {
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
}
.icon-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
}
.bottom-actions { margin-top: 16px; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
caption { text-align: left; font-weight: 700; padding: 12px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 700; background: #fbfcfd; }
tr:last-child td { border-bottom: 0; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
}
button:hover, .button:hover { background: var(--accent-dark); }
.button.secondary {
  background: #243b53;
}
.button.secondary:hover {
  background: #102a43;
}
.danger-button {
  background: #b42318;
}
.danger-button:hover {
  background: #7a271a;
}
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.report-status {
  margin: 14px 0 0;
  color: var(--muted);
}
label { display: grid; gap: 6px; color: var(--muted); }
input, select {
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.error { margin: 0; color: #b42318; }
.muted { color: var(--muted); }
.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.employee-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}
.employee-card-top,
.employee-card-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.employee-card-bottom {
  align-items: center;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.employee-name {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.employee-tags,
.employee-locations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.employee-tags span,
.employee-locations span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 700;
}
.employee-tags span {
  background: #ecfdf5;
  color: var(--accent-dark);
}
.employee-locations span {
  background: #f1f5f9;
  color: #243b53;
}
.detail-tags,
.detail-locations {
  margin-top: 10px;
}
.profile-table {
  display: grid;
  gap: 10px;
}
.profile-table div {
  display: grid;
  gap: 3px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.profile-table div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.profile-table span {
  color: var(--muted);
}
.profile-table strong {
  overflow-wrap: anywhere;
}
.calendar-list { display: grid; gap: 10px; }
.day-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.day-date {
  display: grid;
  align-content: center;
  gap: 2px;
  color: var(--muted);
}
.day-date strong { color: var(--text); font-size: 22px; }
.day-shifts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shift-pill {
  display: grid;
  gap: 2px;
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fbfcfd;
}
.shift-pill span, .shift-pill em { color: var(--muted); font-style: normal; }
.shift-pill.needs-pay { border-color: #d97706; background: #fff7ed; }
.stacked-table { margin-bottom: 18px; }
.planner {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.planner-sidebar {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.planner-sidebar h1 { margin-bottom: 0; }
.side-form { display: grid; gap: 12px; }
.side-form input, .side-form select { width: 100%; min-width: 0; }
.side-block { display: grid; gap: 8px; }
.side-block h2 { margin-bottom: 4px; font-size: 16px; }
.employee-chip {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfcfd;
}
.employee-chip.active {
  border-color: var(--accent);
  background: #ecfdf5;
  color: var(--accent-dark);
  font-weight: 700;
}
.full-width { width: 100%; }
.planner-main { min-width: 0; }
.planner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.planner-header h1 { margin-bottom: 4px; }
.planner-header p { margin: 0; }
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.month-grid > * { min-width: 0; }
.weekday {
  background: #edf2f7;
  color: var(--muted);
  font-weight: 800;
  padding: 10px;
  text-align: center;
}
.calendar-cell {
  min-width: 0;
  min-height: 150px;
  background: var(--panel);
  padding: 10px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}
.calendar-cell.empty {
  background: #f1f5f9;
}
.cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cell-top strong { font-size: 18px; }
.add-shift {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}
.cell-shifts { display: grid; align-content: start; gap: 10px; }
.branch-group {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 2px solid var(--line);
}
.branch-group:first-child {
  padding-top: 0;
  border-top: 0;
}
.branch-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
}
.branch-title span {
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.branch-title strong {
  color: var(--text);
  font-size: 11px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.branch-shifts {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.branch-a .branch-title { background: #e8f7f4; }
.branch-a .mini-shift { border-left: 4px solid #0f766e; }
.branch-b .branch-title { background: #fff3df; }
.branch-b .mini-shift { border-left: 4px solid #d97706; }
.branch-c .branch-title { background: #eef2ff; }
.branch-c .mini-shift { border-left: 4px solid #4f46e5; }
.branch-d .branch-title { background: #fce7f3; }
.branch-d .mini-shift { border-left: 4px solid #be185d; }
.branch-e .branch-title { background: #ecfccb; }
.branch-e .mini-shift { border-left: 4px solid #65a30d; }
.branch-empty .branch-title { background: #f1f5f9; }
.branch-empty .mini-shift { border-left: 4px solid #64748b; }
.mini-shift {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: #fbfcfd;
}
.mini-shift strong {
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.mini-shift span, .mini-shift em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.mini-shift.needs-pay { border-color: #d97706; background: #fff7ed; }
.mini-empty { color: var(--muted); font-size: 13px; }
.bulk-form { display: grid; gap: 20px; }
.bulk-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}
.bulk-fields .wide { grid-column: 1 / -1; }
.bulk-fields textarea { min-height: 92px; }
.bulk-entry-form { display: grid; gap: 16px; }
.bulk-entry-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.bulk-entry-table input,
.bulk-entry-table select {
  width: 100%;
  min-width: 0;
}
.bulk-entry-table th:nth-child(1) { min-width: 150px; }
.bulk-entry-table th:nth-child(2) { min-width: 180px; }
.bulk-entry-table th:nth-child(3) { min-width: 180px; }
.bulk-entry-table th:nth-child(4) { min-width: 150px; }
.bulk-entry-table th:nth-child(5) { min-width: 240px; }
.icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  background: #e2e8f0;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}
.icon-button:hover {
  background: #cbd5e1;
}
.date-check-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(64px, 1fr));
  gap: 10px;
  max-width: 760px;
}
.date-check {
  display: block;
  position: relative;
  color: var(--text);
}
.date-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.date-check span {
  display: grid;
  grid-template-rows: auto auto;
  gap: 8px;
  place-items: center;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  font-weight: 700;
  cursor: pointer;
}
.date-check strong {
  font-size: 18px;
}
.date-check em {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #9aa6b2;
  border-radius: 6px;
  color: transparent;
  font-style: normal;
  line-height: 1;
}
.date-check input:checked + span {
  border-color: var(--accent);
  background: #ecfdf5;
  color: var(--accent-dark);
}
.date-check input:checked + span em {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--text);
}
.check-line input {
  min-width: 0;
  width: 18px;
  height: 18px;
}
.payroll-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.payroll-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.payroll-card.is-paid {
  border-color: #9bd6c7;
  background: #fbfffd;
}
.payroll-card-top, .payroll-card-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.payroll-name {
  display: block;
  margin-bottom: 3px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.payroll-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.payroll-amounts div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.payroll-amounts span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}
.payroll-amounts strong { font-size: 18px; }
.status-badge {
  white-space: nowrap;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 800;
  font-size: 13px;
  background: #eef2f7;
  color: #334155;
}
.status-paid {
  background: #dcfce7;
  color: #166534;
}
.status-formed {
  background: #fef3c7;
  color: #92400e;
}
.import-status-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.import-status-card div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}
.import-status-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}
.import-status-card strong {
  font-size: 16px;
}
.import-status-card.status-success div {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.import-status-card.status-error div {
  border-color: #fecaca;
  background: #fff1f2;
}
.import-log-success {
  background: #dcfce7;
  color: #166534;
}
.import-log-error {
  background: #fee2e2;
  color: #991b1b;
}
.import-log-running {
  background: #dbeafe;
  color: #1d4ed8;
}
.app-dialog {
  width: min(1120px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
}
.app-dialog::backdrop {
  background: rgba(15, 23, 42, 0.36);
}
.dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.dialog-header h2,
.dialog-header p {
  margin: 0;
}
.dialog-header h2 {
  margin-bottom: 4px;
}
.dialog-body {
  max-height: calc(100vh - 150px);
  overflow: auto;
  padding: 16px 20px 20px;
}
.picker-toolbar {
  margin-bottom: 14px;
}
.picker-toolbar input {
  width: min(520px, 100%);
}
.picker-table .button {
  min-height: 34px;
  padding: 7px 10px;
}
.log-details,
.log-error {
  max-width: 520px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 8px 0 0;
  padding: 9px 10px;
  border-radius: 6px;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.log-details {
  background: #f8fafc;
  border: 1px solid var(--line);
}
.log-error {
  background: #fff1f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.empty-state p { margin-top: -8px; }
.edit-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.edit-panel input, .edit-panel select, .edit-panel textarea {
  width: 100%;
  min-width: 0;
}
.quick-periods {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.period-month {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.period-month input {
  min-width: 110px;
}
.period-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}
.period-button {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.period-button strong {
  color: var(--text);
}
.period-button span {
  color: var(--muted);
  font-size: 13px;
}
.period-button:hover, .period-button.active {
  border-color: var(--accent);
  background: #ecfdf5;
}
.revenue-month-table th:not(:first-child),
.revenue-month-table td:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}
.revenue-month-table .revenue-city-row td {
  padding-top: 18px;
  padding-bottom: 10px;
  background: #eef6f3;
  color: var(--accent-dark);
  font-weight: 900;
}
.revenue-month-table .revenue-city-total td {
  background: #fbfcfd;
  border-top: 2px solid var(--line);
  font-weight: 900;
}
.revenue-month-table .revenue-city-total td:first-child {
  color: var(--text);
}
.daily-entry-form {
  display: grid;
  gap: 22px;
}
.daily-date-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.daily-entry-table input,
.daily-entry-table select {
  width: 100%;
  min-width: 0;
}
.daily-entry-table .money-input {
  max-width: 160px;
}
.daily-entry-table th:last-child,
.daily-entry-table td:last-child {
  width: 48px;
  text-align: center;
}
.remove-row {
  min-height: 34px;
  width: 34px;
  padding: 0;
  border-radius: 6px;
  background: #eef2f7;
  color: #334155;
  font-size: 20px;
  line-height: 1;
}
.remove-row:hover {
  background: #fee2e2;
  color: #991b1b;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .brand-logo { width: 96px; }
  .nav-dropdown { position: static; box-shadow: none; margin-top: 4px; }
  .metrics, .grid.two, .payroll-grid, .payroll-amounts, .period-buttons { grid-template-columns: 1fr; }
  .page-title-row, .payroll-card-top, .payroll-card-bottom { flex-direction: column; }
  .day-row { grid-template-columns: 1fr; }
  .planner { grid-template-columns: 1fr; }
  .planner-sidebar { position: static; }
  .month-grid { grid-template-columns: 1fr; }
  .weekday { display: none; }
  .bulk-fields, .date-check-grid { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
