:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #edf2f7;
  --text: #17202a;
  --muted: #64748b;
  --line: #d8e0ea;
  --accent: #1167b1;
  --accent-2: #0f766e;
  --ok: #198754;
  --late: #c26a00;
  --warning: #d8a100;
  --critical: #c73535;
  --shadow: 0 8px 24px rgba(18, 38, 63, 0.08);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111827;
  --surface: #182235;
  --surface-2: #243044;
  --text: #f3f6fb;
  --muted: #a8b3c5;
  --line: #334155;
  --accent: #61a5fa;
  --accent-2: #2dd4bf;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button,
a.secondary-button {
  border: 0;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.secondary-button {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  gap: 0;
}

.collector-button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 14px;
  color: #fff;
}

.collector-button-fast {
  background: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 78%, #000);
}

.collector-button-full {
  background: var(--late);
  border-color: color-mix(in srgb, var(--late) 78%, #000);
}

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px 24px 76px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.brand-logo {
  display: block;
  object-fit: cover;
  border-radius: 50%;
  background: #d4d4d4;
}

.brand-logo-login {
  width: 168px;
  height: 168px;
  margin: 0 auto;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}

.brand-logo-sidebar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
}

.login-panel h1 {
  margin: 20px 0 22px;
  font-size: 24px;
  text-align: center;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  min-height: 40px;
  padding: 0 12px;
}

.login-panel label + label,
.login-panel button {
  margin-top: 14px;
}

.login-panel button {
  width: 100%;
}

.form-error {
  color: var(--critical);
  margin-bottom: 0;
}

.help-panel {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.help-panel strong {
  color: var(--text);
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.sidebar-brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  justify-content: flex-start;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  gap: 10px;
}

.nav-item.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

.nav-icon,
.button-icon,
.title-icon,
.label-icon,
.card-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  line-height: 1;
}

.nav-icon {
  width: 20px;
  color: var(--accent);
}

.nav-icon svg,
.title-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  padding: 22px;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

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

.topbar h1 {
  margin: 0;
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 17px;
}

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

.topbar-actions,
.toolbar,
.pagination,
.health-legend {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.detail-back-row {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.site-footer {
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  background: transparent;
  color: var(--muted);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
}

.site-footer strong {
  color: inherit;
  font-weight: 600;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
}

.app-footer {
  margin-top: auto;
  transform: translateY(22px);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.collector-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.collector-guide {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.collector-guide strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.collector-guide > span {
  color: var(--muted);
  line-height: 1.5;
}

.collector-guide-fast {
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--ok) 11%, var(--surface)) 0%, var(--surface) 75%);
}

.collector-guide-fast strong {
  color: var(--ok);
}

.collector-guide-full {
  border-color: color-mix(in srgb, var(--late) 38%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--late) 13%, var(--surface)) 0%, var(--surface) 75%);
}

.collector-guide-full strong {
  color: var(--late);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--line);
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.card-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--line);
  color: var(--text);
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
}

.stat-total,
.stat-idle {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface)) 0%, var(--surface) 72%);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.stat-total::before,
.stat-idle::before,
.stat-total .card-icon,
.stat-idle .card-icon {
  background: var(--accent);
  color: #fff;
}

.stat-ok {
  background: linear-gradient(135deg, color-mix(in srgb, var(--ok) 13%, var(--surface)) 0%, var(--surface) 72%);
  border-color: color-mix(in srgb, var(--ok) 34%, var(--line));
}

.stat-ok::before,
.stat-ok .card-icon {
  background: var(--ok);
  color: #fff;
}

.stat-late,
.stat-alert {
  background: linear-gradient(135deg, color-mix(in srgb, var(--late) 15%, var(--surface)) 0%, var(--surface) 72%);
  border-color: color-mix(in srgb, var(--late) 35%, var(--line));
}

.stat-late::before,
.stat-alert::before,
.stat-late .card-icon,
.stat-alert .card-icon {
  background: var(--late);
  color: #fff;
}

.stat-warning {
  background: linear-gradient(135deg, color-mix(in srgb, var(--warning) 17%, var(--surface)) 0%, var(--surface) 72%);
  border-color: color-mix(in srgb, var(--warning) 40%, var(--line));
}

.stat-warning::before,
.stat-warning .card-icon {
  background: var(--warning);
  color: #111827;
}

.stat-critical,
.stat-no-backup {
  background: linear-gradient(135deg, color-mix(in srgb, var(--critical) 13%, var(--surface)) 0%, var(--surface) 72%);
  border-color: color-mix(in srgb, var(--critical) 35%, var(--line));
}

.stat-critical::before,
.stat-no-backup::before,
.stat-critical .card-icon,
.stat-no-backup .card-icon {
  background: var(--critical);
  color: #fff;
}

.stat-running {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 15%, var(--surface)) 0%, var(--surface) 72%);
  border-color: color-mix(in srgb, var(--accent-2) 35%, var(--line));
}

.stat-running::before,
.stat-running .card-icon {
  background: var(--accent-2);
  color: #052e2b;
}

