/* Given.lv saknes dashboard (:8000/) */
:root {
  --bg: #f6f3ee;
  --text: #211b16;
  --muted: #645a50;
  --accent: #8a6a43;
  --card-border: #eadfd4;
  --ok-bg: #dcfce7;
  --ok-fg: #166534;
  --bad-bg: #fee2e2;
  --bad-fg: #991b1b;
  --warn-bg: #fef3c7;
  --warn-fg: #92400e;
  --panel-bg: #fff;
  --content-max: 1280px;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

main {
  max-width: var(--content-max);
  margin: 40px auto 72px;
  padding: 0 28px;
}

.hero h1 {
  font-size: 2.1rem;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.lede {
  color: var(--muted);
  margin: 0 0 14px;
  max-width: 56rem;
  font-size: 1.02rem;
}

.summary-strip {
  margin: 0 0 24px;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  background: var(--panel-bg);
  border: 1px solid var(--card-border);
}

.summary-pill.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.summary-pill.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.summary-pill.bad { background: var(--bad-bg); color: var(--bad-fg); border-color: transparent; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  overflow-wrap: break-word;
  word-break: normal;
}

.panels-row {
  display: grid;
  gap: 22px;
  margin-bottom: 22px;
}

@media (min-width: 960px) {
  .panels-row {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 22px 26px 26px;
  box-shadow: 0 8px 24px rgba(33, 27, 22, 0.06);
}

.panel-links {
  margin-bottom: 0;
}

.panel h2 {
  font-size: 1.08rem;
  margin: 0;
  font-weight: 700;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.btn-refresh {
  font: inherit;
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.btn-refresh:hover {
  background: #ede8e0;
}

.btn-refresh:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.health-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 14px;
}

.health-table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.health-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: fixed;
}

.health-table th,
.health-table td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid #eee8df;
  vertical-align: top;
}

#health-table th:nth-child(1),
#health-table td:nth-child(1) {
  width: 26%;
}

#health-table th:nth-child(2),
#health-table td:nth-child(2) {
  width: 18%;
  white-space: nowrap;
}

#health-table th:nth-child(3),
#health-table td:nth-child(3) {
  width: 14%;
  white-space: nowrap;
}

#health-table th:nth-child(4),
#health-table td:nth-child(4) {
  width: 42%;
}

#schedules-table th:nth-child(1),
#schedules-table td:nth-child(1) {
  width: 28%;
}

#schedules-table th:nth-child(2),
#schedules-table td:nth-child(2) {
  width: 16%;
}

#schedules-table th:nth-child(3),
#schedules-table td:nth-child(3) {
  width: 18%;
}

#schedules-table th:nth-child(4),
#schedules-table td:nth-child(4) {
  width: 22%;
}

#schedules-table th:nth-child(5),
#schedules-table td:nth-child(5) {
  width: 16%;
  white-space: nowrap;
}

#schedules-table td .next-date,
#schedules-table td .next-time {
  display: block;
  line-height: 1.3;
}

#schedules-table td .next-time {
  color: var(--muted);
  font-size: 0.85rem;
}

.health-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: normal;
  line-height: 1.25;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.badge.bad {
  background: var(--bad-bg);
  color: var(--bad-fg);
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.health-table td:first-child {
  cursor: help;
}

.cell-process {
  display: block;
  font-weight: 600;
  line-height: 1.3;
}

.cell-process-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
  line-height: 1.4;
  max-width: none;
}

.health-note {
  font-size: 0.84rem;
  color: var(--muted);
  max-width: none;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.health-code {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.retention-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eee8df;
}

.retention-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 6px;
}

.retention-intro {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.4;
}

.retention-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
}

.retention-list li {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid #f3ede6;
}

.retention-list li:last-child {
  border-bottom: none;
}

.retention-list .ret-label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.retention-list .ret-value {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

.schedules-foot {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 14px 0 0;
  line-height: 1.45;
}

.badge.sched {
  background: #ede9fe;
  color: #5b21b6;
}

.badge.sched-off {
  background: #f1f5f9;
  color: #64748b;
}

.health-table .cron-expr {
  font-size: 0.88rem;
  line-height: 1.35;
  max-width: none;
  white-space: normal;
}

.schedules-table th,
.schedules-table td {
  padding: 11px 10px;
}


.schedules-table .cron-expr {
  font-family: inherit;
}

.grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

a.card {
  display: block;
  padding: 20px 20px;
  border-radius: 14px;
  background: #fffef9;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 14px rgba(33, 27, 22, 0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  min-height: 5.5rem;
}

a.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(33, 27, 22, 0.1);
  border-color: #d4c4b0;
}

a.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a.card.card-external .title::after {
  content: " ↗";
  font-size: 0.85em;
  opacity: 0.55;
}

a.card .title {
  font-weight: 700;
  font-size: 1.02rem;
}

a.card .hint {
  color: var(--accent);
  margin-top: 10px;
  line-height: 1.4;
  font-size: 0.88rem;
  overflow-wrap: break-word;
}
