/* ============================================================
   Social Media CRM — Global Stylesheet
   Design System: Bootstrap 5.3 + Custom Variables
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --primary:       #6366f1;
    --primary-dark:  #4f46e5;
    --primary-light: #e0e7ff;
    --secondary:     #f59e0b;
    --success:       #10b981;
    --danger:        #ef4444;
    --warning:       #f59e0b;
    --info:          #3b82f6;
    --dark-bg:       #0f172a;
    --sidebar-bg:    #1e293b;
    --sidebar-text:  #94a3b8;
    --sidebar-hover: #334155;
    --sidebar-active:#6366f1;
    --card-bg:       #ffffff;
    --body-bg:       #f1f5f9;
    --text-primary:  #0f172a;
    --text-muted:    #64748b;
    --border:        #e2e8f0;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:     0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg:     0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --radius:        1rem;
    --radius-sm:     0.75rem;
    --radius-lg:     1.25rem;
    --transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 260px;
    --shadow-premium: 0 10px 30px -5px rgba(0,0,0,0.05), 0 4px 10px -5px rgba(0,0,0,0.03);
    --glass: rgba(255,255,255,0.7);
    --glass-border: rgba(255,255,255,0.4);
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* ── Layout ────────────────────────────────────────────────── */
.crm-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand .brand-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #fff;
}

.sidebar-brand .brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.sidebar-brand .brand-role {
    font-size: 0.7rem;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    flex: 1;
}

