/* ==========================================================================
   NexFeed — Premium Dark Obsidian SaaS Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Premium Midnight Obsidian Dark SaaS Theme Colors */
    --bg-main: #0a0b10;       /* Rich Midnight Deep Black */
    --bg-sidebar: #10121e;    /* Layered Midnight Blue-Black */
    --card-bg: #161827;       /* Dark Navy Card Background */
    --card-border: rgba(255, 255, 255, 0.08); /* Sophisticated subtle border */
    
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); /* Modern premium Indigo-Purple */
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --text-primary: #f8fafc;   /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --text-muted: #64748b;     /* Slate 500 */
    
    /* Semantic Colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.08);
    
    /* Layout Constants */
    --sidebar-width: 260px;
    --border-radius: 12px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   BASE & TYPOGRAPHY
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
    font-size: 14.5px;
    line-height: 1.6;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

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

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

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

/* ==========================================
   LAYOUT
   ========================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    background: var(--primary-gradient);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.brand-logo svg {
    width: 18px;
    height: 18px;
}

.sidebar-brand h2 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.sidebar-nav {
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--accent);
}

.nav-item:hover svg {
    color: var(--accent);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.25);
    font-weight: 600;
}

.nav-item.active svg {
    color: var(--accent);
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--danger);
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    cursor: pointer;
    margin-top: 10px;
}

.sidebar-logout-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
    color: var(--danger);
    transition: all var(--transition-fast);
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.sidebar-logout-btn:hover svg {
    color: var(--danger);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--card-border);
}

/* Status Indicator */
.status-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-dot.online {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.online::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 50%;
    background-color: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* Main Content Wrapper */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 50px;
    min-width: 0;
    position: relative;
}

/* ==========================================
   TYPOGRAPHY & UI BASICS
   ========================================== */
/* Stats Grid Row */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
    border-color: #3f3f46;
    transform: translateY(-2px);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-info p {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
    font-weight: 600;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.section-header {
    margin-bottom: 36px;
}

.section-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 14.5px;
}

.subsection-title {
    margin: 32px 0 16px 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-indigo { background-color: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.2); }
.badge-success { background-color: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.15); }
.badge-danger { background-color: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.15); }
.badge-warning { background-color: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.15); }
.badge-outline { border: 1px solid var(--card-border); color: var(--text-secondary); }

/* ==========================================
   CARDS & CONTAINERS
   ========================================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 24px;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
    border-color: #3f3f46; /* Slightly lighter zinc */
}

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

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

.border-bottom {
    border-bottom: 1px solid var(--card-border);
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 13.5px;
}

.optional {
    font-weight: normal;
    color: var(--text-muted);
}

/* Scrollable containers */
.scrollable-y {
    overflow-y: auto;
}
.max-h-300 {
    max-height: 300px;
}

/* ==========================================
   FORMS & INPUTS
   ========================================== */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    background: #09090b;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Inline submit elements */
.inline-submit, .inline-submit-label {
    display: flex;
    gap: 12px;
}

.inline-submit input {
    flex-grow: 1;
}

/* Checkbox Switches */
.inline-checkbox {
    display: flex;
    align-items: center;
    gap: 14px;
}

.checkbox-label strong {
    display: block;
    font-size: 14px;
}

.checkbox-label p {
    margin-top: 2px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #27272a;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 4px;
    bottom: 4px;
    background-color: var(--text-secondary);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:checked + .slider {
    background: var(--primary-gradient);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: #fff;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 13.5px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    background: var(--accent);
}

.btn-secondary {
    background: #27272a;
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover:not(:disabled) {
    background: #3f3f46;
    border-color: #52525b;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.08);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12.5px;
    border-radius: 6px;
}

.btn-xs {
    padding: 5px 10px;
    font-size: 11.5px;
    border-radius: 6px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-danger-link {
    background: transparent;
    border: none;
    color: var(--danger);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-danger-link:hover {
    color: #f87171;
}

/* ==========================================
   COMPOSE VIEW LAYOUT
   ========================================== */
.compose-grid {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 36px;
    align-items: start;
}

/* Media Dropzone */
.media-dropzone {
    border: 2px dashed #27272a;
    border-radius: var(--border-radius);
    padding: 40px 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.005);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.media-dropzone:hover, .media-dropzone.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.02);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.08);
}

.file-input {
    display: none;
}

.dropzone-content svg {
    color: var(--text-secondary);
    margin-bottom: 14px;
    transition: transform 0.2s ease;
}

.media-dropzone:hover .dropzone-content svg {
    transform: translateY(-2px);
    color: var(--accent);
}

.dropzone-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

.dropzone-content p span {
    color: var(--accent);
    font-weight: 600;
}

.dropzone-content small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
}

