:root {
  --bg: #0f1420; --panel: #171d2b; --line: #263042; --text: #e6ebf5;
  --muted: #8b98b0;
  --critical: #ff3b3b; --high: #ff8c1a; --trouble: #ffd23b; --info: #3ba0ff;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, "Segoe UI", Roboto, sans-serif;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; letter-spacing: .3px; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--text); }
.topbar .user { color: var(--info); font-weight: 600; }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
.linkbtn:hover { color: var(--critical); }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }

.panel-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 20px; cursor: pointer; font: inherit; }
.filter.active { color: var(--text); border-color: var(--info); }
.status { display: flex; align-items: center; gap: 14px; }
.conn { font-size: 13px; }
.conn.on { color: #35d07f; } .conn.off { color: var(--muted); }
.mute { color: var(--muted); font-size: 13px; cursor: pointer; }

.events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.event {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-left-width: 4px;
  border-radius: 8px; padding: 10px 14px;
}
.event .dot { width: 10px; height: 10px; border-radius: 50%; }
.event.pr-critical { border-left-color: var(--critical); }
.event.pr-critical .dot { background: var(--critical); box-shadow: 0 0 8px var(--critical); }
.event.pr-high { border-left-color: var(--high); } .event.pr-high .dot { background: var(--high); }
.event.pr-trouble { border-left-color: var(--trouble); } .event.pr-trouble .dot { background: var(--trouble); }
.event.pr-info { border-left-color: var(--info); } .event.pr-info .dot { background: var(--info); }
.event.st-ack { opacity: .72; }
.event .msg { font-weight: 600; }
.event .meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 12px; margin-top: 3px; }
.badge { background: var(--line); border-radius: 10px; padding: 0 8px; color: var(--text); }
.event .actions { display: flex; gap: 6px; }
.actions button { background: var(--line); color: var(--text); border: 0; padding: 6px 12px;
  border-radius: 6px; cursor: pointer; font: inherit; }
.actions .resolve { background: #1f6f4a; }
.actions button:hover { filter: brightness(1.2); }
.empty { color: var(--muted); text-align: center; padding: 30px; }
@keyframes flash { from { background: #2a2036; } to { background: var(--panel); } }
.event.new-flash { animation: flash 1.2s ease-out; }

/* Giriş */
.login-wrap { display: flex; justify-content: center; padding-top: 8vh; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px; width: 320px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin: 0 0 6px; font-size: 20px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.login-card input { background: var(--bg); border: 1px solid var(--line); color: var(--text);
  padding: 9px 11px; border-radius: 6px; font: inherit; }
.login-card button { background: var(--info); color: #04121f; border: 0; padding: 10px;
  border-radius: 6px; font-weight: 700; cursor: pointer; }
.err { color: var(--critical); font-size: 13px; margin: 0; }

/* Geçmiş */
.history-search { display: flex; gap: 8px; margin-bottom: 14px; }
.history-search input { flex: 1; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); padding: 9px 12px; border-radius: 6px; font: inherit; }
.history-search button { background: var(--info); border: 0; color: #04121f; padding: 0 18px;
  border-radius: 6px; font-weight: 700; cursor: pointer; }
table.history { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.history th, table.history td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.history th { color: var(--muted); font-weight: 600; }
.pill { padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.pill.pr-critical { background: var(--critical); color: #fff; }
.pill.pr-high { background: var(--high); color: #201400; }
.pill.pr-trouble { background: var(--trouble); color: #201d00; }
.pill.pr-info { background: var(--info); color: #04121f; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 16px; color: var(--muted); }
.pager a { color: var(--info); text-decoration: none; }
