:root {
  --ink: #232333;
  --muted: #67677b;
  --line: #d8d7e8;
  --page: #f4f4fa;
  --panel: #ffffff;
  --nav: #24205f;
  --nav-soft: #373394;
  --accent: #373394;
  --accent-dark: #26216f;
  --accent-soft: #eeeeff;
  --accent-line: #cac8f3;
  --gray: #9d9d9d;
  --amber: #b7791f;
  --red: #b42318;
  --green: #237a57;
  --shadow: 0 16px 40px rgba(36, 32, 95, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  background: var(--page);
  color: var(--ink);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  overflow: hidden;
}

body.is-authenticated .auth-gate {
  display: none;
}

body:not(.is-authenticated) .sidebar,
body:not(.is-authenticated) .shell {
  display: none;
}

body:not(.is-authenticated) {
  display: block;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(36, 32, 95, 0.92), rgba(35, 122, 87, 0.74)),
    var(--page);
}

.auth-panel {
  width: min(430px, 100%);
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 24px 70px rgba(22, 19, 71, 0.34);
  padding: 28px;
  display: grid;
  gap: 22px;
}

.auth-panel > img {
  width: 128px;
  height: 74px;
  object-fit: contain;
}

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

.auth-form h1 {
  font-size: 1.55rem;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.auth-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(55, 51, 148, 0.12);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  height: 100vh;
  background: var(--nav);
  color: #ffffff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: grid;
  gap: 8px;
  padding-left: 12px;
}

.brand-button {
  border: 0;
  background: transparent;
  color: #ffffff;
  text-align: left;
}

.brand img {
  width: 132px;
  height: 76px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
  padding: 8px;
}

.brand span,
.sidebar-card span,
.sidebar-card small {
  color: rgba(255, 255, 255, 0.72);
}

#release-version-label {
  font-size: 0.78rem;
  line-height: 1.25;
}

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

.nav-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  padding: 10px 12px;
  text-align: left;
}

.nav-subitem {
  width: calc(100% - 22px);
  margin-left: 22px;
  position: relative;
}

.nav-subitem::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 12px;
  bottom: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.22);
}

.nav-item:hover,
.nav-item.is-active {
  color: #ffffff;
  background: var(--nav-soft);
}

.nav-item svg,
.primary-button svg,
.ghost-button svg,
.completion-list svg,
.check-list svg,
.drop-zone svg,
.metric-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 3px;
}

.shell {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px;
}

.topbar,
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.topbar {
  margin-bottom: 24px;
}

.system-banner-stack:empty {
  display: none;
}

.system-banner-stack {
  display: grid;
  gap: 10px;
  margin: -10px 0 24px;
}

.system-banner {
  --banner-color: #2563eb;
  --banner-bg: #eff6ff;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--banner-color) 35%, white);
  border-left: 5px solid var(--banner-color);
  border-radius: 10px;
  background: var(--banner-bg);
  color: #172033;
}

.system-banner[data-severity="Success"] { --banner-color: #16803c; --banner-bg: #f0fdf4; }
.system-banner[data-severity="Warning"] { --banner-color: #b45309; --banner-bg: #fffbeb; }
.system-banner[data-severity="Maintenance"] { --banner-color: #7c3aed; --banner-bg: #f5f3ff; }
.system-banner[data-severity="Critical"] { --banner-color: #c62828; --banner-bg: #fef2f2; }

.system-banner > i {
  width: 20px;
  height: 20px;
  color: var(--banner-color);
}

.system-banner-copy strong,
.system-banner-copy span {
  display: block;
}

.system-banner-copy span {
  margin-top: 2px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.system-banner-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--banner-color);
  cursor: pointer;
}

.system-banner-close:hover,
.system-banner-close:focus-visible {
  background: color-mix(in srgb, var(--banner-color) 10%, transparent);
}

.system-banner-admin-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(360px, 1.4fr);
  gap: 18px;
  margin-top: 14px;
  align-items: start;
}

.system-banner-admin-list-pane {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.system-banner-search {
  flex: 0 0 auto;
}

.system-banner-sort-help {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.system-banner-sort-help i {
  width: 16px;
  height: 16px;
}

.system-banner-admin-list {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
  scrollbar-gutter: stable;
}

.system-banner-admin-item {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
}

.system-banner-admin-item[draggable="true"] {
  cursor: grab;
}

.system-banner-admin-item.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.system-banner-admin-item.is-drop-before {
  box-shadow: 0 -3px 0 var(--accent);
}

.system-banner-admin-item.is-drop-after {
  box-shadow: 0 3px 0 var(--accent);
}

.system-banner-admin-item-heading {
  display: flex;
  align-items: center;
  gap: 7px;
}

.system-banner-admin-item-heading i {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}

.system-banner-admin-item.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.system-banner-admin-item small { color: var(--muted); }
.system-banner-form { min-width: 0; }
.banner-message-field { grid-column: 1 / -1; }
.banner-message-field textarea { resize: vertical; }
.banner-role-field { grid-column: 1 / -1; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.banner-role-field legend { font-weight: 800; }
#system-banner-role-options { display: flex; flex-wrap: wrap; gap: 10px 16px; }
#system-banner-role-options label { display: flex; align-items: center; gap: 6px; }
.banner-form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }

@media (max-width: 900px) {
  .system-banner-admin-grid { grid-template-columns: 1fr; }
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-weight: 850;
  font-size: 0.78rem;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(1.5rem, 2vw, 2.15rem);
  line-height: 1.15;
  margin-bottom: 0;
}

h2 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

p {
  color: var(--muted);
  line-height: 1.45;
}

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

#data-source-status {
  order: 1;
}

#report-scope-action,
#primary-action {
  order: 2;
}

#session-status {
  order: 8;
}

#logout-action {
  order: 9;
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}

.ghost-button {
  background: #ffffff;
  color: var(--accent-dark);
  border: 1px solid var(--accent-line);
}

.danger-button {
  color: #b42318;
  border-color: #fecdca;
}

.danger-text {
  color: #b42318;
}

.full {
  width: 100%;
}

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

[hidden] {
  display: none !important;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

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

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

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

.metric {
  padding: 18px;
}

.metric-button {
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  color: var(--ink);
}

.metric-button:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.metric-button.is-selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 7px 0;
  font-size: 2rem;
  line-height: 1;
}

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

.inline-control {
  width: 220px;
}

.weekly-search-control {
  width: min(360px, 100%);
}

