:root {
  --bg: #f5f5f7;
  --bg-soft: #fbfbfd;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-tint: #f7f7f9;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --brand: #ff8a2a;
  --brand-deep: #ff6a00;
  --navy: #3a3a3c;
  --navy-soft: #8e8e93;
  --line: rgba(29, 29, 31, 0.08);
  --success: #34a853;
  --success-soft: rgba(78, 167, 102, 0.12);
  --danger: #c94b4b;
  --danger-soft: rgba(201, 75, 75, 0.10);
  --warn: #d9822b;
  --warn-soft: rgba(217, 130, 43, 0.12);
  --pay-detail-panel-width: clamp(360px, 31vw, 440px);
  --pay-detail-sheet-panel-width: clamp(680px, 58vw, 860px);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --radius: 20px;
  --font-sans: "SF Pro Display", "SF Pro Text", "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
}

a {
  color: var(--navy);
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.sidebar,
.topbar,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.sidebar {
  border-radius: 24px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 4px 10px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff9a46 0%, #ff7f1f 100%);
  box-shadow: 0 6px 18px rgba(255, 138, 42, 0.18);
  position: relative;
  flex: 0 0 auto;
}

.brand-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff7ef;
  position: absolute;
  inset: 0;
  margin: auto;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.brand-copy span {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.sidebar-copy {
  padding: 0 8px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  padding: 0.78rem 0.9rem;
  border-radius: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.nav-link.active,
.nav-link:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
  transform: none;
}

.main-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.topbar {
  border-radius: 24px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar h1,
.hero h2,
.section-header h2,
.section-header h3 {
  margin: 0.2rem 0 0;
  letter-spacing: -0.03em;
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  border-radius: var(--radius);
  padding: 20px;
}

.inset-card {
  background: var(--surface-tint);
  box-shadow: none;
  border: 1px solid var(--line);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

.hero-copy h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.hero-panel {
  border-radius: 18px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.025);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-stat span,
.stat-note,
.table-subtle {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.mini-stat strong {
  font-size: 1.35rem;
}

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

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

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

.trust-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trust-card strong {
  display: block;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.accent-card {
  background: rgba(255, 138, 42, 0.08);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.overview-snapshot {
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(255, 170, 94, 0.24), transparent 34%),
    radial-gradient(circle at top right, rgba(84, 121, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 247, 249, 0.96) 100%);
}

.overview-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 0;
}

.overview-hero-copy,
.overview-mix-panel {
  padding: 26px 28px 28px;
}

.overview-hero-copy {
  border-right: 1px solid rgba(29, 29, 31, 0.06);
}

.overview-hero-copy h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(2.3rem, 5vw, 4rem);
  letter-spacing: -0.055em;
}

.overview-month-form {
  margin-top: 16px;
  max-width: 260px;
}

.overview-month-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overview-month-form span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.overview-money-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.overview-money-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(29, 29, 31, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.overview-money-card span,
.overview-money-card em,
.overview-bar-head span,
.overview-bar-foot span,
.overview-line-labels span,
.overview-reminder-row span,
.overview-mix-values span,
.overview-donut-core span {
  color: var(--ink-soft);
}

.overview-money-card strong {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  letter-spacing: -0.05em;
}

.overview-money-card em {
  font-style: normal;
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.05);
}

.overview-delta.positive {
  color: #28743f;
  background: rgba(52, 168, 83, 0.12);
}

.overview-delta.negative {
  color: #9d6b14;
  background: rgba(217, 130, 43, 0.14);
}

.overview-delta.flat {
  color: var(--ink-soft);
  background: rgba(29, 29, 31, 0.05);
}

.overview-money-card-accent {
  background: linear-gradient(180deg, rgba(255, 242, 228, 0.96) 0%, rgba(255, 255, 255, 0.86) 100%);
  border-color: rgba(255, 138, 42, 0.14);
}

.overview-mix-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.overview-donut-wrap {
  display: flex;
  justify-content: center;
}

.overview-donut {
  --overview-donut: conic-gradient(#e9e9ee 0% 100%);
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--overview-donut);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.04);
}

.overview-donut-core {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 14px 28px rgba(29, 29, 31, 0.08);
}

.overview-donut-core strong {
  margin-top: 8px;
  font-size: 1.1rem;
  letter-spacing: -0.04em;
}

.overview-mix-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.overview-mix-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(29, 29, 31, 0.06);
}

.overview-mix-label,
.overview-mix-values {
  display: flex;
  align-items: center;
  gap: 10px;
}

.overview-mix-values {
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.overview-mix-values strong {
  font-size: 0.95rem;
}

.overview-color-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
}

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

.overview-grid-bottom {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.overview-chart-card,
.overview-trend-card,
.overview-people-card {
  padding: 24px;
}

.overview-bar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.overview-bar-list.compact {
  gap: 12px;
}

.overview-bar-row {
  --bar-tone: var(--brand);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 247, 249, 0.92) 100%);
  border: 1px solid rgba(29, 29, 31, 0.06);
}

.overview-bar-row.compact {
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
}

.overview-rank-pill {
  width: 38px;
  min-width: 38px;
  border-radius: 14px;
  background: rgba(29, 29, 31, 0.04);
  color: var(--ink);
  font-weight: 800;
  display: grid;
  place-items: center;
}

.overview-bar-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.overview-bar-head,
.overview-bar-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.overview-bar-track {
  height: 11px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.06);
  overflow: hidden;
}

.overview-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bar-tone) 60%, white), var(--bar-tone));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--bar-tone) 25%, transparent);
}

.overview-line-shell {
  margin-top: 6px;
}

.overview-line-chart {
  width: 100%;
  height: auto;
  display: block;
}

.overview-grid-line {
  stroke: rgba(29, 29, 31, 0.08);
  stroke-width: 1;
}

