:root {
  --bg: #07111f;
  --panel: #0f1b2d;
  --panel2: #14243a;
  --text: #eaf2ff;
  --muted: #92a6c5;
  --accent: #4ea1ff;
  --accent2: #62d0ff;
  --danger: #ff6b6b;
  --ok: #44d17a;
  --line: rgba(255,255,255,.1);
  --soft: rgba(255,255,255,.07);
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #17345c 0, #07111f 45%, #040914 100%);
  color: var(--text);
}
a { color: #9fd0ff; text-decoration: none; }
a:hover { color: #d6edff; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  padding: 16px 28px;
  background: rgba(7,17,31,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 900; color: #fff; }
.brand-home { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: #fff; }
.brand-home:hover { color: #fff; }
.brand-mark {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 11px;
  background: radial-gradient(circle at 35% 30%, #6fe0ff, #318fff 58%, #0a3473 100%);
  color: #03101f; font-size: 15px;
  box-shadow: 0 0 28px rgba(78,161,255,.45);
}
.brand-handle { flex: 0 0 auto; color: #9fd0ff; font-weight: 900; }
.topbar nav { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.topbar nav a { color: #9fd0ff; font-weight: 850; letter-spacing: .01em; }
.wrap { max-width: 1680px; margin: 0 auto; padding: 28px 18px 80px; }
.login-card, .panel {
  background: rgba(15,27,45,.88);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  border-radius: 22px; padding: 22px; margin-bottom: 20px;
}
.login-card { max-width: 440px; margin: 60px auto; }
.muted { color: var(--muted); }
.success, .error { border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.success { background: rgba(68,209,122,.14); color: #b7ffd1; }
.error { background: rgba(255,107,107,.16); color: #ffd1d1; }
.form-grid, .filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; align-items: end; }
.form-grid.one { grid-template-columns: 1fr; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 850; }
input, select, textarea {
  width: 100%; border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  background: #081326; color: #fff; padding: 12px; font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(78,161,255,.8); box-shadow: 0 0 0 4px rgba(78,161,255,.16); }
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; padding: 12px 16px;
  background: linear-gradient(135deg,#398bff,#62d0ff);
  color: #04101e; font-weight: 950; cursor: pointer; line-height: 1.1;
}
button:hover, .button:hover { filter: brightness(1.07); color: #04101e; }
button.danger, .danger button, .pill.danger { background: rgba(255,107,107,.18); color: #ffd2d2; }
.button.ghost { background: rgba(255,255,255,.08); color: #ddecff; border: 1px solid rgba(255,255,255,.14); }
.button.ghost:hover { color: #fff; }

/* Legacy/simple cards still used on non-dashboard pages */
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin: 18px 0; }
.stats-grid.small { grid-template-columns: repeat(5,minmax(0,1fr)); }
.stat-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; padding: 16px; }
.stat-card span { display: block; color: var(--muted); font-weight: 850; }
.stat-card strong { display: block; font-size: 34px; margin-top: 8px; }
.stat-card small { color: #9fd0ff; }
.columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.stat-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.domain-row, .user-row { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.09); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.actions form { display: flex; gap: 8px; }
.inline-actions { margin-top: 1rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.check-row { display: flex; align-items: center; gap: .5rem; }
.check-row input[type="checkbox"] { width: auto; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; background: rgba(255,255,255,.1); padding: 4px 9px; font-size: 12px; color: #d8e9ff; }
.code-box { white-space: pre-wrap; word-break: break-word; background: #040914; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 12px; color: #bfdbfe; }
.qr { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 12px; }
.danger-soft { border-color: rgba(220,38,38,.35); background: rgba(220,38,38,.06); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: top; }
th { color: #a8c8ff; }

/* Landing page */
.hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 26px; align-items: center; padding: 34px; overflow: hidden; }
.eyebrow { color: #9fd0ff; text-transform: uppercase; letter-spacing: .12em; font-weight: 950; font-size: 12px; }
.hero h1 { font-size: clamp(42px, 7vw, 72px); line-height: .95; margin: 10px 0; }
.hero-text { font-size: 20px; line-height: 1.45; color: #c7d6ee; max-width: 760px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-card { min-width: 0; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.11); border-radius: 20px; padding: 14px; overflow: hidden; }
.hero-card img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; border-radius: 16px; }
.hero-card ul { margin: 14px 0 0; padding-left: 20px; color: #c7d6ee; }
.hero-card li { margin: 8px 0; }
.big-link { font-size: 22px; font-weight: 950; }

/* New dashboard */
.dashboard-shell {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 270px;
  gap: 16px;
  padding: 18px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(9,23,43,.94), rgba(4,10,20,.9));
  border: 1px solid rgba(120,180,255,.18);
  box-shadow: 0 30px 100px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.04);
}
.dash-sidebar {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 12px;
  border-radius: 24px;
  background: rgba(3,13,26,.74);
  border: 1px solid rgba(255,255,255,.06);
  min-height: 760px;
}
.dash-logo-row { display: flex; gap: 10px; align-items: center; padding: 4px 4px 20px; }
.dash-logo-row strong { display: block; }
.dash-logo-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 12px 12px; border-radius: 12px; color: #d9e9ff; font-weight: 750; }
.side-link span { width: 22px; text-align: center; opacity: .9; }
.side-link:hover, .side-link.active { background: rgba(42,130,255,.18); color: #bfe2ff; }
.side-spacer { flex: 1; }
.dash-main { min-width: 0; }
.dash-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dash-topline h1 { margin: 0; font-size: clamp(30px, 4vw, 54px); letter-spacing: -.04em; }
.status-pill { display: inline-flex; align-items: center; gap: 9px; padding: 12px 16px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); color: #cfe4ff; font-weight: 800; white-space: nowrap; }
.status-pill span { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 18px rgba(68,209,122,.75); }
.dashboard-filter-card {
  display: grid; grid-template-columns: minmax(240px,1.4fr) minmax(180px,.8fr) auto; gap: 14px; align-items: end;
  padding: 16px; border-radius: 22px; margin-bottom: 14px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(120,180,255,.14);
}
.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-card, .chart-card, .health-card {
  position: relative; overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17,36,62,.92), rgba(8,18,34,.92));
  border: 1px solid rgba(120,180,255,.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.kpi-card { min-height: 150px; padding: 16px; }
.kpi-card::after, .chart-card::after { content:""; position:absolute; inset:auto -30% -40% -30%; height:80px; background: radial-gradient(circle, rgba(78,161,255,.18), transparent 62%); pointer-events:none; }
.kpi-head { display: flex; justify-content: space-between; align-items: center; color: #cfe0f9; font-weight: 900; }
.kpi-head i { font-style: normal; width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.kpi-card strong { display: block; font-size: 34px; line-height: 1; margin: 15px 0 8px; }
.kpi-card small { color: #9fb6d4; font-weight: 750; }
.trend.up { color: #64e89c; }
.trend.down { color: #ff9292; }
.spark { position: absolute; left: 14px; right: 14px; bottom: 8px; width: calc(100% - 28px); height: 42px; opacity: .95; }
.spark polyline { fill: none; stroke: #2d93ff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 8px rgba(45,147,255,.45)); }
.mini-orbit { position: absolute; inset: auto 20px 16px auto; width: 80px; height: 50px; border-radius: 50%; border: 1px solid rgba(98,208,255,.25); }
.mini-orbit span { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #62d0ff; box-shadow: 0 0 18px #62d0ff; }
.mini-orbit span:nth-child(1){left:14px;top:18px}.mini-orbit span:nth-child(2){left:44px;top:6px}.mini-orbit span:nth-child(3){right:9px;bottom:9px}
.dash-grid-main { display: grid; grid-template-columns: 1.35fr .9fr .9fr; gap: 12px; }
.chart-card { padding: 16px; min-height: 230px; }
.visitors-chart { grid-column: span 2; }
.top-pages-card { grid-column: span 3; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-title-row h2 { margin: 0; font-size: 18px; }
.card-title-row span { color: #9fb6d4; font-size: 13px; font-weight: 800; }
.big-line-chart { width: 100%; height: 170px; border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,.035), transparent); }
.big-line-chart polyline { fill: none; stroke: #2d93ff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 10px rgba(45,147,255,.55)); }
.timeline-bars { display: grid; grid-template-columns: repeat(14,1fr); gap: 6px; height: 70px; align-items: end; margin-top: 10px; }
.timeline-bars div { display: grid; gap: 4px; align-items: end; height: 100%; min-width: 0; }
.timeline-bars span { display: block; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #4ea1ff, rgba(78,161,255,.22)); min-height: 4px; }
.timeline-bars small { color: #7d93b4; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.world-card { position: relative; height: 120px; border-radius: 16px; background: radial-gradient(circle at 35% 45%, rgba(57,139,255,.32), transparent 28%), radial-gradient(circle at 65% 55%, rgba(98,208,255,.22), transparent 20%), linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.01)); border: 1px solid rgba(255,255,255,.08); overflow: hidden; margin-bottom: 12px; }
.globe-lines { position: absolute; inset: 12px 24px; border-radius: 50%; border: 1px solid rgba(98,208,255,.22); box-shadow: inset 34px 0 0 rgba(78,161,255,.08), inset -34px 0 0 rgba(78,161,255,.06); }
.globe-lines::before, .globe-lines::after { content:""; position: absolute; inset: 26px -18px; border-top: 1px solid rgba(98,208,255,.18); border-bottom: 1px solid rgba(98,208,255,.18); }
.globe-lines::after { inset: -6px 50%; width: 0; border-left: 1px solid rgba(98,208,255,.18); border-top: 0; border-bottom: 0; }
.pulse-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #62d0ff; box-shadow: 0 0 16px #62d0ff; }
.d1 { left: 28%; top: 38%; }.d2 { left: 54%; top: 28%; }.d3 { left: 68%; top: 56%; }.d4 { left: 42%; top: 64%; }
.rank-list { display: grid; gap: 10px; }
.rank-row, .page-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.07); overflow: hidden; }
.rank-row span, .page-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d8e9ff; }
.rank-row b, .page-row strong { color: #eef6ff; }
.rank-row em, .page-row em { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: linear-gradient(90deg,#2d93ff,#62d0ff); box-shadow: 0 0 14px rgba(78,161,255,.35); }
.donut-wrap { display: flex; gap: 18px; align-items: center; }
.donut { flex: 0 0 auto; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; text-align: center; background: conic-gradient(#2d93ff 0 var(--p1), #36d6b4 var(--p1) var(--p2), #8c5cff var(--p2) 100%); position: relative; box-shadow: 0 0 26px rgba(45,147,255,.25); }
.donut::after { content:""; position: absolute; inset: 22px; border-radius: 50%; background: #0b182b; border: 1px solid rgba(255,255,255,.08); }
.donut strong, .donut small { position: relative; z-index: 1; display:block; }
.donut small { color: #9fb6d4; font-size: 11px; margin-top: 22px; }
.donut strong { font-size: 21px; margin-bottom: -22px; }
.donut.os { width: 116px; height: 116px; }
.legend-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; color: #d8e9ff; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; margin-right: 2px; }
.legend-dot.c1 { background:#2d93ff }.legend-dot.c2 { background:#36d6b4 }.legend-dot.c3 { background:#8c5cff }.legend-dot.c4 { background:#ff9f43 }.legend-dot.c5 { background:#7d93b4 }
.device-icons { display: flex; justify-content: space-around; margin-top: 18px; color: #65cfff; font-size: 26px; }
.page-table { display: grid; gap: 8px; }
.platform-strip { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; margin: 14px 0; }
.platform-strip div { padding: 14px; border-radius: 16px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); }
.platform-strip span, .platform-strip small { display: block; color: #9fb6d4; font-weight: 800; }
.platform-strip strong { display: block; font-size: 26px; margin-top: 6px; }
.modern-panel { background: linear-gradient(180deg, rgba(17,36,62,.78), rgba(8,18,34,.84)); }
.modern-row { border-top-color: rgba(120,180,255,.12); }
.add-domain-form { margin-bottom: 12px; }
.two-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-event { display: grid; gap: 3px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.mini-event span { font-weight: 900; }.mini-event small { color: #9fb6d4; }
.dash-health-rail { display: grid; align-content: start; gap: 12px; }
.health-card { padding: 16px; min-height: 94px; }
.health-card h2 { margin: 0 0 10px; font-size: 18px; }
.health-card span { display: block; color: #9fb6d4; font-weight: 850; }
.health-card strong { display: block; font-size: 30px; margin: 8px 0 4px; }
.health-card .small-strong { font-size: 18px; word-break: break-word; }
.health-card small { color: #9fb6d4; }
.ok-line { color: #64e89c; font-weight: 850; }
.uptime-bars { display: grid; grid-template-columns: repeat(16,1fr); gap: 4px; margin-top: 16px; }
.uptime-bars i { height: 22px; border-radius: 99px; background: linear-gradient(180deg,#64e89c,#229d56); box-shadow: 0 0 9px rgba(68,209,122,.28); }
.meter { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); margin-top: 10px; overflow: hidden; }
.meter em { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#2d93ff,#62d0ff); box-shadow: 0 0 12px rgba(78,161,255,.4); }

@media (max-width: 1320px) {
  .dashboard-shell { grid-template-columns: 170px minmax(0,1fr); }
  .dash-health-rail { grid-column: 2; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .main-health { grid-column: span 2; }
}
@media (max-width: 1050px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .dash-sidebar { min-height: 0; flex-direction: row; overflow-x: auto; padding: 10px; }
  .dash-logo-row { padding: 0 12px 0 0; min-width: 190px; }
  .side-spacer { display: none; }
  .side-link { white-space: nowrap; }
  .dash-health-rail { grid-column: auto; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kpi-grid, .platform-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dash-grid-main { grid-template-columns: 1fr 1fr; }
  .visitors-chart, .top-pages-card { grid-column: span 2; }
}
@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .brand { width: 100%; flex-wrap: wrap; }
  .topbar nav { justify-content: flex-start; }
  .stats-grid, .stats-grid.small, .columns, .form-grid, .filters, .domain-row, .user-row, .hero, .dashboard-filter-card, .two-panels { grid-template-columns: 1fr; }
  .actions { justify-content: flex-start; }
  .hero h1 { font-size: 42px; }
}
@media (max-width: 680px) {
  .wrap { padding: 18px 10px 60px; }
  .dashboard-shell { padding: 10px; border-radius: 22px; }
  .dash-topline { flex-direction: column; }
  .kpi-grid, .dash-grid-main, .dash-health-rail, .platform-strip { grid-template-columns: 1fr; }
  .visitors-chart, .top-pages-card, .main-health { grid-column: auto; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .timeline-bars { grid-template-columns: repeat(7,1fr); }
  .timeline-bars div:nth-child(-n+7) { display: none; }
}
@media (max-width: 520px) {
  .topbar { padding: 14px 18px; }
  .panel, .login-card { border-radius: 18px; padding: 18px; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 34px; }
  .hero-text { font-size: 17px; }
  .stat-card strong { font-size: 28px; }
}
