/* EOSC Node Slovakia - monitoring portal styles. No build step, no dependencies. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1c2128;
  --muted: #6a737d;
  --accent: #0b5fff;
  --ok: #2f9e44;
  --warning: #f08c00;
  --critical: #e03131;
  --downtime: #7048e8;
  --unknown: #adb5bd;
  --missing: #ced4da;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  /* Light theme only - the OS dark-mode preference is deliberately ignored. */
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* Header ------------------------------------------------------------------ */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-sub {
  display: inline-flex; align-items: center; gap: 8px;
  padding-left: 14px; border-left: 1px solid var(--border);
  font-weight: 500; color: var(--muted); font-size: .9rem; white-space: nowrap;
}
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(47, 158, 68, .18); flex-shrink: 0; }
@media (max-width: 640px) { .brand-sub { display: none; } .brand-logo { height: 28px; } }
.topbar nav { display: flex; gap: 6px; }
.topbar nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); }
.topbar nav a:hover { background: var(--bg); text-decoration: none; }
.topbar nav a.on { background: var(--bg); color: var(--text); font-weight: 600; }

main.wrap { padding-top: 22px; padding-bottom: 32px; }
h1 { font-size: 1.45rem; margin: 0 0 6px; }
h2 { font-size: 1.1rem; margin: 0 0 4px; }
h3 { font-size: 1rem; margin: 0 0 12px; }
.crumbs { margin: 0 0 14px; font-size: .9rem; }

/* Hero -------------------------------------------------------------------- */
.hero {
  display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--unknown);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px;
}
.hero.st-ok { border-left-color: var(--ok); }
.hero.st-warning { border-left-color: var(--warning); }
.hero.st-critical { border-left-color: var(--critical); }
.hero.st-downtime { border-left-color: var(--downtime); }
.hero-metrics { display: flex; gap: 26px; }
.hero-metrics span { display: block; font-size: 1.35rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.hero-metrics label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }

/* Cards ------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px;
}
.card.narrow { max-width: 460px; }
.card.empty { text-align: center; padding: 40px 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }

.service header { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.service header p { margin: 4px 0 0; }
.service h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.service footer { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: .87rem; margin-top: 10px; }
dl.metrics { display: flex; gap: 22px; margin: 0; }
dl.metrics dt { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
dl.metrics dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Status pills and the daily uptime bar ------------------------------------ */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem;
  font-weight: 700; letter-spacing: .03em; color: #fff; background: var(--unknown);
}
.badge.st-ok { background: var(--ok); }
.badge.st-warning { background: var(--warning); }
.badge.st-critical { background: var(--critical); }
.badge.st-downtime { background: var(--downtime); }
.badge.st-unknown { background: var(--unknown); }
.badge.st-missing { background: var(--missing); color: #3b4148; }
.badge.st-paused { background: var(--muted); }

.uptime-bar { display: flex; gap: 2px; margin: 14px 0 4px; }
.uptime-bar i { flex: 1 1 4px; height: 26px; border-radius: 3px; background: var(--missing); min-width: 3px; }
.uptime-bar.tall i { height: 40px; }
.uptime-bar i.st-ok { background: var(--ok); }
.uptime-bar i.st-warning { background: var(--warning); }
.uptime-bar i.st-critical { background: var(--critical); }
.uptime-bar i.st-downtime { background: var(--downtime); }
.uptime-bar i.st-unknown { background: var(--unknown); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.periods { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.periods a { padding: 4px 10px; border-radius: 6px; color: var(--muted); font-size: .88rem; }
.periods a.on { background: var(--accent); color: #fff; }
.legend { display: flex; gap: 12px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--unknown); display: inline-block; }
.legend i.st-ok { background: var(--ok); }
.legend i.st-warning { background: var(--warning); }
.legend i.st-critical { background: var(--critical); }
.legend i.st-downtime { background: var(--downtime); }

/* Tables ------------------------------------------------------------------ */
table { width: 100%; border-collapse: collapse; }
table.kv th { text-align: left; color: var(--muted); font-weight: 500; width: 46%; padding: 6px 8px 6px 0; vertical-align: top; }
table.kv td { padding: 6px 0; }
table.list { font-size: .9rem; }
table.list th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--border); }
table.list td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
td.msg { color: var(--muted); max-width: 380px; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Forms ------------------------------------------------------------------- */
button, .button {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px;
  font: inherit; font-weight: 600; cursor: pointer;
}
button:hover, .button:hover { filter: brightness(1.06); text-decoration: none; }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 500; }
button.link.danger { color: var(--critical); }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; }
label { display: block; margin-bottom: 12px; font-size: .88rem; font-weight: 600; }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: 3px; }
label input, label select { margin-top: 5px; font-weight: 400; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 16px; }
legend { padding: 0 6px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 18px; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.inline-form label { margin-bottom: 0; }

.alert { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); margin: 0 0 16px; }
.alert.ok { background: rgba(47, 158, 68, .12); border-color: rgba(47, 158, 68, .4); }
.alert.warn { background: rgba(240, 140, 0, .12); border-color: rgba(240, 140, 0, .4); }
.alert.error { background: rgba(224, 49, 49, .12); border-color: rgba(224, 49, 49, .4); }
.alert ul { margin: 0; padding-left: 18px; }
.token { word-break: break-all; }

.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: .9rem; }

pre { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
.foot { padding: 18px 16px 40px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--border); }
.foot p { margin: 4px 0; }

@media (max-width: 640px) {
  .hero-metrics { gap: 16px; }
  dl.metrics { gap: 14px; }
  table.list { font-size: .84rem; }
}

/* Highlight a card whose status just changed during a background refresh. */
.card.flash { animation: flash 1.2s ease-out; }
@keyframes flash {
  from { box-shadow: 0 0 0 3px rgba(11, 95, 255, .35); }
  to   { box-shadow: var(--shadow); }
}

/* Long history tables stay inside the card. */
.scroll-y { max-height: 440px; overflow-y: auto; }
.scroll-y thead th { position: sticky; top: 0; background: var(--surface); }
