/* frontend/src/styles.css */
:root {
  --page-bg: #f3f6f9;
  --sidebar-bg: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f8fafc;
  --column-bg: #e9eef4;
  --text: #14161a;
  --heading: #14161a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #8a97a8;
  --border: #e3e8ef;
  --border-strong: #d5dce5;
  --line: #eef1f5;
  --accent: #f0394a;
  --accent-hover: #d42a3c;
  --accent-text: #d42638;
  --accent-contrast: #ffffff;
  --accent-soft: #fdecee;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --danger-border: #f5c6c2;
  --warning: #9a4a07;
  --warning-soft: #fef3e2;
  --warning-border: #f7dcb0;
  --success: #16794a;
  --success-soft: #e7f6ee;
  --success-border: #bfe6cf;
  --info: #1d5fa8;
  --info-soft: #e8f1fb;
  --neutral: #475569;
  --neutral-soft: #eef1f5;
  --disabled-bg: #f1f4f8;
  --overlay: rgba(15, 27, 45, 0.5);
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.05);
  --shadow-pop: 0 10px 40px rgba(15, 27, 45, 0.18);
  --chart-bar: #f0394a;
}
.theme-dark {
  --page-bg: #0e1014;
  --sidebar-bg: #14171c;
  --surface: #171a20;
  --surface-strong: #101216;
  --surface-soft: #1c2027;
  --column-bg: #121418;
  --text: #eceef2;
  --text-2: #c5cad3;
  --muted: #969ca8;
  --faint: #7a808c;
  --border: #272b33;
  --border-strong: #353a44;
  --line: #1f2329;
  --accent: #f0394a;
  --accent-text: #ff7a86;
  --heading: #f4f5f7;
  --accent-hover: #ff5464;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(240, 57, 74, 0.16);
  --danger: #f38b80;
  --danger-soft: rgba(217, 48, 37, 0.16);
  --danger-border: rgba(243, 139, 128, 0.32);
  --warning: #f2b765;
  --warning-soft: rgba(217, 119, 6, 0.16);
  --warning-border: rgba(242, 183, 101, 0.32);
  --success: #62cf96;
  --success-soft: rgba(31, 157, 92, 0.16);
  --success-border: rgba(98, 207, 150, 0.32);
  --info: #86b9ef;
  --info-soft: rgba(29, 95, 168, 0.24);
  --neutral: #a9b6c7;
  --neutral-soft: rgba(148, 163, 184, 0.14);
  --disabled-bg: rgba(148, 163, 184, 0.08);
  --overlay: rgba(3, 8, 15, 0.66);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 16px 48px rgba(0, 0, 0, 0.5);
  --chart-bar: #f0394a;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--page-bg);
}
body {
  margin: 0;
  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.45;
}
button,
input,
textarea,
select {
  font: inherit;
}
h1,
h3,
p {
  margin: 0;
}
h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
a {
  color: var(--accent-text);
}
a:hover {
  color: var(--accent-hover);
}
.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
}
.mobile-bar,
.sidebar-backdrop {
  display: none;
}
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  display: block;
  height: 44px;
  width: auto;
}
.brand-logo-dark,
.theme-dark .brand-logo-light {
  display: none;
}
.theme-dark .brand-logo-dark {
  display: block;
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  padding: 20px 12px;
}
.nav-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--faint);
  padding: 0 10px 10px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item svg {
  flex: none;
}
.nav-item:hover {
  background: var(--surface-soft);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
}
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.user-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.user-chip-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.user-chip-text span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip-text small {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-footer-actions .icon-only-button {
  min-width: 32px;
  min-height: 32px;
  padding: 6px;
}
.main-content {
  min-width: 0;
  padding: 32px 48px 48px;
}
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
.page > * {
  min-width: 0;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.section-header h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--heading);
  text-wrap: balance;
}
.section-header p {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
}
.section-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.section-actions:empty {
  display: none;
}
.section-actions-spread {
  width: 100%;
  justify-content: space-between;
}
.section-actions select {
  font-weight: 600;
}
.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ghost-button,
.primary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.button-icon {
  flex: 0 0 auto;
  display: inline-flex;
}
.icon-only-button {
  min-width: 36px;
  min-height: 36px;
  padding: 8px;
}
.primary-button {
  background: var(--accent);
  color: var(--accent-contrast);
}
.primary-button:hover {
  background: var(--accent-hover);
}
.ghost-button {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-2);
  font-weight: 600;
}
.ghost-button:hover {
  background: var(--surface-soft);
  color: var(--accent-text);
}
.danger-button {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}
.danger-button:hover {
  border-color: var(--danger);
}
.nav-item:disabled,
.ghost-button:disabled,
.primary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.full-button {
  width: 100%;
  padding: 11px 16px;
}
button:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.month-navigator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
}
.month-nav-button {
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
}
.month-nav-label {
  position: relative;
  display: block;
  min-width: 150px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}
