/* =============================================
   WA Marketing Pro — Design System
   Modern SaaS Dashboard with Light/Dark Theme
   ============================================= */

/* ---- CSS Variables ---- */
:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    /* Light theme */
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-sidebar-active: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    --text-primary: #1a1a2e;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-sidebar: #cbd5e1;
    --text-sidebar-active: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --accent: #25d366;
    --accent-hover: #1ebe57;
    --accent-light: rgba(37, 211, 102, 0.1);
    --accent-glow: rgba(37, 211, 102, 0.3);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.1);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
[data-theme="dark"], .dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #1a2332;
    --bg-sidebar: #0a0f1a;
    --bg-sidebar-hover: #141c2e;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border: #334155;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
input, select, textarea, button { font-family: var(--font); }

/* ---- Sidebar ---- */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    z-index: 1000;
    display: flex; flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255,255,255,0.05);
}
.sidebar-header {
    padding: 20px 20px 16px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo {
    display: flex; align-items: center; gap: 12px;
}
.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}
.logo-text {
    font-size: 18px; font-weight: 700; color: #fff;
    letter-spacing: -0.5px;
}
.sidebar-close {
    display: none; background: none; border: none;
    color: var(--text-sidebar); font-size: 20px; cursor: pointer;
}
.sidebar-nav {
    flex: 1; overflow-y: auto; padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.nav-section { padding: 8px 0; }
.nav-label {
    padding: 8px 24px 6px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: rgba(203,213,225,0.4);
}
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px; margin: 2px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 14px; font-weight: 500;
    transition: var(--transition);
    position: relative;
}
.nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: #fff;
}
.nav-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.25);
}
.nav-link i { width: 20px; text-align: center; font-size: 15px; }
.nav-badge {
    margin-left: auto; font-size: 10px;
    color: var(--accent); font-weight: 700;
}
.nav-badge.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.user-card {
    display: flex; align-items: center; gap: 12px;
}
.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: 700;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 13px; font-weight: 600; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--text-tertiary); }

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.content-wrapper {
    padding: 24px;
    max-width: 1400px;
}

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-height);
    padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(12px);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.menu-toggle {
    display: none; background: none; border: none;
    font-size: 20px; color: var(--text-primary); cursor: pointer;
}
.page-title {
    font-size: 20px; font-weight: 700;
    letter-spacing: -0.5px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-divider {
    width: 1px; height: 24px; background: var(--border);
}
.theme-toggle {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); font-size: 16px;
    transition: var(--transition);
}
.theme-toggle:hover {
    border-color: var(--accent); color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}
.light-mode .light-icon, .dark-mode .dark-icon { display: none; }
.light-mode .dark-icon, .dark-mode .light-icon { display: inline; }

.btn-logout {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: var(--radius-sm);
    background: var(--danger-light); color: var(--danger);
    font-size: 13px; font-weight: 600;
    transition: var(--transition);
}
.btn-logout:hover {
    background: var(--danger); color: #fff;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}
.card-title {
    font-size: 16px; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
}
.card-body { padding: 24px; }
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

/* ---- Stat Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px; margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex; align-items: flex-start; justify-content: space-between;
    transition: var(--transition);
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; border-radius: 3px 3px 0 0;
}
.stat-card.accent::before { background: linear-gradient(90deg, #25d366, #128c7e); }
.stat-card.info::before { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.stat-card.warning::before { background: linear-gradient(90deg, #f59e0b, #f97316); }
.stat-card.danger::before { background: linear-gradient(90deg, #ef4444, #ec4899); }
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-info h3 {
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.stat-value {
    font-size: 32px; font-weight: 800;
    letter-spacing: -1px; line-height: 1;
}
.stat-change {
    font-size: 12px; margin-top: 8px;
    display: flex; align-items: center; gap: 4px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.stat-card.accent .stat-icon { background: var(--accent-light); color: var(--accent); }
.stat-card.info .stat-icon { background: var(--info-light); color: var(--info); }
.stat-card.warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.danger .stat-icon { background: var(--danger-light); color: var(--danger); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    border: none; cursor: pointer;
    transition: var(--transition);
    text-decoration: none; line-height: 1.4;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
    transform: translateY(-1px); color: #fff;
}
.btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger {
    background: var(--danger); color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: #dc2626; }
.btn-info {
    background: var(--info); color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.btn-warning {
    background: var(--warning); color: #fff;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}
.btn-outline:hover {
    background: var(--accent); color: #fff;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; margin-bottom: 8px;
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary);
}
.form-control {
    width: 100%; padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.form-control::placeholder { color: var(--text-tertiary); }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-text {
    font-size: 12px; color: var(--text-tertiary); margin-top: 4px;
}
.form-check {
    display: flex; align-items: center; gap: 8px;
}
.form-check input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--accent);
}

/* ---- Tables ---- */
.table-container {
    overflow-x: auto; border-radius: var(--radius-md);
}
.table {
    width: 100%; border-collapse: separate;
    border-spacing: 0;
}
.table th {
    padding: 14px 16px;
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    text-align: left; white-space: nowrap;
}
.table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.table tr:hover td { background: var(--accent-light); }
.table tr:last-child td { border-bottom: none; }

/* ---- Badges ---- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-accent { background: var(--accent-light); color: var(--accent); }

/* ---- Alerts ---- */
.alert {
    padding: 14px 20px; border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: 12px;
    margin: 0 24px 16px; font-size: 14px; font-weight: 500;
    animation: slideDown 0.3s ease;
}
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid rgba(59,130,246,0.2); }
.alert-close {
    margin-left: auto; background: none; border: none;
    font-size: 18px; cursor: pointer; color: inherit; opacity: 0.7;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Modals ---- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
    z-index: 2000; padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s ease;
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: var(--bg-tertiary);
    cursor: pointer; font-size: 16px; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex; gap: 12px; justify-content: flex-end;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---- Progress Bar ---- */
.progress-bar {
    height: 8px; background: var(--bg-tertiary);
    border-radius: 10px; overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 10px;
    background: linear-gradient(90deg, #25d366 0%, #128c7e 100%);
    transition: width 0.6s ease;
}
.progress-fill.danger { background: linear-gradient(90deg, #ef4444, #ec4899); }

/* ---- Auth Pages ---- */
.auth-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative; overflow: hidden;
}
.auth-wrapper::before {
    content: ''; position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(37,211,102,0.15) 0%, transparent 70%);
    top: -200px; right: -200px;
    border-radius: 50%;
}
.auth-wrapper::after {
    content: ''; position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(18,140,126,0.1) 0%, transparent 70%);
    bottom: -100px; left: -100px;
    border-radius: 50%;
}
.auth-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%; max-width: 440px;
    position: relative; z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-logo {
    text-align: center; margin-bottom: 32px;
}
.auth-logo .logo-icon {
    width: 56px; height: 56px;
    margin: 0 auto 16px;
    font-size: 28px;
}
.auth-logo h1 {
    color: #fff; font-size: 24px; font-weight: 800;
    letter-spacing: -0.5px;
}
.auth-logo p { color: #94a3b8; font-size: 14px; margin-top: 6px; }
.auth-card .form-control {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255,255,255,0.1);
    color: #f1f5f9;
}
.auth-card .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,211,102,0.2);
}
.auth-card .form-control::placeholder { color: #64748b; }
.auth-card .form-label { color: #94a3b8; }
.auth-footer {
    text-align: center; margin-top: 24px;
    color: #94a3b8; font-size: 14px;
}
.auth-footer a { color: var(--accent); font-weight: 600; }
.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5; padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px; font-size: 14px;
    display: flex; align-items: center; gap: 8px;
}

/* ---- Sidebar Overlay (mobile) ---- */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none; opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block; opacity: 1;
}