/* Selected File State */
.file-info-icon {
    width: 54px;
    height: 54px;
    background: #18181b;
    border-radius: 10px;
    margin: 0 auto 14px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.file-info-icon::before {
    content: '🎬';
    font-size: 22px;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    font-size: 14px;
}

.file-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 12px 0;
}

/* Video Publishing Mode Selection */
#video-options-container {
    margin-top: 24px;
    background: #09090b;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-options-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.video-options-radios {
    display: flex;
    gap: 24px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    user-select: none;
    transition: color var(--transition-fast);
}

.radio-option:hover {
    color: var(--text-primary);
}

.radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Category Filters */
.group-filters {
    margin-bottom: 24px;
}

.group-filters label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
    letter-spacing: 0.05em;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    border-color: var(--card-border);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.01);
}

.filter-btn:hover {
    border-color: #3f3f46;
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Pages Checklist */
.pages-list-wrapper {
    margin-top: 20px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: #09090b;
    overflow: hidden;
}

.list-search {
    border-bottom: 1px solid var(--card-border);
}

.list-search input {
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 13.5px;
    padding: 14px 16px;
}

.list-search input:focus {
    box-shadow: none;
}

.pages-checklist {
    max-height: 380px;
    overflow-y: auto;
    padding: 4px;
}

.composer-account-group {
    background: #09090b;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.composer-account-group-header {
    background: #18181b;
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.composer-account-group-header h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-select-all-group {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-select-all-group:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.composer-page-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--card-border);
    transition: background var(--transition-fast);
}

.composer-page-item:last-child {
    border-bottom: none;
}

.composer-page-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.composer-page-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.composer-page-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    accent-color: var(--accent);
}

.avatar-xs {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
}

.selected-summary {
    margin-top: 16px;
    font-size: 13px;
    font-weight: 500;
    text-align: right;
    color: var(--text-secondary);
}

/* ==========================================
   MODAL DIALOG / QUEUE OVERLAY
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 9, 11, 0.85); /* Dark obsidian backdrop */
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-card.modal-md {
    max-width: 600px;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-close:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
    max-height: 400px;
    overflow-y: auto;
}

.modal-desc {
    color: var(--text-secondary);
    font-size: 13.5px;
    margin-bottom: 16px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Queue Progress UI */
.queue-status-text {
    font-weight: 600;
    font-size: 14.5px;
    margin-bottom: 8px;
}

.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.progress-bar-container {
    flex-grow: 1;
    height: 8px;
    background: #09090b;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width var(--transition-normal);
}

.progress-percent {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    width: 36px;
    text-align: right;
}

.queue-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.queue-item {
    background: rgba(255, 255, 255, 0.005);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px 16px;
}

.queue-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.queue-item-meta strong {
    font-size: 13.5px;
}

.job-progress-container {
    height: 4px;
    background: #09090b;
    border-radius: 2px;
    overflow: hidden;
    margin: 8px 0;
}

.job-progress-fill {
    height: 100%;
    background-color: var(--accent);
    border-radius: 2px;
    transition: width 0.15s ease;
}

.job-error-text {
    margin-top: 4px;
}

/* Helper Banner Card */
.helper-banner {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.helper-icon {
    font-size: 20px;
    line-height: 1;
}

.helper-text {
    font-size: 13.5px;
    color: var(--text-secondary);
}

.helper-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.helper-text a {
    color: #818cf8;
    text-decoration: underline;
}

.helper-text a:hover {
    color: #a5b4fc;
}

/* ==========================================
   PAGES & ACCOUNTS TAB GRID
   ========================================== */
.auth-box-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.w-full {
    width: 100% !important;
}

.block {
    display: block !important;
}

.mt-10 {
    margin-top: 10px !important;
}

.auth-option-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.accounts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.account-card .card-body {
    padding: 0;
}

.account-page-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--card-border);
}

