:root {
  --ink: #111b20;
  --ink-soft: rgba(17, 27, 32, 0.72);
  --paper: #f4efe6;
  --paper-strong: #fffaf2;
  --sand: #d9cfbe;
  --olive: #7fa37c;
  --olive-deep: #5f7f5c;
  --rust: #cc7a52;
  --rose: #b65f72;
  --line: rgba(17, 27, 32, 0.12);
  --shadow: 0 24px 70px rgba(35, 31, 24, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
}

html {
  font-size: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(204, 122, 82, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(127, 163, 124, 0.2), transparent 32%),
    linear-gradient(180deg, #f7f2e8 0%, #efe8db 48%, #ece6de 100%);
  min-height: 100vh;
}

body.auth-body {
  display: grid;
  place-items: center;
  padding: 22px;
}

body.drawer-open {
  overflow: hidden;
}

h1,
h2,
h3,
strong {
  font-family: 'Fraunces', serif;
  letter-spacing: -0.03em;
}

code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.92em;
}

.shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

.dashboard-shell-focused,
.admin-shell {
  grid-template-columns: 1fr;
}

.report-shell {
  display: grid;
  gap: 12px;
}

.report-sticky-menu {
  position: sticky;
  top: 10px;
  z-index: 80;
  display: grid;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(104, 125, 148, 0.14);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(250, 252, 255, 0.93), rgba(244, 247, 251, 0.88)),
    radial-gradient(circle at top right, rgba(155, 182, 210, 0.16), transparent 42%);
  box-shadow: 0 16px 38px rgba(45, 58, 73, 0.08);
  backdrop-filter: blur(20px);
}

.hero-panel,
.upload-panel,
.imports-panel,
.report-hero,
.kpi-card,
.insight-card,
.summary-card,
.chart-card,
.table-section,
.detail-card,
.stat-card {
  position: relative;
  overflow: hidden;
}

.glass-card {
  background: rgba(255, 250, 242, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
}

.hero-panel {
  padding: 40px;
  background:
    linear-gradient(135deg, rgba(255, 251, 244, 0.96), rgba(241, 233, 220, 0.92)),
    linear-gradient(160deg, rgba(204, 122, 82, 0.12), rgba(127, 163, 124, 0.16));
  color: var(--ink);
  border-radius: calc(var(--radius-lg) + 8px);
  min-height: 360px;
}

.dashboard-main-panel,
.admin-hero-panel {
  min-height: 0;
}

.admin-danger-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.admin-slider-shell {
  display: block;
  width: min(1180px, calc(100% - 32px));
}

.settings-panel.admin-slider-panel {
  width: 100%;
  height: auto;
  min-height: calc(100vh - 56px);
  border-radius: 34px;
  transform: none;
  transition: none;
  overflow: visible;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(245, 239, 229, 0.92)),
    radial-gradient(circle at top right, rgba(155, 182, 210, 0.16), transparent 38%);
}

.admin-slider-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  margin: -4px -4px 18px;
  padding: 4px 4px 18px;
}

.admin-slider-heading h1 {
  margin: 4px 0 6px;
  font-size: clamp(2.1rem, 4vw, 4rem);
}

.admin-slider-copy {
  max-width: 680px;
  margin: 0;
  color: var(--ink-soft);
}

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

.admin-slider-tabs {
  position: sticky;
  top: 10px;
  z-index: 30;
  margin: 0 -4px 22px;
  padding: 8px;
  border: 1px solid rgba(17, 27, 32, 0.08);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.9);
  box-shadow: 0 14px 30px rgba(35, 31, 24, 0.08);
  backdrop-filter: blur(16px);
}

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

.admin-section-title h2 {
  margin: 4px 0 0;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.admin-upload-form {
  margin-top: 20px;
}

.dashboard-warning {
  margin-top: 18px;
}

.table-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.hero-panel::after,
.report-hero::after {
  content: '';
  position: absolute;
  inset: auto -10% -30% auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(204, 122, 82, 0.2), transparent 62%);
  pointer-events: none;
}

.hero-panel h1,
.report-hero h1 {
  margin: 8px 0 16px;
  font-size: clamp(2.2rem, 4.3vw, 4.4rem);
  line-height: 0.95;
}