.month-nav-label span {
  display: inline-block;
}
.month-nav-label span::first-letter {
  text-transform: uppercase;
}
.month-nav-label:hover {
  background: var(--surface-soft);
}
.month-nav-label input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
}
.card > h3 {
  margin-bottom: 16px;
}
.metrics-grid,
.charts-grid,
.two-column-layout {
  display: grid;
  gap: 18px;
}
.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.charts-grid,
.two-column-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.metric-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 22px 20px;
}
.metric-card span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.metric-card strong {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}
.metric-card small {
  font-size: 12px;
  color: var(--muted);
}
.table-wrapper {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  vertical-align: middle;
}
th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child td {
  border-bottom: none;
}
th:first-child,
td:first-child {
  padding-left: 0;
}
td:first-child {
  white-space: nowrap;
}
td .action-row {
  flex-wrap: nowrap;
}
th:last-child,
td:last-child {
  padding-right: 0;
}
.movement-row.inflow td {
  background: var(--success-soft);
}
.movement-row.outflow td {
  background: var(--danger-soft);
}
.payment-row-outstanding td {
  background: var(--warning-soft);
}
.movement-row td:first-child,
.payment-row-outstanding td:first-child {
  padding-left: 12px;
}
.movement-row td:last-child,
.payment-row-outstanding td:last-child {
  padding-right: 12px;
}
.loading-state,
.empty-cell {
  text-align: center;
  color: var(--faint);
  padding: 28px;
  font-size: 13px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.full-width {
  grid-column: 1 / -1;
}
input,
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
}
input:disabled,
textarea:disabled,
select:disabled {
  background: var(--disabled-bg);
  color: var(--muted);
  cursor: not-allowed;
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 0;
  border-color: var(--accent);
}
textarea {
  min-height: 100px;
  line-height: 1.5;
  resize: vertical;
}
.form-actions,
.action-row,
.inline-form,
.assignment-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.form-actions {
  margin-top: 20px;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.checkbox-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.checkbox-chip.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
}
.checkbox-chip input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}
.label-with-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.info-hint {
  position: relative;
  display: inline-flex;
  color: var(--accent-text);
  cursor: help;
}
.info-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: max-content;
  max-width: min(320px, 70vw);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  white-space: pre-wrap;
}
.info-hint:hover .info-tooltip,
.info-hint:focus .info-tooltip {
  display: block;
}
input[aria-invalid=true],
textarea[aria-invalid=true],
select[aria-invalid=true] {
  border-color: var(--danger);
}
input[aria-invalid=true]:focus,
textarea[aria-invalid=true]:focus,
select[aria-invalid=true]:focus {
  outline-color: var(--danger-soft);
  border-color: var(--danger);
}
.field-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}
.modal-card .error-box {
  margin: 16px 0 0;
}
.error-box {
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid var(--danger-border);
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--neutral);
}
.badge.pending,
.badge.partial {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge.paid,
.badge.active,
.badge.completed,
.badge.income,
.badge.invoice {
  background: var(--success-soft);
  color: var(--success);
}
.badge.in_progress,
.badge.transfer {
  background: var(--info-soft);
  color: var(--info);
}
.badge.expense,
.badge.payment,
.badge.reimbursement-payment {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge.finished,
.badge.done {
  background: var(--neutral-soft);
  color: var(--neutral);
}
.warning-text {
  color: var(--warning);
}
.success-text {
  color: var(--success);
}
.assignment-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.assignment-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
}
.assignment-header {
  display: grid;
  margin-bottom: 12px;
}
.matrix-cell {
  display: grid;
  gap: 4px;
}
.assignment-editor {
  display: grid;
  gap: 16px;
}
.assignment-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
.assignment-editor-list {
  display: grid;
  gap: 10px;
}
.assignment-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 120px 110px;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}
.earning-bulk-list {
  margin: 16px 0;
}
.earning-bulk-list .assignment-editor-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
}
.assignment-editor-info {
  display: grid;
  gap: 4px;
}
.assignment-editor-info small {
  color: var(--muted);
}
.task-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.task-board-actions {
  justify-content: flex-start;
}
.task-column-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 420px;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: var(--column-bg);
}
.task-column-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 4px 6px;
}
.task-column-header h3 {
  font-size: 14px;
}
.task-column-header p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.task-column-header .payment-debt-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--neutral);
  font-size: 12px;
  font-weight: 700;
}
.task-card-list {
  display: grid;
  gap: 10px;
  align-content: start;
  flex: 1;
  border-radius: 12px;
}
.task-card-list.drag-over {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.task-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
  cursor: grab;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}