.weekly-search-control small {
  min-height: 1em;
  color: var(--muted);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

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

input.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

textarea {
  min-height: 96px;
  padding: 10px;
  resize: vertical;
  line-height: 1.4;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 900;
}

.compact {
  min-height: 36px;
}

.compact-input {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
}

.save-status {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-dark);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.save-status svg {
  width: 18px;
  height: 18px;
}

.save-status.is-dirty {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.save-status.is-saving {
  border-color: var(--accent-line);
  background: #eef6ff;
  color: var(--accent-dark);
}

.save-status.is-error {
  border-color: #fecdca;
  background: #fff5f5;
  color: #b42318;
}

.data-source-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.data-source-pill:hover,
.data-source-pill:focus-visible {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(55, 51, 148, 0.12);
  outline: none;
}

.data-source-pill.is-api {
  border-color: #b8ddca;
  background: #ebf7f1;
  color: var(--green);
}

.data-source-pill.is-local {
  border-color: #f7d48b;
  background: #fff5db;
  color: var(--amber);
}

.session-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.home-controls {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.home-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.weekly-list-toolbar {
  align-items: end;
  justify-content: flex-start;
  margin: 14px 0 12px;
}

.weekly-list-toolbar .weekly-search-control {
  flex: 1 1 360px;
}

.weekly-list-toolbar .inline-control:not(.weekly-search-control) {
  flex: 0 1 220px;
}

.weekly-list-toolbar .inline-control:not(.weekly-search-control)::after {
  content: "";
  min-height: 1em;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.segmented button {
  min-height: 36px;
  border: 0;
  background: #ffffff;
  color: var(--accent-dark);
  padding: 0 12px;
  font-weight: 850;
}

.segmented button + button {
  border-left: 1px solid var(--accent-line);
}

.segmented .is-selected {
  background: var(--accent);
  color: #ffffff;
}

.report-list,
.expense-list,
.link-list,
.check-list,
.uploaded-list,
.project-options,
.week-finish-list {
  display: grid;
  gap: 10px;
}

.week-finish-list {
  gap: 22px;
}

.list-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.pager-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager-actions strong {
  color: var(--ink);
  font-size: 0.85rem;
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.split-layout,
.workspace-grid,
.settings-grid,
.report-layout,
.invoice-stack,
.invoice-detail-grid {
  display: grid;
  gap: 16px;
}

.split-layout,
.workspace-grid,
.settings-grid,
.invoice-detail-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.command-work-grid {
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  align-items: start;
}

.command-project-detail-panel {
  align-self: start;
}

.productivity-period-panel,
.productivity-filter-panel {
  margin-bottom: 16px;
}

.productivity-date-editor,
.productivity-filter-editor {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 0;
}

.productivity-filter-editor select[multiple] {
  min-height: 112px;
  padding: 8px;
}

.productivity-filter-editor option {
  padding: 4px 6px;
}

.productivity-scope-control {
  min-height: 42px;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  align-self: end;
}

.productivity-scope-control input {
  width: 16px;
  height: 16px;
}

.productivity-nav-panel {
  margin-bottom: 16px;
  padding: 14px;
}

.productivity-tabs-control {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.productivity-tabs-control button {
  min-width: 0;
  min-height: 34px;
  padding: 0 6px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.productivity-tabs-control button + button {
  border-left: 1px solid var(--accent-line);
}

.productivity-tab {
  display: none;
}

.productivity-tab.is-active {
  display: grid;
  gap: 16px;
}

.productivity-top-row {
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
}

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

.project-report-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
}

.associate-report-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
}

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

.associate-project-detail-panel {
  grid-column: 1 / -1;
}

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

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

.associate-repeat-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  padding: 14px;
}

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

.associate-repeat-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.associate-repeat-section h4 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 1rem;
}

.invoice-stack {
  grid-template-columns: 1fr;
}

.invoice-workbench-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  align-items: start;
}

.invoice-side-stack {
  display: grid;
  gap: 16px;
}

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

.wide {
  min-width: 0;
}

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

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

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

th {
  background: #f3f3fb;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tfoot td {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 900;
}

.bar-stack,
.score-list,
.target-list,
.settings-list,
.admin-card-grid,
.kaizen-list,
.kaizen-update-group,
.timeline {
  display: grid;
  gap: 10px;
}

.bar-label,
.score-heading,
.target-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 850;
}

.target-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.target-heading em {
  color: var(--muted);
  font-style: normal;
  font-weight: 850;
}

.associate-productivity-overall-summary {
  align-content: start;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.bar-fill.neutral-bar-fill {
  background: #b9a7dc;
}

.bar-fill.band-green {
  background: var(--green);
}

.bar-fill.band-blue {
  background: #1660d5;
}

.bar-fill.band-yellow {
  background: var(--amber);
}

.bar-fill.band-red {
  background: var(--red);
}

.target-bar-wrap {
  padding-top: 28px;
}

.target-progress {
  position: relative;
  height: 14px;
  overflow: visible;
}

.target-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.target-marker i {
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 0 0 2px #ffffff;
}

.target-marker small,
.target-end-label {
  position: absolute;
  top: -24px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.target-marker small {
  transform: translateX(-50%);
  left: 50%;
}

.target-end-label {
  right: 0;
}

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

.rate-pair span {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.rate-pair .traffic-light-metric small {
  color: inherit;
}

.rate-pair .rate-target-percent {
  justify-self: end;
  font-weight: 900;
}

.productivity-target-cell strong,
.productivity-target-cell small {
  display: block;
  color: inherit;
}

.productivity-target-cell small {
  margin-top: 0.2rem;
  font-weight: 700;
}

.rate-pair small,
.split-legend,
.best-list small,
.impact-card small,
.plan-basis {
  color: var(--muted);
}

.plan-basis {
  font-size: 0.82rem;
  font-weight: 750;
}

.billing-stack,
.associate-split-list,
.best-list,
.impact-list {
  display: grid;
  gap: 10px;
}

.billing-bar-list {
  display: grid;
  gap: 10px;
}

.billing-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(160px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
}

.billing-row strong,
.billing-row em {
  color: var(--billing-color);
}

.billing-row strong {
  font-size: 0.86rem;
}

.billing-row em {
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.billing-track {
  height: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f6;
}

.billing-track span {
  min-width: 38px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--billing-color);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.82rem;
}

.billing-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  color: var(--accent-dark);
  font-size: 1.08rem;
  font-weight: 950;
}

.billing-total span:first-child {
  text-align: left;
}

.billing-total span:last-child {
  margin-left: auto;
  text-align: right;
}

.best-list-heading {
  margin: 8px 0 0;
  color: var(--accent-dark);
}

.billing-visual-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(150px, 0.6fr);
  gap: 16px;
  align-items: center;
}

.billing-visual {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.billing-pie {
  width: min(220px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 10px solid #ffffff;
  box-shadow: inset 0 0 0 1px var(--line), 0 0 0 1px var(--line);
}

.stacked-column {
  width: 86px;
  height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f6;
}

.stacked-column span {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 850;
}

.billing-legend {
  display: grid;
  gap: 8px;
}

.billing-legend span {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.billing-legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.billing-legend em {
  color: var(--muted);
  font-style: normal;
  font-weight: 850;
}

.time-split-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.split-bar {
  height: 18px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3f6;
}

.split-bar span {
  min-width: 4px;
}

.summary-split-bar {
  height: 22px;
  box-shadow: inset 0 0 0 1px rgba(71, 85, 105, 0.18);
}

.split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.82rem;
}

.split-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.split-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.associate-split-row,
.best-list article,
.impact-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  padding: 12px;
}

.bucket-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
}

.bucket-detail-grid span {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 2px 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.bucket-detail-grid i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.bucket-detail-grid strong,
.bucket-detail-grid em,
.bucket-detail-grid small {
  grid-column: 2;
}

.bucket-detail-grid em {
  color: var(--ink);
  font-style: normal;
  font-weight: 850;
}

.bucket-detail-grid small {
  color: var(--muted);
}

.bucket-detail-grid .target-box {
  width: fit-content;
  border-radius: 7px;
  padding: 4px 7px;
  color: #ffffff;
  font-weight: 850;
}

.target-box.band-blue {
  background: #1660d5;
}

.target-box.band-green {
  background: var(--green);
}

.target-box.band-yellow {
  background: var(--amber);
}

.target-box.band-red {
  background: var(--red);
}

.best-list article span {
  font-weight: 850;
}

.best-metric-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.best-metric-line em {
  font-style: normal;
}

.best-metric-line b {
  white-space: nowrap;
}

.compact-table {
  margin: 8px 0 14px;
}

.target-chip {
  display: inline-flex;
  min-width: 50px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  color: #ffffff;
  font-weight: 850;
}

.target-chip.band-green {
  background: var(--green);
}

.target-chip.band-blue {
  background: #1660d5;
}

.target-chip.band-yellow {
  background: var(--amber);
}

.target-chip.band-red {
  background: var(--red);
}

.total-row td {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 900;
}

.catalog-total-row td {
  background: #edf0f4;
  color: var(--accent-dark);
  font-weight: 900;
}

td.approved {
  color: var(--green);
  font-weight: 850;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

td.review {
  color: var(--amber);
  font-weight: 850;
}

.impact-card span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.impact-card em {
  font-style: normal;
  font-weight: 850;
}

.row-expand-button {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.row-expand-button svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex: 0 0 auto;
}

.expanded-detail-row td {
  background: #fbfbff;
}

.expanded-detail {
  display: grid;
  gap: 10px;
}

.expanded-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.expanded-detail-grid span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
}

.expanded-detail-grid em {
  color: var(--ink);
  font-style: normal;
  font-weight: 850;
}

.expanded-detail-grid b {
  color: var(--accent-dark);
}

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

.kaizen-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.kaizen-workspace {
  min-width: 0;
}

.kaizen-tabs {
  flex: 0 0 auto;
}

.kaizen-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 190px auto auto minmax(160px, auto);
  gap: 10px;
  align-items: end;
  margin: 16px 0;
}

.kaizen-admin-hint {
  align-self: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.score-card,
.target-card,
.admin-card,
.kaizen-item,
.kaizen-coverage-card,
.settings-list span,
.timeline article,
.mini-metric {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  padding: 12px;
}

.impact-plan-card {
  gap: 12px;
}

.impact-list > .impact-plan-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.impact-section {
  display: grid;
  gap: 8px;
}

.impact-section h3 {
  margin: 0;
  color: var(--accent);
}

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

.impact-grid span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.impact-grid em {
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
}

.impact-grid em.approved {
  color: var(--green);
}

.impact-grid em.review {
  color: var(--amber);
}

.impact-grid em.blocked {
  color: var(--red);
}

.kaizen-note,
.kaizen-item[data-kaizen-record] {
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.kaizen-note.is-read,
.kaizen-item.is-read {
  background: #ffffff;
}

.kaizen-item-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.kaizen-item-heading time {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.kaizen-file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.kaizen-file-row .kaizen-file-missing {
  background: #f4f6fb;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.kaizen-tools .ghost-button:disabled,
.kaizen-file-row .ghost-button:disabled {
  background: #f4f6fb;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.kaizen-coverage {
  max-height: 488px;
  overflow: auto;
  padding-right: 4px;
}

.kaizen-coverage-card {
  padding: 10px;
}

.kaizen-coverage-card span {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 850;
}

.kaizen-update-group {
  margin-top: 6px;
}

.kaizen-update-group h3 {
  color: var(--accent-dark);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  background: #ffffff;
}

.report-selector {
  align-self: start;
  display: grid;
  gap: 12px;
}

.report-selector-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.report-option,
.full-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 850;
  text-align: left;
  padding: 0 12px;
}

.report-option {
  width: 100%;
  margin-top: 0;
  text-align: center;
}

.report-option.is-selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

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

.filter-reset-button {
  align-self: end;
}

.export-dialog {
  width: min(980px, 100%);
}

.export-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.export-actions a {
  text-decoration: none;
}

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

.export-meta span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  padding: 10px;
}

.export-meta small {
  color: var(--muted);
  font-weight: 800;
}

.export-preview-shell {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.export-sheet {
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.export-sheet th,
.export-sheet td {
  border: 1px solid #d9def4;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.export-sheet th {
  background: #eef0fb;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.76rem;
}

.export-title-row td {
  background: var(--accent-dark);
  color: #ffffff;
  font-weight: 900;
}

.export-period-row td {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 850;
}

.export-group-row td {
  background: #f7f8ff;
  font-weight: 900;
}

.export-project-row td {
  background: #e7ecff;
  color: var(--accent-dark);
  font-weight: 950;
}

.export-total-row td,
.export-project-total-row td {
  background: #d9dee8;
  font-weight: 900;
}

.export-project-total-row td {
  color: var(--accent-dark);
}

.export-grand-row td {
  background: #334155;
  color: #ffffff;
  font-weight: 950;
}

.export-created-row td {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}

.export-spacer-row td {
  height: 14px;
  background: #ffffff;
  border-left-color: transparent;
  border-right-color: transparent;
}

.report-card,
.expense-card,
.link-card,
.drop-zone,
.check-list span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  padding: 12px;
}

.report-card {
  display: grid;
  grid-template-columns: auto minmax(220px, 1.2fr) minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: start;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
}

.report-card-main {
  display: grid;
  gap: 4px;
}

.report-card-main p {
  margin: 4px 0 0;
}

.report-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.report-card-metrics > span {
  display: grid;
  gap: 2px;
}

.report-card-actions {
  display: grid;
  grid-template-columns: minmax(92px, 1fr);
  gap: 8px;
  min-width: 112px;
}

.report-card-actions button {
  white-space: nowrap;
}

.report-card-status {
  justify-self: end;
}

.report-card strong,
.expense-card strong,
.link-card strong {
  display: block;
}

.report-card small,
.expense-card small,
.link-card small {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.78rem;
  font-weight: 850;
}

.pill.open {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.pill.in-process,
.pill.ready {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.pill.approved {
  background: #ebf7f1;
  color: var(--green);
}

.pill.blocked {
  background: #fdecec;
  color: var(--red);
}

.pill.complete {
  background: #ebf7f1;
  color: var(--green);
}

.pill.review {
  background: #fff5db;
  color: var(--amber);
}

.pill.pending {
  background: #fff5db;
  color: var(--amber);
}

.pill.on-hold {
  background: #f1f1f7;
  color: var(--muted);
}

.pill.removed {
  background: #fdecec;
  color: var(--red);
}

.pill.pending.is-past-due {
  background: #fdecec;
  color: var(--red);
}

.pill.submitted {
  background: #ebf7f1;
  color: var(--green);
}

.pill.added-to-payroll {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.report-header {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.report-header-three,
.expense-summary {
  grid-template-columns: 200px minmax(0, 1fr) 220px;
  align-items: end;
}

.expense-summary {
  grid-template-columns: 200px minmax(0, 1fr) 240px;
}

.receipt-summary {
  grid-template-columns: 200px minmax(0, 1fr);
}

.report-associate-context {
  min-width: 180px;
  display: grid;
  justify-items: end;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  padding: 10px 12px;
  text-align: right;
}

.report-associate-context span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-associate-context strong {
  color: var(--ink);
  font-size: 1rem;
}

.expense-summary label:nth-child(2) {
  grid-column: 2 / 4;
}

.expense-project-summary {
  grid-column: 1 / 3;
}

.expense-project-summary div {
  display: grid;
  gap: 6px;
}

.expense-project-summary div span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.expense-project-summary em,
.expense-project-summary small {
  min-width: 0;
  color: var(--muted);
  font-style: normal;
  font-weight: 750;
}

.expense-project-summary div strong {
  font-size: 0.95rem;
  white-space: nowrap;
}

.report-preview-stack {
  display: grid;
  gap: 18px;
}

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

.report-start-summary {
  margin: 14px 0;
}

.report-data-status {
  margin: -4px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  color: var(--muted);
  padding: 9px 11px;
  font-size: 0.82rem;
  font-weight: 800;
}

.report-data-status.is-loading {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.report-data-status.is-api {
  border-color: #b9e4cf;
  background: #ebf7f1;
  color: var(--green);
}

.report-data-status.is-local {
  border-color: #f7d6a4;
  background: #fff7e8;
  color: #8a5a00;
}

.workbook-preview-wrap {
  max-height: 560px;
  border: 1px solid var(--line);
}

.workbook-preview-table {
  min-width: 680px;
  background: #ffffff;
}

.workbook-preview-table th {
  background: #eef0fb;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.workbook-preview-table td,
.workbook-preview-table th {
  border: 1px solid #d9def4;
  padding: 8px 10px;
  vertical-align: top;
  white-space: nowrap;
}

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

.payroll-export-control {
  white-space: normal;
}

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

.report-preview-section h3 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--ink);
}

.report-preview-section p {
  margin: 4px 0 0;
  color: var(--muted);
}

.report-loading-panel {
  border: 1px dashed var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 16px;
}

.report-loading-box {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--accent-dark);
  font-weight: 900;
}

.report-loading-box svg {
  animation: report-spin 1s linear infinite;
}

@keyframes report-spin {
  to {
    transform: rotate(360deg);
  }
}

.field-note {
  min-height: 40px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  color: var(--green);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 850;
}

.field-note.is-warning {
  color: var(--red);
  background: #fff7f6;
  border-color: #f4c6c1;
}

.action-helper {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.3;
}

.submit-helper {
  grid-column: 1 / -1;
  padding: 4px 2px;
}

.travel-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
}

.project-picker {
  display: none;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
}

.project-picker.is-open {
  display: grid;
}

.project-picker p {
  margin-bottom: 0;
}

.project-picker-close {
  justify-self: end;
}

.project-options {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.project-option:has(input:disabled) {
  color: var(--muted);
  background: #f7f8fb;
}

.project-option small {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}

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

.hours-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
}

.hours-table th,
.hours-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  background: #ffffff;
}

.hours-table th {
  background: #f3f3fb;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.hours-table thead th {
  vertical-align: bottom;
}

.hours-table th:first-child,
.hours-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}

.hours-table col.day-column,
.hours-table .day-column {
  width: 128px;
}

.hours-table col.location-column,
.hours-table .location-column {
  width: 180px;
}

.hours-table col.project-column {
  width: 72px;
}

.hours-table .project-column,
.hours-table .project-hour-cell {
  text-align: center;
  overflow-wrap: anywhere;
}

.hours-table th.project-title-column {
  height: 210px;
  padding: 10px 4px;
  vertical-align: bottom;
}

.hours-table th.project-title-column span {
  display: inline-block;
  max-height: 190px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: left;
  line-height: 1.15;
  white-space: normal;
}

.hours-table col.total-column,
.hours-table .total-column {
  width: 108px;
  text-align: center;
}

.hours-table th.daily-total-heading {
  position: relative;
  padding-top: 44px;
}

.daily-total-heading > span {
  display: block;
}

.daily-total-project-action {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  min-height: 30px;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.daily-total-project-action svg {
  width: 15px;
  height: 15px;
}

.hours-table input {
  width: min(76px, 100%);
  min-height: 34px;
  text-align: center;
  font-weight: 800;
}

.hours-table input[type="number"],
#standard-travel-hours {
  -moz-appearance: textfield;
  appearance: textfield;
}

.hours-table input[type="number"]::-webkit-outer-spin-button,
.hours-table input[type="number"]::-webkit-inner-spin-button,
#standard-travel-hours::-webkit-outer-spin-button,
#standard-travel-hours::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.hours-table select {
  width: 150px;
  min-height: 34px;
}

.hours-table .row-total,
.hours-table .col-total {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 900;
  text-align: center;
}

.standard-travel-row td,
.standard-travel-cell {
  background: #fbfbff;
  font-weight: 850;
  text-align: center;
}

.standard-travel-cell input {
  margin-inline: auto;
}

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

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

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

.optional {
  color: var(--muted);
  font-weight: 650;
}

.mini-metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

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

.row-total.mismatch {
  background: #fdecec;
  color: var(--red);
  box-shadow: inset 0 0 0 2px #f4c6c1;
}

.check-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.check-row label,
.link-card label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.expense-card,
.link-card {
  display: grid;
  gap: 6px;
}

.link-card.linked-existing {
  background: #f1f3f5;
  border-color: #d7dce2;
  color: #59636e;
}

.link-card.linked-existing label {
  color: #3f4852;
}

.expense-card {
  width: 100%;
  color: var(--ink);
  text-align: left;
}

button.expense-card {
  cursor: pointer;
}

.expense-card:hover,
.expense-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.entry-status {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.entry-status.is-locked,
.lock-notice {
  color: #8a2c0d;
}

.entry-status.is-error {
  color: #b42318;
}

.entry-status.is-saving {
  color: #8a5a00;
}

.entry-status.is-saved {
  color: #18794e;
}

.lock-notice {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  font-weight: 800;
}

.expense-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.flag-row span {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 850;
}

.flag-on {
  background: #ebf7f1;
  color: var(--green);
}

.flag-off {
  background: #eeeeef;
  color: var(--gray);
}

.drop-zone {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  margin: 18px 0 12px;
  color: var(--accent-dark);
  border-style: dashed;
  background: var(--accent-soft);
}

.drop-zone svg {
  width: 38px;
  height: 38px;
}

.drop-zone span {
  color: var(--muted);
}

.uploaded-files {
  margin-top: 16px;
}

.uploaded-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 3px 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  width: 100%;
  color: var(--ink);
  text-align: left;
}

.uploaded-select {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.uploaded-select strong,
.uploaded-select small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-select .receipt-link-summary {
  color: var(--ink);
  font-weight: 800;
}

.uploaded-file.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(55, 51, 148, 0.14);
}

.file-input {
  display: none;
}

.drop-zone.is-dragover {
  border-color: var(--accent);
  background: #e1e7ff;
}

.drop-zone.is-locked {
  cursor: not-allowed;
  opacity: 0.65;
  background: #f4f4f5;
  color: var(--muted);
}

.uploaded-file small {
  color: var(--muted);
}

.file-status {
  grid-column: 2;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 850;
}

.receipt-view-button,
.receipt-remove-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
}

.receipt-remove-button {
  color: var(--red);
}

.receipt-view-button:disabled,
.receipt-remove-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.receipt-view-button i,
.receipt-remove-button i {
  width: 17px;
  height: 17px;
}

.selected-receipt-note {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-link-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8ff;
}

.receipt-link-actions div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.receipt-link-actions strong,
.receipt-link-actions small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-link-actions small {
  color: var(--muted);
  font-weight: 750;
}

.file-status.linked {
  background: #ebf7f1;
  color: var(--green);
}

.file-status.unlinked {
  background: #fff5db;
  color: var(--amber);
}

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

.completion-list button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  font-weight: 800;
}

.payroll-status-card {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-weight: 850;
}

.payroll-status-card > span {
  flex: 1 1 auto;
  min-width: 0;
}

.payroll-status-card svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.payroll-status-card span,
.payroll-status-card small {
  display: block;
}

.payroll-status-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.payroll-status-card.is-sent {
  border-color: #a9ddc0;
  background: #ebf7f1;
  color: var(--green);
}

.payroll-status-card.is-pending {
  border-color: #f4d58d;
  background: #fff8e6;
  color: #9a6700;
}

.payroll-rollback-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.completion-list .action-return {
  grid-column: 2;
}

.completion-list .action-submit.is-ready {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.completion-list button:disabled {
  background: #f4f6fb;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.completion-list .action-submit:disabled {
  background: #f4f6fb;
  border-color: var(--line);
  color: var(--muted);
}

.week-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  font-weight: 850;
}

.week-status-line svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.week-status-line.is-ready {
  border-color: #a9ddc0;
  background: #ebf7f1;
  color: var(--green);
}

.week-status-line.needs-attention {
  border-color: #f4d58d;
  background: #fff8e6;
  color: #9a6700;
}

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

.checks-heading h2 {
  margin: 0;
}

.week-finish-row {
  scroll-margin-top: 28px;
}

.finish-report-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #c7d2fe;
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  background: #f8f9ff;
  box-shadow: var(--shadow);
  scroll-margin-top: 28px;
}

.finish-report-card .panel {
  box-shadow: none;
}

.finish-header-editor {
  margin: 0;
}

.finish-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.finish-header-actions small {
  color: var(--muted);
}

.finish-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dbe2ff;
}