.hero-copy {
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.hero-copy-tight {
  margin-top: 10px;
  max-width: 780px;
}

.report-hero .hero-copy {
  color: var(--ink-soft);
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-view-selector {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-view-selector .eyebrow {
  margin: 0;
}

.month-cta {
  margin-top: 18px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.month-cta h3 {
  margin: 2px 0 0;
  font-size: 1.35rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.76;
}

.stat-grid,
.kpi-grid,
.chart-grid,
.detail-grid,
.watchlist-section,
.reference-grid,
.insight-layout {
  display: grid;
  gap: 16px;
}

.stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 32px;
}

.kpi-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.reference-grid,
.insight-layout,
.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.watchlist-section {
  grid-template-columns: 1fr;
}

.chart-card.wide {
  grid-column: span 2;
}

.stat-card,
.kpi-card {
  padding: 22px;
}

.kpi-card {
  display: grid;
  align-content: start;
  min-height: 132px;
  padding: 14px;
  overflow: visible;
  z-index: 1;
}

.table-section,
.detail-card {
  overflow: visible;
  z-index: 1;
}

.stat-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 250px;
  padding: 66px 24px 24px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(236, 231, 223, 0.82)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.42), transparent 42%);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 22px;
  width: 52px;
  height: 4px;
  border-radius: 999px;
  background: rgba(17, 27, 32, 0.18);
}

.stat-label,
.kpi-card > span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.stat-label {
  margin-bottom: 0;
  align-self: start;
}

.stat-middle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 10px 0 14px;
  text-align: center;
}

.stat-card strong,
.kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.7rem, 2vw, 2.6rem);
}

.kpi-card strong {
  margin-top: 6px;
  font-size: clamp(1.55rem, 1.75vw, 2.05rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
  white-space: nowrap;
}

.stat-value {
  margin: 0;
  max-width: 11ch;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(2rem, 2.2vw, 2.45rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: rgba(17, 27, 32, 0.9);
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: balance;
}

.stat-value-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12em;
  min-height: 2em;
}

.stat-value-stack span {
  display: block;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-transform: none;
}

.kpi-card small,
.stat-card small {
  display: block;
  margin-top: 10px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.kpi-card small {
  margin-top: 8px;
  font-size: 0.76rem;
  line-height: 1.25;
}

[data-reorderable-kpis] > .kpi-card,
table[id] th {
  cursor: grab;
}

[data-reorderable-kpis] > .kpi-card:active,
table[id] th:active {
  cursor: grabbing;
}

.kpi-card.is-dragging,
th.is-dragging {
  opacity: 0.46;
}

.kpi-card.is-drop-target,
th.is-drop-target {
  outline: 2px solid rgba(92, 129, 166, 0.42);
  outline-offset: -4px;
}

.stat-detail {
  align-self: end;
  max-width: 28ch;
  font-size: 0.98rem;
  line-height: 1.45;
}

.stat-card-period {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(226, 233, 224, 0.72)),
    radial-gradient(circle at top right, rgba(127, 163, 124, 0.22), transparent 46%);
}

.stat-card-period::before {
  background: rgba(127, 163, 124, 0.86);
}

.stat-card-delta {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(230, 224, 214, 0.78)),
    radial-gradient(circle at top right, rgba(204, 122, 82, 0.2), transparent 44%);
}

.stat-card-delta::before {
  background: rgba(204, 122, 82, 0.88);
}

.stat-card-focus {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(229, 231, 235, 0.78)),
    radial-gradient(circle at top right, rgba(17, 27, 32, 0.12), transparent 48%);
}

.stat-card-focus::before {
  background: rgba(17, 27, 32, 0.82);
}

.stat-card-quality {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(233, 223, 227, 0.76)),
    radial-gradient(circle at top right, rgba(182, 95, 114, 0.18), transparent 44%);
}

.stat-card-quality::before {
  background: rgba(182, 95, 114, 0.8);
}

.tone-sand {
  background: linear-gradient(135deg, rgba(255, 250, 242, 0.85), rgba(217, 207, 190, 0.55));
}

.tone-olive {
  background: linear-gradient(135deg, rgba(127, 163, 124, 0.2), rgba(255, 250, 242, 0.88));
}

.tone-ink {
  background: linear-gradient(135deg, rgba(17, 27, 32, 0.15), rgba(255, 250, 242, 0.88));
}

.tone-rust {
  background: linear-gradient(135deg, rgba(204, 122, 82, 0.22), rgba(255, 250, 242, 0.9));
}