.overview-line {
  fill: none;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overview-line.broker {
  stroke: url(#brokerTrend);
}

.overview-line.salary {
  stroke: url(#salaryTrend);
}

.overview-line-labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.overview-line-labels > div {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(247, 247, 249, 0.92);
  border: 1px solid rgba(29, 29, 31, 0.06);
}

.overview-line-labels strong {
  display: block;
  margin-top: 8px;
  font-size: 0.94rem;
}

.overview-line-legend {
  margin-top: 14px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.legend-swatch {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.legend-swatch.broker {
  background: linear-gradient(90deg, #ffb066 0%, #ff6a00 100%);
}

.legend-swatch.salary {
  background: linear-gradient(90deg, #7bb0ff 0%, #335dff 100%);
}

.overview-reminder-section + .overview-reminder-section {
  margin-top: 18px;
}

.overview-reminder-section h4 {
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}

.overview-reminder-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.overview-reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(247, 247, 249, 0.92);
  border: 1px solid rgba(29, 29, 31, 0.06);
}

.overview-reminder-row strong {
  display: block;
}

.overview-reminder-row em {
  min-width: 52px;
  text-align: right;
  font-style: normal;
  font-weight: 800;
  color: var(--brand-deep);
}

.action-list,
.checklist-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-item,
.checklist-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(247, 249, 252, 0.84);
  border: 1px solid rgba(22, 32, 51, 0.06);
}

.action-copy,
.checklist-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-copy p,
.checklist-copy p {
  margin: 0;
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.run-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.run-snapshot-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.run-snapshot-card h3 {
  margin: 0.2rem 0 0;
  letter-spacing: -0.03em;
}

.run-snapshot-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.run-snapshot-meta > div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(73, 96, 142, 0.08);
}

.run-snapshot-meta span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.run-snapshot-meta strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.salary-overview-grid {
  align-items: start;
}

.salary-summary-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.salary-overview-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.salary-overview-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr) minmax(180px, 0.8fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  border-radius: 18px;
  background: rgba(247, 249, 252, 0.84);
  border: 1px solid rgba(22, 32, 51, 0.06);
}

.salary-overview-name,
.salary-overview-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.salary-overview-name strong {
  font-size: 1rem;
}

.salary-overview-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.salary-overview-meta > div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(73, 96, 142, 0.08);
}

.salary-overview-meta span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.salary-overview-meta strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.salary-overview-actions {
  align-items: flex-start;
}

.salary-overview-note {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.pay-review-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pay-review-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(190px, 0.72fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  border-radius: 18px;
  background: rgba(247, 249, 252, 0.84);
  border: 1px solid rgba(22, 32, 51, 0.06);
}

.pay-review-name,
.pay-review-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-review-name strong {
  font-size: 1rem;
}

.pay-review-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pay-review-meta > div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(73, 96, 142, 0.08);
}

.pay-review-meta span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pay-review-meta strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.pay-review-actions {
  align-items: flex-start;
}

.pay-review-note {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.detail-link-button {
  margin-top: 8px;
  padding: 0.34rem 0.68rem;
  border: 1px solid rgba(255, 138, 42, 0.16);
  border-radius: 999px;
  background: rgba(255, 138, 42, 0.1);
  color: var(--brand-deep);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.people-action-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.people-action-stack .detail-link-button {
  margin-top: 0;
}

.detail-link-button:hover {
  color: var(--brand);
  background: rgba(255, 138, 42, 0.16);
}

.detail-link-button.is-active {
  color: #fff7ef;
  background: linear-gradient(180deg, #ff9a46 0%, #ff7f1f 100%);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(255, 138, 42, 0.2);
}

.pay-detail-row-active td {
  background: rgba(255, 138, 42, 0.08);
}

.pay-detail-row-active td.frozen-col {
  background: #ffe8d1;
}

.pay-detail-cell-host {
  z-index: 28;
  overflow: visible;
}

.pay-detail-row-active td:first-child {
  box-shadow: inset 4px 0 0 rgba(255, 127, 31, 0.85);
}

.pay-detail-row-active [data-net-pay-display] strong {
  color: var(--brand-deep);
}

.pay-row-variance {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.variance-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variance-chip {
  font-size: 0.72rem;
}

.total-col.variance-up-cell {
  background: rgba(78, 167, 102, 0.12);
}

.total-col.variance-up-cell strong {
  color: #28743f;
}

.total-col.variance-down-cell {
  background: rgba(213, 155, 54, 0.16);
}

.total-col.variance-down-cell strong {
  color: #9d6b14;
}

.pay-detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 42;
  pointer-events: none;
}

.pay-detail-drawer-home {
  position: relative;
}

.pay-detail-backdrop {
  display: none;
}

.pay-detail-panel {
  position: absolute;
  width: min(var(--pay-detail-panel-width), calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 28px));
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(49, 76, 127, 0.12);
  box-shadow: 0 28px 64px rgba(19, 27, 43, 0.18);
}

.pay-detail-panel::before {
  content: "";
  position: absolute;
  top: 18px;
  left: -10px;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.97);
  border-left: 1px solid rgba(49, 76, 127, 0.12);
  border-top: 1px solid rgba(49, 76, 127, 0.12);
  transform: rotate(-45deg);
  border-top-left-radius: 4px;
}

.pay-detail-drawer-sheet .pay-detail-panel-sheet {
  width: min(var(--pay-detail-sheet-panel-width), calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 26px 26px 30px;
  border-radius: 30px;
  box-shadow: 0 34px 90px rgba(19, 27, 43, 0.22);
}

.pay-detail-drawer-inline {
  position: absolute;
  inset: 0 auto auto calc(100% + 18px);
  z-index: 36;
  pointer-events: none;
}

.pay-detail-drawer-inline .pay-detail-panel-sheet {
  position: absolute;
  top: 0;
  left: 0;
}

.pay-detail-drawer-sheet .pay-detail-panel-sheet::before {
  top: var(--pay-detail-arrow-offset, 112px);
  left: -12px;
  width: 24px;
  height: 24px;
}

.pay-detail-header {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: -20px -20px 16px;
  padding: 20px 20px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 252, 0.94) 100%);
  border-bottom: 1px solid rgba(49, 76, 127, 0.08);
  backdrop-filter: blur(14px);
}

.pay-detail-header h3 {
  margin: 0.2rem 0 0;
}

.pay-detail-drawer-sheet .pay-detail-header {
  margin: -26px -26px 18px;
  padding: 24px 26px 18px;
}

.pay-detail-summary-card {
  background: linear-gradient(180deg, rgba(255, 247, 239, 0.95) 0%, rgba(255, 255, 255, 0.94) 100%);
  border: 1px solid rgba(255, 138, 42, 0.14);
}

.pay-detail-summary-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-detail-context-line {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.pay-detail-summary-grid > div:first-child strong {
  color: var(--brand-deep);
  font-size: 1.18rem;
}

.pay-detail-drawer-sheet .pay-detail-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pay-detail-package-strip {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(73, 96, 142, 0.08);
}

.pay-detail-package-strip span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pay-detail-package-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.pay-detail-package-strip p {
  margin: 6px 0 0;
}

.pay-detail-logic-card {
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.96) 0%, rgba(255, 255, 255, 0.94) 100%);
  border: 1px solid rgba(49, 76, 127, 0.08);
}

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

.detail-metric-grid > div,
.detail-history-row,
.detail-copy-stack > div {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(73, 96, 142, 0.08);
}

.detail-metric-grid span,
.detail-history-value span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-metric-grid strong,
.detail-history-value strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.detail-copy-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-copy-stack p {
  margin: 6px 0 0;
}

.detail-formula-caption {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(49, 76, 127, 0.06);
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.detail-formula-list,
.detail-source-list,
.detail-compare-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-formula-row,
.detail-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  column-gap: 16px;
  row-gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(73, 96, 142, 0.08);
}

.detail-compare-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(73, 96, 142, 0.08);
}

.detail-formula-copy span,
.detail-source-row span,
.detail-section-label,
.detail-compare-values span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-formula-copy,
.detail-source-row span {
  min-width: 0;
  line-height: 1.35;
}

.detail-formula-copy,
.detail-source-row span {
  overflow-wrap: anywhere;
}

.detail-formula-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-formula-source {
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  text-transform: none;
}

.detail-formula-row strong,
.detail-source-row strong,
.detail-compare-title {
  color: var(--ink);
}

.detail-formula-row strong,
.detail-source-row strong {
  font-size: 0.96rem;
  white-space: nowrap;
  text-align: right;
}

.detail-formula-row-strong {
  background: linear-gradient(180deg, rgba(255, 247, 239, 0.96) 0%, rgba(255, 255, 255, 0.94) 100%);
  border-color: rgba(255, 138, 42, 0.16);
}

.detail-formula-row-strong strong {
  color: var(--brand-deep);
  font-size: 1rem;
}

.detail-source-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pay-detail-drawer-sheet .detail-source-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-section-label {
  margin: 0 0 10px;
}

.detail-compare-card {
  align-items: flex-start;
  flex-direction: column;
}

.detail-compare-title {
  font-size: 0.95rem;
}

.detail-compare-values {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-compare-delta {
  align-self: flex-start;
}

.pay-detail-drawer-sheet .detail-compare-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-history-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.detail-history-row p {
  margin: 6px 0 0;
}

.detail-history-value {
  min-width: 120px;
  text-align: right;
}

.pay-detail-drawer-sheet .pay-detail-note-card {
  grid-column: 1 / -1;
}

@media (max-width: 1360px) {
  .overview-hero-grid,
  .overview-grid,
  .overview-grid-bottom {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview-hero-copy {
    border-right: 0;
    border-bottom: 1px solid rgba(29, 29, 31, 0.06);
  }

  .overview-money-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pay-detail-drawer-sheet .pay-detail-panel-sheet {
    width: min(720px, calc(100vw - 28px));
  }

  .pay-detail-drawer-sheet .pay-detail-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pay-detail-drawer-sheet .detail-compare-list,
  .pay-detail-drawer-sheet .detail-source-sections {
    grid-template-columns: minmax(0, 1fr);
  }
}

body.drawer-open {
  overflow: auto;
}

body.drawer-open .page-content {
  padding-right: 0;
}

.two-column-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.payout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}

.payout-card {
  gap: 16px;
}

.pay-run-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.pay-run-total span,
.mini-metrics span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pay-run-total strong {
  font-size: 1.6rem;
  letter-spacing: -0.04em;
}

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

.mini-metrics > div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(73, 96, 142, 0.08);
}

.mini-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 1.08rem;
}

