/* LOCURA Status - brand: warm cream bg, navy/blue, Inter. Zero em-dash. */
:root {
  --bg: #E7E2D2;
  --card: #EFEADD;
  --card-2: #F2EEE3;
  --fg: #2C2518;
  --muted: #6B6254;
  --navy: #011423;
  --blue: #0A5899;
  --border: rgba(1, 20, 35, 0.10);
  --ring: rgba(1, 20, 35, 0.06);
  --up: #16A34A;
  --up-text: #15803D;
  --degraded: #F59E0B;
  --degraded-text: #B45309;
  --down: #DC2626;
  --down-text: #B91C1C;
  --none: #CBC4B2;
  --radius: 10px;
  --radius-lg: 14px;
  --maxw: 880px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Topbar */
.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(239, 234, 221, 0.6);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 34px; width: auto; display: block; }
.brand .titles { display: flex; flex-direction: column; line-height: 1.1; }
.brand .titles strong { color: var(--navy); font-weight: 800; font-size: 16px; letter-spacing: 0.2px; }
.brand .titles span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.topbar nav { display: flex; gap: 18px; font-size: 14px; font-weight: 500; }
.topbar nav a { color: var(--navy); }

/* Hero / overall banner */
.hero { margin: 28px 0 8px; }
.banner {
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 1px 0 var(--ring), 0 1px 3px rgba(1,20,35,0.04);
  border: 1px solid var(--border);
}
.banner .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.banner .icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.banner h1 { margin: 0; font-size: 21px; font-weight: 700; color: var(--navy); }
.banner p { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.banner.is-operational { background: linear-gradient(180deg, #EAF6EE, #E8F3EC); border-color: rgba(22,163,74,0.28); }
.banner.is-operational .icon { background: rgba(22,163,74,0.14); color: var(--up-text); }
.banner.is-degraded { background: linear-gradient(180deg, #FBF2DF, #F8EFD8); border-color: rgba(245,158,11,0.30); }
.banner.is-degraded .icon { background: rgba(245,158,11,0.16); color: var(--degraded-text); }
.banner.is-major_outage { background: linear-gradient(180deg, #FCEAEA, #F9E4E4); border-color: rgba(220,38,38,0.30); }
.banner.is-major_outage .icon { background: rgba(220,38,38,0.14); color: var(--down-text); }
.banner .icon svg { width: 24px; height: 24px; }

/* Group sections */
.section { margin-top: 26px; }
.section > h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 600; margin: 0 0 10px 4px;
}
.group-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 var(--ring);
  overflow: hidden;
}
.svc { padding: 16px 20px; border-top: 1px solid var(--border); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .12s; }
.svc:first-child { border-top: none; }
.svc:hover { background: var(--card-2); }
.svc:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.svc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.svc-head-l { min-width: 0; }
.svc-head-r { display: flex; align-items: center; gap: 12px; flex: none; }
.chev { display: inline-flex; color: var(--muted); transition: transform .2s ease; }
.chev svg { width: 16px; height: 16px; }
.svc.is-open .chev { transform: rotate(180deg); }
.svc-name { font-weight: 600; color: var(--navy); font-size: 15.5px; }
.svc-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill .pdot { width: 9px; height: 9px; border-radius: 50%; }
.pill.up { color: var(--up-text); } .pill.up .pdot { background: var(--up); }
.pill.degraded { color: var(--degraded-text); } .pill.degraded .pdot { background: var(--degraded); }
.pill.down { color: var(--down-text); } .pill.down .pdot { background: var(--down); }

/* 90-day history bar */
.history { margin-top: 12px; }
.bars { display: flex; gap: 2px; align-items: stretch; height: 34px; }
.bars .bar { flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--none); transition: opacity .12s; }
.bars .bar.operational { background: var(--up); }
.bars .bar.partial { background: var(--degraded); }
.bars .bar.major { background: var(--down); }
.bars .bar.none { background: var(--none); opacity: .55; }
.bars .bar:hover { opacity: .7; }
.history-legend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.history-legend .mid { font-weight: 600; color: var(--fg); }

/* Rozwijane szczegoly uslugi (klik w usluge) */
.svc-detail-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.svc.is-open .svc-detail-wrap { grid-template-rows: 1fr; }
.svc-detail { overflow: hidden; min-height: 0; }
.svc.is-open .svc-detail { padding-top: 16px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metric { background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 8px; text-align: center; }
.m-val { display: block; font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.m-lab { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.detail-rows { margin-top: 14px; }
.drow { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 13px; }
.drow:first-child { border-top: none; }
.drow-k { color: var(--muted); }
.drow-v { color: var(--fg); font-weight: 600; text-align: right; }
.detail-inc { margin-top: 14px; }
.detail-inc-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.detail-inc-empty { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.detail-inc-empty svg { width: 16px; height: 16px; color: var(--up-text); flex: none; }
.d-inc { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.d-inc + .d-inc { border-top: 1px solid var(--border); }
.d-inc-mark { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.d-inc.down .d-inc-mark { background: var(--down); }
.d-inc.degraded .d-inc-mark { background: var(--degraded); }
.d-inc-txt { flex: 1; color: var(--muted); min-width: 0; }
.d-inc-txt strong { color: var(--navy); font-weight: 600; }

/* Incidents */
.incidents .group-card { padding: 4px 0; }
.inc { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 14px; align-items: flex-start; }
.inc:first-child { border-top: none; }
.inc .bar-mark { width: 4px; align-self: stretch; border-radius: 3px; flex: none; }
.inc.down .bar-mark { background: var(--down); }
.inc.degraded .bar-mark { background: var(--degraded); }
.inc .inc-body { flex: 1; }
.inc .inc-title { font-weight: 600; color: var(--navy); font-size: 14.5px; }
.inc .inc-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.inc-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.inc-badge.active { background: rgba(220,38,38,0.12); color: var(--down-text); }
.inc-badge.resolved { background: rgba(22,163,74,0.12); color: var(--up-text); }
.empty { padding: 22px 20px; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.empty svg { width: 18px; height: 18px; color: var(--up-text); flex: none; }

/* Footer */
footer { margin: 40px 0 48px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
footer .frow { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; justify-content: space-between; }
footer .links a { color: var(--navy); margin-right: 16px; font-weight: 500; }
footer .note { margin-top: 10px; font-size: 12px; max-width: 620px; }

.updated { display: inline-flex; align-items: center; gap: 7px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(22,163,74,0.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,0.45);} 70%{ box-shadow: 0 0 0 7px rgba(22,163,74,0);} 100%{ box-shadow:0 0 0 0 rgba(22,163,74,0);} }

.stale { color: var(--degraded-text); }

@media (max-width: 560px) {
  .banner h1 { font-size: 18px; }
  .topbar nav { display: none; }
  .svc-head { flex-wrap: wrap; }
  .bars { height: 30px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  .svc-detail-wrap, .chev { transition: none; }
}
