@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
    --bg-primary: #0a0f1e;
    --bg-secondary: #0f172a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(99, 179, 237, 0.6);
    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --green: #10b981;
    --red: #ef4444;
    --yellow: #f59e0b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html {
    scroll-behavior: smooth
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, .08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, .06) 0%, transparent 50%);
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    background: rgba(15, 23, 42, .95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2
}

.logo-text span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted)
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    background: var(--bg-card);
    color: var(--text-primary)
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, .2), rgba(139, 92, 246, .1));
    color: var(--text-primary);
    border: 1px solid rgba(99, 102, 241, .3);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-2));
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    font-size: 18px;
    width: 20px;
    text-align: center
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}

.sidebar-footer .nav-link {
    color: var(--text-muted)
}

.sidebar-footer .nav-link:hover {
    color: var(--red)
}

/* ── MAIN CONTENT ──────────────────────────────────────────── */
.main {
    margin-left: 240px;
    min-height: 100vh;
    padding: 32px
}

.page-header {
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px
}

.page-header-text h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px
}

.page-header-text p {
    font-size: 14px;
    color: var(--text-secondary)
}

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, .15)
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary)
}

/* ── STAT CARDS ────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
}

.stat-card.blue::before {
    background: linear-gradient(90deg, var(--accent), var(--accent-2))
}

.stat-card.purple::before {
    background: linear-gradient(90deg, var(--accent-2), #d946ef)
}

.stat-card.green::before {
    background: linear-gradient(90deg, var(--green), #34d399)
}

.stat-card.red::before {
    background: linear-gradient(90deg, var(--red), #f87171)
}

.stat-card.yellow::before {
    background: linear-gradient(90deg, var(--yellow), #fcd34d)
}

.stat-card.gray::before {
    background: linear-gradient(90deg, #475569, #64748b)
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow)
}

.stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    word-break: break-all
}

.stat-value.sm {
    font-size: 22px
}

.stat-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    opacity: .15
}

/* Progress bar inside stat card */
.stat-progress {
    margin-top: 12px
}

.stat-progress-bar {
    height: 5px;
    background: rgba(255, 255, 255, .06);
    border-radius: 50px;
    overflow: hidden
}

.stat-progress-bar div {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 50px;
    transition: width .4s ease
}

.stat-progress-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px
}

/* ── CHARTS ────────────────────────────────────────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px
}

.chart-box {
    position: relative
}

#noDataLabel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 12px;
    display: none;
}

canvas {
    max-height: 220px
}

/* ── FORMS ─────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 7px
}

.required {
    color: var(--red);
    margin-left: 3px
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, .06);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
    color: var(--text-muted)
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6
}

select.form-control {
    cursor: pointer;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, .4)
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border)
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, .2)
}

.btn-success {
    background: linear-gradient(135deg, var(--green), #059669);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, .25);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, .35)
}

.btn-danger {
    background: linear-gradient(135deg, var(--red), #dc2626);
    color: #fff
}

.btn-danger:hover {
    transform: translateY(-1px)
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12px
}

.btn-lg {
    padding: 13px 24px;
    font-size: 15px
}

.btn[disabled],
.btn.disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

/* ── ALERT BANNER ──────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.alert-warning {
    background: rgba(245, 158, 11, .1);
    border: 1px solid rgba(245, 158, 11, .25);
    color: #fcd34d
}

.alert-success {
    background: rgba(16, 185, 129, .1);
    border: 1px solid rgba(16, 185, 129, .25);
    color: #6ee7b7
}

.alert-danger {
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .25);
    color: #fca5a5
}

/* ── TOAST (activation popup) ──────────────────────────────── */
#activationModal {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .3);
    color: #fca5a5;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    z-index: 9999;
    width: 320px;
    box-shadow: var(--shadow);
    font-size: 13px;
}

#activationModal .title {
    font-weight: 700;
    margin-bottom: 4px
}

#activationModal .msg {
    opacity: .85
}

#activationModal .close {
    position: absolute;
    top: 8px;
    right: 10px;
    cursor: pointer;
    font-size: 16px;
    color: #fca5a5;
    opacity: .7;
}

#activationModal .close:hover {
    opacity: 1
}

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge.active,
.badge-success {
    background: rgba(16, 185, 129, .15);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, .3)
}

.badge.inactive,
.badge-danger {
    background: rgba(239, 68, 68, .15);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, .3)
}

.badge.admin,
.badge-info {
    background: rgba(99, 102, 241, .15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, .3)
}

.badge-warning {
    background: rgba(245, 158, 11, .15);
    color: var(--yellow);
    border: 1px solid rgba(245, 158, 11, .3)
}

/* ── TABLE ─────────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border)
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--bg-card)
}

thead tr {
    border-bottom: 1px solid var(--border)
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    background: rgba(255, 255, 255, .02);
}

tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    transition: var(--transition)
}

tbody tr:hover {
    background: rgba(255, 255, 255, .03)
}

tbody tr.user-inactive td {
    opacity: .55
}

tbody td {
    padding: 13px 16px;
    color: var(--text-secondary);
    vertical-align: middle;
    white-space: nowrap;
}

td.email {
    color: var(--text-primary);
    font-weight: 500;
    text-align: left
}

/* ── SEARCH / FILTER BAR ───────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap
}

.search-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition);
    width: 260px;
}

.search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow)
}

.search-input::placeholder {
    color: var(--text-muted)
}

/* ── MANAGE DROPDOWN (admin) ───────────────────────────────── */
.manage {
    position: relative;
    display: inline-block
}

.manage-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.manage-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow)
}

.dropdown {
    display: none;
    position: fixed;
    background: rgba(15, 23, 42, .98);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    min-width: 240px;
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    backdrop-filter: blur(20px);
    max-height: 90vh;
    overflow-y: auto;
}