.full-span {
  grid-column: 1 / -1;
}

.notice-card {
  background: linear-gradient(180deg, rgba(255, 138, 42, 0.1), rgba(255, 255, 255, 0.92));
}

.raw-text-panel {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: rgba(27, 39, 67, 0.92);
  color: #eef4ff;
  overflow-x: auto;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 0.92rem;
}

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

.feature-list strong,
.spotlight-list li {
  color: var(--ink);
}

.feature-list > div,
.spotlight-card {
  line-height: 1.5;
}

.feature-list > div {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(247, 249, 252, 0.84);
  border: 1px solid rgba(22, 32, 51, 0.06);
}

.spotlight-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.upload-dropzone {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.file-stack input[type="file"] {
  padding: 18px;
  border-style: dashed;
  border-color: rgba(49, 76, 127, 0.22);
  background: rgba(255, 255, 255, 0.72);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.hero-actions,
.button-row,
.inline-meta,
.filters,
.topbar-actions,
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filters {
  margin-bottom: 18px;
}

.filters.card {
  padding: 18px;
}

.button-row form {
  margin: 0;
}

.admin-documents-grid {
  align-items: flex-start;
}

.table-row-selected td {
  background: rgba(255, 138, 42, 0.08);
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(49, 76, 127, 0.08);
}

.section-tabbar {
  margin-bottom: 1rem;
}

.pay-run-view-toolbar .section-tabbar {
  margin-bottom: 0;
}

.pay-run-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 120ms ease, color 120ms ease;
}

.toggle-pill.active {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(49, 76, 127, 0.12);
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(255, 138, 42, 0.24);
}

.button-secondary {
  background: transparent;
  color: var(--navy);
  border: 1px solid rgba(49, 76, 127, 0.18);
  box-shadow: none;
}

.ghost-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(49, 76, 127, 0.08);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

.notification-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: rgba(49, 76, 127, 0.08);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.notification-link:hover,
.notification-link-active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(49, 76, 127, 0.12);
}

.notification-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}

.notification-icon svg {
  width: 100%;
  height: 100%;
}

.notification-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack.tight {
  gap: 10px;
}

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