.content-band {
  margin-top: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.content-band h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.content-band p {
  margin: 0;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 6px;
}

.ok { background: var(--ok); }
.late { background: var(--late); }
.warning { background: var(--warning); }
.critical { background: var(--critical); }

.toolbar {
  margin-bottom: 14px;
}

.toolbar input {
  max-width: 360px;
}

.toolbar select {
  max-width: 240px;
}

.filter-summary {
  margin: -4px 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: var(--muted);
  background: var(--surface-2);
  user-select: none;
}

th[data-sort] {
  cursor: pointer;
}

.clients-table {
  min-width: 1020px;
}

.clients-table th,
.clients-table td {
  padding: 10px 7px;
}

.clients-table .size-cell {
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  min-width: 92px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  color: white;
}

.status-ok { background: var(--ok); }
.status-late_business { background: var(--late); }
.status-warning { background: var(--warning); color: #111827; }
.status-critical,
.status-no_backup { background: var(--critical); }

.alert-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff4d6;
  color: #7a4a00;
  border: 1px solid #edc56a;
  font-size: 12px;
  font-weight: 800;
}

[data-theme="dark"] .alert-chip {
  background: #3a2d13;
  color: #ffd98a;
  border-color: #7a5a18;
}

.muted-cell {
  color: var(--muted);
}

.file-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.health-bar {
  width: 94px;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.health-bar span {
  display: block;
  height: 100%;
  background: var(--accent-2);
}

.health-wrap {
  display: grid;
  gap: 5px;
  min-width: 110px;
}

.health-wrap small {
  color: var(--muted);
  font-size: 12px;
}

.row-action {
  min-height: 32px;
  padding: 0 10px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.pagination {
  justify-content: flex-end;
  margin-top: 14px;
}

.compact-label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.compact-label select {
  width: auto;
  min-width: 84px;
}

.page-jump-label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.page-jump-label input {
  width: 64px;
  min-height: 40px;
  padding: 0 7px;
  text-align: center;
}

.detail-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
}

.detail-panel,
.timeline,
.files-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.detail-panel h2,
.timeline h2,
.files-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.detail-note {
  margin: -2px 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

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

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

.metric-list span {
  color: var(--muted);
}

.metric-list strong {
  max-width: 58%;
  overflow-wrap: anywhere;
  text-align: right;
}

.health-explanation {
  --health-tone: var(--accent);
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--health-tone);
}

.health-explanation.health-positive {
  --health-tone: var(--ok);
}

.health-explanation.health-warning {
  --health-tone: var(--late);
}

.health-explanation.health-critical {
  --health-tone: var(--critical);
}

.health-explanation h3 {
  margin: 0 0 7px;
  color: var(--health-tone);
  font-size: 15px;
}

.health-explanation > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.health-score-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.health-score-line span {
  color: var(--muted);
}

.health-deductions {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 0;
  list-style: none;
}

.health-deductions li {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 7px;
  padding-left: 13px;
  font-size: 12px;
  line-height: 1.4;
}

.health-deductions li::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--late);
}

.health-deductions li.deduction-critical::before {
  background-color: var(--critical);
}

.health-deductions li.deduction-critical > strong {
  color: var(--critical);
}

.health-deductions li.deduction-warning > strong {
  color: var(--late);
}

.health-positive-message {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ok) !important;
  font-weight: 700;
}

.health-final-score {
  margin-top: 4px;
  border-bottom: 0;
  color: var(--health-tone);
  font-size: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item strong {
  display: block;
}

.files-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.files-base-path {
  margin: 0 0 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.compact-folders {
  display: grid;
  gap: 0;
}

.compact-folder {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  padding-bottom: 12px;
}

.compact-folder h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.compact-file-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.compact-file-row {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface);
  font-size: 13px;
}

.compact-file-row + .compact-file-row {
  border-top: 1px solid var(--line);
}

.compact-file-row time {
  color: var(--muted);
  white-space: nowrap;
}

.compact-file-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.compact-file-row > strong {
  white-space: nowrap;
}

.empty-row td {
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  max-width: 980px;
}

.settings-grid button {
  align-self: end;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.label-icon {
  width: 18px;
  color: var(--accent);
}

.about-page {
  display: grid;
  gap: 22px;
  width: min(1080px, 100%);
}

.about-brand {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 18px 4px 28px;
  border-bottom: 1px solid var(--line);
}

.about-brand img {
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.about-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.about-brand h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.about-brand p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.about-release {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid #d8a100;
  border-radius: 8px;
}

.about-release-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 12px;
}

.about-release-heading > div {
  display: grid;
  gap: 2px;
}

.about-release-heading span:not(.about-release-icon),
.about-version-grid span,
.about-company span {
  color: var(--muted);
  font-size: 13px;
}

.about-release-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ok) 15%, var(--surface));
  color: var(--ok);
  font-weight: 900;
}