.finish-report-header span:first-child {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.finish-report-header h2 {
  margin: 2px 0 0;
  font-size: 1.1rem;
}

.workflow-history-panel {
  grid-column: 1 / -1;
}

.workflow-history-list {
  display: grid;
  gap: 10px;
}

.workflow-history-list.is-collapsed {
  display: none;
}

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

.ghost-button.compact {
  min-height: 34px;
  padding: 0 10px;
}

.workflow-history-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  padding: 12px;
}

.workflow-history-list strong,
.workflow-history-list small,
.workflow-history-list span {
  display: block;
}

.workflow-history-list small {
  color: var(--muted);
  margin-top: 4px;
}

.workflow-history-list span {
  margin-top: 8px;
}

.check-list span,
.check-list button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-list button {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  font-weight: 750;
}

.check-list button:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.check-list button.warn {
  border-color: #f4d58d;
  background: #fffaf0;
}

.check-loading-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9ff;
  color: var(--muted);
  font-weight: 850;
}

.check-loading-note svg {
  width: 17px;
  height: 17px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.check-list .ok svg,
.check-list button.ok svg {
  color: var(--green);
}

.check-list .warn svg,
.check-list button.warn svg {
  color: var(--amber);
}

.link-card.linked-existing input {
  accent-color: var(--accent);
}

.report-context {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
}

.weekly-header-panel,
.travel-calculation,
.subpanel {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
}

.header-field-grid,
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.header-field-grid span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.travel-calculation {
  grid-column: 1 / -1;
  margin: 0;
}

.travel-calculation span {
  color: var(--muted);
}

.settings-tab {
  display: none;
  margin-top: 16px;
}

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

.settings-heading {
  display: grid;
  align-items: start;
  grid-template-columns: 1fr;
  gap: 10px;
}

.settings-heading-copy p {
  white-space: nowrap;
}

.settings-access {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.settings-access .segmented {
  flex: 1 1 720px;
  flex-wrap: wrap;
  overflow: visible;
}

.settings-review-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.settings-review-toolbar .save-status {
  margin-right: auto;
}

.role-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
}

.settings-review-export {
  margin-left: 0;
}

.settings-status-row {
  margin-top: 12px;
}

.settings-status-row .save-status {
  justify-content: flex-start;
}

.role-preview span {
  display: none;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.subpanel {
  margin: 0;
}

.compact-subpanel {
  gap: 8px;
  padding: 12px;
}

.compact-subpanel .settings-form-grid,
.settings-column {
  gap: 8px;
}

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

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

#settings-catalog .catalog-layout {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  align-items: start;
  min-height: 680px;
}

#settings-catalog .catalog-left-stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

#settings-catalog .catalog-entry-frame {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 680px;
  max-height: calc(100vh - 220px);
}

