/* CovertVPN Admin Panel — Dark Theme */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --border: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #eab308;
    --radius: 8px;
}

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

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
}
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 1.5rem;
    max-width: 1200px;
}

/* Sidebar */
.sidebar-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.1rem;
}
.sidebar-subtitle { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.nav-list { list-style: none; padding: 0.5rem 0; flex: 1; }
.nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 1rem; color: var(--text-muted);
    text-decoration: none; font-size: 0.875rem;
    border-radius: 0; transition: all 0.15s;
}
.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-icon { width: 1.25rem; text-align: center; }
.sidebar-footer { padding: 0.75rem; border-top: 1px solid var(--border); }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }

/* Page title */
.page-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
td { font-size: 0.875rem; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Forms */
label { display: block; margin-bottom: 0.375rem; color: var(--text-muted); font-size: 0.8rem; font-weight: 500; }
input[type="text"], input[type="password"], textarea, select {
    width: 100%; padding: 0.6rem 0.75rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg); color: var(--text);
    font-size: 0.875rem; font-family: inherit;
    margin-bottom: 0.75rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 100px; }
select { cursor: pointer; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem; border: none; border-radius: var(--radius);
    font-size: 0.875rem; cursor: pointer; text-decoration: none;
    font-family: inherit; transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: var(--surface-hover); color: var(--text); }
.btn-secondary:hover { background: #475569; }
.btn-sm { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
.btn-group { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.875rem; }
.alert-success { background: #14532d; border: 1px solid #166534; color: #86efac; }
.alert-error { background: #7f1d1d; border: 1px solid #991b1b; color: #fca5a5; }
.alert-warning { background: #713f12; border: 1px solid #a16207; color: #fde047; }
.alert-info { background: #1e3a5f; border: 1px solid #1d4ed8; color: #93c5fd; }

/* Badges */
.badge {
    display: inline-block; padding: 0.15rem 0.5rem;
    font-size: 0.7rem; font-weight: 600; border-radius: 4px;
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-success { background: var(--success); color: #000; }
.badge-warning { background: var(--warning); color: #000; }
.badge-error { background: var(--error); color: #fff; }
.badge-muted { background: var(--surface-hover); color: var(--text-muted); }

/* Monospace text */
.mono { font-family: 'Courier New', Consolas, monospace; font-size: 0.8rem; word-break: break-all; }

/* Truncated address */
.addr { font-family: monospace; font-size: 0.8rem; }

/* Utility */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }

/* Login page (standalone) */
.login-wrapper {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
}
.login-card { width: 100%; max-width: 400px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-brand span, .nav-link span:not(.nav-icon), .sidebar-subtitle, .sidebar-footer a { display: none; }
    .sidebar-brand { text-align: center; font-size: 0.8rem; }
    .main-content { margin-left: 60px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
