:root {
  --bg: #f4f7f3;
  --panel: #ffffff;
  --ink: #16211f;
  --accent: #005f73;
  --accent-2: #0a9396;
  --line: #d7e1dd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, #e5f4ee 0, transparent 25%),
    linear-gradient(135deg, #f4f7f3 0%, #eef3f0 100%);
}

.topbar {
  padding: 1.5rem 1rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
}

.topbar h1 {
  margin: 0;
}

.topbar p {
  margin: 0.4rem 0 0;
}

.layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

input,
textarea,
button {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

textarea {
  font-family: ui-monospace, Consolas, monospace;
}

button {
  cursor: pointer;
  background: #fff;
}

button:hover {
  border-color: var(--accent);
}

.row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

ul {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

pre {
  white-space: pre-wrap;
  background: #f6f8f7;
  border: 1px dashed var(--line);
  padding: 0.7rem;
  border-radius: 8px;
}

.rec-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem;
  margin-bottom: 0.6rem;
}

.muted {
  color: #546a64;
  font-size: 0.9rem;
}

/* Health Bar */
.health-bar {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.health-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.health-label {
  font-size: 0.75rem;
  color: #546a64;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.health-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.health-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.health-fresh {
  background: #10b981;
  color: white;
}

.health-warning {
  background: #f59e0b;
  color: white;
}

.health-stale {
  background: #ef4444;
  color: white;
}

/* Alert Banner */
.alert-banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-banner.alert-error {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.alert-banner.alert-warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.alert-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.alert-message {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Run List Item Styling */
.run-item {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.25rem;
  border-left: 3px solid transparent;
}

.run-item-failed {
  background: #fef2f2;
  border-left-color: #ef4444;
  color: #7f1d1d;
}

.run-item-warning {
  background: #fffbeb;
  border-left-color: #f59e0b;
  color: #78350f;
}

/* Filter Bar */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-bar input,
.filter-bar select {
  width: 100%;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#storesTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#storesTable thead {
  background: var(--bg);
}

#storesTable th,
#storesTable td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

#storesTable th {
  font-weight: 600;
  color: var(--ink);
}

#storesTable tbody tr:last-child td {
  border-bottom: none;
}

#storesTable tbody tr:hover {
  background: var(--bg);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.pagination button {
  width: auto;
  padding: 0.5rem 1rem;
}

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

#pageInfo {
  font-size: 0.9rem;
  color: #546a64;
}
