:root {
    --brand: #6366f1;
    --brand-dark: #4f46e5;
    --sidebar-bg: #111827;
    --sidebar-text: #9ca3af;
    --sidebar-active: #6366f1;
    --topbar-bg: #ffffff;
    --body-bg: #f1f5f9;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--body-bg);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: #1f2937;
}

.app-body {
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 250px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 1.25rem 1.25rem;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand:hover {
    color: #fff;
}

.nav-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    padding: 1rem 1.25rem 0.35rem;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-left: 3px solid transparent;
    font-size: 0.92rem;
}

.sidebar-nav .nav-link i {
    font-size: 1.05rem;
    width: 1.2rem;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.18);
    border-left-color: var(--sidebar-active);
}

/* ---------- Topbar ---------- */
.app-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    background: var(--topbar-bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    min-height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.btn-icon {
    background: transparent;
    border: 0;
    font-size: 1.3rem;
    color: #4b5563;
    padding: 0.25rem 0.5rem;
}

/* ---------- Cards ---------- */
.stat-card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ---------- IP box ---------- */
.ip-box {
    background: #0f172a;
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    color: #e2e8f0;
}

.ip-display {
    font-family: "Consolas", "Courier New", monospace;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    word-break: break-all;
    min-height: 2rem;
}

.ip-display.blurred {
    filter: blur(6px);
    user-select: none;
    color: #94a3b8;
}

.blurred {
    filter: blur(6px);
    user-select: none;
    color: #94a3b8;
}

.ip-display.visible {
    filter: none;
    color: #4ade80;
}

/* ---------- Auth ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
    padding: 1rem;
}

.auth-shell {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    border-radius: 18px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--brand);
    color: #fff;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Progress ---------- */
.limit-progress {
    height: 10px;
    border-radius: 999px;
}

.limit-progress .progress-bar {
    background: linear-gradient(90deg, var(--brand), #8b5cf6);
    border-radius: 999px;
}

/* ---------- Tables ---------- */
.table-card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.table-card .table {
    margin-bottom: 0;
}

.table-card .table thead th {
    background: #f8fafc;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
}

.table-card .table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* ---------- Forms ---------- */
.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}

.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-brand:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

/* ---------- Misc ---------- */
.monospace {
    font-family: "Consolas", "Courier New", monospace;
}

.pagination {
    margin-bottom: 0;
}

.dropdown-item i {
    width: 1.1rem;
    text-align: center;
}