.security-levels-info {
  margin-bottom: 12px;
}

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

.security-levels-inline article {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.security-levels-inline article span {
  font-size: 0.82rem;
}

.security-levels,
.control-stack,
.associate-list,
.catalog-grid,
.chip-row,
.threshold-grid,
.catalog-entry-list,
.picker-options {
  display: grid;
  gap: 10px;
}

.security-levels article,
.associate-row,
.catalog-card,
.chip-row span,
.sample {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.security-levels article,
.associate-row,
.catalog-card {
  display: grid;
  gap: 4px;
  color: var(--ink);
  text-align: left;
}

.associate-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(84px, 0.35fr) minmax(110px, 0.55fr) minmax(140px, 0.65fr) auto;
  align-items: center;
  width: 100%;
}

.associate-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(84px, 0.35fr) minmax(110px, 0.55fr) minmax(140px, 0.65fr) auto;
  align-items: center;
  padding: 0 10px 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.associate-list-header span:last-child {
  justify-self: end;
}

.associate-row small {
  display: block;
  color: var(--muted);
}

.associate-row em {
  justify-self: end;
  border-radius: 999px;
  padding: 4px 9px;
  font-style: normal;
  font-weight: 850;
}

.associate-row em.approved {
  background: #ebf7f1;
  color: var(--green);
}

.associate-row em.blocked {
  background: #fdecec;
  color: var(--red);
}

.associate-status-display {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 850;
}

.associate-status-display.approved {
  background: #ebf7f1;
  color: var(--green);
}

.associate-status-display.blocked {
  background: #fdecec;
  color: var(--red);
}

.associate-row.is-selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.catalog-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

#settings-catalog .catalog-grid {
  grid-auto-rows: 64px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

#settings-catalog .catalog-card {
  grid-template-columns: 14px minmax(0, 1fr);
  grid-template-rows: 20px 18px;
  align-content: center;
  column-gap: 8px;
  min-height: 64px;
  max-height: 64px;
  width: 100%;
  overflow: hidden;
}