.upload-panel,
.imports-panel,
.report-hero,
.insight-card,
.summary-card,
.chart-card,
.table-section,
.detail-card {
  padding: 22px;
}

.imports-panel {
  grid-column: 1 / -1;
}

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

.panel-heading-tight {
  gap: 10px;
  margin-bottom: 10px;
}

.gross-records-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px) minmax(0, 1fr);
  align-items: start;
}

.gross-records-heading .table-filter {
  justify-self: center;
  width: 100%;
  max-width: 420px;
}

.table-filter {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.table-filter span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.table-filter input {
  width: 100%;
  border: 1px solid rgba(17, 27, 32, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
}

.panel-heading h2 {
  margin: 6px 0 0;
  font-size: 1.7rem;
}

.table-note {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.45;
}

.upload-form {
  display: flex;
  align-items: end;
  gap: 14px;
  margin: 22px 0 26px;
}

.file-field {
  display: grid;
  gap: 10px;
  flex: 1;
}

.file-field span {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

input[type='file'] {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(17, 27, 32, 0.24);
  background: rgba(255, 255, 255, 0.62);
}

.primary-button,
.secondary-button,
.table-link,
.back-link {
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.primary-button {
  border: 0;
  padding: 15px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fffaf2;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button {
  border: 1px solid rgba(17, 27, 32, 0.12);
  padding: 14px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.danger-button {
  background: rgba(182, 95, 114, 0.12);
  color: #6f2738;
  border-color: rgba(182, 95, 114, 0.28);
}

.primary-button:hover,
.secondary-button:hover,
.table-link:hover,
.back-link:hover {
  transform: translateY(-1px);
}

.danger-form {
  margin: 0 0 24px;
}

.light-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-color: rgba(17, 27, 32, 0.14);
}

.feedback {
  padding: 14px 16px;
  border-radius: 14px;
  margin-top: 14px;
}

.feedback.error {
  background: rgba(182, 95, 114, 0.14);
  color: #6f2738;
}

.feedback.success {
  background: rgba(127, 163, 124, 0.16);
  color: #315033;
}

.feedback.warn {
  background: rgba(204, 122, 82, 0.16);
  color: #7a3f22;
}

.import-preview {
  margin-top: 14px;
  padding: 18px;
}

.unknown-paytype-panel {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid rgba(128, 64, 32, 0.18);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 242, 226, 0.92), rgba(255, 250, 242, 0.86));
}

.unknown-paytype-panel h4 {
  margin: 2px 0 0;
  font-size: 1.05rem;
}

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

.unknown-paytype-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(17, 27, 32, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.unknown-paytype-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unknown-paytype-row span {
  color: var(--ink-soft);
  font-weight: 800;
  white-space: nowrap;
}

.month-status-banner {
  margin-top: -6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(17, 27, 32, 0.12);
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.84rem;
  white-space: nowrap;
}

.chip.accent {
  background: rgba(127, 163, 124, 0.16);
}

.chip.warn {
  background: rgba(204, 122, 82, 0.14);
}

.chip.user-chip {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-color: rgba(17, 27, 32, 0.14);
}

.report-session .chip.user-chip {
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  border-color: rgba(17, 27, 32, 0.12);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(248, 244, 236, 0.96));
  box-shadow: 0 1px 0 var(--line), 0 8px 18px rgba(35, 31, 24, 0.06);
}

.floating-table-head {
  position: fixed;
  display: none;
  overflow: hidden;
  z-index: 79;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.99), rgba(248, 244, 236, 0.97));
  box-shadow: 0 14px 28px rgba(35, 31, 24, 0.1);
}

.floating-table-head.is-visible {
  display: block;
}

.floating-table-head table {
  border-collapse: collapse;
  table-layout: fixed;
}

.floating-table-head th {
  position: static;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.sort-arrows {
  display: inline-flex;
  flex-direction: column;
  line-height: 0.72;
  font-size: 0.54rem;
  color: rgba(17, 27, 32, 0.34);
}

.sort-button[data-direction='asc'] .sort-arrows span:first-child,
.sort-button[data-direction='desc'] .sort-arrows span:last-child {
  color: rgba(17, 27, 32, 0.92);
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid rgba(17, 27, 32, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: rgba(17, 27, 32, 0.72);
  font-family: 'Manrope', sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: text-top;
  cursor: help;
  user-select: none;
}

.help-tip:focus-visible {
  outline: 2px solid rgba(17, 27, 32, 0.32);
  outline-offset: 2px;
}

.help-tip::after {
  content: attr(data-help);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  width: max-content;
  max-width: min(280px, 70vw);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(17, 27, 32, 0.15);
  background: rgba(17, 27, 32, 0.92);
  color: rgba(255, 255, 255, 0.96);
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 8px 18px rgba(7, 13, 22, 0.22);
  transition: opacity 0.14s ease, transform 0.14s ease;
  display: none;
}

.kpi-card .help-tip {
  z-index: 2;
}

.kpi-card .help-tip::after {
  z-index: 40;
}

.table-section .help-tip,
.detail-card .help-tip {
  z-index: 2;
}

.table-section .help-tip::after,
.detail-card .help-tip::after {
  z-index: 40;
}

.help-popover {
  position: fixed;
  z-index: 1200;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(17, 27, 32, 0.15);
  background: rgba(17, 27, 32, 0.94);
  color: rgba(255, 255, 255, 0.96);
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 8px 18px rgba(7, 13, 22, 0.24);
  pointer-events: none;
}

.help-tip.is-open::after,
.help-tip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

tr:last-child td {
  border-bottom: 0;
}

.table-wrap tfoot td {
  background: rgba(255, 255, 255, 0.36);
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
}

.gross-records-table {
  min-width: 1120px;
  table-layout: fixed;
}

.gross-records-table th,
.gross-records-table .sort-button {
  white-space: nowrap;
}

.gross-records-col-employee {
  width: 18%;
}

.gross-records-col-department {
  width: 13%;
}

.gross-records-col-gross {
  width: 86px;
}

.gross-records-col-hourly,
.gross-records-col-salary {
  width: 108px;
}

.gross-records-col-reimbursement {
  width: 148px;
}

.gross-records-col-bonus {
  width: 92px;
}

.gross-records-col-commissions {
  width: 132px;
}

.gross-records-col-missing {
  width: 136px;
}

.accordion-sort-heading {
  display: grid;
  gap: 6px;
}

.accordion-sort-heading .sort-button {
  justify-content: flex-start;
}

.column-accordion-toggle {
  width: fit-content;
  border: 1px solid rgba(17, 27, 32, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  text-transform: uppercase;
}

.column-accordion-toggle::after {
  content: '+';
  display: inline-block;
  margin-left: 5px;
}

.column-accordion-toggle.is-active {
  background: rgba(104, 125, 148, 0.12);
  color: var(--ink);
}

.column-accordion-toggle.is-active::after {
  content: '-';
}

.accordion-total {
  display: block;
  white-space: nowrap;
}

.column-accordion-panel {
  display: none;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(17, 27, 32, 0.08);
}

.column-accordion-panel span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.25;
}

.column-accordion-panel b {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}

.column-accordion-panel em {
  color: var(--ink);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.gross-records-table tbody tr.has-salaried-holiday-premium {
  background: rgba(202, 105, 55, 0.08);
  box-shadow: inset 3px 0 0 rgba(202, 105, 55, 0.65);
}

.holiday-premium-flag {
  border-radius: 6px;
  background: rgba(202, 105, 55, 0.14);
  padding: 3px 5px;
}

.holiday-premium-flag b,
.holiday-premium-flag em {
  color: #8e3e21;
}

.gross-records-table.is-hourly-expanded [data-accordion-cell='hourly'] .column-accordion-panel,
.gross-records-table.is-reimbursement-expanded [data-accordion-cell='reimbursement'] .column-accordion-panel,
.gross-records-table.is-salary-expanded [data-accordion-cell='salary'] .column-accordion-panel {
  display: grid;
}

.gross-mismatch {
  display: block;
  margin-top: 4px;
  color: #9b3f29;
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 700;
}

.restricted-value {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gross-discrepancy-total small {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.2;
}

.scheduled-cell-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.scheduled-cell-form .money-input {
  width: 110px;
  border: 1px solid rgba(17, 27, 32, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
}

.scheduled-cell-form .secondary-button {
  padding: 8px 12px;
  font-size: 0.84rem;
}

.autosave-status {
  min-width: 3.8rem;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--ink-soft);
}

.autosave-status[data-state='saving'] {
  color: rgba(17, 27, 32, 0.76);
}

.autosave-status[data-state='saved'] {
  color: var(--olive-deep);
}

.autosave-status[data-state='error'] {
  color: #9b3f29;
}

.imports-mobile-list {
  display: none;
}

.imports-mobile-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(17, 27, 32, 0.1);
}

.imports-mobile-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.imports-mobile-top strong {
  font-size: 1.18rem;
}

.imports-mobile-top span {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

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

.imports-mobile-meta div {
  display: grid;
  gap: 2px;
}

.imports-mobile-meta dt {
  color: var(--ink-soft);
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.imports-mobile-meta dd {
  margin: 0;
  font-weight: 700;
}

.imports-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.imports-mobile-month {
  padding-top: 10px;
  border-top: 1px dashed rgba(17, 27, 32, 0.18);
  display: grid;
  gap: 8px;
}

.imports-mobile-month small {
  color: var(--ink-soft);
}

.table-link {
  color: var(--ink);
  font-weight: 700;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.table-actions-month {
  min-width: 220px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.positive {
  color: var(--olive-deep);
}

.negative {
  color: #9b3f29;
}

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

.summary-grid div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.summary-grid dt {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.summary-grid dd {
  margin: 8px 0 0;
  font-family: 'Fraunces', serif;
  font-size: 1.32rem;
}

.insight-list {
  display: grid;
  gap: 14px;
}

.insight-list p,
.reference-grid p,
.empty-state,
.mini-row span,
.mini-row small {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.chart-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.chart-frame-compact {
  height: 280px;
}

.chart-frame-wide {
  height: 340px;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.mini-table {
  display: grid;
  gap: 12px;
}

.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(17, 27, 32, 0.08);
}

.mini-row strong {
  display: block;
  font-size: 1.05rem;
}

.mini-values {
  text-align: right;
}

.back-link {
  justify-self: start;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(17, 27, 32, 0.08);
}

.inline-form {
  margin: 0;
}

.report-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-nav {
  display: grid;
  gap: 10px;
  align-items: stretch;
  padding: 12px;
}

.report-sticky-menu .report-nav {
  box-shadow: none;
}

.report-nav-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 14px;
  align-items: stretch;
}

.report-nav-selectors {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.report-nav-title {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border-left: 1px solid rgba(17, 27, 32, 0.1);
}

.report-nav-title h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.1vw, 2.55rem);
  line-height: 0.98;
}

.report-nav-title p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.35;
}

.report-nav-title code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.report-nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.nav-strip {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.nav-strip-label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.nav-strip-label span {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-transform: uppercase;
}

.nav-strip-label small {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
}

.nav-strip-controls {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
}

.nav-strip-controls-solo {
  grid-template-columns: minmax(0, 1fr);
}

.nav-strip-scroll {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 1px 1px 5px;
  scrollbar-color: rgba(119, 143, 168, 0.34) transparent;
  scrollbar-width: thin;
}

.nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(118, 139, 160, 0.22);
  background: rgba(252, 254, 255, 0.8);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0;
  white-space: nowrap;
}

.nav-arrow.is-disabled {
  opacity: 0.46;
  pointer-events: none;
}

.nav-chip {
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
  min-width: 116px;
  max-width: 180px;
  border: 1px solid rgba(118, 139, 160, 0.18);
  border-radius: 14px;
  padding: 7px 9px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(246, 248, 251, 0.72));
  color: var(--ink);
  text-decoration: none;
  scroll-snap-align: start;
  box-shadow: 0 8px 22px rgba(45, 58, 73, 0.035);
}

.nav-chip:hover,
.nav-arrow:hover {
  border-color: rgba(107, 137, 168, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(240, 246, 252, 0.82));
  transform: translateY(-1px);
}

.nav-chip.is-disabled,
.chip.is-disabled,
.table-link.is-disabled,
a[data-report-link].is-disabled {
  opacity: 0.48;
  pointer-events: none;
  cursor: default;
  filter: grayscale(0.28);
}

.nav-chip-main {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-chip-meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-chip.is-active {
  background:
    linear-gradient(135deg, rgba(235, 243, 252, 0.96), rgba(255, 255, 255, 0.93));
  border-color: rgba(91, 121, 153, 0.44);
  color: rgba(17, 27, 32, 0.94);
  box-shadow: inset 0 0 0 1px rgba(91, 121, 153, 0.16), 0 12px 30px rgba(91, 121, 153, 0.12);
}

.nav-chip.is-active .nav-chip-meta {
  color: rgba(62, 82, 104, 0.82);
}

.nav-chip.is-current-month:not(.is-active) {
  background:
    linear-gradient(135deg, rgba(244, 249, 254, 0.9), rgba(255, 255, 255, 0.8));
  border-color: rgba(91, 121, 153, 0.3);
  box-shadow: inset 0 0 0 1px rgba(91, 121, 153, 0.1), 0 8px 22px rgba(45, 58, 73, 0.035);
}

.nav-chip-period {
  min-width: 108px;
}

.nav-view-switch {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-view-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border-radius: 999px;
  border: 1px solid rgba(17, 27, 32, 0.16);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  padding: 6px 10px;
  cursor: pointer;
}

.nav-view-pill.is-active {
  background: rgba(17, 27, 32, 0.9);
  color: #fffaf2;
  border-color: rgba(17, 27, 32, 0.9);
}

.report-session {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-shell {
  width: min(680px, 100%);
}

.auth-card {
  padding: 32px;
  border-radius: calc(var(--radius-lg) + 4px);
  background:
    linear-gradient(135deg, rgba(255, 251, 244, 0.96), rgba(241, 233, 220, 0.92)),
    linear-gradient(160deg, rgba(204, 122, 82, 0.12), rgba(127, 163, 124, 0.16));
  color: var(--ink);
}

.auth-card h1 {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.94;
}

.auth-copy {
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.auth-button {
  display: inline-flex;
  margin-top: 8px;
}

.temp-auth-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(17, 27, 32, 0.14);
}

.temp-auth-form label {
  display: grid;
  gap: 7px;
}

.temp-auth-form span {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.temp-auth-form input {
  width: 100%;
  border: 1px solid rgba(17, 27, 32, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 14px;
  font: inherit;
}

.settings-drawer {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(760px, 94vw);
  pointer-events: none;
  z-index: 20;
}

.settings-backdrop {
  background: rgba(17, 27, 32, 0.38);
  opacity: 0;
  transition: opacity 180ms ease;
}

.settings-panel {
  height: 100vh;
  border-radius: 32px 0 0 32px;
  transform: translateX(100%);
  transition: transform 220ms ease;
  padding: 28px;
  overflow: auto;
  background: rgba(255, 250, 242, 0.94);
}

.settings-drawer.is-open {
  pointer-events: auto;
}

.settings-drawer.is-open .settings-backdrop {
  opacity: 1;
}

.settings-drawer.is-open .settings-panel {
  transform: translateX(0);
}

.settings-heading {
  position: sticky;
  top: 0;
  padding-bottom: 12px;
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(255, 250, 242, 0.92));
  z-index: 1;
}

.settings-close {
  border: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(17, 27, 32, 0.08);
  color: var(--ink);
  font-size: 1.7rem;
  cursor: pointer;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 18px;
}

.settings-tab {
  appearance: none;
  border: 1px solid rgba(17, 27, 32, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 14px;
}

.settings-tab.is-active {
  background: rgba(17, 27, 32, 0.92);
  border-color: rgba(17, 27, 32, 0.92);
  color: #fffaf2;
}

.settings-section {
  display: none;
}

.settings-section.is-active {
  display: block;
}

.mapping-create-form,
.mapping-edit-form {
  display: grid;
  gap: 12px;
}

.mapping-create-form {
  grid-template-columns: 1.3fr 1fr auto;
  align-items: end;
  margin: 18px 0 24px;
}

.mapping-create-form label,
.mapping-edit-form label {
  display: grid;
  gap: 8px;
}

.mapping-create-form span {
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.mapping-create-form input,
.mapping-edit-form input,
.mapping-create-form select,
.mapping-edit-form select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(17, 27, 32, 0.12);
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
}

.mapping-row-pending {
  border-color: rgba(196, 126, 79, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 246, 235, 0.82), rgba(255, 255, 255, 0.72));
}

.pending-mapping-meta {
  align-self: center;
  color: var(--ink-soft);
  font-size: 0.84rem;
  white-space: nowrap;
}

.settings-subheading {
  margin: 24px 0 8px;
  font-size: 1.15rem;
}

.pay-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 20px;
}

.pay-category-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(17, 27, 32, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(244, 238, 227, 0.62));
}

.pay-category-card span {
  color: var(--ink);
  font-weight: 900;
}

.pay-category-card small {
  color: var(--ink-soft);
  line-height: 1.35;
}

.pay-category-card.is-calculated {
  background:
    linear-gradient(135deg, rgba(17, 27, 32, 0.9), rgba(48, 59, 62, 0.82));
}

.pay-category-card.is-calculated span,
.pay-category-card.is-calculated small {
  color: #fffaf2;
}

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

.mapping-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(17, 27, 32, 0.08);
}

.mapping-edit-form {
  grid-template-columns: 1.25fr 1fr auto;
  align-items: center;
}

@media (max-width: 1100px) {
  .dashboard-shell,
  .reference-grid,
  .insight-layout,
  .detail-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .report-nav-grid {
    grid-template-columns: 1fr;
  }

  .report-nav-title {
    border-left: 0;
    border-top: 1px solid rgba(17, 27, 32, 0.1);
    padding: 12px 2px 2px;
  }

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

  .chart-card.wide {
    grid-column: auto;
  }

  .upload-form {
    flex-direction: column;
    align-items: stretch;
  }

  .mapping-create-form,
  .mapping-edit-form,
  .mapping-row {
    grid-template-columns: 1fr;
  }

  .pay-category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html {
    font-size: 13px;
  }

  .shell {
    width: min(100% - 20px, 1400px);
    padding-top: 18px;
  }

  .report-sticky-menu {
    top: 0;
    gap: 8px;
    margin-inline: -4px;
    padding: 8px;
    border-radius: 0 0 22px 22px;
  }

  .hero-panel,
  .upload-panel,
  .imports-panel,
  .report-hero,
  .insight-card,
  .summary-card,
  .chart-card,
  .table-section,
  .detail-card {
    padding: 22px;
    border-radius: 24px;
  }

  .hero-panel h1,
  .report-hero h1 {
    font-size: 2.5rem;
  }

  .panel-heading {
    flex-direction: column;
  }

  .gross-records-heading {
    display: flex;
  }

  .unknown-paytype-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .table-filter {
    width: 100%;
    min-width: 0;
  }

  .report-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .report-session {
    width: 100%;
  }

  .report-session .user-chip {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .report-nav {
    gap: 8px;
    align-items: stretch;
    padding: 10px;
  }

  .report-nav-title h1 {
    font-size: 1.65rem;
  }

  .report-nav-title p {
    font-size: 0.78rem;
  }

  .nav-strip {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .nav-strip-label {
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: 8px;
  }

  .nav-strip-controls {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 6px;
  }

  .nav-strip-controls-solo {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav-arrow {
    width: 30px;
    height: 30px;
    border-radius: 11px;
  }

  .nav-chip {
    min-width: 112px;
    max-width: 154px;
    padding: 7px 8px;
  }

  .nav-chip-main {
    font-size: 0.82rem;
  }

  .nav-chip-meta {
    font-size: 0.6rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .kpi-card {
    min-height: 112px;
    padding: 12px;
  }

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

  .settings-drawer {
    grid-template-columns: 1fr;
  }

  .settings-panel {
    width: 100%;
    border-radius: 24px 24px 0 0;
    margin-top: auto;
    height: min(90vh, 100%);
  }

  .admin-slider-shell {
    width: min(100% - 20px, 1400px);
  }

  .settings-panel.admin-slider-panel {
    height: auto;
    min-height: calc(100vh - 36px);
    border-radius: 24px;
    margin-top: 0;
    padding: 18px;
  }

  .admin-slider-heading {
    grid-template-columns: 1fr;
  }

  .admin-slider-actions {
    justify-content: flex-start;
  }

  .admin-slider-tabs {
    border-radius: 22px;
  }

  .admin-section-title {
    display: grid;
  }

  .chart-frame-compact {
    height: 220px;
  }

  .chart-frame-wide {
    height: 250px;
  }

  .stat-card {
    min-height: 230px;
    padding-top: 62px;
  }

  .stat-middle {
    min-height: 74px;
  }

  .stat-value {
    max-width: 12ch;
    font-size: clamp(1.7rem, 8vw, 2rem);
  }

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

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

  .mini-values {
    text-align: left;
  }

  .imports-table-desktop {
    display: none;
  }

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

  .table-wrap table {
    min-width: 760px;
  }

  th,
  td {
    padding: 12px 12px;
  }

  .table-actions-month {
    min-width: 180px;
  }
}