.account-page-item:last-child {
    border-bottom: none;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
}

.page-meta-details {
    display: flex;
    flex-direction: column;
}

.page-name {
    font-weight: 600;
}

.page-id {
    font-size: 11.5px;
    color: var(--text-muted);
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-info strong {
    font-size: 15px;
}

/* ==========================================
   CATEGORIES & GROUPS LAYOUT
   ========================================== */
.groups-split-layout {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 32px;
}

.assign-checklist-wrapper {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px;
    background: #09090b;
}

.assign-account-group {
    margin-bottom: 16px;
}

.assign-account-group h5 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.checkbox-option {
    padding: 4px 0;
}

.checkbox-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-option input {
    accent-color: var(--accent);
}

.button-group {
    display: flex;
    gap: 12px;
}

/* ==========================================
   TABLES & LOGS
   ========================================== */
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--card-bg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th, .table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--card-border);
}

.table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: #18181b;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

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

.actions-col {
    text-align: right;
    white-space: nowrap;
}

.actions-col button {
    margin-left: 6px;
}

.font-sm {
    font-size: 13.5px;
}

.font-xs {
    font-size: 12px;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-indigo { color: #818cf8; }

.table-actions {
    display: flex;
    gap: 12px;
}

.table-actions input {
    padding: 8px 12px;
    font-size: 13px;
    width: 240px;
}

.error-msg {
    color: var(--danger);
    cursor: help;
    display: inline-block;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fb-link {
    text-decoration: underline;
    font-weight: 500;
}

.file-name-span {
    font-family: monospace;
    font-size: 12px;
}

/* ==========================================
   DRAFTS VIEW GRID
   ========================================== */
.drafts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.draft-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.draft-card .card-body {
    flex-grow: 1;
}

.draft-text {
    font-size: 13.5px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.draft-card .card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: rgba(0, 0, 0, 0.1);
}

/* ==========================================
   SPA ROUTING VISIBILITY
   ========================================== */
.view-section {
    display: none;
}

.view-section.active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   TOAST NOTIFICATION (POPUP)
   ========================================== */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 14px 24px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transition: all var(--transition-normal);
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
    font-weight: 500;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-error {
    background: #450a0a;
    border-color: var(--danger);
    color: #fff;
}

body.theme-light .toast-error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.toast-warning {
    background: #451a03;
    border-color: var(--warning);
    color: #fff;
}

body.theme-light .toast-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* Loading Spinners */
.loading-spinner {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.hidden {
    display: none !important;
}

/* ==========================================
   RESPONSIVENESS
   ========================================== */
@media (max-width: 1024px) {
    .compose-grid {
        grid-template-columns: 1fr;
    }
    
    .groups-split-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh !important;
        width: 280px !important;
        z-index: 9999 !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(9, 9, 11, 0.8);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 9998;
        display: none;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-backdrop.active {
        display: block;
    }
    
    .sidebar-brand {
        padding: 24px 20px;
    }
    
    .sidebar-nav {
        padding: 10px 20px;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 16px !important;
        width: 100%;
        overflow-x: hidden;
    }
    
    .top-header {
        margin: -16px -16px 20px -16px !important;
        padding: 12px 16px !important;
    }
    
    #btn-mobile-menu-toggle {
        display: flex !important;
    }
    
    #header-user-email-text {
        display: none !important;
    }
    
    .auth-box-container,
    .accounts-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .grid-pricing {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* ==========================================
   LIGHT MODE THEME OVERRIDES
   ========================================== */
body.theme-light {
    /* Premium Alabaster Slate SaaS Theme Colors */
    --bg-main: #f8fafc;       /* Premium Clean Slate Off-White */
    --bg-sidebar: #ffffff;    /* Stark Contrast White Sidebar */
    --card-bg: #ffffff;       /* Pure White Card Background */
    --card-border: #e2e8f0;   /* Clean Slate Border */
    
    --accent: #4f46e5;        /* Deep Premium Indigo for readability */
    --accent-hover: #3730a3;  /* Midnight Indigo */
    --text-primary: #0f172a;   /* Slate 900 (highly legible) */
    --text-secondary: #475569; /* Slate 600 */
    --text-muted: #94a3b8;     /* Slate 400 */
    
    background-color: var(--bg-main);
    color: var(--text-primary);
}

body.theme-light .list-search {
    background: #f4f4f5;
}

body.theme-light .assign-checklist-wrapper,
body.theme-light .pages-list-wrapper {
    background: transparent;
}

body.theme-light .pages-checklist,
body.theme-light .assign-checklist-wrapper {
    background: #f4f4f5;
}

body.theme-light input[type="text"],
body.theme-light input[type="password"],
body.theme-light input[type="datetime-local"],
body.theme-light textarea,
body.theme-light select {
    background: #ffffff;
    border-color: #d4d4d8;
    color: #09090b;
}

body.theme-light input:focus,
body.theme-light textarea:focus,
body.theme-light select:focus {
    background: #ffffff;
    border-color: var(--accent);
}

body.theme-light .table th {
    background: #f4f4f5;
    color: #52525b;
}

body.theme-light .composer-account-group {
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

body.theme-light .composer-account-group-header {
    background: #f4f4f5;
}

body.theme-light .modal-card {
    background: #ffffff;
}

body.theme-light .btn-secondary {
    background: #e4e4e7;
    color: #09090b;
    border-color: #d4d4d8;
}

body.theme-light .btn-secondary:hover {
    background: #d4d4d8;
}

body.theme-light .slider {
    background-color: #d4d4d8;
}

body.theme-light .slider:before {
    background-color: #71717a;
}

body.theme-light input:checked + .slider:before {
    background-color: #ffffff;
}

/* ==========================================
   CAPTION BOX & EMOJI PICKER
   ========================================== */
.caption-wrapper {
    position: relative;
    border-radius: 8px;
    background: #09090b;
    border: 1px solid var(--card-border);
    overflow: hidden;
}

body.theme-light .caption-wrapper {
    background: #ffffff;
    border-color: #d4d4d8;
}

.caption-wrapper textarea {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding-bottom: 44px; /* Leave space for emoji button */
    resize: vertical;
}

.btn-emoji-trigger {
    position: absolute;
    right: 14px;
    bottom: 12px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    user-select: none;
    transition: transform var(--transition-fast);
}

.btn-emoji-trigger:hover {
    transform: scale(1.15);
}

/* Emoji Popover */
.emoji-picker-popover {
    position: absolute;
    right: 14px;
    bottom: 48px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px;
    width: 280px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 100;
    animation: scaleUp 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); transform-origin: bottom right; }
    to { opacity: 1; transform: scale(1); }
}

.emoji-picker-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 4px;
    letter-spacing: 0.05em;
}

.emoji-list {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    padding-right: 4px;
}

.emoji-item {
    font-size: 18px;
    text-align: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background var(--transition-fast);
    user-select: none;
}

.emoji-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.theme-light .emoji-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.character-counter-wrapper {
    display: flex;
    justify-content: flex-end;
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
}

/* ==========================================
   THEME TOGGLE IN SIDEBAR
   ========================================== */
.theme-toggle-container {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-toggle-container span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.theme-switch {
    width: 36px;
    height: 18px;
}

.theme-switch .slider:before {
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
}

.theme-switch input:checked + .slider:before {
    transform: translateX(18px);
}

/* ==========================================
   GLOBAL TOP NAV HEADER & PLAN BADGES
   ========================================== */
.top-header {
    border-bottom: 1px solid var(--card-border);
    background: rgba(9, 9, 11, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.15s ease, border-color 0.15s ease;
}

body.theme-light .top-header {
    background: rgba(255, 255, 255, 0.6);
    border-color: #e4e4e7;
}

.plan-badge-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.plan-badge-pill.free-badge {
    background: rgba(113, 113, 122, 0.15);
    color: #a1a1aa;
    border: 1px solid rgba(113, 113, 122, 0.3);
}

.plan-badge-pill.pro-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.plan-badge-pill.enterprise-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}

body.theme-light .btn-icon:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #000 !important;
}

body.theme-light #btn-profile-dropdown span {
    color: var(--text-secondary) !important;
}

body.theme-light #dropdown-email {
    color: var(--text-primary) !important;
}