.bulk-fee-target-grid,
.bulk-fee-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.bulk-fee-target-pill {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(73, 96, 142, 0.14);
  background: rgba(255, 255, 255, 0.78);
}

.bulk-fee-target-pill input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.bulk-fee-target-pill span {
  flex: 1;
}

.bulk-fee-target-pill strong {
  font-size: 0.95rem;
  color: var(--navy);
}

.bulk-fee-preview {
  gap: 12px;
}

.form-actions {
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label span {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(73, 96, 142, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.top-spaced {
  margin-top: 18px;
}

.document-folder {
  overflow: hidden;
}

.document-folder-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.document-folder-summary::-webkit-details-marker {
  display: none;
}

.document-folder-summary::after {
  content: "View";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(49, 76, 127, 0.16);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.document-folder[open] .document-folder-summary::after {
  content: "Hide";
}

.document-folder-summary h4 {
  margin: 0.2rem 0 0;
}

.document-folder-summary .muted {
  margin: 0.35rem 0 0;
}

.hidden {
  display: none;
}

.birthday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.birthday-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.birthday-card span,
.birthday-card em,
.birthday-card small {
  color: var(--ink-soft);
  font-style: normal;
}

.birthday-card strong {
  color: var(--ink);
  font-size: 1rem;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.sheet-shell {
  background: rgba(250, 252, 255, 0.86);
  max-height: 76vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

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

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

th {
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(242, 246, 252, 0.88);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.55);
}

.sheet-table th,
.sheet-table td {
  white-space: nowrap;
  font-size: 0.92rem;
}

.pay-run-sheet {
  min-width: 1860px;
  border-collapse: separate;
  border-spacing: 0;
}

.time-off-sheet {
  width: 100%;
  min-width: 1620px;
  table-layout: fixed;
}

.time-off-sheet .frozen-1 {
  left: 0;
  min-width: 96px;
  width: 96px;
}

.time-off-sheet .frozen-2 {
  left: 96px;
  min-width: 340px;
  width: 340px;
}

.time-off-col-code {
  width: 96px;
}

.time-off-col-name {
  width: 340px;
}

.time-off-col-approved,
.time-off-col-pending {
  width: 160px;
}

.time-off-col-leave-types {
  width: 220px;
}

.time-off-col-dates {
  width: 260px;
}

.time-off-col-vacation,
.time-off-col-sick,
.time-off-col-personal {
  width: 120px;
}

.sheet-table td {
  padding: 0.8rem 0.75rem;
}

.pay-run-sheet thead {
  isolation: isolate;
}

.pay-run-sheet thead th {
  position: sticky;
  z-index: 16;
  background: #f4f7fc;
  background-clip: padding-box;
  overflow: hidden;
}

.pay-run-sheet thead tr.sheet-band-row th {
  top: 0;
  height: 48px;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  box-shadow: inset 0 -1px 0 rgba(73, 96, 142, 0.08);
}

.pay-run-sheet thead tr.sheet-role-row th {
  left: 0;
  z-index: 19;
  background: #eef3fb;
  box-shadow: inset 0 -1px 0 rgba(73, 96, 142, 0.08);
}

.pay-run-sheet thead tr.sheet-column-row th {
  top: 48px;
  z-index: 18;
  height: 52px;
  padding-top: 0.78rem;
  padding-bottom: 0.78rem;
  background: #f7f9fd;
  box-shadow: inset 0 -1px 0 rgba(73, 96, 142, 0.08);
}

.sheet-band {
  text-align: center;
  font-weight: 800;
}

.sheet-band-profile {
  background: #e8eefb;
  left: 0;
  z-index: 20;
  box-shadow: inset -1px 0 0 rgba(73, 96, 142, 0.08);
}

.sheet-band-auto {
  background: #eef3fb;
}

.sheet-band-additions {
  background: #edf8ef;
}

.addition-col {
  background: rgba(78, 167, 102, 0.08);
}

.sheet-band-deductions {
  background: #f9efe9;
}

.deduction-col {
  background: rgba(209, 121, 82, 0.10);
}

.managed-override-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 160px;
}

.override-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.override-toggle input {
  margin: 0;
}

.sheet-band-final {
  background: #fff4ea;
}

.total-col {
  background: rgba(255, 138, 42, 0.09);
}

.frozen-col {
  position: sticky;
  z-index: 14;
  background: #fafcff;
}

.pay-run-sheet thead .frozen-col {
  z-index: 22;
  background: #f7f9fd;
}

.frozen-1 {
  left: 0;
  min-width: 220px;
}

.frozen-2 {
  left: 220px;
  min-width: 88px;
}

.frozen-3 {
  left: 308px;
  min-width: 240px;
}

.sheet-lead-row {
  background: rgba(255, 138, 42, 0.08);
}

.sheet-lead-row td.frozen-col {
  background: #fff3e7;
}

.sheet-member-row td.frozen-col {
  background: #f4f7fc;
}

.sheet-total-row td.frozen-col {
  background: #eef3fb;
}

.sheet-group-cell {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.sheet-toggle-button {
  min-width: 16px;
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.sheet-toggle-button:hover {
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: #edf0f8;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-green {
  background: rgba(78, 167, 102, 0.14);
  color: #28743f;
}

.badge-red {
  background: rgba(201, 75, 75, 0.14);
  color: #a12d2d;
}

.badge-amber {
  background: rgba(213, 155, 54, 0.16);
  color: #9d6b14;
}

.badge-slate {
  background: rgba(96, 112, 140, 0.12);
  color: #50617a;
}

.broker-form-history-header {
  margin-top: 1.5rem;
}

.compact-history-table {
  margin-top: 0.75rem;
}

.row-inline-badge {
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
}

.eyebrow {
  margin: 0;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.73rem;
  font-weight: 700;
}

.muted,
.empty-state {
  color: var(--ink-soft);
}

.empty-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(234, 241, 251, 0.8));
  border: 1px solid var(--line);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.review-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.review-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.review-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin-bottom: 14px;
}

.flash {
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-bottom: 18px;
  font-weight: 600;
}

.flash-success {
  background: rgba(78, 167, 102, 0.12);
  color: #28743f;
}

.flash-error {
  background: rgba(211, 92, 92, 0.12);
  color: #8f2f2f;
}

.centered-flash {
  max-width: 640px;
  margin: 24px auto 0;
}

.compact-button {
  padding: 0.7rem 0.9rem;
  min-width: 92px;
}

.hidden-inline-form {
  display: none;
}

.full-width {
  width: 100%;
}

.locked-card {
  opacity: 0.94;
}

.sheet-table input {
  min-width: 110px;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
}

.row-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pay-row-explainer {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.35;
}

.owing-page {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.owing-hero {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.82)),
    linear-gradient(180deg, rgba(255, 138, 42, 0.08), rgba(39, 93, 173, 0.05));
}

.owing-hero-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 253, 0.88));
  border: 1px solid rgba(73, 96, 142, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.owing-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.owing-register-card {
  padding-top: 18px;
}

.owing-filter-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 246, 252, 0.92));
}