#settings-catalog .catalog-card .drag-handle {
  grid-row: 1 / span 2;
}

#settings-catalog .catalog-card strong,
#settings-catalog .catalog-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#settings-catalog .catalog-card small {
  color: var(--muted);
}

.catalog-card.is-drop-target,
.catalog-entry-row.is-drop-target {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.drag-handle {
  align-self: center;
  color: var(--muted);
  cursor: grab;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  user-select: none;
}

.catalog-entry-row {
  grid-template-columns: 14px minmax(0, 45%) minmax(0, 1fr) auto;
  column-gap: 8px;
}

.catalog-entry-row .drag-handle {
  grid-column: 1;
  grid-row: 1;
}

.catalog-entry-row strong,
.catalog-entry-row small {
  min-width: 0;
}

.catalog-entry-row strong {
  grid-column: 2;
  overflow-wrap: anywhere;
  white-space: normal;
}

.catalog-entry-row small {
  grid-column: 3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.catalog-entry-row .project-type-pill {
  grid-column: 4;
  justify-self: end;
}

#settings-catalog .catalog-entry-search {
  margin: 0;
}

#settings-catalog .catalog-entry-list {
  align-content: start;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

#settings-catalog .empty-list-note {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.control-stack > div {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.settings-column {
  display: grid;
  gap: 10px;
}

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

