:root {
  --bg: #0b0f1a;
  --panel: #121826;
  --panel2: #1a2236;
  --border: #232c44;
  --text: #e8ecf5;
  --text2: #9aa7c2;
  --accent: #6366f1;
  --accent2: #8b5cf6;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); }

/* Login */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(99,102,241,.18), transparent 60%), var(--bg); }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 20px;
  padding: 40px 34px; width: 360px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo h1 { font-size: 24px; }
.login-logo h1 span { color: var(--accent2); }
.login-logo p { color: var(--text2); font-size: 13px; margin-top: 4px; }
.logo-dot { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 10px 30px rgba(99,102,241,.4); }
label { display: block; font-size: 12px; color: var(--text2); margin: 14px 0 6px; }
input, select { width: 100%; padding: 12px 14px; background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.btn-primary { width: 100%; margin-top: 18px; padding: 13px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 700; cursor: pointer; }
.btn-primary:hover { opacity: .9; }
.btn-ghost { padding: 13px 18px; border: 1px solid var(--border); background: transparent; color: var(--text2); border-radius: 10px; cursor: pointer; }
.alert-error { background: rgba(239,68,68,.12); color: var(--red); padding: 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }

/* App */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--panel); border-right: 1px solid var(--border); padding: 20px 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 26px; }
.brand .logo-dot { width: 30px; height: 30px; margin: 0; border-radius: 9px; }
.brand b { color: var(--accent2); }
nav a { display: block; color: var(--text2); text-decoration: none; padding: 11px 14px; border-radius: 10px; margin-bottom: 4px; font-size: 14px; }
nav a:hover { background: var(--panel2); color: var(--text); }
nav a.nav-active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.main { flex: 1; padding: 26px 30px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.topbar h1 { font-size: 22px; }
.topbar .btn-primary { width: auto; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat.ok .stat-num { color: var(--green); }
.stat.bad .stat-num { color: var(--red); }
.stat-num { font-size: 30px; font-weight: 800; }
.stat-label { color: var(--text2); font-size: 13px; margin-top: 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card.online { border-left: 4px solid var(--green); }
.card.offline { border-left: 4px solid var(--red); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--text2); }
.card.online .card-dot { background: var(--green); box-shadow: 0 0 12px var(--green); }
.card.offline .card-dot { background: var(--red); box-shadow: 0 0 12px var(--red); }
.card-name { font-weight: 700; font-size: 15px; flex: 1; }
.card-url { color: var(--text2); font-size: 12px; word-break: break-all; margin-bottom: 10px; }
.card-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text2); margin-bottom: 10px; }
.card-actions { display: flex; gap: 8px; margin-top: 8px; }
.card-actions button { flex: 1; padding: 8px; border: 1px solid var(--border); background: var(--panel2); color: var(--text2); border-radius: 8px; cursor: pointer; font-size: 12px; }
.card-actions button:hover { border-color: var(--accent); color: var(--text); }
.card canvas { max-height: 70px; }
.chart-box { margin-top: 8px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 26px; width: 420px; }
.modal-box h3 { margin-bottom: 6px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn-primary, .modal-actions .btn-ghost { width: auto; margin: 0; }

/* Status */
.status-wrap { max-width: 900px; margin: 0 auto; padding: 40px 20px; }
.status-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.status-badge { padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.status-badge.ok { background: rgba(34,197,94,.15); color: var(--green); }
.status-badge.warn { background: rgba(245,158,11,.15); color: var(--amber); }
.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.status-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: relative; }
.status-card.offline { border-left: 4px solid var(--red); }
.status-card.online { border-left: 4px solid var(--green); }
.status-dot { position: absolute; top: 16px; right: 16px; width: 12px; height: 12px; border-radius: 50%; }
.status-card.online .status-dot { background: var(--green); }
.status-card.offline .status-dot { background: var(--red); }
.status-name { font-weight: 700; margin-bottom: 4px; }
.status-url { color: var(--text2); font-size: 12px; word-break: break-all; }
.status-meta { margin-top: 10px; font-size: 12px; color: var(--text2); }
