/* ═══════════════════════════════════════════
   SocialMind - Main Stylesheet
   ═══════════════════════════════════════════ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --gray-900: #0f172a;
    --gray-800: #1e293b;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 65px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── Auth Pages ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.auth-container { width: 100%; max-width: 420px; }

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { font-size: 1.8rem; color: var(--gray-900); margin: 0.5rem 0; }
.auth-header p { color: var(--gray-500); font-size: 0.9rem; }

.auth-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    font-size: 1.5rem;
}

.auth-form .form-group { margin-bottom: 1.2rem; }
.auth-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.85rem;
}
.auth-form label i { margin-right: 0.3rem; color: var(--gray-400); }

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--gray-50);
}
.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--white);
}

.auth-footer { text-align: center; margin-top: 1.5rem; color: var(--gray-500); font-size: 0.9rem; }

.auth-platforms {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}
.auth-platforms p { font-size: 0.8rem; color: var(--gray-400); margin-bottom: 0.5rem; }
.platform-icons { display: flex; gap: 1rem; justify-content: center; font-size: 1.3rem; }
.platform-icons i { color: var(--gray-400); transition: var(--transition); }
.platform-icons i:hover { color: var(--primary); }

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

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: var(--gray-300);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
}
.logo i {
    color: var(--primary);
    font-size: 1.4rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.1rem;
    display: none;
}

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

.nav-section { padding: 0.5rem 0; }
.nav-section-title {
    display: block;
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: var(--gray-400);
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.nav-link:hover {
    color: var(--white);
    background: rgba(255,255,255,0.05);
}
.nav-link.active {
    color: var(--white);
    background: rgba(99,102,241,0.15);
    border-left-color: var(--primary);
}
.nav-link i { width: 20px; text-align: center; font-size: 1rem; }

.sidebar-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.user-info { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; }
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.user-details { min-width: 0; }
.user-name { display: block; font-size: 0.85rem; color: var(--white); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { display: block; font-size: 0.7rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-logout {
    color: var(--gray-500);
    font-size: 1rem;
    padding: 0.4rem;
    transition: var(--transition);
}
.btn-logout:hover { color: var(--danger); }

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

.top-bar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left { display: flex; align-items: center; gap: 1rem; }
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-600);
    cursor: pointer;
}
.page-title { font-size: 1.2rem; font-weight: 600; color: var(--gray-900); }

.top-bar-right { display: flex; align-items: center; gap: 1rem; }

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.search-box i {
    position: absolute;
    left: 0.8rem;
    color: var(--gray-400);
    font-size: 0.85rem;
}
.search-box input {
    padding: 0.5rem 0.8rem 0.5rem 2.2rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 20px;
    font-size: 0.85rem;
    width: 220px;
    transition: var(--transition);
    background: var(--gray-50);
}
.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    width: 280px;
    background: var(--white);
}

.notification-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--gray-500);
    transition: var(--transition);
}
.notification-btn:hover { background: var(--gray-100); color: var(--primary); }

.content-area { padding: 1.5rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-outline { background: var(--white); color: var(--gray-700); border: 1.5px solid var(--gray-200); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; justify-content: center; padding: 0.7rem; font-size: 1rem; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }

/* ── Cards ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}
.card-header h3 { font-size: 1rem; color: var(--gray-900); }
.card-header h3 i { margin-right: 0.4rem; color: var(--gray-400); }
.card-body { padding: 1.5rem; }

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

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--gray-500); }

/* ── Section Header ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.5rem 0 1rem;
}
.section-header h2 { font-size: 1.1rem; font-weight: 600; color: var(--gray-900); }

/* ── Platforms Grid ── */
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.platform-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.platform-card:hover { box-shadow: var(--shadow-md); }
.platform-card.disconnected { opacity: 0.7; }

