:root {
  --bg: #05070f;
  --panel: #121522;
  --border: #1f2333;
  --text: #e6e9f2;
  --muted: #9aa3c7;

  --green: #22c55e;
  --green-soft: #0b3d21;

  --red: #ef4444;
  --red-soft: #3f0b0b;

  --yellow: #f59e0b;

  --accent: #00ff88;
}

/* ✅ GLOBAL */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 20px;
  font-family: system-ui;
  background: linear-gradient(180deg, #05070f, #0a0d17);
  color: var(--text);
}

/* ✅ LAYOUT */

.page-shell {
  max-width: 1100px;
  margin: auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-last-checked {
  color: var(--muted);
}

/* ✅ GLOBAL STATUS */

.global-status-banner {
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.global-status-banner.up {
  background: var(--green-soft);
  border-color: var(--green);
}

.global-status-banner.down {
  background: var(--red-soft);
  border-color: var(--red);
}

.global-status-banner.neutral {
  background: #1a1222;
  border-color: #444;
}

/* ✅ FORM */

.monitor-form-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.monitor-form-card h2 {
  margin-top: 0;
}

.monitor-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}

.monitor-form-card input {
  padding: 10px;
  background: #000;
  border: 1px solid var(--border);
  color: white;
}

.monitor-form-card button {
  background: var(--accent);
  border: none;
  cursor: pointer;
  font-weight: bold;
  padding: 10px;
}

.form-status {
  margin-top: 10px;
  font-size: 14px;
}

/* ✅ GROUPS */

.monitor-group-section {
  margin-top: 20px;
}

.monitor-group-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
}

/* ✅ GRID */

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 15px;
}

/* ✅ CARD */

.monitor-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.monitor-title {
  font-size: 18px;
  font-weight: bold;
}

.monitor-url {
  font-size: 13px;
  color: var(--muted);
}

/* ✅ ACTIONS */

.monitor-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-action-btn {
  border-radius: 6px;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
}

.card-action-btn.secondary {
  background: #111;
  border: 1px solid #444;
  color: white;
}

.card-action-btn.danger {
  background: #200;
  border: 1px solid red;
  color: red;
}

.card-action-btn:hover {
  opacity: 0.8;
}

/* ✅ STATUS BADGE */

.status-pill {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: bold;
}

.status-pill.up {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.down {
  background: var(--red-soft);
  color: var(--red);
}

/* ✅ META */

.monitor-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 10px;
  gap: 10px;
}

.meta-label {
  font-size: 11px;
  color: var(--muted);
}

.meta-value {
  font-size: 14px;
}

/* ✅ HISTORY BARS */

.history-bars {
  display: flex;
  gap: 3px;
  margin-top: 10px;
}

.history-bar {
  width: 6px;
  height: 25px;
  border-radius: 3px;
}

.history-bar.up {
  background: var(--green);
}

.history-bar.down {
  background: var(--red);
}

/* ✅ INCIDENTS */

.incidents-section {
  margin-top: 10px;
}

.incident-item {
  font-size: 12px;
  padding: 8px;
  border-top: 1px solid #222;
  color: #ccc;
}

/* ✅ HISTORY MODAL */

.history-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
}

.history-modal.hidden {
  display: none;
}

.history-modal-backdrop {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
}

.history-modal-panel {
  position: relative;
  max-width: 700px;
  margin: 80px auto;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  z-index: 1000;
}

.history-modal-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.history-close-btn {
  background: #111;
  border: 1px solid #444;
  color: white;
  cursor: pointer;
}

.history-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-log-item {
  border-bottom: 1px solid #222;
  padding-bottom: 6px;
}

.history-log-status.up {
  color: var(--green);
}

.history-log-status.down {
  color: var(--red);
}

.muted {
  color: var(--muted);
}