.owing-create-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 235, 0.92));
}

.owing-controls-grid {
  align-items: start;
}

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

.owing-create-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.owing-create-card textarea,
.owing-entry-form textarea {
  min-height: 100px;
}

.owing-register-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.owing-register-summary strong {
  color: var(--ink);
  font-weight: 650;
}

.owing-empty-panel {
  background: rgba(255, 255, 255, 0.66);
}

.owing-entry-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.owing-entry-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(24, 39, 75, 0.06);
  overflow: hidden;
}

.owing-entry-card-open {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 236, 0.82));
}

.owing-entry-card-cleared {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 250, 243, 0.92));
}

.owing-entry-card[open] {
  box-shadow: 0 18px 36px rgba(24, 39, 75, 0.1);
}

.owing-entry-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(150px, 0.34fr) minmax(220px, 0.72fr) minmax(220px, 0.72fr) auto;
  gap: 16px;
  align-items: start;
  padding: 20px;
}

.owing-entry-summary::-webkit-details-marker {
  display: none;
}

.owing-entry-primary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.owing-entry-title-row,
.owing-entry-meta,
.owing-entry-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.owing-entry-title-row strong {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.owing-entry-meta {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.owing-entry-meta strong {
  color: var(--ink);
  font-weight: 700;
}

.owing-entry-balance,
.owing-entry-preview {
  min-width: 0;
}

.owing-entry-balance span,
.owing-entry-preview span {
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.owing-entry-balance strong {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.owing-entry-preview p {
  margin: 8px 0 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.owing-entry-preview p.is-empty {
  color: var(--ink-soft);
}

.owing-entry-action {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  background: rgba(49, 76, 127, 0.08);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.owing-entry-form {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.owing-entry-context {
  align-items: flex-start;
  padding-top: 28px;
}

.owing-entry-context .badge {
  max-width: 100%;
}

.owing-entry-form textarea {
  white-space: pre-wrap;
}

.owing-entry-form .form-actions {
  margin-top: 4px;
}

.pay-run-sheet td.frozen-col {
  background: #fafcff;
  background-clip: padding-box;
  box-shadow: 1px 0 0 rgba(73, 96, 142, 0.08);
}

.pay-run-sheet td strong {
  white-space: nowrap;
}

.login-layout {
  min-height: 100vh;
  padding: 32px 20px 60px;
  background:
    radial-gradient(circle at top, rgba(255, 138, 42, 0.16), transparent 34%),
    linear-gradient(180deg, #eef3fb 0%, #f7f9fc 100%);
}

.login-shell {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(560px, 100%);
  padding: 38px;
}

.login-brand {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.brand-lockup.large strong {
  font-size: 2.1rem;
}

.login-form {
  margin-top: 12px;
}

.portal-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

.view-purpose-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.view-purpose-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(238, 243, 251, 0.72);
  border: 1px solid var(--line);
}

.view-purpose-card strong {
  display: block;
  margin-bottom: 6px;
}

.view-purpose-card p {
  margin: 0;
  color: var(--ink-soft);
}

.upload-helper-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(238, 243, 251, 0.78);
  border: 1px solid var(--line);
}

.upload-helper-card strong {
  display: block;
  margin-bottom: 6px;
}

.upload-helper-card p {
  margin: 0;
  color: var(--ink-soft);
}

.auto-period-card {
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(235, 243, 253, 0.92), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(111, 132, 168, 0.16);
}

.auto-period-card strong {
  display: block;
  margin-bottom: 8px;
}

.auto-period-card p {
  margin: 0 0 8px;
}

.auto-period-card p:last-child {
  margin-bottom: 0;
}

.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.queued-upload-stack {
  display: grid;
  gap: 12px;
}

.upload-queue-card {
  min-height: 108px;
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(111, 132, 168, 0.28);
  background: rgba(245, 248, 253, 0.9);
}

.upload-queue-empty {
  color: var(--ink-soft);
  line-height: 1.5;
}

.upload-queue-list {
  display: grid;
  gap: 10px;
}

.upload-queue-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(111, 132, 168, 0.14);
}

.upload-queue-meta {
  display: grid;
  gap: 4px;
}

.upload-queue-meta span {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.upload-picker-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hidden-upload-inputs {
  display: none;
}

.team-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.team-role-groups {
  display: grid;
  gap: 22px;
}

.team-role-section {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(241, 245, 252, 0.92), rgba(255, 255, 255, 0.86));
  border: 1px solid rgba(111, 132, 168, 0.12);
  position: relative;
  overflow: hidden;
}

.team-role-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.team-role-header h4 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.team-role-section::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  border-radius: 24px 0 0 24px;
  background: rgba(111, 132, 168, 0.18);
}

.lane-managing-partner {
  background: linear-gradient(180deg, rgba(233, 240, 255, 0.98), rgba(255, 255, 255, 0.9));
}

.lane-managing-partner::before {
  background: linear-gradient(180deg, #4065a8, #7895d0);
}

.lane-broker-partner {
  background: linear-gradient(180deg, rgba(255, 243, 230, 0.98), rgba(255, 255, 255, 0.9));
}

.lane-broker-partner::before {
  background: linear-gradient(180deg, #ef8b35, #ffb36f);
}

.lane-broker {
  background: linear-gradient(180deg, rgba(241, 247, 239, 0.98), rgba(255, 255, 255, 0.9));
}

.lane-broker::before {
  background: linear-gradient(180deg, #5f9c62, #95c78f);
}

.lane-contractor {
  background: linear-gradient(180deg, rgba(247, 243, 252, 0.98), rgba(255, 255, 255, 0.9));
}

.lane-contractor::before {
  background: linear-gradient(180deg, #8d6db6, #b89bd8);
}

.lane-broker-team {
  background: linear-gradient(180deg, rgba(239, 247, 250, 0.98), rgba(255, 255, 255, 0.9));
}

.lane-broker-team::before {
  background: linear-gradient(180deg, #4b9bb6, #82c7d9);
}

.lane-salary {
  background: linear-gradient(180deg, rgba(252, 245, 236, 0.98), rgba(255, 255, 255, 0.9));
}

.lane-salary::before {
  background: linear-gradient(180deg, #bc7a2f, #ddb276);
}

.lane-salary-override {
  background: linear-gradient(180deg, rgba(246, 240, 234, 0.98), rgba(255, 255, 255, 0.9));
}

.lane-salary-override::before {
  background: linear-gradient(180deg, #9b6d4a, #cf9d74);
}

.lane-draw {
  background: linear-gradient(180deg, rgba(248, 241, 236, 0.98), rgba(255, 255, 255, 0.9));
}

.lane-draw::before {
  background: linear-gradient(180deg, #d46b5b, #efaa8d);
}

.lane-default::before {
  background: linear-gradient(180deg, #8ea1bf, #b2bfd3);
}

.team-cluster-card {
  display: grid;
  gap: 16px;
}

.team-cluster-details {
  overflow: hidden;
}

.team-cluster-toggle {
  display: grid;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.team-cluster-toggle::-webkit-details-marker {
  display: none;
}

.team-cluster-body {
  display: grid;
  gap: 16px;
}

.expense-editor {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.expense-editor-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.compact-expense-editor {
  padding: 12px 0 0;
}

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

.team-cluster-toggle-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.team-cluster-toggle::after {
  content: "+";
  justify-self: start;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(111, 132, 168, 0.18);
  background: rgba(244, 248, 253, 0.9);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.team-cluster-details[open] .team-cluster-toggle::after {
  content: "-";
}

.pay-team-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 253, 0.92));
}

.pay-team-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-cluster-lead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.team-cluster-lead h4 {
  margin: 4px 0 0;
  font-size: 1.35rem;
}

.team-cluster-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.team-cluster-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(239, 244, 252, 0.9), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(111, 132, 168, 0.16);
}

.team-cluster-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.team-cluster-summary strong {
  font-size: 0.98rem;
}

.team-connector-line {
  height: 20px;
  width: 2px;
  background: linear-gradient(180deg, rgba(62, 87, 137, 0.55), rgba(255, 138, 42, 0.2));
  margin: -2px auto 0;
  border-radius: 999px;
}

.team-member-bubbles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.team-member-bubble {
  position: relative;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(111, 132, 168, 0.16);
  box-shadow: 0 14px 32px rgba(63, 80, 118, 0.08);
}

.pay-team-bubble {
  display: grid;
  gap: 8px;
}

.team-member-bubble::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  width: 2px;
  height: 13px;
  transform: translateX(-50%);
  background: rgba(62, 87, 137, 0.28);
}

.team-member-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.team-member-bubble p {
  margin: 4px 0 0;
}

.team-bubble-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.team-bubble-metrics > div {
  padding: 10px;
  border-radius: 14px;
  background: rgba(238, 243, 251, 0.62);
  border: 1px solid rgba(111, 132, 168, 0.12);
}

.team-bubble-metrics span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.team-bubble-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 0.98rem;
}

.team-member-empty {
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(111, 132, 168, 0.25);
  background: rgba(238, 243, 251, 0.5);
}

.team-cluster-actions {
  display: flex;
  justify-content: flex-end;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  opacity: 0.66;
  cursor: not-allowed;
}

.sidebar-footer strong {
  font-size: 1rem;
}

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

  .sidebar {
    order: 2;
  }

  .stats-grid,
  .trust-grid,
  .dashboard-grid,
  .run-snapshot-grid,
  .detail-drawer-grid,
  .two-column-grid,
  .hero,
  .upload-layout,
  .form-grid,
  .compact-grid,
  .mini-metrics,
  .run-snapshot-meta,
  .detail-metric-grid,
  .review-meta,
  .portal-metrics,
  .upload-helper-grid,
  .team-cluster-summary,
  .view-purpose-grid,
  .team-bubble-metrics {
    grid-template-columns: 1fr;
  }

  .expense-editor-grid,
  .compact-expense-editor .expense-editor-grid {
    grid-template-columns: 1fr;
  }

  .salary-overview-row,
  .salary-overview-meta,
  .pay-review-row,
  .pay-review-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .overview-mix-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview-donut-wrap {
    justify-content: flex-start;
  }

  .overview-line-labels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.drawer-open {
    overflow: hidden;
  }

  body.drawer-open .page-content {
    padding-right: 0;
  }

  .pay-detail-drawer {
    inset: 0;
    z-index: 50;
    pointer-events: none;
  }

  .pay-detail-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(19, 27, 43, 0.34);
    pointer-events: auto;
  }

  .pay-detail-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    height: auto;
    max-height: none;
  }

  .pay-detail-panel::before {
    display: none;
  }
}

@media (max-width: 720px) {
  .overview-hero-copy,
  .overview-mix-panel,
  .overview-chart-card,
  .overview-trend-card,
  .overview-people-card {
    padding: 18px;
  }

  .overview-bar-head,
  .overview-bar-foot,
  .overview-reminder-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .overview-reminder-row em {
    text-align: left;
  }

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

  .app-shell {
    padding: 10px;
  }

  .sidebar,
  .topbar,
  .card {
    border-radius: 22px;
  }

  .topbar,
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .action-item,
  .checklist-item,
  .detail-history-row {
    flex-direction: column;
  }

  .team-cluster-toggle-meta {
    justify-items: start;
  }

  th,
  td {
    padding: 0.8rem 0.65rem;
  }
}

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

.mini-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.9rem;
}

.mini-balance-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  padding: 1rem;
}

.request-list,
.calendar-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.request-card,
.calendar-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  padding: 1rem;
}

.thread-card-link {
  display: block;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.notification-card-unread {
  border-color: rgba(255, 138, 42, 0.28);
  box-shadow: 0 12px 24px rgba(255, 138, 42, 0.08);
}

.thread-card-link:hover {
  border-color: rgba(255, 138, 42, 0.26);
  box-shadow: 0 12px 24px rgba(24, 39, 75, 0.06);
}

.thread-card-active {
  border-color: rgba(255, 138, 42, 0.38);
  box-shadow: 0 14px 28px rgba(255, 138, 42, 0.12);
}

.conversation-thread {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.conversation-message {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.conversation-message p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.calendar-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.inline-filter {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: end;
}

.bottom-spaced {
  margin-bottom: 1rem;
}

.rule-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.rule-guide-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.rule-guide-toggle {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.rule-guide-toggle::-webkit-details-marker {
  display: none;
}

.rule-guide-body {
  padding: 0 1.1rem 1.1rem;
  display: grid;
  gap: 0.85rem;
}

.rule-guide-block p {
  margin: 0.25rem 0 0;
}

.rule-guide-list {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
}

.note-hero-panel {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.72)),
    linear-gradient(180deg, rgba(255, 138, 42, 0.08), rgba(39, 93, 173, 0.05));
}

.note-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.note-stat-open {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(201, 75, 75, 0.08));
}

.note-stat-pending {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(217, 130, 43, 0.1));
}

.note-stat-done {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(78, 167, 102, 0.1));
}

.note-controls-grid {
  align-items: start;
}

.note-create-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 235, 0.92));
}

.note-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.note-column {
  border-radius: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.note-column-open {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(201, 75, 75, 0.06));
}

.note-column-pending {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(217, 130, 43, 0.08));
}

.note-column-done {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(78, 167, 102, 0.08));
}

.note-column-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.note-column-header h4,
.note-card h4 {
  margin: 0.25rem 0 0;
}

.note-card-stack,
.note-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.note-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(24, 39, 75, 0.06);
}

.note-card-open {
  border-color: rgba(201, 75, 75, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 241, 241, 0.96));
}

.note-card-pending {
  border-color: rgba(217, 130, 43, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 236, 0.96));
}

.note-card-done {
  border-color: rgba(78, 167, 102, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 250, 243, 0.98));
}

.note-list-card {
  padding: 18px;
}

.note-card-head,
.note-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.note-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.note-period {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.note-body {
  margin: 0.8rem 0 0;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
}

.note-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.note-meta-grid span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.note-meta-grid strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.4;
}

.note-editor {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.note-editor summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
  list-style: none;
}

.note-editor summary::-webkit-details-marker {
  display: none;
}

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

.note-empty-panel {
  background: rgba(255, 255, 255, 0.6);
}

@media (max-width: 1480px) {
  .owing-entry-summary {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.42fr) minmax(0, 1fr);
  }

  .owing-entry-preview:last-of-type {
    grid-column: 2 / 4;
  }

  .owing-entry-action {
    justify-self: start;
    align-self: flex-start;
  }
}