.platform-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.platform-info h3 { font-size: 0.95rem; font-weight: 600; color: var(--gray-900); margin-bottom: 0.2rem; }
.platform-info .followers { font-size: 0.8rem; color: var(--gray-500); margin-left: 0.5rem; }
.stat-small { font-size: 0.8rem; color: var(--gray-500); }

/* ── Platform Header (individual platform pages) ── */
.platform-header {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.platform-account { display: flex; align-items: center; gap: 1rem; }
.platform-account h3 { font-size: 1.1rem; color: var(--gray-900); }
.platform-actions { display: flex; gap: 0.5rem; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-muted { background: var(--gray-100); color: var(--gray-500); }
.badge-platform { background: var(--primary-light); color: var(--primary-dark); }

/* ── Tables ── */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--gray-100); }
.table th { font-size: 0.8rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.03em; }
.table td { font-size: 0.9rem; }
.table tbody tr:hover { background: var(--gray-50); }

/* ── Posts Grid ── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.post-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.post-header {
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-100);
}
.post-date { font-size: 0.8rem; color: var(--gray-400); }
.post-content { padding: 1rem; font-size: 0.9rem; line-height: 1.5; color: var(--gray-700); }
.post-media { padding: 0 1rem 1rem; }
.post-media img { width: 100%; border-radius: var(--radius-sm); object-fit: cover; max-height: 200px; }

/* ── Forms ── */
.form-group { margin-bottom: 1.2rem; }
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.85rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--white);
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: 0.8rem; color: var(--gray-400); margin-top: 0.3rem; display: block; }
.char-count { font-size: 0.8rem; color: var(--gray-400); text-align: right; display: block; margin-top: 0.3rem; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 1.5rem; }

/* ── Alerts ── */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert i { margin-right: 0.4rem; }
.alert-danger { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-500);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; color: var(--gray-300); }
.empty-state h3 { color: var(--gray-700); margin-bottom: 0.5rem; }
.empty-state p { margin-bottom: 0.3rem; }
.empty-state .btn { margin-top: 1rem; }

/* ── Chart placeholder ── */
.chart-placeholder {
    text-align: center;
    padding: 3rem;
    color: var(--gray-400);
}
.chart-placeholder i { font-size: 3rem; margin-bottom: 1rem; }

/* ── Settings ── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.setting-item:last-child { border-bottom: none; }
.setting-info { display: flex; align-items: center; gap: 0.8rem; }
.setting-action { display: flex; align-items: center; gap: 0.5rem; }

/* ── Messaging ── */
.messaging-container {
    display: flex;
    height: calc(100vh - var(--topbar-height) - 3rem);
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.conversations-list {
    width: 340px;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.conversations-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--gray-200);
}
.conversations-header h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.filter-tabs { display: flex; gap: 0.3rem; }
.filter-tab {
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--gray-500);
    transition: var(--transition);
}
.filter-tab:hover { background: var(--gray-100); color: var(--gray-700); }
.filter-tab.active { background: var(--primary); color: var(--white); }

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
    color: inherit;
}
.conversation-item:hover { background: var(--gray-50); }
.conversation-item.active { background: var(--primary-light); }
.conversation-item.unread { background: #f0f9ff; }

.conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.conv-info { flex: 1; min-width: 0; }
.conv-header { display: flex; justify-content: space-between; align-items: center; }
.conv-name { font-weight: 600; font-size: 0.9rem; color: var(--gray-900); }
.conv-time { font-size: 0.75rem; color: var(--gray-400); }
.conv-preview { font-size: 0.8rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.unread-badge {
    background: var(--primary);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.empty-conversations {
    padding: 2rem;
    text-align: center;
    color: var(--gray-400);
}
.empty-conversations i { font-size: 2rem; margin-bottom: 0.5rem; }

.chat-area { flex: 1; display: flex; flex-direction: column; }
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}
.chat-empty i { font-size: 3rem; margin-bottom: 1rem; color: var(--gray-300); }
.chat-empty h3 { color: var(--gray-600); }

.chat-header {
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.btn-back {
    color: var(--gray-500);
    display: none;
}
.chat-contact { display: flex; align-items: center; gap: 0.6rem; }
.chat-contact strong { font-size: 0.95rem; color: var(--gray-900); }
.chat-contact .text-muted { font-size: 0.8rem; display: block; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--gray-50);
}

.message { display: flex; max-width: 70%; }
.message-sent { align-self: flex-end; }
.message-received { align-self: flex-start; }

.message-bubble {
    padding: 0.6rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
}
.message-sent .message-bubble {
    background: var(--primary);
    color: var(--white);
    border-bottom-right-radius: 4px;
}
.message-received .message-bubble {
    background: var(--white);
    color: var(--gray-800);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
}
.message-time {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 0.2rem;
    display: block;
    text-align: right;
}

.chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--gray-200);
    background: var(--white);
}
.chat-input input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 24px;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}
.chat-input input:focus { border-color: var(--primary); }
.btn-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ── Error Page ── */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
}
.error-container { text-align: center; }
.error-code { font-size: 6rem; font-weight: 800; color: var(--gray-300); }
.error-message { font-size: 1.2rem; color: var(--gray-500); margin-bottom: 1.5rem; }

