:root {
  --black: #000000;
  --white: #ffffff;
  --primary: #cae223;
  --secondary: #f1e710;
  --ink: #101010;
  --muted: #687076;
  --line: #e1e5e8;
  --surface: #ffffff;
  --soft: #f5f6f0;
  --danger: #b42318;
  --success: #147a2e;
  --warning: #a16207;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

code {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
}

.menu-state {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.18s ease;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--black);
  color: var(--white);
  padding: 26px 18px;
  transition: padding 0.18s ease, transform 0.2s ease;
  z-index: 40;
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 0;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: var(--black);
  font-family: Anton, Impact, sans-serif;
  font-size: 22px;
}

.brand strong {
  display: block;
  font-family: Anton, Impact, sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.brand-copy {
  min-width: 0;
}

.brand small,
.user-box small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.sidebar .brand small {
  color: #c5c9cc;
}

.scope-picker {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 12px;
}

.scope-picker label {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.scope-picker select {
  width: 100%;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #111111;
  color: var(--white);
  padding: 10px 11px;
}

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

.nav-list a {
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 8px;
  color: #dde1e3;
  font-weight: 800;
  padding: 12px 13px;
  min-height: 46px;
}

.nav-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-list a:hover,
.nav-list a.is-active {
  background: var(--primary);
  color: var(--black);
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #111111;
  color: var(--white);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--primary);
  color: var(--black);
}

.icon-button .nav-icon {
  width: 20px;
  height: 20px;
}

.mobile-menu-button,
.mobile-menu-close,
.sidebar-scrim {
  display: none;
}

body.sidebar-collapsed .app-shell,
#sidebar-collapse-toggle:checked ~ .app-shell {
  grid-template-columns: 88px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar,
#sidebar-collapse-toggle:checked ~ .app-shell .sidebar {
  padding: 24px 14px;
}

body.sidebar-collapsed .sidebar-head,
#sidebar-collapse-toggle:checked ~ .app-shell .sidebar-head {
  display: grid;
  justify-items: center;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .scope-picker,
#sidebar-collapse-toggle:checked ~ .app-shell .brand-copy,
#sidebar-collapse-toggle:checked ~ .app-shell .scope-picker,
body.sidebar-collapsed .nav-label,
#sidebar-collapse-toggle:checked ~ .app-shell .nav-label {
  display: none;
}

body.sidebar-collapsed .brand,
#sidebar-collapse-toggle:checked ~ .app-shell .brand {
  justify-content: center;
}

body.sidebar-collapsed .brand-mark,
#sidebar-collapse-toggle:checked ~ .app-shell .brand-mark {
  width: 44px;
  height: 44px;
}

body.sidebar-collapsed .nav-list a,
#sidebar-collapse-toggle:checked ~ .app-shell .nav-list a {
  justify-content: center;
  padding: 12px;
}

.main {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

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

h1 {
  margin-bottom: 0;
  font-family: Anton, Impact, sans-serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.eyebrow {
  margin-bottom: 7px;
  color: #4a5600;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  padding: 9px 14px;
}

.button-primary {
  background: var(--primary);
  color: var(--black);
}

.button-muted {
  background: #ecefec;
  color: var(--ink);
}

.content-band {
  display: grid;
  gap: 22px;
}

.flash-message {
  border: 1px solid #d7ed55;
  border-radius: 8px;
  background: #fbffe8;
  color: #4a5600;
  font-weight: 900;
  margin-bottom: 18px;
  padding: 12px 14px;
}

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

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

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 142px;
  padding: 18px;
}

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

.metric-card strong {
  font-family: Anton, Impact, sans-serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
}

.metric-card.positive,
.metric-card.warning,
.metric-card.neutral {
  border-top: 5px solid var(--primary);
}

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

.hours-layout {
  grid-template-columns: minmax(310px, 420px) minmax(0, 1fr);
}

.panel,
.table-panel {
  overflow: hidden;
}

.panel {
  padding: 20px;
}

.panel-heading,
.split-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading span,
.split-actions p {
  color: var(--muted);
}

.split-actions p {
  margin-bottom: 0;
}

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

.documents-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto;
  align-items: end;
  gap: 12px;
}