.dropdown.show {
    display: block
}

.dropdown.up {
    transform: translateY(-100%)
}

.dd-group {
    margin-bottom: 10px
}

.dd-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: var(--transition);
}

.dd-btn:hover {
    filter: brightness(1.1)
}

.dd-btn.activate {
    background: linear-gradient(135deg, var(--green), #059669);
    color: #fff
}

.dd-btn.deactivate {
    background: linear-gradient(135deg, var(--red), #dc2626);
    color: #fff
}

.dd-btn.add {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff
}

.dd-btn.set {
    background: linear-gradient(135deg, var(--accent-2), #7c3aed);
    color: #fff
}

.dd-btn.reset {
    background: linear-gradient(135deg, var(--yellow), #d97706);
    color: #fff
}

.dd-btn.delete {
    background: linear-gradient(135deg, var(--red), #7f1d1d);
    color: #fff
}

.small-input {
    width: 100%;
    background: rgba(255, 255, 255, .04);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    margin-bottom: 6px;
    outline: none;
}

.small-input:focus {
    border-color: var(--border-focus)
}

#blurOverlay {
    position: fixed;
    top: 0;
    left: 240px; /* start after sidebar so nav links stay clickable */
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(3px);
    z-index: 900;
    display: none;
}

/* ── AUTH PAGES ────────────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px
}

.auth-logo .logo-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 24px var(--accent-glow);
}

.auth-logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px
}

.auth-logo p {
    font-size: 13px;
    color: var(--text-muted)
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted)
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500
}

.auth-footer a:hover {
    text-decoration: underline
}

/* ── INLINE ALERT (campaign error/success) ─────────────────── */
#alertBox {
    display: none;
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .3);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    z-index: 9999;
    min-width: 340px;
    max-width: 520px;
    font-size: 13px;
    box-shadow: var(--shadow);
    display: none;
}

#alertBox .alert-row {
    display: flex;
    align-items: center;
    gap: 10px
}

#alertBox .title {
    font-weight: 700;
    color: #f87171
}

#alertBox .msg {
    font-size: 12px;
    margin-top: 2px;
    opacity: .9
}

#alertBox .close {
    margin-left: auto;
    cursor: pointer;
    font-size: 16px;
    opacity: .7
}

#alertBox .close:hover {
    opacity: 1
}

#errorBox {
    color: var(--red);
    font-size: 13px;
    margin-top: 10px;
    display: none
}

#successBox {
    margin-top: 10px;
    display: none;
    padding: 14px 16px;
    background: rgba(16, 185, 129, .1);
    border: 1px solid rgba(16, 185, 129, .25);
    border-radius: var(--radius-sm);
    color: #6ee7b7;
    font-size: 13px;
}

.success-title {
    font-weight: 700;
    margin-bottom: 4px
}

/* ── RECIPIENT COUNTER PILL ────────────────────────────────── */
.recipient-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, .15);
    border: 1px solid rgba(99, 102, 241, .3);
    color: #a5b4fc;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ── FILE DROP ─────────────────────────────────────────────── */
.file-drop {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.file-drop:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, .05)
}

.file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%
}

/* ── DOT INDICATORS ────────────────────────────────────────── */
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block
}

.dot-green {
    background: var(--green)
}

.dot-red {
    background: var(--red)
}

.dot-blue {
    background: var(--accent)
}

.dot.pulse {
    animation: pulse 1.5s infinite
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .3
    }
}

/* ── PAGINATION ─────────────────────────────────────────────── */
#paginationWrap {
    text-align: center;
    margin-top: 20px
}

#paginationWrap a,
#paginationWrap span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    margin: 0 2px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

#paginationWrap a:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent)
}

#paginationWrap .active-page {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
    font-weight: 700;
}

/* ── CAMPAIGN 2-COL ─────────────────────────────────────────── */
.campaign-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start
}

@media(max-width:900px) {
    .campaign-grid {
        grid-template-columns: 1fr
    }
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media(max-width:768px) {
    .sidebar {
        width: 60px
    }

    .logo-text,
    .nav-link span {
        display: none
    }

    .nav-link {
        justify-content: center
    }

    .main {
        margin-left: 60px;
        padding: 16px
    }

    .form-row {
        grid-template-columns: 1fr
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr
    }

    .charts-grid {
        grid-template-columns: 1fr
    }

    .campaign-grid {
        grid-template-columns: 1fr
    }

    #blurOverlay {
        backdrop-filter: none;
        background: rgba(0, 0, 0, .65)
    }

    .dropdown {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        border-radius: 16px 16px 0 0;
        min-width: unset;
        padding: 28px 16px;
    }
}

@media(max-width:480px) {
    .stats-grid {
        grid-template-columns: 1fr
    }
}

::-webkit-scrollbar {
    width: 6px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .15);
    border-radius: 3px
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .25)
}

/* ── TOGGLE SWITCH ──────────────────────────────────────────── */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0
}

.toggle-track {
    display: inline-block;
    position: relative;
    width: 40px;
    height: 22px;
    background: rgba(255, 255, 255, .12);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, .15);
    transition: background .25s ease, border-color .25s ease;
}

.toggle-track.on {
    background: rgba(16, 185, 129, .8);
    border-color: rgba(16, 185, 129, .6);
    box-shadow: 0 0 10px rgba(16, 185, 129, .35);
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.toggle-track.on .toggle-thumb {
    transform: translateX(18px)
}

/* ── STATUS DOT BLINK ───────────────────────────────────────── */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 4px rgba(16, 185, 129, .8)
    }

    50% {
        opacity: .4;
        box-shadow: none
    }
}

.dot-blink {
    animation: blink 1.5s ease-in-out infinite;
}