:root {
  --bg: #f3f0ea;
  --panel: #fffcf5;
  --ink: #1c1f20;
  --muted: #5a6466;
  --border: #d7d1c4;
  --accent: #124c43;
  --accent-2: #d47a2c;
  --shadow: 0 10px 30px rgba(28, 31, 32, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(212, 122, 44, 0.14), transparent 30%),
    linear-gradient(180deg, #f7f3eb 0%, var(--bg) 100%);
}

.page {
  width: calc(100vw - 24px);
  max-width: none;
  margin: 12px auto 40px;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--accent-2);
  font-weight: 700;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1;
}

.subtitle {
  max-width: 72ch;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

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

.summary-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.summary-card {
  padding: 18px;
}

.summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.summary-card strong {
  font-size: 26px;
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 22px;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
}

.refresh-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.asset-type-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.status-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: 14px;
  background: #faf5e8;
  color: var(--muted);
  border: 1px solid #ead8b6;
}

.status-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.status-header strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.status-detail {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge.is-idle {
  background: rgba(90, 100, 102, 0.12);
  color: var(--muted);
}

.status-badge.is-running {
  background: rgba(18, 76, 67, 0.14);
  color: var(--accent);
}

.status-badge.is-done {
  background: rgba(212, 122, 44, 0.16);
  color: #8a4b14;
}

.status-badge.is-error {
  background: rgba(173, 47, 47, 0.14);
  color: #8d2d2d;
}

.progress-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.progress-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(215, 209, 196, 0.9);
}

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

.progress-meta span {
  color: var(--muted);
  font-size: 13px;
}

.progress-meta strong {
  color: var(--ink);
  font-size: 14px;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(28, 31, 32, 0.08);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1e6b5f 0%, #124c43 100%);
  transition: width 0.25s ease;
}

.progress-fill.is-accent {
  background: linear-gradient(90deg, #e0a548 0%, #d47a2c 100%);
}

.refresh-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(215, 209, 196, 0.9);
}

.metric-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  color: var(--ink);
  font-size: 15px;
}

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

.filters-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filters-grid span {
  font-size: 13px;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
}

select[multiple] {
  min-height: 94px;
}

.checkbox-row {
  flex-direction: row !important;
  align-items: center;
  align-self: end;
  gap: 10px !important;
  padding-top: 24px;
}

.filter-actions {
  display: flex;
  gap: 10px;
  align-self: end;
  grid-column: span 2;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--border);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.table-wrap {
  overflow-x: visible;
}

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

thead th {
  padding: 10px 8px;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  vertical-align: bottom;
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.sort-header:hover:not(:disabled) {
  transform: none;
  color: var(--ink);
}

.sort-header:focus-visible {
  outline: 2px solid rgba(18, 76, 67, 0.28);
  outline-offset: 4px;
  border-radius: 999px;
}

.sort-header .sort-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(215, 209, 196, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sort-header.is-active {
  color: var(--ink);
}

.sort-header.is-active .sort-indicator {
  border-color: rgba(18, 76, 67, 0.16);
  background: rgba(18, 76, 67, 0.12);
  color: var(--accent);
}

.sort-header.is-active[data-sort-dir="desc"] .sort-indicator {
  border-color: rgba(212, 122, 44, 0.22);
  background: rgba(212, 122, 44, 0.16);
  color: #8a4b14;
}

tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #ece7dc;
  vertical-align: top;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

tbody tr:nth-child(even) {
  background: rgba(18, 76, 67, 0.03);
}

thead th:nth-child(5),
tbody td:nth-child(5) {
  width: 96px;
}

thead th:nth-child(6),
tbody td:nth-child(6) {
  width: 84px;
}

thead th:nth-child(7),
tbody td:nth-child(7) {
  width: 96px;
}

thead th:nth-child(14),
tbody td:nth-child(14) {
  width: 88px;
}

thead th:nth-child(15),
tbody td:nth-child(15) {
  width: 110px;
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--panel);
  box-shadow: -8px 0 16px rgba(28, 31, 32, 0.08);
}

thead th:nth-child(15) {
  z-index: 3;
}

tbody tr:nth-child(even) td:nth-child(15) {
  background: #f7f5ef;
}

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

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 28px;
}

.type-badge,
.status-active,
.status-inactive {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.type-badge {
  background: rgba(18, 76, 67, 0.12);
  color: var(--accent);
}

.status-active {
  background: rgba(18, 76, 67, 0.12);
  color: var(--accent);
}

.status-inactive {
  background: rgba(173, 47, 47, 0.12);
  color: #8d2d2d;
}

.table-link-button {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(18, 76, 67, 0.18);
  background: rgba(18, 76, 67, 0.08);
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.table-link-button:hover:not(:disabled) {
  transform: none;
  background: rgba(18, 76, 67, 0.14);
}

@media (max-width: 1200px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .page {
    width: min(100vw - 20px, 100%);
    margin: 16px auto 32px;
  }

  .panel,
  .summary-card {
    border-radius: 16px;
  }

  .status-header,
  .progress-meta {
    flex-direction: column;
    align-items: start;
  }

  .progress-group,
  .refresh-metrics {
    grid-template-columns: 1fr;
  }

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

  .filter-actions {
    grid-column: auto;
    flex-direction: column;
  }

  .pagination-bar {
    justify-content: space-between;
  }
}