.task-card strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.task-card p {
  color: var(--text-2);
  white-space: pre-wrap;
}
.task-card.dragging {
  opacity: 0.6;
  cursor: grabbing;
}
.task-card.priority-high {
  border-left-color: #d93025;
}
.task-card.priority-medium {
  border-left-color: #e0912b;
}
.task-card.priority-low {
  border-left-color: #1f9d5c;
}
.task-card:hover {
  border-color: var(--border-strong);
}
.task-card.priority-high:hover {
  border-left-color: #d93025;
}
.task-card.priority-medium:hover {
  border-left-color: #e0912b;
}
.task-card.priority-low:hover {
  border-left-color: #1f9d5c;
}
.task-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.task-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.task-card-meta small,
.task-empty {
  color: var(--muted);
}
.task-priority-badge.priority-high {
  background: var(--danger-soft);
  color: var(--danger);
}
.task-priority-badge.priority-medium {
  background: var(--warning-soft);
  color: var(--warning);
}
.task-priority-badge.priority-low {
  background: var(--success-soft);
  color: var(--success);
}
.task-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.task-card:hover .task-card-actions,
.task-card:focus-within .task-card-actions {
  opacity: 1;
  pointer-events: auto;
}
.task-empty {
  padding: 18px 14px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
}
.payments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.payments-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 18px;
}
.payments-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.payments-card-header p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.payment-employee-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.payment-employee-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.payment-debt-chip {
  display: grid;
  gap: 2px;
  min-width: 110px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--info-soft);
  color: var(--info);
}
.payment-period-list {
  display: grid;
  gap: 8px;
}
.payment-period-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}
.payment-period-row.empty {
  color: var(--muted);
  justify-content: center;
}
.payment-period-main,
.payment-period-meta {
  display: grid;
  gap: 4px;
}
.payment-period-main strong {
  font-size: 15px;
}
.payment-period-meta {
  justify-items: end;
}
.employee-balance-list {
  display: grid;
  gap: 8px;
}
.employee-balance-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.employee-balance-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
}
.invoice-simulator {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 13.5px;
}
.invoice-payment-section,
.invoice-payment-summary {
  margin-top: 18px;
}
.invoice-sim-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.invoice-sim-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.invoice-sim-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.invoice-sim-row.accent strong,
.invoice-sim-row.accent span {
  color: var(--accent-text);
  font-weight: 800;
}
.invoice-detail {
  display: grid;
  gap: 18px;
}
.invoice-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.invoice-detail-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}
.invoice-detail-card small {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.invoice-detail-card strong {
  font-size: 14px;
  font-weight: 600;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay);
}
.modal-card {
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 26px 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.payment-detail-modal {
  width: min(1180px, 96vw);
}
.invoice-payment-modal {
  width: min(920px, 96vw);
}
.modal-card-compact {
  width: min(520px, 100%);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--heading);
}
.modal-header p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--page-bg);
}
.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 30px 32px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}
.login-card .brand-logo {
  height: 56px;
  margin-bottom: 4px;
}
.login-card h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--heading);
}
.login-card p {
  font-size: 13.5px;
  color: var(--muted);
}
.login-card .error-box {
  margin-bottom: 0;
}
.recharts-bar-rectangle path {
  fill: var(--chart-bar);
}
.recharts-cartesian-grid line {
  stroke: var(--line);
  stroke-dasharray: none;
}
.recharts-cartesian-axis-line,
.recharts-cartesian-axis-tick-line {
  stroke: var(--border-strong);
}
.recharts-text {
  fill: var(--muted);
  font-size: 11px;
}
.recharts-default-tooltip {
  border: 1px solid var(--border) !important;
  border-radius: 10px;
  background: var(--surface) !important;
  box-shadow: var(--shadow-pop);
  font-size: 13px;
}
.recharts-tooltip-label {
  color: var(--text);
  font-weight: 700;
}
.recharts-tooltip-item {
  color: var(--text-2) !important;
}
.recharts-tooltip-cursor {
  fill: var(--accent-soft);
}
@media (max-width: 1100px) {
  .main-content {
    padding: 28px 28px 40px;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .charts-grid,
  .two-column-layout,
  .payments-layout,
  .task-board {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }
  .app-shell {
    display: block;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .main-content {
    width: 100%;
    padding: 16px;
  }
  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .page > *,
  .card,
  .section-header > *,
  .payment-employee-card,
  .assignment-card,
  .task-column-card {
    min-width: 0;
    max-width: 100%;
  }
  .section-header,
  .inline-form,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .section-header {
    padding-bottom: 16px;
  }
  .section-header h1 {
    font-size: 26px;
  }
  .form-grid,
  .invoice-detail-grid,
  .assignment-editor-row,
  .earning-bulk-list .assignment-editor-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .payments-grid,
  .assignment-list,
  .checkbox-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .payment-employee-header,
  .payment-period-row {
    flex-direction: column;
    align-items: stretch;
  }
  .payment-period-meta {
    justify-items: stretch;
  }
  .table-wrapper {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .month-navigator {
    display: flex;
    width: 100%;
    max-width: 100%;
    justify-content: space-between;
  }
  .month-nav-label {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .card > .section-actions,
  .section-actions {
    max-width: 100%;
  }
  .payment-employee-header > *,
  .payment-period-row > *,
  .employee-balance-row > *,
  .assignment-summary > * {
    min-width: 0;
  }
  .recharts-wrapper {
    max-width: 100%;
  }
  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 14px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
  }
  .mobile-bar strong {
    font-size: 16px;
    font-weight: 800;
    color: var(--heading);
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: var(--overlay);
  }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 41;
    width: min(280px, 84vw);
    height: auto;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }
  .sidebar.open {
    transform: none;
    box-shadow: var(--shadow-pop);
  }
  .nav-item {
    padding: 12px;
  }
  .card {
    padding: 16px;
  }
  .section-actions {
    flex-wrap: wrap;
  }
  .section-actions > * {
    flex: 1 1 auto;
  }
  .metric-card {
    padding: 16px;
  }
  .metric-card strong {
    font-size: 22px;
    overflow-wrap: anywhere;
  }
  th,
  td {
    padding: 10px 8px;
    white-space: nowrap;
  }
  .task-card-actions {
    opacity: 1;
    pointer-events: auto;
  }
  .task-column-card {
    min-height: 0;
  }
  .payment-debt-chip {
    min-width: 0;
  }
  .employee-balance-row,
  .assignment-summary,
  .invoice-sim-row,
  .task-card-meta {
    flex-wrap: wrap;
  }
  .action-row {
    flex-wrap: wrap;
  }
  .form-actions > button {
    width: 100%;
  }
  .modal-overlay {
    padding: 8px;
    align-items: end;
  }
  .modal-card,
  .payment-detail-modal,
  .invoice-payment-modal,
  .modal-card-compact {
    width: 100%;
    max-height: 94vh;
    padding: 18px 16px;
    border-radius: 16px;
  }
  .modal-header h3 {
    font-size: 19px;
  }
  .login-card {
    padding: 22px 20px;
  }
  input,
  textarea,
  select {
    font-size: 16px;
  }
}
@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .section-actions > button {
    width: 100%;
  }
  .section-actions .icon-only-button {
    flex: 0 0 auto;
    width: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
