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

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #273449;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --green: #4ade80;
  --red: #f87171;
  --blue: #60a5fa;
  --yellow: #fbbf24;
}

body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; line-height: 1.5; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 40px; width: 100%; max-width: 360px; text-align: center; }
.login-logo { font-size: 40px; margin-bottom: 12px; }
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { color: var(--text-muted); margin-bottom: 24px; font-size: 13px; }

/* Header */
.header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.header-left { display: flex; align-items: center; gap: 12px; }
.header-flag { font-size: 24px; }
.header-title { font-weight: 700; font-size: 15px; }
.header-sub { color: var(--text-muted); font-size: 12px; }
.header-stats { display: flex; align-items: center; gap: 20px; }
.stat { text-align: center; }
.stat-value { font-weight: 700; font-size: 18px; }
.stat-label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.online-text { color: var(--green); }

/* Main */
.main { padding: 24px; max-width: 1100px; margin: 0 auto; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 16px; font-weight: 600; }

/* Add form */
.add-form { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.add-form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hidden { display: none !important; }

/* User grid */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.user-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.user-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.user-status-row { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--text-muted); }
.user-name { font-weight: 600; font-size: 15px; }
.user-ip { color: var(--text-muted); font-size: 12px; font-family: monospace; }
.user-badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-online { background: rgba(74,222,128,0.15); color: var(--green); }
.badge-offline { background: rgba(148,163,184,0.1); color: var(--text-muted); }

/* Traffic */
.user-traffic { display: flex; gap: 16px; background: var(--surface2); border-radius: 6px; padding: 8px 12px; }
.traffic-item { display: flex; align-items: center; gap: 6px; }
.traffic-arrow { font-weight: 700; color: var(--blue); }
.traffic-arrow.down { color: var(--green); }
.traffic-value { font-size: 13px; font-family: monospace; }

/* User actions */
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Result page */
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px; max-width: 480px; margin: 32px auto; }
.result-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.result-check { font-size: 32px; color: var(--green); }
.result-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.qr-wrapper { background: white; border-radius: 8px; padding: 16px; text-align: center; margin-bottom: 20px; }
.qr-img { max-width: 100%; width: 280px; height: auto; }
.result-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.result-note { background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.3); border-radius: 6px; padding: 12px; font-size: 13px; color: var(--yellow); }
.result-note a { color: var(--blue); }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* Alerts */
.alert { border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: var(--red); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; border: none; transition: opacity 0.15s; white-space: nowrap; }
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--green); color: #0f172a; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-danger { background: rgba(248,113,113,0.15); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.btn-full { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Forms */
.input { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; color: var(--text); font-size: 14px; outline: none; }
.input:focus { border-color: var(--green); }
