:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f6fa;
  color: #020817;
  --background: #f3f6fa;
  --card: #ffffff;
  --card-foreground: #020817;
  --muted: #64748b;
  --border: #d8e0ea;
  --input: #c9d6e8;
  --primary: #2563eb;
  --primary-foreground: #ffffff;
  --success: #059669;
  --success-bg: #dcfce7;
  --success-border: #86efac;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-border: #fecaca;
  --ring: rgba(37, 99, 235, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.08), transparent 26rem),
    var(--background);
  margin: 0;
}

.shell {
  width: min(1232px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.header-shell {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 82px;
}

.page-shell {
  padding: 32px 0 56px;
}

.eyebrow {
  color: #42669d;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  margin: 0 0 8px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--card-foreground);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
}

h2 {
  color: var(--card-foreground);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.status-pill {
  align-items: center;
  background: #eef2f7;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  color: #475569;
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  min-height: 42px;
  padding: 0 18px;
}

.status-pill[data-status="completed"] {
  background: #dffbef;
  border-color: #a7f3d0;
  color: #047857;
}

.status-pill[data-status="running"],
.status-pill[data-status="queued"] {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.status-pill[data-status="failed"] {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.panel,
.progress-grid > div,
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1), 0 1px 2px rgba(15, 23, 42, 0.06);
}

.filter-panel {
  overflow: hidden;
  padding: 0;
}

.filter-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 104px;
  padding: 24px;
}

.filter-title-group {
  align-items: center;
  display: flex;
  gap: 12px;
}

.filter-title-group p {
  color: #42669d;
  font-size: 13px;
  font-weight: 500;
  margin-top: 3px;
}

.filter-icon-tile {
  align-items: center;
  background: #eff6ff;
  border-radius: 8px;
  color: var(--primary);
  display: inline-flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.filter-icon-tile svg {
  height: 20px;
  width: 20px;
}

.filter-chevron {
  color: #8aa0bf;
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.preferences {
  border-top: 1px solid #e8eef6;
  display: grid;
  gap: 18px 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 26px 24px 24px;
}

.search-field {
  grid-column: 1 / -1;
}

label {
  color: #0f2344;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 9px;
}

select,
input,
button,
.input-shell {
  border: 1px solid var(--input);
  border-radius: 8px;
  font: inherit;
  min-height: 45px;
}

select,
input {
  background: #ffffff;
  color: #020817;
  font-weight: 400;
  outline: none;
  padding: 0 20px;
  width: 100%;
}

select:focus,
input:focus,
.input-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.input-shell {
  align-items: center;
  background: #ffffff;
  display: flex;
  min-height: 56px;
  padding: 0 16px;
}

.input-shell svg {
  color: #8aa0bf;
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.input-shell input {
  border: 0;
  min-height: 54px;
  padding: 0 0 0 14px;
}

.input-shell input:focus {
  box-shadow: none;
}

input::placeholder {
  color: #8aa0bf;
}

button {
  align-items: center;
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  gap: 10px;
  grid-column: 1 / -1;
  justify-content: center;
  margin-top: 6px;
  padding: 0 18px;
  min-height: 52px;
}

button svg {
  height: 18px;
  width: 18px;
}

button:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

button:disabled {
  background: #93a4bd;
  border-color: #93a4bd;
  cursor: not-allowed;
}

.progress-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.08fr repeat(3, 1fr);
  margin: 24px 0;
}

.progress-grid > div {
  display: grid;
  gap: 9px;
  min-height: 98px;
  padding: 22px 20px;
}

.metric-label {
  align-items: center;
  color: #496282;
  display: inline-flex;
  font-size: 13px;
  font-weight: 500;
  gap: 8px;
}

.metric-label svg {
  color: var(--primary);
  height: 16px;
  width: 16px;
}

.progress-grid > div:nth-child(3) .metric-label svg {
  color: #059669;
}

.progress-grid > div:nth-child(4) .metric-label svg {
  color: #7c3aed;
}

.progress-grid strong {
  color: #020817;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.1;
}

#progress-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

.table-heading {
  padding: 26px 24px 22px;
}

.table-heading p {
  color: #42669d;
  font-size: 14px;
  margin-top: 7px;
}

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

table[data-mode="packages"] {
  min-width: 1480px;
}

table[data-mode="lpse"] {
  min-width: 1060px;
}

th,
td {
  border-top: 1px solid #dfe7f1;
  font-size: 13px;
  padding: 18px 24px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: #32435e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  color: #020817;
  line-height: 1.5;
}

td a {
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.badge {
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  min-height: 27px;
  padding: 0 10px;
}

.badge-type {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.badge-muted {
  background: #f1f5f9;
  border-color: #dbe3ee;
  color: #475569;
}

.server-cell {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.server-cell svg {
  color: #059669;
  height: 17px;
  width: 17px;
}

.server-cell.offline svg {
  color: #dc2626;
}

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

.pagination-bar {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid #dfe7f1;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-width: 1060px;
  padding: 16px 24px;
}

.pagination-bar[hidden] {
  display: none;
}

table[data-mode="packages"] + .pagination-bar {
  min-width: 1480px;
}

table[data-mode="lpse"] + .pagination-bar {
  min-width: 1060px;
}

.pagination-summary,
#pagination-label {
  color: #496282;
  font-size: 13px;
  font-weight: 500;
}

.pagination-controls {
  align-items: center;
  display: flex;
  gap: 10px;
}

.pagination-controls button {
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 auto;
  grid-column: auto;
  height: 36px;
  justify-content: center;
  margin: 0;
  min-height: 36px;
  padding: 0;
  width: 36px;
}

.pagination-controls button svg {
  height: 17px;
  width: 17px;
}

.page-size-label {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.page-size-label select {
  min-height: 36px;
  padding: 0 34px 0 12px;
  width: auto;
}

@media (max-width: 980px) {
  .preferences {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .progress-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 28px, 1232px);
  }

  .header-shell {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 18px 0;
  }

  .filter-panel {
    padding: 0;
  }

  .filter-header {
    min-height: auto;
    padding: 20px;
  }

  .preferences {
    padding: 22px 20px 20px;
  }

  .preferences,
  .progress-grid {
    grid-template-columns: 1fr;
  }

  .progress-grid > div:first-child {
    grid-column: auto;
  }

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