.target-editor {
  display: grid;
  gap: 10px;
}

.target-table {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr);
  gap: 4px;
  align-items: center;
}

.target-table > * {
  min-height: 36px;
  display: flex;
  align-items: center;
}

.target-head {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.target-table .is-invalid {
  color: var(--red);
}

.traffic-table {
  display: grid;
  gap: 8px;
}

.traffic-table button {
  display: grid;
  grid-template-columns: 48px minmax(180px, 1fr) 72px repeat(4, minmax(88px, 0.7fr));
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.traffic-table button > * {
  padding: 10px;
}

.tl-blue {
  background: #1660d5;
  color: #ffffff;
}

.tl-green {
  background: #168000;
  color: #ffffff;
}

.tl-yellow {
  background: #ffff00;
  color: #1b1b1b;
}

.tl-red {
  background: #ff2a12;
  color: #ffffff;
}

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

.sample {
  font-weight: 850;
  text-align: center;
}

.sample.green {
  background: #ebf7f1;
  color: var(--green);
}

.sample.blue {
  background: #e8f0ff;
  color: #174ea6;
}

.sample.yellow {
  background: #fff8db;
  color: #8a6500;
}

.sample.orange {
  background: #fff1e6;
  color: #9a4b00;
}

.sample.red {
  background: #fdecec;
  color: var(--red);
}

.catalog-entry-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 45%) minmax(0, 1fr) auto;
  gap: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.catalog-entry-row.is-selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.project-type-pill {
  width: fit-content;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 850;
}

.catalog-entry-frame {
  align-self: start;
}

.catalog-entry-list-heading h3,
.catalog-entry-list-heading p {
  margin: 0;
}

.project-code-layout {
  align-items: start;
}

#settings-projects.is-active {
  display: block;
  overflow: visible;
}

