* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0f1117; color: #e2e8f0; line-height: 1.6; }
a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #161b22; border-right: 1px solid #30363d; display: flex; flex-direction: column; padding: 20px 0; }
.sidebar-brand { padding: 0 20px; margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }
.sidebar-brand .brand-icon { font-size: 22px; color: #58a6ff; }
.sidebar-brand .brand-text { font-size: 16px; font-weight: 700; color: #f0f6fc; }
.sidebar-nav { flex: 1; }
.nav-link { display: block; padding: 10px 20px; color: #8b949e; transition: all 0.15s; font-size: 14px; }
.nav-link:hover { color: #f0f6fc; background: #21262d; text-decoration: none; }
.nav-link.active { color: #58a6ff; background: #1a2332; border-right: 2px solid #58a6ff; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #30363d; }
.main-content { flex: 1; padding: 24px 32px; overflow-x: auto; }

/* Login page */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 32px; width: 380px; }
.login-brand { text-align: center; margin-bottom: 24px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-brand .brand-icon { font-size: 28px; color: #58a6ff; }
.login-brand .brand-text { font-size: 20px; font-weight: 700; color: #f0f6fc; }
.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; font-size: 13px; color: #8b949e; margin-bottom: 4px; }
.login-form input { width: 100%; padding: 10px 12px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #e2e8f0; font-size: 14px; }
.login-form input:focus { outline: none; border-color: #58a6ff; }

/* Forms */
.form-card { max-width: 520px; background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #8b949e; margin-bottom: 4px; }
.form-group input { width: 100%; padding: 10px 12px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #e2e8f0; font-size: 14px; }
.form-group input:focus { outline: none; border-color: #58a6ff; }
.input-prefix { display: flex; gap: 0; }
.input-prefix input { border-radius: 6px 0 0 6px; flex: 1; }
.input-prefix .prefix { padding: 10px 12px; background: #21262d; border: 1px solid #30363d; border-left: none; border-radius: 0 6px 6px 0; color: #8b949e; font-size: 13px; display: flex; align-items: center; }
.form-actions { display: flex; gap: 12px; margin-top: 20px; }

/* Buttons */
.btn { display: inline-block; padding: 8px 16px; background: #21262d; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; text-align: center; transition: all 0.15s; }
.btn:hover { background: #30363d; color: #f0f6fc; text-decoration: none; }
.btn-primary { background: #238636; border-color: #2ea043; color: #fff; }
.btn-primary:hover { background: #2ea043; }
.btn-success { background: #238636; border-color: #2ea043; color: #fff; }
.btn-success:hover { background: #2ea043; }
.btn-warning { background: #9e6a03; border-color: #bb8009; color: #fff; }
.btn-warning:hover { background: #bb8009; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn:disabled, .btn.btn-loading { opacity: 0.6; cursor: not-allowed; }

/* Spinner */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Page header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h1 { font-size: 22px; color: #f0f6fc; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 16px 20px; }
.stat-card .stat-label { font-size: 12px; color: #8b949e; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #f0f6fc; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 12px; font-size: 12px; color: #8b949e; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #30363d; }
.data-table td { padding: 10px 12px; font-size: 14px; border-bottom: 1px solid #21262d; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #161b22; }

/* Badge */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-active { background: #0d4429; color: #3fb950; }
.badge-suspended { background: #3d1520; color: #f85149; }
.badge-cancelled { background: #3d1520; color: #f85149; }
.badge-pending { background: #3b2e04; color: #d29922; }
.badge-success { background: #0d4429; color: #3fb950; }
.badge-error { background: #3d1520; color: #f85149; }
.badge-failure { background: #3d1520; color: #f85149; }
.badge-info { background: #0c2d6b; color: #58a6ff; }
.badge-warning { background: #3b2e04; color: #d29922; }

/* Detail grid */
.detail-grid { display: grid; gap: 16px; }
.detail-card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 20px; }
.detail-card h2 { font-size: 16px; font-weight: 600; color: #f0f6fc; margin-bottom: 16px; }
.detail-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px; font-size: 14px; }
.detail-list dt { color: #8b949e; }
.detail-list dd { color: #e2e8f0; }
.domain-list { list-style: none; }
.domain-list li { padding: 8px 0; border-bottom: 1px solid #21262d; }
.domain-list li:last-child { border-bottom: none; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form { display: inline; }

/* Alerts */
.alert { padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #3d1520; border: 1px solid #6e2b32; color: #f85149; }
.alert-success { background: #0d4429; border: 1px solid #1b7c3a; color: #3fb950; }
.alert-warning { background: #3b2e04; border: 1px solid #6e4f04; color: #d29922; }

/* Log viewer */
.log-viewer { background: #0d1117; border: 1px solid #30363d; border-radius: 8px; padding: 16px; max-height: 600px; overflow: auto; }
.log-viewer pre { font-family: 'SF Mono', Monaco, Consolas, monospace; font-size: 12px; color: #c9d1d9; white-space: pre-wrap; word-break: break-all; }

/* Empty state */
.empty-state { text-align: center; padding: 24px; color: #8b949e; }

/* Audit log */
.audit-card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 20px; overflow-x: auto; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit-table th { text-align: left; padding: 8px 12px; color: #8b949e; border-bottom: 1px solid #30363d; font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.audit-table td { padding: 8px 12px; border-bottom: 1px solid #21262d; vertical-align: top; }
.audit-table tr:last-child td { border-bottom: none; }
.audit-time { color: #8b949e; font-family: 'SF Mono', Monaco, monospace; font-size: 12px; white-space: nowrap; }
.audit-action { font-weight: 500; color: #f0f6fc; }
.audit-detail { color: #c9d1d9; max-width: 300px; word-break: break-word; }

/* Mobile */
@media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; padding: 12px 16px; flex-direction: row; align-items: center; border-right: none; border-bottom: 1px solid #30363d; }
    .sidebar-brand { margin-bottom: 0; }
    .sidebar-nav { display: flex; gap: 12px; }
    .sidebar-footer { padding: 0; border-top: none; }
    .main-content { padding: 16px; }
    .stats { grid-template-columns: 1fr; }
    .detail-list { grid-template-columns: 100px 1fr; }
    .action-buttons { flex-direction: column; }
    .data-table { font-size: 13px; }
}

/* MFA Styles */
.mfa-container { max-width: 480px; margin: 0 auto; }
.mfa-subtitle { color: #8b949e; margin-bottom: 24px; text-align: center; }
.mfa-form { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 32px; text-align: center; }
.mfa-form input[type="text"] { font-size: 32px; text-align: center; letter-spacing: 8px; padding: 12px; }
.mfa-logout { margin-top: 16px; text-align: center; }
.mfa-status { padding: 12px 16px; border-radius: 8px; margin-bottom: 24px; display: flex; align-items: center; gap: 8px; }
.mfa-active { background: #0d4429; border: 1px solid #1b7c3a; color: #3fb950; }
.mfa-inactive { background: #3d1520; border: 1px solid #6e2b32; color: #f85149; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.mfa-active .status-dot { background: #3fb950; }
.mfa-inactive .status-dot { background: #f85149; }
.mfa-action-form { margin-top: 16px; }
.mfa-setup-steps h2 { font-size: 18px; color: #f0f6fc; margin: 24px 0 12px; }
.mfa-setup-steps p { color: #8b949e; margin-bottom: 8px; }
.qr-container { text-align: center; margin: 16px 0; padding: 16px; background: #fff; border-radius: 12px; display: inline-block; }
.qr-container img { display: block; }
.manual-code { background: #0d1117; border: 1px solid #30363d; border-radius: 6px; padding: 12px; font-family: monospace; font-size: 16px; letter-spacing: 2px; text-align: center; color: #58a6ff; margin: 12px 0; word-break: break-all; }
@media (max-width: 768px) { .mfa-form input[type="text"] { font-size: 24px; letter-spacing: 4px; } }