/* ── Admin ── */
.admin-avatar { background: linear-gradient(135deg, #f59e0b, #ef4444) !important; }
.admin-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: var(--white);
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
    margin-left: 0.3rem;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.admin-form-grid > .card:first-child {
    grid-column: 1 / -1;
}

.access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.8rem;
}

.access-toggle {
    cursor: pointer;
    display: block;
}
.access-toggle input { display: none; }
.access-toggle-content {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.85rem;
}
.access-toggle-content i { font-size: 1.1rem; }
.access-toggle input:checked + .access-toggle-content {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 500;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.action-btns { display: flex; gap: 0.3rem; }
.btn-danger-outline { border-color: #fecaca !important; color: #dc2626 !important; }
.btn-danger-outline:hover { background: #fee2e2 !important; }

.platform-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.platform-badge { font-size: 1.1rem; }

.search-input {
    padding: 0.4rem 0.8rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}
.search-input:focus { border-color: var(--primary); }

/* ── Profile ── */
.profile-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 3rem;
    font-weight: 700;
    overflow: hidden;
    border: 4px solid var(--gray-200);
}
.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-letter { line-height: 1; }

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-meta {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}
.meta-item { text-align: center; }
.meta-label { display: block; font-size: 0.75rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; }
.meta-value { display: block; font-size: 0.9rem; font-weight: 600; color: var(--gray-700); margin-top: 0.2rem; }

.profile-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.profile-tab {
    flex: 1;
    padding: 0.8rem;
    background: var(--white);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-500);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.profile-tab:hover { background: var(--gray-50); color: var(--gray-700); }
.profile-tab.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.profile-tab-content { display: none; }
.profile-tab-content.active { display: block; }

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}
.forgot-link { font-size: 0.85rem; color: var(--primary); }
.forgot-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .profile-container { grid-template-columns: 1fr; }
}

/* ── AI Agent ── */
.ai-configs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.ai-config-card .card-body { padding: 1rem 1.5rem; }
.ai-config-card .form-group { margin-bottom: 0.8rem; }
.ai-config-card textarea { min-height: 50px; font-size: 0.85rem; }

/* Toggle Switch */
.switch-label {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch-label input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--gray-300);
    border-radius: 24px;
    transition: var(--transition);
}
.switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}
.switch-label input:checked + .switch-slider { background: var(--success); }
.switch-label input:checked + .switch-slider::before { transform: translateX(20px); }

