*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --border: #2a2a38;
  --border2: #3a3a50;
  --accent: #e8ff47;
  --accent2: #7c6af7;
  --text: #e8e8f0;
  --text2: #8888aa;
  --text3: #555570;
  --ok: #47ffaa;
  --warn: #ffb347;
  --err: #ff4747;
  --info: #47b8ff;
  --font: 'Syne', sans-serif;
  --mono: 'DM Mono', monospace;
  --sidebar-w: 220px;
  --radius: 8px;
}

body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }

.layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.logo { display: flex; align-items: center; gap: 12px; padding: 28px 20px 24px; border-bottom: 1px solid var(--border); }
.logo-icon { font-size: 24px; color: var(--accent); }
.logo-text { font-size: 15px; font-weight: 800; line-height: 1.2; }
.logo-text em { font-style: normal; color: var(--text2); font-weight: 400; }

.nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--text2); text-decoration: none;
  font-size: 14px; font-weight: 600;
  transition: all 0.15s; border: 1px solid transparent;
}
.nav-item:hover { color: var(--text); background: var(--bg3); }
.nav-item.active { color: var(--accent); background: rgba(232,255,71,0.08); border-color: rgba(232,255,71,0.2); }
.nav-icon { font-size: 16px; }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.sync-info { display: flex; align-items: center; gap: 8px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sync-dot.ok  { background: var(--ok);   box-shadow: 0 0 6px var(--ok); }
.sync-dot.warn{ background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.sync-label { font-size: 11px; color: var(--text2); line-height: 1.4; font-family: var(--mono); }
.btn-sync {
  width: 100%; padding: 8px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text2);
  font-family: var(--font); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.btn-sync:hover { color: var(--accent); border-color: var(--accent); }

/* MAIN */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* TOPBAR */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 32px; border-bottom: 1px solid var(--border); background: var(--bg2);
}
.topbar h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.topbar-sub { font-size: 12px; color: var(--text3); font-family: var(--mono); display: block; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.badge-server {
  font-family: var(--mono); font-size: 11px; color: var(--ok);
  background: rgba(71,255,170,0.08); border: 1px solid rgba(71,255,170,0.2);
  padding: 4px 10px; border-radius: 4px;
}

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--border); border-bottom: 1px solid var(--border); }
.kpi-card { background: var(--bg2); padding: 28px 24px; position: relative; }
.kpi-card.kpi-primary { border-top: 3px solid var(--accent2); }
.kpi-card.kpi-warn    { border-top: 3px solid var(--warn); }
.kpi-label { font-size: 11px; color: var(--text3); font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.kpi-value { font-size: 36px; font-weight: 800; letter-spacing: -1px; line-height: 1; margin-bottom: 6px; }
.kpi-sub   { font-size: 12px; color: var(--text2); }
.btn-send-all {
  position: absolute; bottom: 16px; right: 16px;
  padding: 6px 12px; background: var(--warn); color: #000;
  border: none; border-radius: 4px;
  font-family: var(--font); font-size: 11px; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-send-all:hover { opacity: 0.8; }

/* SECTION */
.section { padding: 28px 32px; flex: 1; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-header h2 { font-size: 16px; font-weight: 700; }
.search-input {
  padding: 8px 14px; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text); font-family: var(--font);
  font-size: 13px; width: 240px; outline: none; transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--accent2); }

/* TABLE */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg3); }
.data-table th {
  padding: 12px 16px; text-align: left;
  font-size: 11px; color: var(--text3); font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--bg3); }

.domain-link { color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px; }
.domain-link:hover { color: var(--accent); }
.cell-number  { font-family: var(--mono); font-size: 13px; color: var(--text2); }
.cell-date    { font-family: var(--mono); font-size: 12px; color: var(--text3); }
.cell-title   { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); font-size: 12px; }
.cell-actions { display: flex; gap: 8px; align-items: center; }

/* BADGES */
.badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-family: var(--mono); font-weight: 500; }
.badge-ok   { background: rgba(71,255,170,0.12); color: var(--ok);   border: 1px solid rgba(71,255,170,0.2); }
.badge-warn { background: rgba(255,179,71,0.12);  color: var(--warn); border: 1px solid rgba(255,179,71,0.2); }
.badge-err  { background: rgba(255,71,71,0.12);   color: var(--err);  border: 1px solid rgba(255,71,71,0.2); }
.badge-info { background: rgba(71,184,255,0.12);  color: var(--info); border: 1px solid rgba(71,184,255,0.2); }

/* BUTTONS */
.btn-action {
  padding: 6px 12px; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 4px; color: var(--text2); font-family: var(--font);
  font-size: 12px; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.15s; white-space: nowrap;
}
.btn-action:hover { color: var(--accent); border-color: var(--accent); }
.btn-action:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost { color: var(--text3); }
.btn-primary {
  padding: 8px 16px; background: var(--accent); border: none;
  border-radius: var(--radius); color: #000; font-family: var(--font);
  font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-ghost-link { color: var(--text2); text-decoration: none; font-size: 13px; }
.btn-ghost-link:hover { color: var(--text); }

/* RATE BAR */
.rate-bar { display: flex; align-items: center; gap: 8px; min-width: 100px; }
.rate-fill { height: 4px; background: var(--accent2); border-radius: 2px; flex: 1; max-width: 60px; }
.rate-bar span { font-family: var(--mono); font-size: 11px; color: var(--text2); }

/* TOAST */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 14px 20px;
  font-size: 13px; font-weight: 600;
  opacity: 0; transform: translateY(10px);
  transition: all 0.3s; z-index: 9999; max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok   { border-color: var(--ok);   color: var(--ok); }
.toast.err  { border-color: var(--err);  color: var(--err); }
.toast.info { border-color: var(--info); color: var(--info); }