/* ==========================================================================
   FB Publisher Pro — 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 {
    /* Obsidian Dark SaaS Theme Colors */
    --bg-main: #09090b;       /* Obsidian Black / Zinc 950 */
    --bg-sidebar: #09090b;    /* Seamless sidebar */
    --card-bg: #18181b;       /* Zinc 900 */
    --card-border: #27272a;   /* Zinc 800 */
    
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%); /* Modern rich Indigo */
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text-primary: #f4f4f5;   /* Zinc 100 */
    --text-secondary: #a1a1aa; /* Zinc 400 */
    --text-muted: #71717a;     /* Zinc 500 */
    
    /* Semantic Colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    
    /* 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;
    background: linear-gradient(135deg, #ffffff 0%, #e4e4e7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.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(255, 255, 255, 0.03);
    color: var(--text-primary);
}

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

.nav-item.active {
    background: #1e1b4b; /* Deep Indigo shadow */
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-weight: 600;
}

.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: #fca5a5;
}

.sidebar-logout-btn:hover svg {
    color: #fca5a5;
}

.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: #09090b;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 14px 24px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    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;
}

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

/* 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 {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }
    
    .sidebar-brand {
        padding: 20px;
    }
    
    .sidebar-nav {
        padding: 10px 20px 20px 20px;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px;
    }
    
    .auth-box-container,
    .accounts-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   LIGHT MODE THEME OVERRIDES
   ========================================== */
body.theme-light {
    --bg-main: #f4f4f5;       /* Zinc 100 */
    --bg-sidebar: #ffffff;    /* Pure White */
    --card-bg: #ffffff;       /* Pure White */
    --card-border: #e4e4e7;   /* Zinc 200 */
    
    --text-primary: #09090b;   /* Zinc 950 */
    --text-secondary: #52525b; /* Zinc 600 */
    --text-muted: #8e8e93;     /* Zinc 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);
}

