/* =============================================
   SocialAPI - Design System
   Inspired by narratheque.io (dark/purple theme)
   ============================================= */

/* ---------- CSS Variables: Dark theme (default) ---------- */
:root, [data-theme="dark"] {
    --bg-primary: #0a0a1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-input: #0f1629;
    --border-color: #2a2a4a;
    --border-light: #3a3a5a;

    --accent: #7c3aed;
    --accent-hover: #9333ea;
    --accent-light: #a78bfa;
    --accent-subtle: rgba(124, 58, 237, 0.15);

    --text-primary: #f1f1f1;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.15);

    --facebook: #1877F2;
    --instagram: #E4405F;
    --x-twitter: #000000;
    --linkedin: #0A66C2;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);

    --scrollbar-thumb: var(--border-color);
    --login-gradient: linear-gradient(135deg, var(--bg-primary) 0%, #1a0a2e 50%, var(--bg-primary) 100%);

    --sidebar-width: 260px;
    --header-height: 64px;
    --transition: all 0.2s ease;
}

/* ---------- CSS Variables: Light theme ---------- */
[data-theme="light"] {
    --bg-primary: #f4f2f7;
    --bg-secondary: #ffffff;
    --bg-card: #f9f8fc;
    --bg-input: #ffffff;
    --border-color: #e2dff0;
    --border-light: #d0cce0;

    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-light: #6d28d9;
    --accent-subtle: rgba(124, 58, 237, 0.08);

    --text-primary: #1e1b2e;
    --text-secondary: #5c5775;
    --text-muted: #8a839e;

    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --error: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.08);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.08);
    --info: #2563eb;
    --info-bg: rgba(37, 99, 235, 0.08);

    --shadow: 0 2px 12px rgba(100, 80, 140, 0.08);
    --shadow-lg: 0 4px 24px rgba(100, 80, 140, 0.12);

    --scrollbar-thumb: var(--border-color);
    --login-gradient: linear-gradient(135deg, #f4f2f7 0%, #ede5f7 50%, #f4f2f7 100%);
}

/* Light theme overrides for elements that need special treatment */
[data-theme="light"] .sidebar {
    box-shadow: 2px 0 12px rgba(100, 80, 140, 0.06);
}

[data-theme="light"] .sidebar-header h2 {
    -webkit-text-fill-color: var(--accent);
}

[data-theme="light"] .login-card .logo h1 {
    -webkit-text-fill-color: var(--accent);
}

[data-theme="light"] .page-header {
    box-shadow: 0 1px 4px rgba(100, 80, 140, 0.06);
}

[data-theme="light"] .stat-card:hover {
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.1);
}