.form-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 12px 0 0;
}

.overview-filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(140px, 1fr)) auto auto;
  align-items: end;
  gap: 12px;
}

.overview-toolbar {
  display: flex;
  position: relative;
  z-index: 20;
  justify-content: flex-end;
}

.overview-range-details {
  position: relative;
  width: min(100%, 520px);
}

.overview-range-details summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
}

.overview-range-details summary::-webkit-details-marker {
  display: none;
}

.overview-range-details summary::after {
  content: "⌄";
  display: grid;
  place-items: center;
  color: #4a5600;
  font-size: 18px;
  font-weight: 900;
  transition: transform 0.15s ease;
}

.overview-range-details[open] summary {
  border-color: var(--primary);
}

.overview-range-details[open] summary::after {
  transform: rotate(180deg);
}

.overview-range-details summary span,
.overview-range-details summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-range-details summary strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-range-details .overview-filter-form {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(760px, calc(100vw - 360px));
  min-width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

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

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

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

.inline-actions form {
  margin: 0;
}

.inline-date-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.inline-date-form input[type="date"] {
  width: 132px;
  min-height: 36px;
  padding: 7px 8px;
}

.bar-chart {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 52px minmax(100px, 1fr) 110px;
  align-items: center;
  gap: 12px;
}

.bar-row span,
.bar-row strong {
  font-size: 13px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebdf;
}

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

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

.rank-list,
.compact-bars {
  display: grid;
  gap: 14px;
}

.rank-row,
.compact-bars > div {
  display: grid;
  gap: 8px;
}

.rank-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.rank-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.rank-row span,
.compact-bars strong {
  font-size: 13px;
  font-weight: 900;
}

.rank-track {
  overflow: hidden;
  grid-column: 1 / -1;
  height: 9px;
  border-radius: 999px;
  background: #e7ebdf;
}

.rank-track div {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.compact-bars > div {
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-bars .rank-track {
  grid-column: 1 / -1;
}

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

.hour-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(202, 226, 35, 0.62) 0%, rgba(202, 226, 35, 0.18) var(--intensity), #fff 100%);
  min-height: 70px;
  padding: 9px;
}

.hour-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.hour-grid strong {
  font-size: 12px;
}

.cost-list div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.table-panel .panel-heading {
  padding: 18px 20px 0;
}

.table-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px 16px;
}

.table-controls label {
  width: min(100%, 420px);
}

.table-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

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

th,
td {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  text-align: left;
  vertical-align: middle;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.integration-snapshot {
  max-width: 760px;
  padding: 14px 16px 10px;
}

.integration-snapshot .panel-heading {
  margin-bottom: 10px;
}

.integration-snapshot h2 {
  font-size: 18px;
}

.compact-table th,
.compact-table td {
  padding: 8px 10px;
}

.compact-table td {
  font-size: 14px;
}

.compact-table td strong {
  font-variant-numeric: tabular-nums;
}

.compact-table td small {
  margin-top: 0;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable::after {
  content: "↕";
  color: #9aa2a8;
  margin-left: 7px;
}

th.sortable[aria-sort="ascending"]::after {
  content: "↑";
  color: var(--black);
}

th.sortable[aria-sort="descending"]::after {
  content: "↓";
  color: var(--black);
}

.table-link {
  color: #4a5600;
  font-weight: 900;
}

.table-actions {
  text-align: right;
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
}

.pagination span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef0e7;
  color: #303030;
  font-size: 12px;
  font-weight: 900;
}

.status.active,
.status.configured,
.status.approved,
.status.valid {
  background: #edf8ad;
  color: #405000;
}

.status.planned,
.status.draft,
.status.syncing {
  background: #fff7c2;
  color: var(--warning);
}

.status.error,
.status.closed,
.status.cancelled,
.status.storno,
.status.disabled {
  background: #fee2e2;
  color: var(--danger);
}

.form-grid,
.record-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.integration-system-fields {
  display: contents;
}

.integration-system-fields[hidden] {
  display: none;
}

.record-card {
  padding: 18px;
}

.records-grid {
  display: grid;
  gap: 16px;
}

.nested-table {
  box-shadow: none;
  margin-top: 18px;
}

.nested-table input {
  min-width: 130px;
}

label {
  display: grid;
  gap: 7px;
  color: #2d3338;
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 10px 11px;
}

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

.wide,
fieldset.wide {
  grid-column: 1 / -1;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 13px;
}

legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.checkbox-grid input {
  width: auto;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  width: auto;
}

.shift-form {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fast-report-header {
  align-items: end;
}

.fast-report-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.fast-report-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) 96px 96px auto;
  gap: 10px;
  align-items: end;
}

.fast-report-filter label {
  min-width: 0;
}

.print-only {
  display: none;
}

.fast-report-context {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  margin-bottom: 18px;
  padding: 12px 14px;
}

.fast-report-context strong {
  color: var(--black);
}

.fast-report-context span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.fast-report-kpis {
  margin-bottom: 20px;
}

.fast-report-main {
  margin-bottom: 20px;
}

.fast-split-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.fast-split-strip article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.fast-split-strip span,
.fast-split-strip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.fast-split-strip strong {
  font-family: Anton, Impact, sans-serif;
  font-size: 28px;
  font-weight: 400;
}

.fast-wide-panel {
  margin-bottom: 20px;
}

.fast-cumulative-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.fast-line-chart {
  display: grid;
  gap: 10px;
  padding: 6px 4px 0;
}

.fast-line-chart svg {
  display: block;
  width: 100%;
  min-height: 260px;
}

.chart-axis {
  stroke: var(--line);
  stroke-width: 2;
}

.chart-day-line {
  stroke: #c7cdd1;
  stroke-width: 1.2;
}

.chart-hour-line {
  stroke: #edf0f2;
  stroke-width: 0.8;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.chart-line-primary {
  stroke: var(--primary);
}

.chart-line-secondary {
  stroke: var(--secondary);
}

.chart-line-muted {
  stroke: #111111;
  opacity: 0.34;
}

.chart-week-marker {
  stroke: var(--black);
  stroke-width: 2.4;
}

.chart-week-marker-point {
  fill: var(--black);
  stroke: var(--white);
  stroke-width: 1.2;
}

.chart-point {
  cursor: crosshair;
  fill: transparent;
  opacity: 0;
  pointer-events: all;
  stroke: transparent;
  stroke-width: 0;
}

.chart-point-primary {
  fill: transparent;
}

.chart-point-muted {
  fill: transparent;
  opacity: 0;
}

.chart-point:hover {
  opacity: 0;
  stroke: transparent;
  stroke-width: 0;
}

.fast-line-chart text {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.fast-timeline-chart svg {
  min-height: 248px;
}

.fast-timeline-chart .chart-line {
  stroke-width: 2.1;
}

.fast-timeline-chart .chart-line-muted {
  opacity: 0.28;
}

.fast-timeline-chart text {
  font-size: 9px;
}

.fast-timeline-chart .chart-day-label {
  fill: var(--black);
  font-size: 11px;
}

.fast-timeline-chart .chart-hour-label {
  fill: #7b8288;
  font-size: 8px;
}

.fast-cumulative-chart svg {
  min-height: 260px;
}

.fast-cumulative-chart .chart-line {
  stroke-width: 2.8;
}

.fast-cumulative-chart .chart-hour-line {
  stroke: #edf0f2;
  stroke-width: 0.8;
}

.fast-cumulative-chart text {
  font-size: 11px;
}

.fast-cumulative-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  min-height: 250px;
  align-items: stretch;
  padding: 18px 4px 8px;
}

.fast-cumulative-bars-panel {
  border-left: 5px solid var(--primary);
}

.fast-bar-column {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  min-height: 230px;
  text-align: center;
}

.fast-bar-column strong {
  font-family: Anton, Impact, sans-serif;
  font-size: 20px;
  font-weight: 400;
}

.fast-bar-column small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.fast-bar-shell {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 170px;
  border-bottom: 2px solid var(--line);
  background: linear-gradient(to top, #f4f6f6 1px, transparent 1px);
  background-size: 100% 34px;
}

.fast-bar-shell span {
  display: block;
  width: min(82px, 78%);
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  transition: height 160ms ease;
}

.fast-bar-primary {
  background: var(--primary);
}

.fast-bar-muted {
  background: #111111;
  opacity: 0.34;
}

.chart-legend {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

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

.chart-legend i {
  display: inline-block;
  width: 24px;
  height: 5px;
  border-radius: 999px;
}

.legend-primary {
  background: var(--primary);
}

.legend-secondary {
  background: var(--secondary);
}

.legend-black {
  background: var(--black);
}

.legend-muted {
  background: #111111;
  opacity: 0.34;
}

.fast-summary-grid,
.fast-ratio-list,
.fast-top-items {
  display: grid;
  gap: 10px;
}

.fast-summary-grid div,
.fast-ratio-list div,
.fast-top-items div {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.fast-summary-grid div:last-child,
.fast-ratio-list div:last-child,
.fast-top-items div:last-child {
  border-bottom: 0;
}

.fast-summary-grid span,
.fast-ratio-list span,
.fast-top-items span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.fast-summary-grid strong,
.fast-ratio-list strong,
.fast-top-items strong {
  color: var(--black);
}

.fast-top-items-panel {
  grid-column: 1 / -1;
}

.fast-item-load-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 12px;
}

.fast-item-load-more small {
  color: var(--muted);
  font-weight: 800;
}

.fast-item-load-more .button[hidden] {
  display: none;
}

.fast-negative-documents-panel {
  grid-column: 1 / -1;
}

.fast-top-items-table,
.fast-negative-documents-table {
  overflow-x: auto;
}

.fast-top-items-table table {
  min-width: 820px;
}

.fast-top-items-table th,
.fast-top-items-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.fast-top-items-table td:nth-child(n + 3),
.fast-top-items-table th:nth-child(n + 3) {
  text-align: right;
  white-space: nowrap;
}

.fast-top-items-table td strong,
.fast-top-items-table td small {
  display: block;
}

.fast-top-items-table td small {
  color: var(--muted);
  margin-top: 2px;
}

.fast-negative-documents-table table {
  min-width: 1040px;
}

.fast-negative-documents-table th,
.fast-negative-documents-table td {
  padding: 7px 9px;
  vertical-align: middle;
  white-space: nowrap;
}

.fast-negative-documents-table td:first-child a {
  color: var(--black);
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.fast-negative-documents-table td:nth-last-child(-n + 2),
.fast-negative-documents-table th:nth-last-child(-n + 2) {
  text-align: right;
}

.fast-negative-documents-table td small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.fast-summary-grid small,
.fast-ratio-list small {
  color: var(--muted);
  font-weight: 800;
}

.delta-up {
  color: var(--success);
  font-weight: 900;
}

.delta-down {
  color: var(--danger);
  font-weight: 900;
}

.delta-flat {
  color: var(--muted);
  font-weight: 900;
}

td.heat-strong {
  background: #e4f77a;
}

td.heat-good {
  background: #f3ffd0;
}

td.heat-soft {
  background: #fff7c2;
}

td.heat-bad {
  background: #fee2e2;
}

td.heat-empty {
  background: #f4f6f7;
}

.empty-state {
  color: var(--muted);
  margin: 0;
  padding: 18px 20px;
}

.login-screen {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.78)),
    radial-gradient(circle at 80% 20%, rgba(202, 226, 35, 0.55), transparent 36%);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  align-items: end;
  padding: 42px;
}

.login-panel {
  width: min(100%, 760px);
  color: var(--white);
}

.login-panel h1 {
  color: var(--primary);
  font-size: 60px;
  margin-bottom: 14px;
}

.login-panel p,
.login-panel li {
  color: #eef2d0;
  font-size: 17px;
  line-height: 1.65;
}

.login-panel .technical {
  color: #ffb4ad;
  font-size: 13px;
}

.auth-form {
  display: grid;
  gap: 14px;
  max-width: 460px;
  margin-top: 24px;
}

.auth-form label {
  color: var(--white);
}

@media (max-width: 1180px) {
  .metric-grid,
  .form-grid,
  .record-card,
  .documents-filter-form,
  .overview-filter-form,
  .fast-report-filter,
  .fast-cumulative-grid,
  .fast-split-strip,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column,
  .hours-layout {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(326px, 88vw);
    max-width: 88vw;
    overflow-y: auto;
    padding: 18px;
    transform: translateX(-100%);
  }

  body.mobile-menu-open .sidebar,
  #mobile-menu-toggle:checked ~ .app-shell .sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .app-shell,
  #sidebar-collapse-toggle:checked ~ .app-shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .sidebar,
  #sidebar-collapse-toggle:checked ~ .app-shell .sidebar {
    padding: 18px;
  }

  body.sidebar-collapsed .sidebar-head,
  #sidebar-collapse-toggle:checked ~ .app-shell .sidebar-head {
    display: flex;
    justify-items: stretch;
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .scope-picker,
  body.sidebar-collapsed .nav-label,
  #sidebar-collapse-toggle:checked ~ .app-shell .brand-copy,
  #sidebar-collapse-toggle:checked ~ .app-shell .scope-picker,
  #sidebar-collapse-toggle:checked ~ .app-shell .nav-label {
    display: block;
  }

  body.sidebar-collapsed .nav-list a,
  #sidebar-collapse-toggle:checked ~ .app-shell .nav-list a {
    justify-content: flex-start;
    padding: 12px 13px;
  }

  .sidebar-toggle {
    display: none;
  }

  .mobile-menu-close {
    display: inline-grid;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 30;
    border: 0;
    background: rgba(0, 0, 0, 0.54);
    cursor: pointer;
  }

  body.mobile-menu-open .sidebar-scrim,
  #mobile-menu-toggle:checked ~ .app-shell .sidebar-scrim {
    display: block;
  }

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

  .main {
    padding: 20px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
  }

  .topbar .user-box {
    grid-column: 1 / -1;
  }

  .topbar-title {
    min-width: 0;
  }

  .topbar,
  .overview-toolbar,
  .split-actions,
  .user-box {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
  }

  h1 {
    font-size: 34px;
  }

  .metric-grid,
  .form-grid,
  .record-card,
  .checkbox-grid,
  .documents-filter-form,
  .overview-filter-form,
  .fast-report-filter,
  .fast-cumulative-grid,
  .fast-split-strip,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 44px minmax(80px, 1fr);
  }

  .bar-row strong {
    grid-column: 2;
  }

  .table-panel {
    overflow-x: auto;
  }

  .overview-range-details {
    width: 100%;
  }

  .overview-range-details summary {
    grid-template-columns: 1fr auto 18px;
  }

  .overview-range-details summary span {
    grid-column: 1 / -1;
  }

  .overview-range-details .overview-filter-form {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 10px;
  }

  .login-shell {
    padding: 24px;
  }

  .login-panel h1 {
    font-size: 42px;
  }
}