/* ── Generation ── */
.gen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.gen-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    color: inherit;
    display: block;
}
.gen-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.gen-preview { height: 180px; background: var(--gray-100); overflow: hidden; }
.gen-preview img { width: 100%; height: 100%; object-fit: cover; }
.gen-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 2rem;
}
.gen-info { padding: 0.8rem 1rem; }
.gen-prompt { font-size: 0.85rem; color: var(--gray-700); line-height: 1.4; margin-bottom: 0.5rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gen-meta { display: flex; align-items: center; justify-content: space-between; }

.gen-result-card { overflow: hidden; }
.gen-result-image { background: var(--gray-900); text-align: center; }
.gen-result-image img { max-width: 100%; max-height: 600px; object-fit: contain; }
.gen-result-actions { padding: 1rem; display: flex; gap: 0.5rem; justify-content: center; }

.detail-grid { display: flex; flex-direction: column; gap: 1rem; }
.detail-item { }
.detail-label { display: block; font-size: 0.75rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.detail-value { font-size: 0.9rem; color: var(--gray-800); }
.detail-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; }

/* Provider selector */
.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.8rem;
}
.provider-option { cursor: pointer; display: block; }
.provider-option input { display: none; }
.provider-option-content {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    padding: 1rem 0.5rem; border: 2px solid var(--gray-200);
    border-radius: var(--radius); transition: var(--transition); text-align: center;
}
.provider-option-content:hover { border-color: var(--gray-300); background: var(--gray-50); }
.provider-option input:checked + .provider-option-content {
    border-color: var(--primary); background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.provider-name { font-size: 0.8rem; font-weight: 600; color: var(--gray-700); }
.model-select {
    width: 100%; padding: 0.65rem 1rem; border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm); font-size: 0.9rem; background: var(--white);
    font-family: inherit; transition: var(--transition);
}
.model-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* Size options */
.size-options { display: flex; gap: 0.5rem; }
.size-option { cursor: pointer; }
.size-option input { display: none; }
.size-option-content {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 0.8rem; border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm); transition: var(--transition); font-size: 0.8rem;
}
.size-option input:checked + .size-option-content {
    border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark);
}
.size-icon { display: block; border: 2px solid currentColor; border-radius: 2px; }
.size-icon.landscape { width: 24px; height: 16px; }
.size-icon.portrait { width: 16px; height: 24px; }
.size-icon.square { width: 20px; height: 20px; }

.info-box {
    background: var(--gray-50); border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm); padding: 1rem;
    font-size: 0.85rem; color: var(--gray-600);
    display: flex; flex-direction: column; gap: 0.5rem;
}
.info-box i { width: 20px; text-align: center; color: var(--gray-400); margin-right: 0.3rem; }

/* ── Modal ── */
.modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 200;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-content {
    background: var(--white); border-radius: var(--radius);
    padding: 1.5rem; width: 100%; max-width: 480px; box-shadow: var(--shadow-lg);
}
.modal-content h3 { margin-bottom: 1rem; }