.about-description {
  margin: 0;
  padding: 4px 20px 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.about-version-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.about-version-grid div {
  display: grid;
  gap: 5px;
  padding: 15px 20px;
}

.about-version-grid div + div {
  border-left: 1px solid var(--line);
}

.about-version-grid strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.about-company {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 4px 6px;
  border-top: 1px solid var(--line);
}

.about-company > div {
  display: grid;
  gap: 4px;
}

.schedule-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.schedule-stat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 116px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.schedule-stat-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 19px;
}

.schedule-stat div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.schedule-stat div > span,
.schedule-stat small {
  color: var(--muted);
}

.schedule-stat strong {
  font-size: 22px;
}

.schedule-stat small {
  line-height: 1.35;
}

.schedule-section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

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

.section-heading h2 {
  margin: 0;
  font-size: 19px;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.chart-container {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chart-layout {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
}

.chart-y-axis {
  display: grid;
  grid-template-columns: 16px 1fr;
  height: 262px;
  color: var(--muted);
  font-size: 11px;
}

.chart-y-axis .axis-title {
  align-self: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  font-weight: 700;
}

.chart-y-axis div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 224px;
  padding-top: 2px;
}

.chart-scroll {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-color: var(--line) transparent;
}

.chart-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.bar-chart {
  display: grid;
  align-items: end;
  height: 244px;
}

.hour-chart {
  grid-template-columns: repeat(24, minmax(34px, 1fr));
  min-width: 900px;
}

.quarter-chart {
  grid-template-columns: repeat(96, minmax(30px, 1fr));
  min-width: 3072px;
}

button.chart-column {
  display: grid;
  grid-template-rows: 22px 200px 22px;
  gap: 0;
  width: 100%;
  min-height: 0;
  height: 244px;
  padding: 0 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  white-space: nowrap;
}

button.chart-column:hover,
button.chart-column:focus-visible,
button.chart-column.is-selected {
  background: color-mix(in srgb, var(--hour-color, var(--accent)) 11%, transparent);
}

button.chart-column:focus-visible,
button.chart-column.is-selected {
  outline: 2px solid var(--hour-color, var(--accent));
  outline-offset: -2px;
}

.chart-column.is-dimmed,
.hour-legend-item.is-dimmed {
  opacity: 0.34;
}

.bar-value,
.bar-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  text-overflow: clip;
}

.bar-value {
  align-self: end;
  color: var(--text);
  font-weight: 700;
}

.bar-label {
  padding-top: 5px;
}

.bar-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 200px;
  border-bottom: 1px solid var(--line);
}

.chart-bar {
  display: block;
  width: min(24px, 72%);
  min-height: 0;
  background: var(--hour-color);
  border-radius: 3px 3px 0 0;
  transition: height 180ms ease, opacity 180ms ease;
}

.chart-x-label {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.hour-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

button.hour-legend-item {
  justify-content: flex-start;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.hour-legend-item i,
.schedule-client-group h3 i {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 3px;
  background: var(--hour-color);
}

button.hour-legend-item:hover,
button.hour-legend-item:focus-visible,
button.hour-legend-item.is-selected {
  border-color: var(--hour-color);
  box-shadow: inset 3px 0 0 var(--hour-color);
}

.schedule-client-heading {
  align-items: center;
}

.schedule-client-groups {
  display: grid;
  gap: 14px;
}

.schedule-client-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--hour-color);
  border-radius: 8px;
  background: var(--surface);
}

.schedule-client-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  color: var(--hour-color);
  font-size: 16px;
  border-bottom: 1px solid var(--line);
}

.schedule-client-group h3 span {
  font-size: 13px;
  font-weight: 600;
}

.schedule-client-group .table-wrap {
  border: 0;
  border-radius: 0;
}

.schedule-client-table {
  min-width: 760px;
}

button.client-name-button {
  justify-content: flex-start;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  text-align: left;
  white-space: normal;
}

button.client-name-button:hover,
button.client-name-button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    height: auto;
  }

  .sidebar,
  .workspace {
    padding: 16px;
  }

  .workspace {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .app-footer {
    transform: translateY(16px);
  }

  .sidebar nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .stat-grid,
  .collector-guide-grid,
  .detail-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .schedule-stats {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .topbar,
  .content-band {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .login-screen {
    padding: 16px 16px 88px;
  }

  .login-panel {
    padding: 22px;
  }

  .brand-logo-login {
    width: 140px;
    height: 140px;
  }

  .sidebar-brand {
    margin-bottom: 14px;
  }

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

  .schedule-stats {
    grid-template-columns: 1fr;
  }

  .about-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .about-brand h2 {
    font-size: 24px;
  }

  .about-version-grid {
    grid-template-columns: 1fr;
  }

  .about-version-grid div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .about-company {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading,
  .schedule-client-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-container {
    padding: 10px;
  }

  .chart-layout {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .pagination {
    justify-content: center;
  }

  .compact-file-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 10px;
  }

  .compact-file-row time {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .topbar-actions,
  .toolbar {
    width: 100%;
  }

  .topbar-actions > *,
  .toolbar > * {
    flex: 1 1 100%;
  }
}
