/* Servionis Status – Aurora / Glass Theme */
:root {
  --bg: #05070d;
  --bg-elev: rgba(20, 26, 42, 0.55);
  --bg-elev-2: rgba(28, 36, 56, 0.65);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2fb;
  --muted: #94a0bd;
  --accent: #10b981;
  --accent-2: #34d399;
  --warn: #f59e0b;
  --down: #ef4444;
  --up: #10b981;
  --degraded: #f59e0b;
  --unknown: #64748b;
  --none: rgba(255, 255, 255, 0.06);
  --primary: #3b82f6;
  --danger: #ef4444;
  --aurora-1: #5eead4;   /* teal */
  --aurora-2: #a78bfa;   /* violet */
  --aurora-3: #38bdf8;   /* sky */
  --aurora-4: #f472b6;   /* pink */
  --aurora-5: #34d399;   /* emerald */
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.35);
  --blur: 22px;
  --font: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,sans-serif;
}
* { box-sizing: border-box }
html,body {
  color: var(--text); font-family: var(--font); margin: 0; padding: 0; min-height: 100vh;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ===== Aurora background (fixed, behind everything) ===== */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 12% 8%,  rgba(94, 234, 212, 0.28), transparent 60%),
    radial-gradient(ellipse 70% 55% at 88% 12%, rgba(167, 139, 250, 0.32), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(56, 189, 248, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 40% at 78% 78%, rgba(244, 114, 182, 0.18), transparent 65%),
    radial-gradient(ellipse 60% 40% at 18% 78%, rgba(52, 211, 153, 0.18), transparent 65%),
    linear-gradient(180deg, #060912 0%, #05070d 100%);
  filter: saturate(1.1);
  animation: auroraShift 28s ease-in-out infinite alternate;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: .35;
  mix-blend-mode: overlay;
}
@keyframes auroraShift {
  0%   { background-position: 0% 0%, 100% 0%, 50% 100%, 80% 80%, 20% 80%, 0 0; }
  100% { background-position: 10% 10%, 90% 5%, 55% 95%, 70% 70%, 30% 90%, 0 0; }
}

a { color: var(--accent-2); text-decoration: none }
a:hover { text-decoration: underline }
hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0 }
.muted { color: var(--muted) }
.small { font-size: .85rem }
.center { text-align: center }
pre, code { font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
pre { background: rgba(15,20,32,.6); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem; overflow-x: auto; font-size: .85rem; color: #cdd5e0; backdrop-filter: blur(10px) }
.token { user-select: all; word-break: break-all }

/* ===== Public ===== */
.public { padding-top: 0 }
.public-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.5rem;
  max-width: 920px; margin: 0 auto;
  background: transparent;
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 500; font-size: .95rem }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background:
    radial-gradient(circle at 30% 30%, var(--aurora-1), transparent 60%),
    radial-gradient(circle at 70% 70%, var(--aurora-2), transparent 60%),
    linear-gradient(135deg, var(--accent), #047857);
  display: inline-block; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
.brand-mark.big { width: 36px; height: 36px; border-radius: 9px }
.brand-name.big { font-size: 1.1rem }
.header-spacer { width: 22px }
.container {
  max-width: 920px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem;
}

.hero { text-align: center; padding: 2rem 0 1.8rem }
.hero.compact { padding: 1.2rem 0 1rem }
.hero h1 {
  font-size: 1.65rem; margin: .9rem 0 .35rem; font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}
.hero p { font-size: .85rem; margin: 0 }
.hero-icon {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto;
  display: grid; place-items: center; font-size: 1.25rem; font-weight: 600;
  color: #001a13; position: relative;
}
.hero-icon::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: inherit; filter: blur(14px); opacity: .35; z-index: -1;
}
.hero-icon.ok   { background: linear-gradient(135deg, var(--aurora-5), var(--aurora-1)) }
.hero-icon.warn { background: linear-gradient(135deg, #fbbf24, #f97316); color: #2a1a00 }
.hero-icon.down { background: linear-gradient(135deg, #f87171, #ef4444); color: #1a0000 }
.hero-icon.unknown { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.3rem; margin: .9rem 0;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0) 40%);
  pointer-events: none;
  border-radius: inherit;
}
.card.highlight { border-color: rgba(16,185,129,.4); background: linear-gradient(180deg, rgba(16,185,129,.1), var(--bg-elev)); }
.card h2 { margin: 0 0 .8rem; font-size: .92rem; font-weight: 500; color: var(--text); position: relative; letter-spacing: .01em }

/* Notice card (no incidents) */
.notice .notice-row { display: flex; align-items: center; gap: .9rem; position: relative }
.notice-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(16,185,129,.18), 0 0 12px rgba(16,185,129,.5);
  flex-shrink: 0;
}
.notice strong { font-weight: 500; font-size: .95rem }

.services-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: .8rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.services-header strong { font-size: .92rem; font-weight: 500; letter-spacing: .01em; color: var(--muted) }
.service-list { list-style: none; padding: 0; margin: 0; position: relative }
.service { padding: 1rem 0; border-bottom: 1px solid var(--border) }
.service:last-child { border-bottom: none }
.service-top { display: flex; justify-content: space-between; align-items: baseline }
.service-name { font-weight: 500; display: flex; align-items: center; gap: .55rem; font-size: .95rem }
.service-desc { margin-top: .25rem }
.uptime {
  font-variant-numeric: tabular-nums; font-size: .82rem; font-weight: 500;
  color: var(--accent-2);
}

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0 }
.dot.state-up { background: var(--up); box-shadow: 0 0 0 3px rgba(16,185,129,.18) }
.dot.state-degraded { background: var(--degraded); box-shadow: 0 0 0 3px rgba(245,158,11,.18) }
.dot.state-down { background: var(--down); box-shadow: 0 0 0 3px rgba(239,68,68,.18) }
.dot.state-unknown { background: var(--unknown) }
.dot.state-none { background: var(--none) }

.bars {
  display: flex; gap: 2px; height: 34px; margin-top: .8rem; align-items: stretch;
  position: relative;
}
.bar {
  flex: 1; min-width: 3px; border-radius: 2px; cursor: pointer;
  background: rgba(255,255,255,.05);
  transition: transform .15s ease, filter .15s ease;
}
.bar.state-up       { background: var(--up) }
.bar.state-degraded { background: var(--degraded) }
.bar.state-down     { background: var(--down) }
.bar.state-unknown  { background: var(--unknown) }
.bar.state-none     { background: rgba(255,255,255,.05) }
.bar:hover { transform: scaleY(1.12); filter: brightness(1.15) }
.bars-axis { display: flex; justify-content: space-between; margin-top: .45rem; font-size: .75rem }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: rgba(20,26,42,.85);
  border: 1px solid var(--border-strong);
  padding: .8rem 1rem;
  border-radius: 12px; box-shadow: var(--shadow); font-size: .85rem; min-width: 200px;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.tooltip .t-state { display: flex; align-items: center; gap: .4rem; font-weight: 600 }
.tooltip .t-meta { color: var(--muted); margin-top: .35rem; font-size: .8rem }

.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .7rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
  background: rgba(255,255,255,.06); color: var(--muted);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.badge.state-up { background: rgba(16,185,129,.18); color: var(--accent-2); border-color: rgba(16,185,129,.4); box-shadow: 0 0 16px rgba(16,185,129,.2) }
.badge.state-degraded { background: rgba(245,158,11,.18); color: var(--warn); border-color: rgba(245,158,11,.4); box-shadow: 0 0 16px rgba(245,158,11,.2) }
.badge.state-down { background: rgba(239,68,68,.2); color: #fca5a5; border-color: rgba(239,68,68,.4); box-shadow: 0 0 16px rgba(239,68,68,.25) }
.badge.state-unknown { background: rgba(100,116,139,.18); color: #cbd5e1 }
.badge.sev-minor { background: rgba(245,158,11,.15); color: var(--warn) }
.badge.sev-major { background: rgba(239,68,68,.2); color: #fca5a5 }
.badge.sev-critical { background: rgba(239,68,68,.32); color: #fff }

.incidents-banner .incident-row, .incident-row {
  display: flex; align-items: center; gap: .8rem; padding: .5rem 0;
  border-bottom: 1px dashed var(--border);
}
.incident-row:last-child { border-bottom: none }
.sev-major strong, .sev-critical strong { color: #fca5a5 }

.incident-detail { padding: 1rem 0; border-bottom: 1px solid var(--border) }
.incident-detail:last-child { border-bottom: none }
.incident-detail header { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap }
.updates { padding-left: 1rem; margin: .6rem 0 0 }
.updates li { margin: .4rem 0; line-height: 1.5 }

.public-footer {
  max-width: 920px; margin: 2rem auto 1.5rem; padding: 1rem 1.5rem;
  display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem;
  border-top: 1px solid var(--border);
}

/* ===== Login ===== */
.login { display: grid; place-items: center; min-height: 100vh; }
.login-box {
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  padding: 2.8rem; border-radius: 20px; width: min(400px, 92vw);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}
.login-box .brand { justify-content: center; flex-direction: column; gap: .3rem; margin-bottom: 1.5rem }
.login-box form { display: grid; gap: .9rem }
.login-box label { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted) }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  background: rgba(15,20,32,.55); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: .65rem .8rem; font-size: .95rem; font-family: inherit;
  outline: none; transition: all .15s;
  backdrop-filter: blur(8px);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
button {
  background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: .55rem 1rem; cursor: pointer; font-size: .9rem;
  font-family: inherit; transition: all .15s;
  backdrop-filter: blur(8px);
}
button:hover { border-color: var(--border-strong); background: rgba(255,255,255,.1) }
button.primary {
  background: linear-gradient(135deg, var(--accent), #059669);
  color: #001a13; border-color: transparent; font-weight: 600;
  box-shadow: 0 6px 20px rgba(16,185,129,.3);
}
button.primary:hover { background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 8px 24px rgba(16,185,129,.45) }
button.danger { background: transparent; color: #fca5a5; border-color: rgba(239,68,68,.3) }
button.danger:hover { background: rgba(239,68,68,.1); border-color: var(--danger) }
button.small { padding: .25rem .55rem; font-size: .8rem }
button.link { background: transparent; border: none; color: var(--muted); padding: .25rem 0; cursor: pointer }
button.link:hover { color: var(--text); text-decoration: underline }
.btn { display: inline-block; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--border) }
.btn.primary { background: var(--accent); color: #001a13; border-color: var(--accent); font-weight: 600 }

/* ===== Admin ===== */
.admin { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh }
.sidebar {
  background: rgba(10,14,24,.55);
  border-right: 1px solid var(--border);
  padding: 1.8rem 1.2rem; display: flex; flex-direction: column; gap: 1rem;
  position: sticky; top: 0; height: 100vh;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.sidebar .brand { padding: 0 .5rem .8rem; border-bottom: 1px solid var(--border); align-items: flex-start }
.sidebar .brand small { display: block; color: var(--muted); font-size: .7rem; font-weight: normal }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; flex: 1 }
.sidebar nav a { color: var(--muted); padding: .55rem .75rem; border-radius: 6px }
.sidebar nav a:hover { background: var(--bg-elev-2); color: var(--text); text-decoration: none }
.sidebar nav a.active { background: var(--bg-elev-2); color: var(--accent-2) }
.sidebar nav a.sub { padding-left: 1.5rem; font-size: .85rem }
.sidebar-bottom { display: flex; flex-direction: column; gap: .5rem; padding-top: 1rem; border-top: 1px solid var(--border) }
.sidebar-bottom form { margin: 0 }

.admin-main { padding: 2.5rem 3rem; overflow-x: auto; max-width: 1400px }
.page-head { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem }
.page-head h1 { margin: 0; font-size: 1.5rem }
.page-head .btn { margin-left: auto }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid var(--border) }
.flash.success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: var(--accent-2) }
.flash.error { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3); color: #fca5a5 }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem }
.stat .stat-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em }
.stat .stat-value { font-size: 2.2rem; font-weight: 700; margin-top: .3rem }

.table { width: 100%; border-collapse: collapse }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle }
.table th { color: var(--muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em }
.table tr:hover td { background: rgba(255,255,255,.02) }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem }
.form-grid .full { grid-column: 1/-1 }
.form-grid label { display: grid; gap: .3rem; font-size: .8rem; color: var(--muted) }
.form-grid label.checkbox { flex-direction: row; align-items: center; display: flex; gap: .5rem }
.form-grid label.checkbox input { width: auto }
.form-grid .row { display: flex; gap: .5rem }
.form-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .4rem 0 }
.inline { display: inline-block; margin: 0 0 0 .3rem }

.service-edit { background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 8px; padding: .8rem 1rem; margin: .6rem 0 }
.service-edit summary { cursor: pointer; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap }
.service-edit summary::-webkit-details-marker { display: none }
.service-edit[open] summary { padding-bottom: .8rem; border-bottom: 1px solid var(--border); margin-bottom: .8rem }

/* ===== Service Picker (Checkboxen) ===== */
.field-label { font-size: .8rem; color: var(--muted); margin-bottom: .5rem; font-weight: 500; letter-spacing: .03em; text-transform: uppercase }
.svc-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.svc-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  cursor: pointer;
  font-size: .88rem;
  transition: all .15s;
  user-select: none;
}
.svc-chip:hover { border-color: var(--border-strong); background: rgba(255,255,255,.07) }
.svc-chip input[type=checkbox] { display: none }
.svc-chip:has(input:checked) {
  border-color: var(--accent);
  background: rgba(16,185,129,.12);
  color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(16,185,129,.25);
}

/* Sort buttons */
.sort-btns { margin-left: auto; display: flex; gap: .2rem; flex-shrink: 0 }
.sort-btn {
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  border-radius: 6px; padding: .15rem .45rem; font-size: .8rem; cursor: pointer;
  color: var(--muted); line-height: 1.4;
  transition: all .12s;
}
.sort-btn:hover { background: rgba(255,255,255,.1); color: var(--text); border-color: var(--border-strong) }

@media (max-width: 720px) {
  .admin { grid-template-columns: 1fr }
  .sidebar { position: static; height: auto }
  .sidebar nav { flex-direction: row; flex-wrap: wrap }
  .public-header { flex-direction: column; gap: 1rem; padding: 1rem }
  .public-nav { margin: 0 }
  .admin-main { padding: 1rem }
}