#settings-projects .project-code-layout {
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  align-items: start;
}

#settings-projects .project-code-layout > .subpanel {
  min-height: 0;
}

#settings-projects .project-code-layout > .compact-subpanel {
  position: sticky;
  top: 0;
}

#settings-projects .project-code-layout > .subpanel:nth-child(2) {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  overflow: hidden;
}

#settings-projects .project-code-layout > .subpanel:nth-child(2) .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#settings-projects .project-code-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

#settings-projects .project-edit-grid {
  grid-template-columns: 1fr;
}

#settings-projects .project-flag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.products-subs-sections {
  display: grid;
  gap: 18px;
}

.products-subs-section {
  display: grid;
  gap: 10px;
}

.products-subs-section > h3 {
  margin: 0;
  color: var(--accent-dark);
}

.products-subs-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.products-subs-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.products-subs-card.is-total {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.products-subs-expand,
.products-subs-card-heading {
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  text-align: left;
}

.products-subs-expand {
  cursor: pointer;
}

.products-subs-expand:hover {
  background: var(--accent-soft);
}

.products-subs-expand > span,
.products-subs-card-heading > span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}

.products-subs-expand strong,
.products-subs-card-heading strong {
  flex: 0 0 auto;
  font-size: 1.2rem;
}

.products-subs-detail {
  display: grid;
  border-top: 1px solid var(--line);
}

.products-subs-detail > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.products-subs-detail > span:last-child {
  border-bottom: 0;
}

.products-subs-detail > span > span {
  display: grid;
  gap: 2px;
}

.products-subs-detail small {
  color: var(--muted);
}

.products-subs-detail em {
  flex: 0 0 auto;
  font-style: normal;
  font-weight: 850;
}

.products-subs-productivity {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 16px;
  border-radius: 10px;
}

.products-subs-productivity span {
  font-weight: 800;
}

.products-subs-productivity strong {
  font-size: 1.35rem;
}

@media (max-width: 900px) {
  .products-subs-card-grid {
    grid-template-columns: 1fr;
  }
}

#settings-expense-accounts.is-active {
  display: block;
  overflow: visible;
}

#settings-expense-accounts .expense-account-layout {
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  align-items: start;
}

#settings-expense-accounts .expense-account-layout > .compact-subpanel {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 0;
}

#settings-expense-accounts .expense-account-list-panel {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  min-height: 0;
  overflow: hidden;
}

#settings-expense-accounts .expense-account-list-panel .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#settings-expense-accounts .settings-compact-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

#settings-expense-accounts .settings-compact-table .is-inactive-row td {
  color: var(--muted);
}

#settings-expense-accounts .status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

#settings-expense-accounts .status-chip.is-active {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
}

#settings-expense-accounts .status-chip.is-inactive {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
}

#settings-expense-accounts .expense-account-edit-grid {
  grid-template-columns: 1fr;
}

.project-edit-grid {
  grid-template-columns: minmax(160px, 0.7fr) minmax(260px, 1.2fr) minmax(220px, 1fr) minmax(160px, 0.7fr) auto;
  align-items: end;
}

.expense-account-edit-grid,
.location-edit-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

.travel-rule-grid {
  grid-template-columns: minmax(180px, 260px) auto;
  align-items: end;
}

.settings-search {
  margin: 12px 0;
}

.settings-compact-table {
  min-width: 620px;
}

.location-table {
  min-width: 780px;
}

.editable-list span {
  grid-template-columns: 14px minmax(130px, 0.38fr) minmax(0, 1fr) auto auto;
  column-gap: 16px;
  align-items: center;
}

.editable-list span .drag-handle {
  grid-column: 1;
}

.editable-list span strong {
  grid-column: 2;
  min-width: 0;
}

.editable-list span small {
  grid-column: 3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editable-list span.is-drop-target {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.inline-sort-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.inline-sort-control input {
  width: 72px;
  min-height: 34px;
}

.editable-list span.is-inactive {
  opacity: 0.65;
}

.project-code-table {
  min-width: 860px;
}

.project-code-table th:nth-child(1),
.project-code-table td:nth-child(1) {
  width: 140px;
}

.project-code-table th:nth-child(4),
.project-code-table td:nth-child(4),
.project-code-table th:nth-child(5),
.project-code-table td:nth-child(5) {
  width: 96px;
  white-space: nowrap;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: var(--accent-soft);
}

.clickable-row.is-selected-row td {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 850;
}

.clickable-row.is-past-due-invoice td {
  background: #fff8ec;
}

.clickable-row.is-past-due-invoice td:nth-child(2) {
  color: var(--red);
  font-weight: 850;
}

.inline-warning {
  display: inline-flex;
  margin-left: 6px;
  border-radius: 999px;
  background: #fdecec;
  color: var(--red);
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.invoice-filters {
  margin-bottom: 14px;
}

.invoice-landing-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.invoice-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.invoice-header-grid,
.invoice-summary-grid,
.invoice-line-form,
.invoice-attachment-row {
  display: grid;
  gap: 12px;
}

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

.invoice-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: stretch;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
}

.invoice-line-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  margin: 14px 0;
}

.invoice-attachment-row {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.invoice-drop-zone {
  min-height: 150px;
  margin: 0;
}

.invoice-attachment-row #invoice-browse,
.invoice-attachment-row .invoice-files {
  width: 100%;
}

.invoice-drop-zone[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.invoice-files {
  margin-top: 10px;
}

.invoice-file {
  width: 100%;
  text-align: left;
}

.invoice-activity-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.activity-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
}

.activity-item strong,
.activity-item span,
.activity-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.activity-item small {
  color: var(--muted);
}

#invoice-table td:nth-child(7) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.invoice-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.invoice-pagination span {
  min-width: 180px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.invoice-empty-row {
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--ink);
}

.toggle-control input {
  min-height: auto;
}

.summary-field {
  display: grid;
  gap: 8px;
  align-content: start;
}

.summary-field.mini-metric {
  min-height: 100%;
}

.field-reconcile > div {
  display: grid;
  align-items: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  font-weight: 850;
}

.field-reconcile strong {
  font-size: 0.86rem;
}

.field-reconcile .is-match {
  background: #ebf7f1;
  border-color: #b7dfcb;
  color: var(--green);
}

.field-reconcile .is-mismatch {
  background: #fdecec;
  border-color: #f4c6c1;
  color: var(--red);
}

.reconcile-stack {
  display: grid;
  gap: 10px;
}

.reconcile-card {
  display: grid;
  gap: 5px;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--line);
}

