:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f9fbff;
  --line: #dce5f2;
  --text: #152033;
  --muted: #6b7a90;
  --primary: #3b82f6;
  --primary-2: #6366f1;
  --green: #16a34a;
  --yellow: #d97706;
  --red: #dc2626;
  --blue: #0ea5e9;
  --shadow: 0 14px 40px rgba(24, 39, 75, 0.08);
  --radius: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(59,130,246,.10), transparent 28%),
              radial-gradient(circle at top right, rgba(99,102,241,.08), transparent 24%), var(--bg);
  color: var(--text); min-height: 100vh; }

.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 18px; background: rgba(255,255,255,0.76);
  backdrop-filter: blur(18px); border-right: 1px solid var(--line); overflow-y:auto; }
.brand { display:flex; gap:12px; align-items:center; padding:16px; border-radius:18px;
  background:linear-gradient(180deg,#fff,#f7faff); border:1px solid var(--line); box-shadow:var(--shadow); margin-bottom:16px; }
.brand-mark { width:44px; height:44px; border-radius:14px; display:grid; place-items:center; color:#fff; font-weight:800;
  background:linear-gradient(135deg,var(--primary),var(--primary-2)); box-shadow:0 10px 25px rgba(59,130,246,.24); }
.brand h1 { margin:0 0 4px; font-size:16px; }
.brand p { margin:0; color:var(--muted); font-size:12px; }

.nav { display:grid; gap:6px; }
.nav a { text-decoration:none; color:var(--text); display:flex; justify-content:space-between; align-items:center;
  padding:10px 14px; border-radius:14px; border:1px solid transparent; font-size:13.5px; }
.nav a:hover, .nav a.active { background:#eef4ff; border-color:#cfe0ff; color:#1d4ed8; }
.nav a span:last-child { color:var(--muted); font-size:11px; }

.sidebar-card { margin-top:16px; padding:16px; border-radius:18px;
  background:linear-gradient(180deg,#fff,#f8fbff); border:1px solid var(--line); box-shadow:var(--shadow); }
.sidebar-card h3 { margin:0 0 8px; font-size:14px; }
.sidebar-card p { margin:0; color:var(--muted); font-size:12px; line-height:1.6; }

.content { padding:22px; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:18px 20px;
  background:rgba(255,255,255,.9); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:18px; }
.topbar h2 { margin:0; font-size:22px; }
.topbar p { margin:6px 0 0; color:var(--muted); font-size:13px; }
.topbar-right { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.pill { display:inline-flex; align-items:center; gap:8px; padding:10px 14px; border-radius:999px;
  border:1px solid var(--line); background:#fff; color:var(--text); font-size:13px; }
.pill .dot { width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 0 6px rgba(22,163,74,.12); }

.alert { padding:12px 16px; border-radius:14px; margin-bottom:16px; font-size:13px; border:1px solid var(--line); background:#fff; }
.alert.success { background:#e8f8ee; color:#12833a; border-color:#bef0cc; }
.alert.danger  { background:#fee2e2; color:#b91c1c; border-color:#fecaca; }

.grid-cards { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:16px; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:18px; }
.metric { display:flex; justify-content:space-between; gap:12px; }
.metric h3 { margin:0; font-size:14px; color:var(--muted); font-weight:500; }
.metric-value { font-size:30px; font-weight:800; margin-top:6px; }
.metric-sub { color:var(--muted); font-size:12px; margin-top:7px; }
.icon { width:52px; height:52px; border-radius:16px; display:grid; place-items:center; font-size:18px; font-weight:800; color:#1d4ed8;
  background:linear-gradient(135deg,#eff6ff,#eef2ff); border:1px solid #dbeafe; }
.status-up { color:var(--green); } .status-down { color:var(--red); }
.status-maintenance { color:var(--yellow); } .status-info { color:var(--blue); }

.layout-2 { display:grid; grid-template-columns:1.45fr .95fr; gap:16px; margin-top:16px; }
.layout-3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-top:16px; }
.panel-header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.panel-header h4 { margin:0; font-size:16px; } .panel-header small { color:var(--muted); }

.btns { display:flex; gap:8px; flex-wrap:wrap; }
.btn { border:0; cursor:pointer; padding:10px 14px; border-radius:14px; text-decoration:none; display:inline-block;
  background:linear-gradient(135deg,var(--primary),var(--primary-2)); color:#fff; font-weight:700; font-size:13px;
  box-shadow:0 10px 24px rgba(59,130,246,.22); }
.btn.secondary { background:#fff; color:var(--text); border:1px solid var(--line); box-shadow:none; }
.btn.secondary.danger { color:#b91c1c; border-color:#fecaca; }

.table-wrap { overflow:auto; border-radius:16px; border:1px solid var(--line); }
table { width:100%; border-collapse:collapse; background:#fff; }
th, td { padding:12px 14px; text-align:left; border-bottom:1px solid #edf2f7; font-size:13px; }
th { background:#f8fbff; color:var(--muted); font-weight:700; }
tr:hover td { background:#fafcff; }

.badge { display:inline-flex; align-items:center; gap:6px; padding:5px 9px; border-radius:999px; font-size:11.5px; font-weight:700; }
.badge.success { background:#e8f8ee; color:#12833a; }
.badge.warn    { background:#fff4df; color:#b26b00; }
.badge.danger  { background:#fee2e2; color:#b91c1c; }
.badge.info    { background:#e0f2fe; color:#0369a1; }

.stack { display:grid; gap:16px; }
.box { background:#fff; border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:18px; }
.box h4 { margin:0 0 8px; font-size:16px; }

.kv { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }
.kv > div, .endpoint { background:#f8fbff; border:1px solid #e3ebf7; border-radius:14px; padding:12px; }
.kv label { display:block; color:var(--muted); font-size:11px; margin-bottom:4px; text-transform:uppercase; letter-spacing:.4px; }
.kv strong { font-size:13px; word-break:break-word; }

.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:8px; }
.field { display:grid; gap:7px; }
.field.span-2 { grid-column: span 2; }
.field label { color:var(--muted); font-size:12px; }
.field input, .field select, .field textarea { width:100%; border-radius:14px; padding:11px 12px;
  border:1px solid #d9e4f2; background:#fff; color:var(--text); outline:none; font-family:inherit; font-size:13.5px; }
.field textarea { min-height:92px; resize:vertical; }
.search { border-radius:14px; padding:9px 12px; border:1px solid #d9e4f2; background:#fff; }

.panel-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.endpoint-list { display:grid; gap:10px; margin-top:12px; }
.endpoint { display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:13px; }
.endpoint code { color:#1d4ed8; font-size:12px; word-break:break-word; }
.footer-note { margin-top:24px; text-align:center; color:var(--muted); font-size:12px; padding-bottom:8px; }

.auth-body { background: linear-gradient(135deg,#f5f7fb 0%, #eef4ff 100%); display:grid; place-items:center; min-height:100vh; padding:24px; }
.auth-wrap { width:100%; max-width:440px; }
.auth-card { background:#fff; border:1px solid var(--line); border-radius:24px; padding:28px; box-shadow:var(--shadow); }

@media (max-width:1100px) {
  .app { grid-template-columns:1fr; }
  .sidebar { position:relative; height:auto; }
  .grid-cards, .layout-2, .layout-3 { grid-template-columns:1fr 1fr; }
}
@media (max-width:760px) {
  .grid-cards, .layout-2, .layout-3, .form-grid, .kv { grid-template-columns:1fr; }
  .topbar { flex-direction:column; align-items:flex-start; }
  .topbar-right { justify-content:flex-start; }
}
