@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');
:root {
  /* paleta de https://home.nori.build (tema escuro) */
  --bg: #07070b;
  --bg-2: #0a1417;
  --card: #0c1518;
  --card-2: #0f1d21;
  --line: rgba(25, 194, 221, .16);
  --line-2: rgba(25, 194, 221, .28);
  --text: #eaf6f7;
  --muted: #8fa9ae;
  --faint: #6a8c92;
  --accent: #19c2dd;
  --accent-2: #08f598;
  --purple: #af70e3;
  --gradient: linear-gradient(115deg, #19c2dd 0%, #08f598 100%);
  --on-gradient: #04231f;
  --glow: rgba(8, 245, 152, .22);
  --up: #08f598;
  --up-bg: rgba(8, 245, 152, .12);
  --down: #ff5c6c;
  --down-bg: rgba(255, 92, 108, .12);
  --warn: #f5c542;
  --warn-bg: rgba(245, 197, 66, .12);
  --radius: 12px;
  --shadow: 0 30px 70px rgba(0, 0, 0, .5);
  --font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  background: radial-gradient(1100px 560px at 8% -12%, rgba(25, 194, 221, .12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(82, 41, 135, .16), transparent 60%), var(--bg);
  color: var(--text); font-size: 14px; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: 12px; }
button { font: inherit; color: inherit; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: rgba(7, 7, 11, .8); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; }
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-sub { color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--card-2); font-weight: 500; transition: .15s;
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--gradient); border-color: transparent; color: var(--on-gradient); font-weight: 600; }
.btn.primary:hover { box-shadow: 0 0 24px var(--glow); filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: #fca5a5; border-color: #5b2323; background: transparent; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--muted); transition: .15s;
}
.icon-btn:hover { background: var(--card-2); border-color: var(--line-2); color: var(--text); }
.icon-btn.danger:hover { color: #fca5a5; border-color: #5b2323; }
.icon-btn:disabled { opacity: .5; cursor: progress; }

/* user menu */
.user-menu { position: relative; }
.avatar-btn {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line);
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: var(--gradient); color: var(--on-gradient); text-transform: uppercase;
}
.user-name { font-weight: 500; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 220px; background: var(--card); border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 20;
}
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-weight: 600; }
.menu-item { width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; background: none; border: 0; cursor: pointer; }
.menu-item:hover { background: var(--card-2); }
.menu-item.danger { color: #fca5a5; }

.banner {
  background: var(--warn-bg); color: #fde68a; border-bottom: 1px solid rgba(245, 197, 66, .25);
  padding: 10px 28px; font-size: 13px; text-align: center;
}

/* ---------- layout ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 24px 28px 60px; display: grid; gap: 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 30px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.02em; }
.kpi-value.up { color: var(--up); } .kpi-value.down { color: var(--down); }
.kpi-foot { color: var(--faint); font-size: 12px; min-height: 16px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); padding: 4px; border-radius: 12px; }
.tab { background: none; border: 0; padding: 7px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; }
.tab span { color: var(--faint); margin-left: 4px; font-size: 12px; }
.tab.active { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 12px; color: var(--muted); min-width: 280px;
}
.search input { background: none; border: 0; outline: 0; color: var(--text); padding: 10px 0; width: 100%; font: inherit; }

/* ---------- monitor cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 14px; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--line-2); }
.card.down { border-color: rgba(255, 92, 108, .45); box-shadow: 0 0 0 1px rgba(255, 92, 108, .15), 0 8px 24px rgba(255, 92, 108, .06); }
.card.paused { opacity: .7; }
.card-head { display: flex; align-items: flex-start; gap: 12px; }
.card-title { flex: 1; min-width: 0; }
.card-title h3 { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title a { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status.up { background: var(--up-bg); color: var(--up); }
.status.down { background: var(--down-bg); color: var(--down); }
.status.unknown, .status.paused { background: var(--warn-bg); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; position: relative; }
.status.up .dot::after, .status.down .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 8px; font-size: 12px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); cursor: default;
}
.chip b { color: var(--text); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.chip.ok i { background: var(--up); } .chip.fail i { background: var(--down); } .chip.na i { background: var(--warn); }
.chip.fail { border-color: rgba(255, 92, 108, .35); }

.uptime { display: flex; flex-direction: column; gap: 6px; }
.uptime-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.uptime-row b { color: var(--text); }
.bars { display: flex; gap: 2px; height: 26px; align-items: stretch; }
.bars span { flex: 1; border-radius: 2px; background: var(--line); min-width: 3px; }
.bars span.ok { background: var(--up); opacity: .85; }
.bars span.fail { background: var(--down); }
.bars span:hover { opacity: 1; filter: brightness(1.2); }

.spark { width: 100%; height: 44px; display: block; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.metric small { color: var(--faint); font-size: 11px; display: block; }
.metric b { font-size: 14px; }
.metric b.bad { color: var(--down); }

.card-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.card-actions { display: flex; gap: 2px; }

.empty {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted);
}
.empty h3 { color: var(--text); margin: 10px 0 6px; }
.skeleton { height: 280px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- alerts ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.panel h2 { margin: 0; font-size: 15px; }
.alerts { display: flex; flex-direction: column; }
.alert { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.alert:first-child { border-top: 0; }
.alert-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; }
.alert-icon.down { background: var(--down-bg); color: var(--down); }
.alert-icon.recovered { background: var(--up-bg); color: var(--up); }
.alert-title { font-weight: 600; }
.alert-mail { font-size: 12px; color: var(--muted); }
.alert-mail.fail { color: #fca5a5; }

/* ---------- modals ---------- */
.modal {
  padding: 0; border: 1px solid var(--line-2); border-radius: 16px; background: var(--card); color: var(--text);
  width: min(640px, 94vw); max-height: 90vh; box-shadow: var(--shadow);
}
.modal.wide { width: min(980px, 96vw); }
.modal.small { width: min(420px, 94vw); }
.modal::backdrop { background: rgba(3, 3, 6, .72); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; overflow: auto; max-height: calc(90vh - 140px); }
.modal-body.block { display: block; }
.modal-body.block .field { margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; }
.full { grid-column: 1 / -1; }
.field label, .field > summary { font-size: 12px; color: var(--muted); font-weight: 500; }
.hint { color: var(--faint); font-size: 11px; }
input, select {
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 10px; padding: 9px 11px;
  font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(25, 194, 221, .2); }
.check-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.check-card {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); cursor: pointer; transition: .15s;
}
.check-card:has(input:checked) { border-color: var(--accent); background: rgba(25, 194, 221, .08); }
.check-card input { margin-top: 2px; accent-color: var(--accent); }
.check-card b { display: block; font-size: 13px; }
.check-card small { color: var(--faint); font-size: 11px; }
.advanced summary { cursor: pointer; padding: 4px 0; }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.switch input { display: none; }
.slider { width: 36px; height: 20px; background: var(--line-2); border-radius: 999px; position: relative; transition: .2s; }
.slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::after { left: 18px; }
.form-err { color: #fca5a5; font-size: 13px; min-height: 16px; }

/* details */
.d-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 18px; }
.d-check { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.d-check.fail { border-color: rgba(255, 92, 108, .4); }
.d-check-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.d-check-head b { text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }
.d-check p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.section-title { font-size: 13px; font-weight: 600; margin: 4px 0 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--faint); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
pre {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; white-space: pre-wrap;
  font-size: 12px; max-height: 240px; overflow: auto; margin: 8px 0 0; font-family: var(--font-mono);
}
details summary { cursor: pointer; }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  background: var(--card-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 10px;
  padding: 10px 14px; box-shadow: var(--shadow); min-width: 240px; max-width: 360px; animation: pop .2s ease-out;
}
.toast.ok { border-left-color: var(--up); } .toast.err { border-left-color: var(--down); }

@media (max-width: 900px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .check-cards { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; }
  .user-name { display: none; }
  .topbar, main { padding-left: 16px; padding-right: 16px; }
  .search { min-width: 0; flex: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- navigation ---------- */
.nav { display: flex; gap: 4px; margin-left: 20px; }
.nav-link { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.nav-link:hover { text-decoration: none; color: var(--text); background: var(--card); }
.nav-link.active { color: var(--text); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-badge { background: var(--down); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.panel-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- alerts page ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.select {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--text);
  padding: 9px 12px; font: inherit; outline: 0;
}
.select:focus { border-color: var(--accent); }
.active-panel { border-color: rgba(255, 92, 108, .4); }
.active-list { display: flex; flex-direction: column; }
.active-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.active-item:first-child { border-top: 0; }
.active-name { display: flex; flex-direction: column; min-width: 0; }
.active-name a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline .day {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint);
  padding: 14px 0 4px; font-weight: 600;
}
.timeline .day:first-child { padding-top: 0; }
.timeline .day + .alert { border-top: 0; }
.alert-time { text-align: right; white-space: nowrap; }
.pill { display: inline-block; font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--up-bg); color: var(--up); margin-left: 4px; }
.more { display: flex; justify-content: center; margin-top: 10px; }
.more .btn[hidden] { display: none; }
@media (max-width: 900px) {
  .nav { margin-left: 8px; }
  .filters { width: 100%; }
  .active-item { grid-template-columns: 1fr; gap: 4px; }
}

/* inline SVG icons (Lucide style) */
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }
.ico-down { color: var(--down); }
.icon-btn .ico { width: 16px; height: 16px; }
.alert-icon .ico { width: 16px; height: 16px; }
.empty-ico { font-size: 32px; line-height: 1; color: var(--faint); }
.alert-mail { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- tipografia e detalhes da identidade Nori ---------- */
h1, h2, h3, .brand-name, .kpi-value, .modal-head h2 { font-family: var(--font-display); }
.kpi-value, .metric b, .alert-time, .chip { font-variant-numeric: tabular-nums; }
.brand-name { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi, .card, .panel { background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 60%), var(--card); }
.card:hover { border-color: var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.switch input:checked + .slider { background: var(--gradient); }
.tab.active, .nav-link.active { box-shadow: inset 0 0 0 1px var(--line-2), 0 0 16px rgba(25, 194, 221, .08); }
::selection { background: rgba(25, 194, 221, .3); }

/* language picker (i18n.js fills every [data-lang-switch]) */
.lang-select { padding: 7px 10px; font-size: 13px; border-radius: 10px; cursor: pointer; }