.reconcile-card div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.reconcile-card span,
.reconcile-card small {
  font-weight: 850;
}

.reconcile-card.is-match {
  background: #ebf7f1;
  border-color: #b7dfcb;
  color: var(--green);
}

.reconcile-card.is-mismatch {
  background: #fdecec;
  border-color: #f4c6c1;
  color: var(--red);
}

.picker-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 18, 45, 0.38);
}

.picker-modal.is-open {
  display: grid;
}

.picker-dialog {
  width: min(720px, 100%);
  max-height: 82vh;
  overflow: auto;
  display: grid;
  gap: 14px;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: var(--shadow);
}

#settings-picker-modal .picker-dialog {
  height: min(720px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

#settings-picker-options {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.misc-type-dialog {
  width: min(680px, 100%);
}

.misc-type-form {
  margin: 4px 0;
}

.kaizen-request-dialog {
  width: min(760px, 100%);
}

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

.kaizen-document-dialog {
  width: min(980px, 100%);
}

.password-reset-dialog {
  width: min(640px, 100%);
}

.password-reset-dialog textarea {
  min-height: 230px;
  resize: vertical;
  line-height: 1.45;
}

.kaizen-document-frame-wrap {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  overflow: hidden;
}

.kaizen-document-frame-wrap.is-empty {
  display: grid;
  place-items: center;
  padding: 18px;
}

.kaizen-document-frame-wrap.is-empty::before {
  content: "Preview unavailable";
  color: var(--muted);
  font-weight: 900;
}

.kaizen-document-frame {
  width: 100%;
  height: 420px;
  border: 0;
}

.kaizen-document-frame-wrap iframe {
  width: 100%;
  height: 420px;
  border: 0;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.form-status.is-error {
  color: var(--red);
}

.form-status.is-saving {
  color: var(--accent-dark);
}

.picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbff;
  padding: 10px;
  color: var(--ink);
}

.quiet,
.settings-list small,
.admin-card small,
.kaizen-item small,
.target-card small,
.score-card small,
.timeline p {
  color: var(--muted);
}

@media (max-width: 1120px) {
  body {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .brand span,
  .nav-item span,
  .sidebar-card {
    display: none;
  }

  .brand {
    padding-left: 0;
  }

  .brand img {
    width: 56px;
    height: 32px;
    padding: 3px;
  }

  .nav-item {
    justify-content: center;
  }

  .nav-subitem {
    width: calc(100% - 18px);
    margin-left: 18px;
  }

  .nav-subitem::before {
    left: -9px;
  }

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

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

  .report-card-actions {
    grid-template-columns: minmax(92px, 1fr);
    width: 100%;
  }

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

  .two-column,
  .split-layout,
  .workspace-grid,
  .invoice-detail-grid,
  .invoice-workbench-grid,
  .invoice-header-grid,
  .invoice-summary-grid,
  .invoice-line-form,
  .invoice-attachment-row,
  .productivity-top-row,
  .project-report-grid,
  .associate-report-grid,
  .associate-summary-dashboard,
  .associate-repeat-grid,
  .settings-grid,
  .kaizen-layout,
  .report-layout,
  .travel-panel,
  .header-field-grid,
  .threshold-grid,
  .project-picker {
    grid-template-columns: 1fr;
  }

  #settings-catalog .catalog-layout {
    min-height: 0;
  }

  #settings-catalog .catalog-entry-frame {
    min-height: 560px;
    max-height: none;
  }

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

  .productivity-tabs-control {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .productivity-tabs-control button {
    padding: 0 3px;
    font-size: 0.76rem;
  }

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

  .kaizen-tools {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 0.4fr);
  }

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

@media (max-width: 720px) {
  body {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .sidebar {
    height: auto;
    min-height: auto;
    position: static;
    overflow-y: visible;
    padding: 12px;
  }

  .brand {
    display: none;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 48px;
  }

  .nav-subitem {
    flex-basis: 48px;
    margin-left: 0;
  }

  .nav-subitem::before {
    display: none;
  }

  .settings-heading-copy p {
    white-space: normal;
  }

  .settings-access {
    align-items: stretch;
    flex-direction: column;
  }

  .role-preview {
    width: 100%;
  }

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

  .editable-list span {
    grid-template-columns: 14px minmax(0, 1fr) auto auto;
  }

  .editable-list span strong,
  .editable-list span small {
    grid-column: 2;
  }

  .editable-list span small {
    white-space: normal;
  }

  #settings-projects.is-active,
  #settings-expense-accounts.is-active,
  #settings-projects .project-code-layout,
  #settings-expense-accounts .expense-account-layout,
  #settings-expense-accounts .expense-account-list-panel,
  #settings-projects .project-code-layout > .subpanel:nth-child(2) {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  #settings-projects .project-code-layout,
  #settings-expense-accounts .expense-account-layout {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  #settings-projects .project-code-layout > .compact-subpanel,
  #settings-expense-accounts .expense-account-layout > .compact-subpanel {
    grid-column: auto;
    grid-row: auto;
    position: static;
  }

  #settings-expense-accounts .expense-account-list-panel {
    grid-column: auto;
    grid-row: auto;
    max-height: none;
  }

  #settings-projects .project-code-layout > .subpanel:nth-child(2) .table-wrap,
  #settings-expense-accounts .expense-account-list-panel .table-wrap {
    flex: none;
  }

  .shell {
    height: auto;
    overflow: visible;
    padding: 18px;
  }

  .topbar,
  .panel-heading {
    display: grid;
  }

  .report-associate-context {
    min-width: 0;
    justify-items: start;
    text-align: left;
  }

  .home-controls {
    justify-items: stretch;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .summary-grid,
  .command-summary-grid,
  .kaizen-summary-grid,
  .kaizen-tools,
  .expense-form,
  .report-header,
  .filter-row,
  .report-card-metrics,
  .report-card-actions,
  .completion-list {
    grid-template-columns: 1fr;
  }

  .expense-summary label:nth-child(2),
  .expense-project-summary {
    grid-column: auto;
  }

  .associate-list-header {
    display: none;
  }

  .associate-row {
    grid-template-columns: 1fr;
  }

  .associate-row em {
    justify-self: start;
  }

  .kaizen-file-row .ghost-button {
    width: 100%;
  }

  .billing-row,
  .impact-grid {
    grid-template-columns: 1fr;
  }

  .billing-track {
    order: 3;
  }
}