.logo-icon {
  width: 40px !important;
  height: 40px !important;
}

.wiki-layout {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.wiki-nav {
  position: sticky;
  top: 18px;
}

.wiki-nav h2 {
  margin-bottom: 14px;
}

.wiki-nav nav {
  display: grid;
  gap: 6px;
}

.wiki-nav a {
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 800;
  padding: 10px 12px;
  text-decoration: none;
}

.wiki-nav a:hover,
.wiki-nav a.is-active {
  background: var(--primary);
  border-color: var(--black);
  color: var(--black);
}

.wiki-content {
  display: grid;
  gap: 18px;
}

.wiki-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.wiki-header h2 {
  margin-bottom: 6px;
}

.wiki-header p,
.wiki-section p {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}

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

.wiki-section {
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
}

.wiki-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.wiki-section h3 {
  font-size: 18px;
  margin: 0;
}

.wiki-section ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.wiki-section li {
  color: var(--text);
  font-weight: 700;
  line-height: 1.45;
}

.wiki-section pre {
  background: #0e0f10;
  border-radius: 8px;
  color: #f6f7f0;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  overflow-x: auto;
  padding: 12px;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .wiki-layout {
    grid-template-columns: 1fr;
  }

  .wiki-nav {
    position: static;
  }
}

@media print {
  @page {
    margin: 8mm;
    size: A4 portrait;
  }

  body {
    background: var(--white);
    color: var(--black);
  }

  .sidebar,
  .sidebar-scrim,
  .mobile-menu-button,
  .mobile-menu-close,
  .sidebar-toggle,
  .topbar,
  .flash-message,
  .fast-report-actions,
  .button,
  .chart-legend {
    display: none !important;
  }

  .fast-item-load-more {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .print-report-title {
    border-bottom: 2px solid var(--black);
    margin-bottom: 6px;
    padding-bottom: 5px;
  }

  .print-report-title h1 {
    font-size: 22px;
  }

  .print-report-title p {
    color: #333333;
    font-weight: 800;
    margin-bottom: 0;
  }

  .app-shell,
  .main,
  .content-band {
    display: block;
    min-height: auto;
    padding: 0;
  }

  .panel,
  .table-panel,
  .metric-card,
  .fast-split-strip article {
    break-inside: avoid;
    box-shadow: none;
  }

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

  .two-column {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .panel,
  .table-panel {
    margin-bottom: 6px;
    padding: 8px;
  }

  .table-panel {
    overflow: visible;
  }

  th,
  td {
    padding: 4px 5px;
    font-size: 8px;
  }

  .metric-card {
    min-height: auto;
    gap: 3px;
    padding: 6px 7px;
  }

  .metric-card strong,
  .fast-split-strip strong {
    font-size: 16px;
  }

  .metric-card span,
  .metric-card small,
  .fast-summary-grid span,
  .fast-ratio-list span,
  .fast-top-items span,
  .fast-summary-grid small,
  .fast-ratio-list small {
    font-size: 8px;
  }

  .panel-heading,
  .split-actions {
    margin-bottom: 6px;
  }

  .panel-heading h2 {
    font-size: 13px;
  }

  .panel-heading span,
  .fast-report-context span,
  .fast-report-context strong {
    font-size: 8px;
  }

  .fast-report-context {
    gap: 4px 8px;
    margin-bottom: 6px;
    padding: 5px 6px;
  }

  .fast-report-kpis,
  .fast-report-main,
  .fast-wide-panel,
  .fast-cumulative-grid,
  .fast-split-strip {
    margin-bottom: 6px;
  }

  .fast-split-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .fast-cumulative-grid {
    grid-template-columns: 2fr 1fr;
    gap: 6px;
  }

  .fast-split-strip article {
    gap: 2px;
    padding: 6px 7px;
  }

  .fast-summary-grid,
  .fast-ratio-list,
  .fast-top-items {
    gap: 3px;
  }

  .fast-summary-grid div,
  .fast-ratio-list div,
  .fast-top-items div {
    gap: 1px;
    padding: 3px 0;
  }

  .fast-line-chart {
    display: block;
    gap: 2px;
    padding: 0;
    width: 100%;
  }

  .fast-line-chart svg {
    display: block;
    width: 100%;
    height: 118px;
    max-height: none;
    min-height: 0 !important;
  }

  .fast-timeline-panel,
  .fast-cumulative-panel {
    display: block;
    width: 100%;
    max-width: none;
  }

  .fast-timeline-panel svg,
  .fast-cumulative-panel svg {
    display: block;
    width: 100%;
    height: 110px;
    max-height: none;
  }

  .fast-timeline-panel,
  .fast-cumulative-panel,
  .fast-wide-panel {
    display: block;
    width: 100%;
    max-width: none;
  }

  .fast-timeline-panel .panel-heading,
  .fast-cumulative-panel .panel-heading {
    margin-bottom: 2px;
  }

  .fast-line-chart text {
    font-size: 6px;
  }

  .fast-negative-documents-table {
    overflow: visible;
  }

  .fast-negative-documents-table table {
    min-width: 0;
    table-layout: auto;
    width: 100%;
  }

  .fast-negative-documents-table th,
  .fast-negative-documents-table td {
    font-size: 6.5px;
    padding: 3px;
    white-space: normal;
  }
}