body.theme-light #profile-dropdown-menu {
    background: #ffffff !important;
    border-color: var(--card-border) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

body.theme-light #top-header-title {
    color: var(--text-primary) !important;
}

/* Dropdown Hover Items */
.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.08) !important;
    color: var(--accent) !important;
}

body.theme-light .dropdown-item:hover {
    background: rgba(79, 70, 229, 0.06) !important;
    color: #4f46e5 !important;
}

.dropdown-item-danger:hover {
    background: var(--danger-bg) !important;
    color: var(--danger) !important;
}

/* Light Theme Badge Overrides */
body.theme-light .badge-indigo {
    background-color: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

body.theme-light .plan-badge-pill.pro-badge {
    background: rgba(217, 119, 6, 0.08);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

body.theme-light .plan-badge-pill.enterprise-badge {
    background: rgba(79, 70, 229, 0.08);
    color: #4338ca;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

body.theme-light .plan-badge-pill.free-badge {
    background: rgba(100, 116, 139, 0.08);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* ==========================================================================
   ATTRACTIVE & DYNAMIC COMPOSER RE-THEMING
   ========================================================================== */
#view-compose .editor-card,
#view-compose .pages-card {
    backdrop-filter: blur(8px) !important;
    background: rgba(22, 24, 39, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 10px 35px 0 rgba(0, 0, 0, 0.3) !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease !important;
}

body.theme-light #view-compose .editor-card,
body.theme-light #view-compose .pages-card {
    backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03) !important;
}

#view-compose .editor-card:hover,
#view-compose .pages-card:hover {
    border-color: rgba(99, 102, 241, 0.22) !important;
    box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.08) !important;
}