.sidebar-section {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sidebar-text);
    padding: 0.75rem 0.5rem 0.25rem;
    margin-top: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.875rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 0.15rem;
}
.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
}
.sidebar-nav a .nav-icon {
    width: 18px;
    opacity: 0.8;
}
.sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}
.sidebar-user .user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: 0.875rem;
    flex-shrink: 0;
}
.sidebar-user .user-info .user-name {
    font-size: 0.875rem; font-weight: 600; color: #fff; line-height: 1.2;
}
.sidebar-user .user-info .user-role {
    font-size: 0.7rem; color: var(--sidebar-text); text-transform: capitalize;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
    height: 64px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky; top: 0;
    z-index: 500;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

@media (max-width: 767px) {
    .topbar { height: 56px; border-bottom: none; background: transparent; box-shadow: none; }
    .topbar-title { font-size: 1rem; }
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

.notif-btn {
    position: relative;
    background: none; border: none;
    cursor: pointer;
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
}
.notif-btn:hover { background: var(--body-bg); color: var(--text-primary); }
.notif-badge {
    position: absolute; top: 4px; right: 4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    min-width: 16px; height: 16px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    padding: 0 3px;
}

/* ── Page Content ──────────────────────────────────────────── */
.page-content {
    padding: 1.75rem;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.page-header .breadcrumb { margin: 0; font-size: 0.8rem; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
}
.card:hover { box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08); transform: translateY(-2px); }
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.card-header h5 { margin: 0; font-size: 0.95rem; font-weight: 600; }
.card-body { padding: 1.25rem; }

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card .stat-info .stat-value {
    font-size: 2rem; font-weight: 800; line-height: 1; color: var(--text-primary);
}
.stat-card .stat-info .stat-label {
    font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-top: 0.25rem;
}
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}

/* ── Status Badges ─────────────────────────────────────────── */
.badge-draft      { background: #f1f5f9; color: #475569; }
.badge-pending    { background: #fef9c3; color: #92400e; }
.badge-approved   { background: #dcfce7; color: #166534; }
.badge-rejected   { background: #fee2e2; color: #991b1b; }
.badge-scheduled  { background: #dbeafe; color: #1e40af; }
.badge-published  { background: #ede9fe; color: #5b21b6; }
.status-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* ── Tables ────────────────────────────────────────────────── */
.table { font-size: 0.875rem; }
.table th {
    background: var(--body-bg);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    padding: 0.75rem 1rem;
}
.table td { padding: 0.875rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table tbody tr:hover { background: var(--body-bg); }
.table-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary-crm {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex; align-items: center; gap: 0.4rem;
    text-decoration: none;
}
.btn-primary-crm:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }

.btn-danger-crm {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-danger-crm:hover { background: #dc2626; }

.btn-success-crm {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-success-crm:hover { background: #059669; }

.btn-outline-crm {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex; align-items: center; gap: 0.4rem;
    text-decoration: none;
}
.btn-outline-crm:hover { background: var(--primary); color: #fff; }

/* ── Form Controls ─────────────────────────────────────────── */
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.875rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: var(--transition);
    background: var(--card-bg);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
    outline: none;
}
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.35rem; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert-crm {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 1rem;
}
.alert-success-crm { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger-crm  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info-crm    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warn-crm    { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.4;
}
.login-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 1.25rem;
    padding: 2.5rem;
    width: 100%; max-width: 420px;
    position: relative;
}
.login-logo {
    text-align: center; margin-bottom: 2rem;
}
.login-logo .logo-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 1rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: #fff; margin-bottom: 0.75rem;
}
.login-logo h2 { color: #fff; font-weight: 800; font-size: 1.5rem; margin: 0 0 0.25rem; }
.login-logo p  { color: rgba(255,255,255,.5); font-size: 0.85rem; margin: 0; }

.login-card .form-control {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.15);
    color: #fff;
}
.login-card .form-control::placeholder { color: rgba(255,255,255,.35); }
.login-card .form-control:focus {
    background: rgba(255,255,255,.12);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,.25);
}
.login-card .form-label { color: rgba(255,255,255,.7); }

.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700; width: 100%;
    font-size: 0.95rem; cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99,102,241,.4); }

/* ── Chat ──────────────────────────────────────────────────── */
/* ── Chat ──────────────────────────────────────────────────── */
.chat-container { display: flex; height: calc(100vh - 130px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #fff; }
.chat-sidebar { width: 280px; border-right: 1px solid var(--border); background: var(--card-bg); overflow-y: auto; flex-shrink: 0; }
.chat-sidebar-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 0.95rem; }

.chat-header { padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); z-index: 10; gap: 0.75rem; flex-shrink: 0; }
.chat-header-info { display: flex; align-items: center; flex: 1; min-width: 0; }
.chat-user-title { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-user-status { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.online-indicator { width: 7px; height: 7px; background: #10b981; border-radius: 50%; display: inline-block; }

.chat-back-btn { font-size: 1.25rem; padding: 0.5rem 0.25rem; color: var(--primary); display: none; text-decoration: none !important; }

.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--body-bg); position: relative; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; background: #f8fafc; }

body.chat-open .chat-back-btn { display: flex; align-items: center; }
body.chat-open .bottom-nav { display: none !important; }
body.chat-open .topbar { display: none !important; }

.chat-user-item {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex; align-items: center; gap: 0.75rem;
    transition: var(--transition);
}
.chat-user-item:hover { background: var(--body-bg); }
.chat-user-item.active { background: var(--primary-light); }
.chat-user-item .chat-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: 0.85rem; flex-shrink: 0;
}
.chat-user-name { font-weight: 600; font-size: 0.875rem; }
.chat-last-msg  { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-unread { background: var(--primary); color: #fff; border-radius: 999px; font-size: 0.65rem; font-weight: 700; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

.msg-bubble { max-width: 65%; padding: 0.75rem 1rem; border-radius: 1rem; font-size: 0.875rem; line-height: 1.5; }
.msg-bubble.sent { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 0.25rem; }
.msg-bubble.recv { background: var(--card-bg); color: var(--text-primary); align-self: flex-start; border-bottom-left-radius: 0.25rem; box-shadow: var(--shadow-sm); }
.msg-time { font-size: 0.65rem; opacity: 0.6; margin-top: 0.25rem; }

.chat-footer { padding: 0.75rem 1.25rem; background: var(--card-bg); border-top: 1px solid var(--border); display: flex; gap: 0.75rem; align-items: center; flex-shrink: 0; }
.chat-footer .form-control { flex: 1; border-radius: 20px; padding-left: 1.2rem; }

/* ── Mobile Chat Logic ─────────────────────────────────────── */
@media (max-width: 767px) {
    .chat-container { height: calc(100vh - 160px) !important; border: none; }
    .chat-sidebar { width: 100%; border-right: none; display: block; }
    .chat-main { 
        display: none; 
        position: fixed; 
        top: 0; left: 0; 
        width: 100%; 
        height: 100vh; 
        height: 100dvh; /* Dynamic Fill */
        z-index: 2000; 
        overflow: hidden;
    }
    
    /* When a chat is active/open */
    body.chat-open { overflow: hidden; position: fixed; width: 100%; height: 100%; }
    body.chat-open .chat-sidebar { display: none; }
    body.chat-open .chat-main { display: flex; }
    body.chat-open .bottom-nav { display: none !important; }
    
    .chat-back-btn { display: flex !important; align-items: center; color: var(--primary); font-weight: 600; text-decoration: none; }
}
.chat-back-btn { display: none; }

/* ── Post Preview ──────────────────────────────────────────── */
.post-preview {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-bg);
    max-width: 500px;
}
.post-preview-header { padding: 0.875rem 1rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid var(--border); }
.post-preview-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; }
.post-preview-media img, .post-preview-media video { width: 100%; display: block; max-height: 360px; object-fit: cover; }
.post-preview-caption { padding: 0.875rem 1rem; font-size: 0.875rem; line-height: 1.6; }
.post-preview-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border); display: flex; gap: 1rem; color: var(--text-muted); font-size: 0.8rem; }

/* ── Platform Pills ────────────────────────────────────────── */
.platform-pill {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem; font-weight: 600;
    background: var(--body-bg);
    color: var(--text-muted);
    margin: 0.1rem;
}
.platform-pill.facebook { background: #e8f0fe; color: #1a56db; }
.platform-pill.instagram { background: #fce7f3; color: #be185d; }
.platform-pill.linkedin  { background: #dbeafe; color: #1e40af; }
.platform-pill.twitter   { background: #e0f2fe; color: #0369a1; }
.platform-pill.tiktok    { background: #f0fdf4; color: #166534; }

/* ── Calendar ──────────────────────────────────────────────── */
#calendar .fc-toolbar-title { font-size: 1.1rem; font-weight: 700; }
#calendar .fc-button { background: var(--primary); border-color: var(--primary); font-size: 0.8rem; }
#calendar .fc-button:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
#calendar .fc-event { border-radius: 4px; font-size: 0.72rem; padding: 2px 4px; border: none; }

/* ── Notification Dropdown ─────────────────────────────────── */
.notif-dropdown {
    width: 340px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    background: var(--card-bg);
}
.notif-item {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex; gap: 0.75rem; align-items: flex-start;
    transition: var(--transition); cursor: pointer;
}
.notif-item:hover { background: var(--body-bg); }
.notif-item.unread { background: #f0f4ff; }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.95rem; }
.notif-text { font-size: 0.82rem; }
.notif-text .notif-title { font-weight: 600; margin-bottom: 0.15rem; }
.notif-text .notif-time { color: var(--text-muted); font-size: 0.72rem; }

/* ── Trial Expired Screen ──────────────────────────────────── */
.trial-expired {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--body-bg); text-align: center; padding: 2rem;
}
.trial-expired .trial-icon { font-size: 4rem; margin-bottom: 1rem; }
.trial-expired h2 { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); }
.trial-expired p { color: var(--text-muted); max-width: 420px; margin: 0.5rem auto 1.5rem; }

/* ── Bottom Navigation (Mobile Only) ───────────────────────── */
.bottom-nav {
    display: none;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); z-index: 3000; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding-bottom: 85px; } /* More space for bottom nav */
    .chat-sidebar { width: 220px; }
    
    .sidebar-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(4px);
        z-index: 2999;
    }
    .sidebar.open + .sidebar-overlay { display: block; }
    
    /* Reveal Bottom Nav on Mobile/Tablet */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 65px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid rgba(0,0,0,0.08);
        z-index: 1050;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 15px rgba(0,0,0,0.03);
    }
    
    .bottom-nav-item {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        flex: 1; height: 100%;
        color: var(--text-muted);
        text-decoration: none;
        transition: var(--transition);
        position: relative;
    }
    
    .bottom-nav-item i { font-size: 1.6rem; transition: var(--transition); }
    .bottom-nav-item span:not(.notif-badge) { display: none; } /* Hide labels */
    .bottom-nav-item.active { color: var(--primary); }
    .bottom-nav-item.active i { transform: translateY(-2px) scale(1.1); }
    
    .bottom-nav-item .notif-badge {
        position: absolute; top: 6px; right: calc(50% - 16px);
        padding: 0 4px; transform: scale(0.85);
    }

    /* Hide the topbar hamburger because we have a Menu button in bottom nav */
    #sidebar-toggler { display: none !important; }
}

@media (max-width: 576px) {
    .chat-container { flex-direction: column; height: calc(100vh - 220px); }
    .chat-sidebar { width: 100%; height: 120px; border-right: none; border-bottom: 1px solid var(--border); }
    .page-content { padding: 1rem; }
    
    /* Premium Mobile Table -> Cards Conversion */
    .table-wrap { border: none !important; box-shadow: none !important; background: transparent !important; }
    .table-wrap .table { background: transparent !important; }
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: flex; flex-direction: column; width: 100%; }
    .table tr { 
        margin-bottom: 1rem; 
        border: 1px solid var(--border) !important; 
        border-radius: var(--radius-lg); 
        padding: 0.5rem; 
        box-shadow: 0 4px 12px rgba(0,0,0,0.03); 
        background: #fff; 
    }
    .table td { 
        border-bottom: 1px dashed var(--border) !important; 
        padding: 0.75rem 0.5rem !important; 
        text-align: left; 
        font-size: 0.9rem;
    }
    .table td:last-child { border-bottom: none !important; }
    
    .page-header h1 { font-size: 1.25rem; }
    
    /* Adjust Stats Cards */
    .stat-card { padding: 1.25rem; align-items: center; text-align: left; }
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
}

/* ── Utility ───────────────────────────────────────────────── */
.gap-2 { gap: 0.5rem; }
.text-muted { color: var(--text-muted) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.border-radius { border-radius: var(--radius); }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); transition: var(--transition); padding: 0.25rem; border-radius: 4px; }
.icon-btn:hover { color: var(--primary); background: var(--primary-light); }
.overflow-hidden { overflow: hidden; }