/* ---- Grid Layouts ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---- QR Code area ---- */
.qr-container {
    display: flex; flex-direction: column; align-items: center;
    padding: 32px; gap: 20px;
}
.qr-box {
    width: 280px; height: 280px;
    background: #fff;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.qr-box canvas, .qr-box img {
    width: 260px; height: 260px;
}
.qr-status {
    text-align: center;
}
.qr-status .status-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; margin-right: 6px;
}
.status-dot.connected { background: var(--success); box-shadow: 0 0 10px var(--success); }
.status-dot.disconnected { background: var(--danger); }
.status-dot.connecting { background: var(--warning); animation: pulse 1.5s infinite; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-tertiary);
}
.empty-state i {
    font-size: 48px; margin-bottom: 16px;
    opacity: 0.3;
}
.empty-state h3 {
    font-size: 18px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 8px;
}
.empty-state p { margin-bottom: 20px; }

/* ---- Tags ---- */
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 12px; font-weight: 600;
}
.tag-remove {
    cursor: pointer; font-size: 14px; opacity: 0.7;
}
.tag-remove:hover { opacity: 1; }

/* ---- Pagination ---- */
.pagination {
    display: flex; gap: 6px; justify-content: center;
    padding: 20px 0;
}
.pagination a, .pagination span {
    padding: 8px 14px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active {
    background: var(--accent); border-color: var(--accent);
    color: #fff;
}

/* ---- Plan Cards ---- */
.plan-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    transition: var(--transition);
    position: relative;
}
.plan-card.featured {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
}
.plan-card.featured::before {
    content: 'POPULAR';
    position: absolute; top: -12px; left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff; padding: 4px 16px;
    border-radius: 20px; font-size: 11px; font-weight: 700;
    letter-spacing: 1px;
}
.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.plan-name { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.plan-price {
    font-size: 42px; font-weight: 800;
    letter-spacing: -2px; margin: 16px 0;
}
.plan-price span { font-size: 16px; color: var(--text-tertiary); font-weight: 500; }
.plan-features {
    list-style: none; text-align: left;
    margin: 24px 0;
}
.plan-features li {
    padding: 8px 0;
    font-size: 14px;
    display: flex; align-items: center; gap: 10px;
    color: var(--text-secondary);
}
.plan-features li i { color: var(--accent); font-size: 12px; }

/* ---- Tabs ---- */
.tabs {
    display: flex; gap: 4px; margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
}
.tab-btn {
    padding: 12px 20px;
    background: none; border: none;
    font-size: 14px; font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer; white-space: nowrap;
    position: relative;
    transition: var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); }
.tab-btn.active::after {
    content: ''; position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 2px; background: var(--accent);
    border-radius: 2px;
}
.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

/* ---- Charts ---- */
.chart-container {
    position: relative;
    height: 300px;
    padding: 16px;
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-tertiary); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.w-100 { width: 100%; }
.fw-bold { font-weight: 700; }

/* ---- Loading Spinner ---- */
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Tooltip ---- */
.tooltip-wrap {
    position: relative;
}
.tooltip-wrap::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 8px);
    left: 50%; transform: translateX(-50%);
    background: var(--bg-sidebar);
    color: #fff; padding: 6px 12px;
    border-radius: 6px; font-size: 12px;
    white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}
.tooltip-wrap:hover::after { opacity: 1; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .content-wrapper { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .auth-card { padding: 32px 24px; }
    .topbar { padding: 0 16px; }
    .btn-logout span { display: none; }
    .table th, .table td { padding: 10px 12px; font-size: 13px; }
}
@media (max-width: 480px) {
    .page-title { font-size: 16px; }
    .stat-value { font-size: 24px; }
}