/* Inputs & Textareas Premium Focus Glow */
#view-compose input[type="text"],
#view-compose textarea {
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    background-color: rgba(10, 11, 16, 0.4) !important;
}

body.theme-light #view-compose input[type="text"],
body.theme-light #view-compose textarea {
    background-color: #fafafa !important;
    border-color: #e4e4e7 !important;
    color: #18181b !important;
}

#view-compose input[type="text"]:focus,
#view-compose textarea:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18) !important;
    background-color: rgba(10, 11, 16, 0.6) !important;
}

body.theme-light #view-compose input[type="text"]:focus,
body.theme-light #view-compose textarea:focus {
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
}

/* Stats Cards Makeover */
#view-compose .stat-card {
    background: linear-gradient(145deg, rgba(22, 24, 39, 0.7), rgba(16, 18, 30, 0.95)) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.22) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden;
    position: relative;
}

body.theme-light #view-compose .stat-card {
    background: linear-gradient(145deg, #ffffff, #f9fafb) !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02) !important;
}

#view-compose .stat-card:hover {
    transform: translateY(-4px) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.15) !important;
}

#view-compose .stat-icon {
    background: rgba(99, 102, 241, 0.12) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    color: #818cf8 !important;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.1) !important;
    transition: transform 0.3s ease !important;
}

#view-compose .stat-card:hover .stat-icon {
    transform: scale(1.15) rotate(6deg) !important;
}

/* Checklist Panel Scroll Styling */
.pages-checklist-container {
    border-radius: 8px !important;
    background: rgba(10, 11, 16, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.03) !important;
    padding: 10px !important;
}

body.theme-light .pages-checklist-container {
    background: #f9fafb !important;
    border-color: #e4e4e7 !important;
}

/* Scrollbar Styling for scrollable lists */
.pages-checklist-container::-webkit-scrollbar,
#view-compose textarea::-webkit-scrollbar {
    width: 6px !important;
}

.pages-checklist-container::-webkit-scrollbar-thumb,
#view-compose textarea::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2) !important;
    border-radius: 10px !important;
}

.pages-checklist-container::-webkit-scrollbar-thumb:hover,
#view-compose textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4) !important;
}