[data-theme="light"] .composer-target.selected {
    background: rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .badge-x {
    background: rgba(0, 0, 0, 0.06);
    color: #1e1b2e;
}

[data-theme="light"] .social-card-header .platform-icon.x {
    background: #1e1b2e;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

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

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

/* ---------- Layout: Login Page ---------- */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: var(--login-gradient);
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-card .logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .logo h1 {
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card .logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

/* ---------- Layout: App Shell ---------- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--accent-subtle);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: var(--accent-subtle);
    color: var(--accent-light);
    border-left-color: var(--accent);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-info .name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-info .role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.page-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-header h1 {
    font-size: 1.3rem;
}

.page-body {
    padding: 2rem;
}

/* ---------- Cards & Panels ---------- */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1rem;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.purple {
    background: var(--accent-subtle);
    color: var(--accent-light);
}

.stat-card .stat-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-card .stat-icon.blue {
    background: var(--info-bg);
    color: var(--info);
}

.stat-card .stat-icon.orange {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-create {
    background: linear-gradient(135deg, #7c3aed, #9333ea, #a855f7);
    color: white;
    padding: 0.45rem 1.15rem 0.45rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
    letter-spacing: 0.02em;
    gap: 0.4rem;
}

.btn-create:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.45);
}

.btn-create:active {
    transform: translateY(0);
    box-shadow: 0 1px 6px rgba(124, 58, 237, 0.25);
}

.btn-create i.fa-plus {
    font-size: 0.5rem;
    background: rgba(255,255,255,0.25);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* ---------- Table ---------- */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-card);
}

th {
    padding: 0.8rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--accent-subtle);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-error {
    background: var(--error-bg);
    color: var(--error);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-purple {
    background: var(--accent-subtle);
    color: var(--accent-light);
}

/* Platform badges */
.badge-facebook { background: rgba(24, 119, 242, 0.15); color: #1877F2; }
.badge-instagram { background: rgba(228, 64, 95, 0.15); color: #E4405F; }
.badge-x { background: rgba(101, 119, 134, 0.15); color: #657786; }
.badge-linkedin { background: rgba(10, 102, 194, 0.15); color: #0A66C2; }
.badge-tiktok { background: rgba(238, 29, 82, 0.15); color: #EE1D52; }
.badge-youtube { background: rgba(255, 0, 0, 0.15); color: #FF0000; }
.badge-threads { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.badge-reddit { background: rgba(255, 69, 0, 0.15); color: #FF4500; }
.badge-pinterest { background: rgba(230, 0, 35, 0.15); color: #E60023; }
.badge-bluesky { background: rgba(0, 133, 255, 0.15); color: #0085FF; }
.badge-telegram { background: rgba(38, 165, 228, 0.15); color: #26A5E4; }
.badge-snapchat { background: rgba(200, 168, 0, 0.15); color: #C8A800; }
.badge-google-business { background: rgba(66, 133, 244, 0.15); color: #4285F4; }
.badge-discord { background: rgba(88, 101, 242, 0.15); color: #5865F2; }
.badge-whatsapp { background: rgba(37, 211, 102, 0.15); color: #25D366; }

/* ---------- Alerts ---------- */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid rgba(239, 68, 68, 0.3); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.3); }

/* ---------- Modal ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ---------- Social Account Cards ---------- */
.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.social-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: var(--transition);
}

.social-card:hover {
    border-color: var(--border-light);
}

.social-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.social-card-header .platform-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.social-card-header .platform-icon.facebook { background: var(--facebook); }
.social-card-header .platform-icon.instagram { background: var(--instagram); }
.social-card-header .platform-icon.x { background: #333; }
.social-card-header .platform-icon.linkedin { background: var(--linkedin); }

.social-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ---------- Post composer ---------- */
.composer {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.composer-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.composer-target {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.composer-target.selected {
    border-color: var(--accent);
    background: var(--accent-subtle);
    color: var(--accent-light);
}

.composer-target:hover {
    border-color: var(--accent);
}

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.char-count.warning { color: var(--warning); }
.char-count.over { color: var(--error); }

/* ---------- Calendar view ---------- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.calendar-header-cell {
    background: var(--bg-card);
    padding: 0.6rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.calendar-cell {
    background: var(--bg-secondary);
    min-height: 100px;
    padding: 0.5rem;
}

.calendar-cell.today {
    background: var(--accent-subtle);
}

.calendar-cell.other-month {
    opacity: 0.4;
}

.calendar-day {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.calendar-event {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ---------- Animations ---------- */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ---------- Theme Toggle ---------- */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--accent-subtle);
}

.theme-toggle .fa-sun,
.theme-toggle .fa-moon {
    font-size: 0.75rem;
    position: absolute;
    transition: opacity 0.2s, transform 0.3s;
}

/* Dark theme: show sun (to switch to light), hide moon */
[data-theme="dark"] .theme-toggle .fa-sun { opacity: 1; transform: rotate(0deg); }
[data-theme="dark"] .theme-toggle .fa-moon { opacity: 0; transform: rotate(-90deg); }

/* Light theme: show moon (to switch to dark), hide sun */
[data-theme="light"] .theme-toggle .fa-sun { opacity: 0; transform: rotate(90deg); }
[data-theme="light"] .theme-toggle .fa-moon { opacity: 1; transform: rotate(0deg); }

/* ---------- Responsive ---------- */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .page-body {
        padding: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .social-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ---------- Utilities ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-secondary); }
.hidden { display: none !important; }
