:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f8fa;
  color: #1f2933;
}

body {
  margin: 0;
}

.app-header {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #d8dee6;
  display: flex;
  gap: 20px;
  justify-content: flex-start;
  padding: 14px 24px;
  flex-wrap: wrap;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

main {
  display: grid;
  gap: 20px;
  padding: 24px;
}

.brand {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.brand-logo {
  border-radius: 6px;
  display: block;
  height: 40px;
  object-fit: cover;
  width: 40px;
}

.top-nav {
  display: flex;
  flex: 1 1 auto;
  gap: 4px;
  min-width: 260px;
}

.top-nav a {
  border-radius: 6px;
  color: #52606d;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
  text-decoration: none;
}

.top-nav a:hover {
  background: #f1f5f9;
  color: #1f2933;
}

.top-nav a.active {
  background: #e8f0fe;
  color: #174ea6;
}

.header-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  margin-left: auto;
}

.utility-nav-link {
  border-radius: 6px;
  color: #52606d;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
  text-decoration: none;
}

.utility-nav-link:hover {
  background: #f1f5f9;
  color: #1f2933;
}

.utility-nav-link.active {
  background: #e8f0fe;
  color: #174ea6;
}

.sub-nav {
  background: #ffffff;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px;
}

.sub-nav a {
  border-radius: 6px;
  color: #52606d;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
  text-decoration: none;
}

.sub-nav a:hover {
  background: #f1f5f9;
  color: #1f2933;
}

.sub-nav a.active {
  background: #ecfdf5;
  color: #047857;
}

.user-label {
  color: #52606d;
  flex: 0 0 auto;
  font-size: 14px;
}

section {
  background: #ffffff;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}

.jobs-backfill-section {
  overflow: visible;
  position: relative;
  z-index: 2;
}

.notice {
  border-color: #d97706;
  background: #fff7ed;
}

.notice p {
  color: #7c2d12;
  font-size: 13px;
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.empty-state {
  color: #52606d;
  font-size: 14px;
  margin: 0;
}

.screen-description {
  color: #52606d;
  font-size: 14px;
  line-height: 1.45;
  margin: -4px 0 14px;
  max-width: 760px;
}

.readme-content {
  color: #1f2933;
  font-size: 14px;
  line-height: 1.55;
  max-width: 980px;
}

.readme-content h2 {
  border-bottom: 1px solid #e5e9f0;
  font-size: 22px;
  margin: 24px 0 12px;
  padding-bottom: 8px;
}

.readme-content h3 {
  font-size: 18px;
  margin: 22px 0 10px;
}

.readme-content h4 {
  font-size: 15px;
  margin: 18px 0 8px;
}

.readme-content p {
  margin: 0 0 12px;
}

.readme-content ul {
  margin: 0 0 14px 20px;
  padding: 0;
}

.readme-content li {
  margin: 4px 0;
}

.readme-content code {
  background: #f1f5f9;
  border-radius: 4px;
  color: #334155;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  padding: 2px 4px;
}

.readme-content pre {
  background: #111827;
  border-radius: 8px;
  color: #e5e7eb;
  margin: 0 0 16px;
  overflow-x: auto;
  padding: 12px;
}

.readme-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.kpi-description {
  border: 1px solid #e5e9f0;
  border-radius: 8px;
  color: #52606d;
  display: grid;
  font-size: 13px;
  gap: 0;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  line-height: 1.4;
  margin: -4px 0 14px;
  overflow: hidden;
}

.kpi-description div {
  border-bottom: 1px solid #e5e9f0;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.kpi-description div:nth-child(odd) {
  border-right: 1px solid #e5e9f0;
}

.kpi-description div:nth-last-child(-n + 1) {
  border-bottom: 0;
}

.kpi-description dt {
  align-self: start;
  background: #ecfdf5;
  border-radius: 4px;
  color: #047857;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 6px;
  text-decoration: underline;
  width: fit-content;
}

.kpi-description dd {
  margin: 0;
}

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

.summary-card {
  border: 1px solid #d8dee6;
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 8px;
  padding: 14px;
  text-decoration: none;
}

.summary-card:hover {
  border-color: #9fb3c8;
  background: #f8fafc;
}

.summary-card span {
  color: #52606d;
  font-size: 13px;
  font-weight: 600;
}

.summary-card strong,
.summary-strip strong {
  font-size: 28px;
  line-height: 1;
}

.metric-pair,
.metric-row > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

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

.summary-card small,
.summary-strip small {
  color: #52606d;
  font-size: 12px;
  line-height: 1.35;
}

.summary-strip {
  background: #f8fafc;
  border: 1px solid #e5e9f0;
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 12px;
}

.table-filters {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-field {
  display: grid;
  flex: 0 0 auto;
  gap: 4px;
}

.filter-field-project,
.filter-field-issue,
.filter-field-person,
.filter-field-priority,
.filter-field-sort,
.filter-field-date {
  width: 220px;
}

.filter-field-size {
  width: 96px;
}

.checkbox-dropdown {
  position: relative;
}

.checkbox-dropdown-trigger {
  align-items: center;
  background: #174ea6;
  border: 1px solid #174ea6;
  border-radius: 6px;
  box-sizing: border-box;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 14px;
  height: 36px;
  justify-content: space-between;
  padding: 6px 8px;
  text-align: left;
  width: 100%;
}

.checkbox-dropdown-trigger::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #ffffff;
  content: "";
  flex: 0 0 auto;
  margin-left: 8px;
}

.table-filters .checkbox-dropdown-trigger span {
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkbox-dropdown-panel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
  display: none;
  left: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1000;
}

.checkbox-dropdown.open .checkbox-dropdown-panel {
  display: grid;
  gap: 2px;
}

.checkbox-dropdown-option {
  align-items: center;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  padding: 7px 8px;
}

.checkbox-dropdown-option:hover {
  background: #f1f5f9;
}

.checkbox-dropdown-select-all {
  border-bottom: 1px solid #e5e9f0;
  border-radius: 4px 4px 0 0;
  margin-bottom: 4px;
  padding-bottom: 9px;
}

.table-filters .checkbox-dropdown-option span {
  color: #1f2933;
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 400;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-filters .checkbox-dropdown-select-all span {
  font-weight: 600;
}

.table-filters span {
  color: #52606d;
  font-size: 12px;
  font-weight: 600;
}

.table-filters input,
.table-filters select {
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #1f2933;
  font: inherit;
  font-size: 14px;
  height: 36px;
  padding: 6px 8px;
  width: 100%;
}

.table-filters .checkbox-dropdown-option input[type="checkbox"] {
  flex: 0 0 auto;
  height: 14px;
  margin: 0;
  padding: 0;
  width: 14px;
}

.table-filters button {
  background: #174ea6;
  border: 1px solid #174ea6;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  height: 36px;
  padding: 6px 12px;
  min-width: 84px;
}

.pagination {
  align-items: center;
  color: #52606d;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
  margin-top: 12px;
}

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

.pagination a,
.pagination .disabled {
  border: 1px solid #d8dee6;
  border-radius: 6px;
  color: #1f2933;
  padding: 6px 9px;
  text-decoration: none;
}

.pagination .disabled {
  color: #9aa5b1;
}

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

.config-form label {
  display: grid;
  gap: 6px;
}

.config-form label span {
  color: #52606d;
  font-size: 13px;
  font-weight: 600;
}

.config-form textarea,
.mapping-input {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box;
  color: #1f2933;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  width: 100%;
}

.config-form textarea:disabled,
.mapping-input:disabled {
  background: #f8fafc;
  color: #52606d;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.form-actions button {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  min-height: 36px;
  padding: 6px 12px;
}

.form-actions button[type="submit"] {
  background: #174ea6;
  border-color: #174ea6;
  color: #ffffff;
}

.form-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.inline-form {
  display: inline-flex;
  margin: 2px 6px 2px 0;
}

.inline-form button {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 6px 9px;
}

table {
  border-collapse: collapse;
  font-size: 14px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e5e9f0;
  padding: 9px 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #52606d;
  font-weight: 600;
}

.cell-warning,
.row-warning td {
  background: #fde2e2;
}

.cell-warning {
  font-weight: 600;
}

.row-warning td:first-child {
  box-shadow: inset 3px 0 0 #fca5a5;
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
  }

  .top-nav {
    order: 3;
    width: 100%;
  }

  .filter-field,
  .filter-button {
    width: 100%;
  }

  .kpi-description {
    grid-template-columns: 1fr;
  }

  .kpi-description div,
  .kpi-description div:nth-child(odd) {
    border-right: 0;
  }

  .kpi-description div:nth-last-child(2) {
    border-bottom: 1px solid #e5e9f0;
  }
}