/* ── Media Library ── */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.media-card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    transition: var(--transition); position: relative;
}
.media-card:hover { box-shadow: var(--shadow-md); }
.media-preview { height: 150px; background: var(--gray-100); overflow: hidden; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-info { padding: 0.6rem 0.8rem; }
.media-name { font-size: 0.8rem; font-weight: 500; color: var(--gray-800);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-size { font-size: 0.7rem; color: var(--gray-400); }
.media-actions {
    position: absolute; top: 0.5rem; right: 0.5rem;
    display: flex; gap: 0.3rem; opacity: 0; transition: var(--transition);
}
.media-card:hover .media-actions { opacity: 1; }
.media-actions .btn { background: rgba(0,0,0,0.6); color: white; border: none; padding: 0.3rem 0.5rem; }
.media-actions .btn:hover { background: rgba(0,0,0,0.8); }

.upload-zone {
    border: 2px dashed var(--gray-300); border-radius: var(--radius);
    padding: 2rem; text-align: center; cursor: pointer;
    transition: var(--transition); color: var(--gray-400); margin-bottom: 1.5rem;
}
.upload-zone:hover,
.upload-zone.drag-active {
    border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}
.upload-zone.drag-active { border-style: solid; transform: scale(1.01); }
.upload-zone i { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.upload-file-list { font-size: 0.85rem; }

/* ── AI Studio ── */
.studio-layout {
    display: flex;
    height: calc(100vh - var(--topbar-height) - 3rem);
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.studio-sidebar {
    width: 300px;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: var(--gray-50);
}
.studio-sidebar-header {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}
.studio-sidebar-header h3 { font-size: 0.95rem; margin: 0; }
.studio-sidebar-header a { text-decoration: none; }

.new-session-form {
    padding: 0.8rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}

.studio-input {
    width: 100%;
    padding: 0.45rem 0.7rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}
.studio-input:focus { outline: none; border-color: var(--primary); }
textarea.studio-input { resize: vertical; min-height: 40px; }

.studio-sessions {
    flex: 1;
    overflow-y: auto;
}
.empty-sessions { padding: 1.5rem; text-align: center; }

.session-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: inherit;
    transition: var(--transition);
}
.session-item:hover { background: var(--white); }
.session-item.active { background: var(--primary-light); border-left: 3px solid var(--primary); }

.session-thumb {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: var(--gray-200); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 1rem;
}
.session-thumb img { width: 100%; height: 100%; object-fit: cover; }

.session-info { min-width: 0; }
.session-title {
    display: block; font-size: 0.85rem; font-weight: 600; color: var(--gray-800);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-meta { font-size: 0.7rem; color: var(--gray-400); }

/* Studio main */
.studio-main {
    flex: 1; display: flex; flex-direction: column; min-width: 0;
}

.studio-empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: var(--gray-400); padding: 2rem;
}
.studio-empty i { font-size: 3rem; margin-bottom: 1rem; color: var(--gray-300); }
.studio-empty h3 { color: var(--gray-600); margin-bottom: 0.3rem; }

.studio-features {
    display: flex; gap: 2rem; margin-top: 1.5rem;
}
.feature-item {
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
    font-size: 0.85rem; color: var(--gray-500);
}
.feature-item i { font-size: 1.3rem; color: var(--primary); }

/* Chat header */
.studio-chat-header {
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--white);
}
.studio-chat-info { display: flex; align-items: center; gap: 0.6rem; }
.studio-chat-info strong { font-size: 0.95rem; display: block; }
.studio-chat-info .text-muted { font-size: 0.75rem; display: block; }
.studio-chat-actions { display: flex; gap: 0.3rem; }

/* Messages */
.studio-messages {
    flex: 1; overflow-y: auto; padding: 1rem;
    display: flex; flex-direction: column; gap: 1rem;
    background: var(--gray-50);
}

.studio-msg {
    display: flex; gap: 0.7rem; max-width: 85%;
}
.studio-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.studio-msg-assistant { align-self: flex-start; }
.studio-msg-system { align-self: center; max-width: 100%; }

.studio-msg-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600; flex-shrink: 0;
}
.user-av { background: var(--primary); color: var(--white); }
.ai-av { background: var(--gray-800); color: var(--white); }
.sys-av { background: var(--gray-200); color: var(--gray-500); font-size: 0.7rem; }

.studio-msg-content { min-width: 0; }

.studio-msg-text {
    padding: 0.7rem 1rem; border-radius: 16px;
    font-size: 0.9rem; line-height: 1.5;
}
.studio-msg-user .studio-msg-text {
    background: var(--primary); color: var(--white);
    border-bottom-right-radius: 4px;
}
.studio-msg-assistant .studio-msg-text {
    background: var(--white); color: var(--gray-800);
    border-bottom-left-radius: 4px; box-shadow: var(--shadow);
}

.studio-msg-system .studio-msg-system {
    background: var(--gray-100); color: var(--gray-500);
    padding: 0.4rem 0.8rem; border-radius: 20px;
    font-size: 0.8rem; text-align: center;
}

.studio-msg-image {
    margin-top: 0.5rem; border-radius: var(--radius-sm); overflow: hidden;
    box-shadow: var(--shadow);
}
.studio-msg-image img {
    max-width: 400px; max-height: 400px; width: 100%;
    display: block; border-radius: var(--radius-sm);
}
.studio-img-actions { padding: 0.4rem; background: var(--white); }

.studio-msg-time {
    display: block; font-size: 0.65rem; color: var(--gray-400);
    margin-top: 0.3rem;
}
.studio-msg-user .studio-msg-time { text-align: right; }

.studio-msg-loading {
    display: flex; flex-direction: column; align-items: center;
    padding: 1.5rem; background: var(--white); border-radius: var(--radius-sm);
    box-shadow: var(--shadow); margin-top: 0.5rem; gap: 0.5rem;
    color: var(--gray-500); font-size: 0.85rem;
}

.loading-spinner {
    width: 30px; height: 30px; border: 3px solid var(--gray-200);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.studio-msg-error {
    padding: 0.6rem 1rem; background: #fee2e2; color: #dc2626;
    border-radius: var(--radius-sm); font-size: 0.85rem; margin-top: 0.5rem;
}
.studio-msg-error i { margin-right: 0.3rem; }

/* Attachments */
.studio-msg-attachments {
    display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.4rem;
}
.attach-thumb {
    display: block; width: 80px; height: 80px; border-radius: 8px;
    overflow: hidden; border: 2px solid var(--gray-200); transition: var(--transition);
}
.attach-thumb:hover { border-color: var(--primary); }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }

.attach-preview {
    display: flex; gap: 0.5rem; padding: 0.5rem 1rem;
    border-top: 1px solid var(--gray-200); background: var(--gray-50);
    align-items: center; flex-wrap: wrap;
}
.attach-preview-item {
    position: relative; width: 64px; height: 64px; border-radius: 8px;
    overflow: hidden; border: 2px solid var(--primary-light);
}
.attach-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.attach-remove {
    position: absolute; top: 2px; right: 2px;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(0,0,0,0.6); color: white; border: none;
    font-size: 0.6rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.attach-remove:hover { background: var(--danger); }

.btn-attach {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    padding: 0; flex-shrink: 0; font-size: 1rem; color: var(--gray-500);
    transition: var(--transition);
}
.btn-attach:hover { color: var(--primary); border-color: var(--primary); }
.btn-attach.has-attach { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

/* Studio input bar */
.studio-input-bar {
    display: flex; gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--gray-200);
    background: var(--white);
}
.studio-input-bar input {
    flex: 1; padding: 0.7rem 1rem;
    border: 1.5px solid var(--gray-200); border-radius: 24px;
    font-size: 0.9rem; outline: none; transition: var(--transition);
}
.studio-input-bar input:focus { border-color: var(--primary); }

@media (max-width: 768px) {
    .studio-layout { flex-direction: column; height: auto; min-height: calc(100vh - var(--topbar-height) - 3rem); }
    .studio-sidebar { width: 100%; max-height: 200px; }
    .studio-msg { max-width: 95%; }
    .studio-msg-image img { max-width: 100%; }
}

/* ── Mail Preview ── */
.mail-body-preview {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* ── Restaurant Switcher ── */
.resto-switcher {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.resto-switcher-btn {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.7rem; border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
    background: rgba(255,255,255,0.05);
}
.resto-switcher-btn:hover { background: rgba(255,255,255,0.1); }

.resto-switcher-logo {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(255,255,255,0.1); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-400); font-size: 0.85rem; flex-shrink: 0;
}
.resto-switcher-logo img { width: 100%; height: 100%; object-fit: cover; }

.resto-switcher-info { flex: 1; min-width: 0; }
.resto-switcher-name {
    display: block; font-size: 0.8rem; font-weight: 600; color: var(--white);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.resto-switcher-hint { display: block; font-size: 0.65rem; color: var(--gray-500); }
.resto-switcher-arrow { color: var(--gray-500); font-size: 0.7rem; transition: var(--transition); }
.resto-switcher-btn.open .resto-switcher-arrow { transform: rotate(180deg); }

.resto-dropdown {
    display: none; margin-top: 0.4rem;
    background: var(--gray-800); border-radius: var(--radius-sm);
    overflow: hidden; box-shadow: var(--shadow-lg);
}
.resto-dropdown.show { display: block; }
.resto-dropdown-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.7rem; font-size: 0.8rem; color: var(--gray-300);
    transition: var(--transition);
}
.resto-dropdown-item:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.resto-dropdown-item.active { background: rgba(99,102,241,0.2); color: var(--white); }
.resto-dropdown-logo {
    width: 26px; height: 26px; border-radius: 6px;
    background: rgba(255,255,255,0.1); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-400); font-size: 0.7rem; flex-shrink: 0;
}
.resto-dropdown-logo img { width: 100%; height: 100%; object-fit: cover; }
.resto-dropdown-manage {
    border-top: 1px solid rgba(255,255,255,0.08);
    color: var(--gray-400); font-size: 0.75rem;
}

/* Restaurant Cards */
.resto-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem;
}
.resto-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.2rem; display: flex; align-items: center; gap: 1rem;
    transition: var(--transition); border-left: 4px solid transparent;
}
.resto-card:hover { box-shadow: var(--shadow-md); }
.resto-card.resto-active { border-left-color: var(--success); background: #f0fdf4; }

.resto-logo {
    width: 60px; height: 60px; border-radius: 12px;
    background: var(--gray-100); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-400); font-size: 1.5rem; flex-shrink: 0;
}
.resto-logo img { width: 100%; height: 100%; object-fit: cover; }

.resto-info { flex: 1; min-width: 0; }
.resto-info h3 { font-size: 1rem; color: var(--gray-900); margin-bottom: 0.2rem; }
.resto-info p { margin: 0.1rem 0; font-size: 0.8rem; }
.resto-info .badge { margin-top: 0.3rem; }

.resto-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }

/* ── Language Switcher ── */
.lang-switcher { position: relative; }
.lang-btn {
    background: none; border: 1.5px solid var(--gray-200);
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; transition: var(--transition);
}
.lang-btn:hover { border-color: var(--primary); }
.lang-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 0.3rem;
    background: var(--white); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); overflow: hidden;
    min-width: 160px; z-index: 200;
    display: none;
}
.lang-dropdown.show { display: block; }
.lang-option {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 1rem; font-size: 0.85rem; color: var(--gray-700);
    transition: var(--transition);
}
.lang-option:hover { background: var(--gray-50); }
.lang-option.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.lang-flag { font-size: 1.2rem; }

/* Auth page lang bar */
.auth-lang-bar {
    position: fixed; top: 1rem; right: 1rem;
    display: flex; gap: 0.3rem; z-index: 50;
}
.auth-lang {
    padding: 0.3rem 0.7rem; border-radius: 20px;
    font-size: 0.8rem; color: rgba(255,255,255,0.7);
    transition: var(--transition); background: rgba(255,255,255,0.15);
}
.auth-lang:hover { background: rgba(255,255,255,0.3); color: #fff; }
.auth-lang.active { background: rgba(255,255,255,0.95); color: var(--gray-800); font-weight: 600; }

/* ── Utilities ── */
.text-muted { color: var(--gray-500) !important; font-size: 0.85rem; }
hr { border: none; border-top: 1px solid var(--gray-200); margin: 1rem 0; }
h4 { font-size: 0.95rem; color: var(--gray-700); margin-bottom: 0.5rem; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-toggle { display: block; }
    .search-box { display: none; }
    .platform-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .platforms-grid { grid-template-columns: 1fr; }

    /* Messaging responsive */
    .conversations-list { width: 100%; }
    .messaging-container { flex-direction: column; height: auto; min-height: calc(100vh - var(--topbar-height) - 3rem); }
    .chat-area { min-height: 400px; }
    .btn-back { display: block; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .content-area { padding: 1rem; }
    .auth-card { padding: 1.5rem; }
}