@media (max-width: 1180px) {
  .owing-stats-grid,
  .note-stats-grid,
  .note-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .owing-entry-primary {
    grid-column: 1 / -1;
  }

  .owing-entry-preview:last-of-type {
    grid-column: auto;
  }

  .owing-entry-action {
    justify-self: start;
  }

  .owing-entry-context {
    padding-top: 0;
  }

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

@media (max-width: 720px) {
  .owing-stats-grid,
  .owing-entry-summary,
  .note-stats-grid,
  .note-board,
  .note-meta-grid,
  .compact-form-grid {
    grid-template-columns: 1fr;
  }

  .calendar-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.owner-page {
  display: grid;
  gap: 1.25rem;
}

.workspace-shell-card,
.owner-hero-card {
  background:
    radial-gradient(circle at top right, rgba(255, 170, 48, 0.14), transparent 28%),
    linear-gradient(135deg, #11243d 0%, #182e4c 52%, #20395c 100%);
  color: #f7f4ed;
  border: 0;
  box-shadow: 0 22px 60px rgba(17, 36, 61, 0.24);
}

.payroll-shell-card {
  background:
    radial-gradient(circle at top right, rgba(255, 170, 48, 0.16), transparent 28%),
    linear-gradient(135deg, #15314a 0%, #1f3c5b 52%, #274a6e 100%);
}

.workspace-shell-card .eyebrow,
.workspace-shell-card .muted,
.workspace-shell-card .section-tabbar .toggle-pill,
.owner-hero-card .eyebrow,
.owner-hero-card .muted,
.owner-hero-card .section-tabbar .toggle-pill {
  color: rgba(247, 244, 237, 0.72);
}

.workspace-shell-card .toggle-pill,
.owner-hero-card .toggle-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.workspace-shell-card .toggle-pill.active,
.owner-hero-card .toggle-pill.active {
  background: #f6f0e6;
  color: #11243d;
  border-color: #f6f0e6;
}

.workspace-shell-card .button-secondary,
.owner-hero-card .button-secondary,
.shell-button-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #f7f4ed;
  border-color: rgba(255, 255, 255, 0.18);
}

.workspace-shell-card .button-secondary:hover,
.owner-hero-card .button-secondary:hover,
.shell-button-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
}

.workspace-shell-head,
.owner-hero-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.workspace-shell-copy {
  display: grid;
  gap: 0.75rem;
}

.workspace-shell-copy p {
  margin: 0;
}

.workspace-shell-period-form,
.owner-period-form {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.workspace-shell-period-form label,
.owner-period-form label,
.owner-upload-card label,
.owner-review-fields label {
  display: grid;
  gap: 0.35rem;
}

.workspace-shell-period-form span,
.owner-period-form span,
.owner-upload-card span,
.owner-review-fields span {
  font-size: 0.78rem;
  font-weight: 600;
}

.workspace-shell-metric-grid,
.owner-metric-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1rem;
}

.workspace-shell-metric-card,
.owner-metric-card {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1rem 1.05rem;
  display: grid;
  gap: 0.28rem;
}

.workspace-shell-metric-card span,
.workspace-shell-metric-card em,
.owner-metric-card span,
.owner-metric-card em {
  color: rgba(247, 244, 237, 0.76);
  font-style: normal;
}

.workspace-shell-metric-card strong,
.owner-metric-card strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.workspace-shell-metric-card-accent,
.owner-metric-card-accent {
  background: linear-gradient(135deg, rgba(255, 166, 33, 0.22), rgba(255, 111, 87, 0.16));
}

.workspace-shell-tab-stack {
  display: grid;
  gap: 0.75rem;
}

.owner-grid {
  display: grid;
  gap: 1.2rem;
}

.owner-grid-wide {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.owner-grid-triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.owner-chart-card {
  overflow: hidden;
}

.owner-chart-card-large {
  min-height: 26rem;
}

.owner-trend-chart {
  display: grid;
  gap: 0.75rem;
}

.owner-trend-chart svg {
  width: 100%;
  height: auto;
  background:
    linear-gradient(180deg, rgba(17, 36, 61, 0.04), rgba(17, 36, 61, 0)),
    #fbfbfd;
  border-radius: 18px;
  border: 1px solid rgba(17, 36, 61, 0.08);
  padding: 0.35rem;
}

.owner-trend-zero {
  stroke: rgba(17, 36, 61, 0.18);
  stroke-width: 1.1;
  stroke-dasharray: 4 4;
}

.owner-trend-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.owner-trend-line-revenue {
  stroke: #f28d1a;
}

.owner-trend-line-broker {
  stroke: #2d63ff;
}

.owner-trend-line-salary {
  stroke: #00a78e;
}

.owner-trend-line-expense {
  stroke: #ff5f57;
}

.owner-trend-line-net {
  stroke: #17253f;
}

.owner-trend-labels,
.owner-trend-legend {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

.owner-trend-labels span,
.owner-trend-legend span {
  font-size: 0.82rem;
  color: var(--muted);
}

.owner-trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.owner-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  display: inline-block;
}

.owner-swatch-revenue {
  background: #f28d1a;
}

.owner-swatch-broker {
  background: #2d63ff;
}

.owner-swatch-salary {
  background: #00a78e;
}

.owner-swatch-expense {
  background: #ff5f57;
}

.owner-swatch-net {
  background: #17253f;
}

.owner-waterfall-list {
  display: grid;
  gap: 0.85rem;
}

.owner-waterfall-step {
  border-radius: 18px;
  padding: 0.95rem 1rem;
}

.owner-waterfall-step-positive {
  background: rgba(30, 166, 114, 0.09);
}

.owner-waterfall-step-negative {
  background: rgba(255, 95, 87, 0.08);
}

.owner-waterfall-head {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.55rem;
}

.owner-waterfall-head span {
  color: var(--muted);
  font-weight: 600;
}

.owner-mix-layout {
  align-items: center;
}

.owner-alert-card {
  background: linear-gradient(180deg, rgba(17, 36, 61, 0.03), rgba(17, 36, 61, 0));
}

.owner-alert-list {
  display: grid;
  gap: 0.9rem;
}

.owner-alert-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem 0;
  border-top: 1px solid rgba(17, 36, 61, 0.08);
}

.owner-alert-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.owner-profit-row .overview-bar-fill {
  background: linear-gradient(90deg, #1ea672, #69c7a1);
}

.owner-loss-row .overview-bar-fill {
  background: linear-gradient(90deg, #ff5f57, #ff9a84);
}

.owner-data-table-wrap {
  overflow-x: auto;
}

.owner-data-table td,
.owner-data-table th {
  white-space: nowrap;
}

.owner-positive-cell {
  color: #1a8f63;
  font-weight: 700;
}

.owner-negative-cell {
  color: #d8504a;
  font-weight: 700;
}

.owner-upload-grid,
.owner-document-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.owner-upload-card {
  display: grid;
  gap: 0.85rem;
}

.owner-review-list {
  display: grid;
  gap: 0.9rem;
}

.owner-review-row {
  border: 1px solid rgba(17, 36, 61, 0.08);
  border-radius: 18px;
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
  background: #fcfcfe;
}

.owner-review-row-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.owner-review-amount {
  font-weight: 700;
  font-size: 1.05rem;
}

.owner-review-amount.positive {
  color: #145f46;
}

.owner-review-amount.negative {
  color: #b44b46;
}

.owner-review-fields {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
}

.owner-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.55rem;
}

.owner-document-list {
  display: grid;
  gap: 0.8rem;
}

.owner-document-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0;
  border-top: 1px solid rgba(17, 36, 61, 0.08);
}

.owner-document-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.owner-document-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: end;
}

@media (max-width: 1100px) {
  .owner-grid-wide,
  .owner-grid-triple,
  .owner-upload-grid,
  .owner-document-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .workspace-shell-head,
  .owner-hero-head,
  .owner-review-row-head,
  .owner-document-row {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-shell-period-form,
  .owner-period-form,
  .owner-document-actions {
    justify-content: stretch;
  }

  .workspace-shell-period-form .button,
  .owner-period-form .button,
  .owner-document-actions .button,
  .owner-review-fields .button {
    width: 100%;
  }

  .owner-review-fields {
    grid-template-columns: 1fr;
  }
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.85rem;
}

.month-grid-head {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5e6472;
  padding: 0 0.35rem;
}

.month-grid-cell {
  min-height: 10rem;
  padding: 0.85rem;
  border-radius: 1rem;
  border: 1px solid rgba(17, 36, 61, 0.08);
  background: #fffdf8;
  display: grid;
  align-content: start;
  gap: 0.65rem;
}

.month-grid-cell-muted {
  background: #f5f6fb;
  color: #7e8592;
}

.month-grid-date {
  font-weight: 700;
  color: #1c2230;
}

.calendar-entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.calendar-entry-list li {
  font-size: 0.92rem;
  line-height: 1.35;
}

.week-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.85rem;
}

.week-calendar-day {
  min-height: 12rem;
  padding: 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(17, 36, 61, 0.08);
  background: #fffdf8;
  display: grid;
  align-content: start;
  gap: 0.8rem;
}

.week-calendar-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

@media (max-width: 1100px) {
  .month-grid,
  .week-calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .month-grid-head {
    display: none;
  }
}

@media (max-width: 720px) {
  .month-grid,
  .week-calendar-grid {
    grid-template-columns: 1fr;
  }
}
