:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: #0b1329;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family); background-color: var(--bg-dark); color: var(--text-main); line-height: 1.5; min-height: 100vh; }

.login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(circle at top, #1e293b, #0f172a); }
.login-card { background: var(--bg-card); border: 1px solid var(--border-color); padding: 2.5rem; border-radius: 12px; width: 100%; max-width: 420px; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5); }
.brand { text-align: center; margin-bottom: 2rem; }
.brand .logo-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.brand h1 { font-size: 1.5rem; font-weight: 700; }
.brand p { color: var(--text-muted); font-size: 0.875rem; }

.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 280px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; }
.sidebar-header { padding: 1.5rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid var(--border-color); }
.logo-badge { font-size: 1.8rem; }
.sidebar-header h2 { font-size: 1.25rem; font-weight: 700; }
.subdomain-tag { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

.nav-menu { padding: 1rem 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; background: transparent; color: var(--text-muted); border: none; border-radius: 8px; cursor: pointer; font-size: 0.95rem; font-weight: 500; text-align: left; transition: all 0.2s; }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-main); }
.nav-item.active { background: var(--primary); color: white; }

.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.user-info { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar { font-size: 1.5rem; }
.user-name { font-weight: 600; font-size: 0.9rem; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

.main-content { flex: 1; padding: 2rem; overflow-y: auto; }
.top-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.header-actions { display: flex; align-items: center; gap: 1rem; }

.pulse-status { padding: 0.4rem 0.8rem; border-radius: 9999px; font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.5rem; }
.pulse-status.online { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.pulse-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.content-section { display: none; }
.content-section.active { display: block; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 1.5rem; }
.stat-label { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 2rem; font-weight: 700; margin: 0.25rem 0; }
.stat-meta { font-size: 0.75rem; color: var(--text-muted); }

.text-success { color: var(--success); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 1.5rem; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.notice-box { background: rgba(59, 130, 246, 0.1); border-left: 4px solid var(--primary); padding: 1.25rem 1.5rem; border-radius: 6px; }

.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-color); }
.data-table th { background: rgba(0, 0, 0, 0.2); color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table td { font-size: 0.9rem; }

.badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.badge-online { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge-offline { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.4rem; }
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; padding: 0.75rem 1rem; background: #0f172a; border: 1px solid var(--border-color); border-radius: 6px; color: white; font-size: 0.95rem;
}
input:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }
.code-font { font-family: var(--font-mono); }

.btn { padding: 0.65rem 1.25rem; border-radius: 6px; font-weight: 600; font-size: 0.9rem; cursor: pointer; border: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #334155; color: white; }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

.section-toolbar { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.search-input { max-width: 400px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-dialog { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; width: 90%; max-width: 520px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5); }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-close { background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 0.75rem; }

.qr-container { background: white; padding: 1rem; border-radius: 8px; display: inline-block; }
.input-with-copy { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.error-badge { background: rgba(239, 68, 68, 0.2); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.4); padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.85rem; }

.hidden { display: none !important; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }
