/* ==========================================================================
   POSTPILOT UNIVERSAL DESIGN SYSTEM
   Premium Dark — Modern Global SaaS Visual Language
   ========================================================================== */

:root {
    /* Brand & Accent Palette (Electric Blue + Restrained Gold) */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-active: #1d4ed8;
    --primary-light: rgba(59, 130, 246, 0.14);
    --primary-glow: rgba(59, 130, 246, 0.3);
    
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --accent-light: rgba(6, 182, 212, 0.14);

    --accent-gold: #f59e0b;
    --accent-gold-hover: #d97706;
    --accent-gold-light: rgba(245, 158, 11, 0.15);
    --accent-gold-border: rgba(245, 158, 11, 0.35);

    /* Semantic States */
    --success: #10b981;
    --success-hover: #059669;
    --success-light: rgba(16, 185, 129, 0.14);
    --success-border: rgba(16, 185, 129, 0.35);
    --success-glow: rgba(16, 185, 129, 0.25);

    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-light: rgba(245, 158, 11, 0.14);
    --warning-border: rgba(245, 158, 11, 0.35);

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: rgba(239, 68, 68, 0.14);
    --danger-border: rgba(239, 68, 68, 0.35);

    /* Social Platform Colors */
    --fb-blue: #1877f2;
    --fb-light: rgba(24, 119, 242, 0.14);
    --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --ig-pink: #e1306c;
    --ig-light: rgba(225, 48, 108, 0.14);
    --li-blue: #0a66c2;
    --li-light: rgba(10, 102, 194, 0.14);
    --wa-green: #25d366;
    --wa-light: rgba(37, 211, 102, 0.14);

    /* Neutral & Surfaces (Premium Deep Midnight Navy) */
    --bg-app: #080c14;
    --bg-surface: #11192b;
    --bg-surface-hover: #162035;
    --bg-surface-subtle: #0d1424;
    --bg-sidebar: #0c1220;
    --bg-sidebar-hover: #141c30;
    --bg-sidebar-active: #1c2842;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverted: #080c14;

    --border: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-dark: rgba(255, 255, 255, 0.14);
    --border-focus: rgba(59, 130, 246, 0.6);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Radiuses */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows (Soft dark depth) */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px -4px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 35px -5px rgba(0, 0, 0, 0.7);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   App Layout
   ========================================================================== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   Mobile App Bar (Hidden on desktop)
   ========================================================================== */
.mobile-header {
    display: none;
    height: 60px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
    text-decoration: none;
}

.mobile-brand i {
    color: var(--primary);
    font-size: 1.25rem;
}

.mobile-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.mobile-btn:hover, .mobile-btn:focus-visible {
    background-color: var(--bg-surface-hover);
    color: var(--primary);
    outline: none;
}

.mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.mobile-backdrop.active {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
    width: 270px;
    background-color: var(--bg-sidebar);
    color: var(--text-inverted);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 100;
    flex-shrink: 0;
    border-right: 1px solid var(--border-dark);
    transition: transform var(--transition-normal);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    user-select: none;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, #06b6d4 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.05rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

.brand-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    background: rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin: 1.25rem 0 0.5rem 0.75rem;
}

.nav-section-title:first-child {
    margin-top: 0.25rem;
}

.nav-item {
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
}

.nav-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: #94a3b8;
    transition: color var(--transition-fast);
}

.nav-item:hover {
    background-color: var(--bg-sidebar-hover);
    color: #ffffff;
}

.nav-item:hover i {
    color: #ffffff;
}

.nav-item.active {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-item.active i {
    color: #ffffff;
}

.nav-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.nav-badge.running {
    background: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(15, 23, 42, 0.6);
}

.system-status-widget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
}

.status-indicator-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500;
}

.pulsing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    position: relative;
}

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

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-app);
}

.top-bar {
    height: 68px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    z-index: 10;
    gap: 1rem;
    flex-shrink: 0;
}

.page-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Top bar search */
.top-bar-search {
    flex: 1;
    max-width: 380px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.55rem 1rem 0.55rem 2.4rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background-color: var(--bg-surface-subtle);
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-clear-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    display: none;
}

.global-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.75rem;
    margin-left: 0.25rem;
    border-left: 1px solid var(--border);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.5) 100%);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.user-info-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-role-label {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
}

#content-area {
    flex: 1;
    padding: 1.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    min-height: 38px;
    line-height: 1;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--bg-surface-subtle);
    border-color: var(--border);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

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

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-outline-danger {
    background-color: transparent;
    border-color: var(--danger-border);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background-color: var(--danger-light);
    border-color: var(--danger);
}

.btn-outline-primary {
    background-color: transparent;
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

.btn-sm {
    padding: 0.38rem 0.75rem;
    font-size: 0.8rem;
    min-height: 32px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.75rem 1.4rem;
    font-size: 0.95rem;
    min-height: 44px;
}

.btn-icon-only {
    padding: 0.5rem;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   Cards & Layout Components
   ========================================================================== */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-dark);
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    font-weight: 400;
}

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

.stat-card {
    background: var(--bg-surface);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-dark);
}

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

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

.stat-info h4 {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-info p {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.25rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-info small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.bg-blue-soft { background-color: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.bg-green-soft { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.bg-orange-soft { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.bg-purple-soft { background-color: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.bg-pink-soft { background-color: rgba(225, 48, 108, 0.15); color: #f472b6; }
.bg-gold-soft { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* Channel Control Tiles */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.control-tile {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-normal);
}

.control-tile:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
}

.tile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tile-brand-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.tile-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.tile-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.tile-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.tile-status-bar {
    margin: 0.5rem 0 1rem;
    padding: 0.6rem 0.85rem;
    background-color: var(--bg-app);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tile-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: auto;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.status-running {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-stopped {
    background-color: var(--bg-surface-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* Platform Tag Pills */
.platform-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.platform-pill.facebook {
    background-color: rgba(24, 119, 242, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(24, 119, 242, 0.35);
}

.platform-pill.instagram {
    background: rgba(225, 48, 108, 0.15);
    color: #f472b6;
    border: 1px solid rgba(225, 48, 108, 0.35);
}

.platform-pill.linkedin {
    background: rgba(10, 102, 194, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(10, 102, 194, 0.35);
}

.platform-pill.whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #4ade80;
    border: 1px solid rgba(37, 211, 102, 0.35);
}

.platform-pill.meta {
    background-color: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

/* ==========================================================================
   Tables & Responsive Data Views
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.data-table th {
    background-color: var(--bg-surface-subtle);
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: var(--bg-surface-hover);
}

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

.post-img-preview {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: block;
    background-color: var(--bg-surface-subtle);
}

.text-truncate {
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Post Card Alternative (Rendered on narrow screens) */
.mobile-posts-list {
    display: none;
    flex-direction: column;
    gap: 0.85rem;
}

.mobile-post-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-post-body {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.mobile-post-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.mobile-post-content {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.4;
    max-height: 72px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.mobile-post-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.65rem;
}

/* ==========================================================================
   Social Accounts Screen
   ========================================================================== */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.account-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-normal);
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.account-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.account-identity {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #ffffff;
}

.account-meta h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.account-details-list {
    margin: 1rem 0;
    background: var(--bg-app);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.account-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-detail-label {
    color: var(--text-muted);
}

.account-detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================================================
   Post Composer & Live Social Preview
   ========================================================================== */
.composer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    align-items: start;
}

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

.composer-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.preview-toggle-group {
    display: inline-flex;
    background: var(--bg-surface-hover);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.preview-tab-btn {
    border: none;
    background: transparent;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all var(--transition-fast);
}

.preview-tab-btn.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-xs);
}

/* Realistic Facebook Mockup (Dark Mode) */
.fb-post-mockup {
    background: #18191a;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    color: #e4e6eb;
}

.fb-mockup-header {
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fb-mockup-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fb-blue) 0%, #00c6ff 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.fb-mockup-page-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #e4e6eb;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.fb-mockup-page-name i {
    color: var(--fb-blue);
    font-size: 0.85rem;
}

.fb-mockup-time {
    font-size: 0.75rem;
    color: #b0b3b8;
}

.fb-mockup-caption {
    padding: 0.5rem 1rem 0.85rem;
    font-size: 0.92rem;
    color: #e4e6eb;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}

.fb-mockup-media-container {
    width: 100%;
    max-height: 380px;
    background-color: #242526;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fb-mockup-img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    display: block;
}

.fb-mockup-media-placeholder {
    padding: 3rem 1rem;
    color: #b0b3b8;
    text-align: center;
    font-size: 0.85rem;
}

.fb-mockup-media-placeholder i {
    font-size: 2.5rem;
    color: #65676b;
    margin-bottom: 0.5rem;
    display: block;
}

.fb-mockup-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-around;
    color: #b0b3b8;
    font-size: 0.85rem;
    font-weight: 600;
}

.fb-footer-action {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: default;
}

/* Realistic Instagram Mockup (Dark Mode) */
.ig-post-mockup {
    background: #121212;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    color: #f5f5f5;
}

.ig-mockup-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.ig-avatar-ring {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 2px;
    background: var(--ig-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #1c1c1c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #f5f5f5;
}

.ig-mockup-user {
    font-weight: 700;
    font-size: 0.88rem;
    color: #f5f5f5;
}

.ig-mockup-location {
    font-size: 0.72rem;
    color: #a8a8a8;
}

.ig-mockup-media-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #181818;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ig-mockup-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ig-mockup-actions {
    padding: 0.75rem 1rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.25rem;
    color: #f5f5f5;
}

.ig-action-left {
    display: flex;
    gap: 1rem;
}

.ig-mockup-caption-wrap {
    padding: 0 1rem 1rem;
    font-size: 0.88rem;
    color: #f5f5f5;
    line-height: 1.4;
    word-break: break-word;
}

.ig-mockup-username-prefix {
    font-weight: 700;
    margin-right: 0.35rem;
}

/* Realistic LinkedIn Mockup (Dark Mode) */
.li-post-mockup {
    background: #1b1f23;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    color: #e8e6e3;
}

.li-mockup-header {
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.li-mockup-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: #0a66c2;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.li-mockup-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.li-mockup-meta {
    font-size: 0.75rem;
    color: #8c9094;
}

.li-mockup-caption {
    padding: 0.5rem 1rem 0.85rem;
    font-size: 0.92rem;
    color: #e8e6e3;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}

.li-mockup-media-container {
    width: 100%;
    max-height: 380px;
    background-color: #12161a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.li-mockup-img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    display: block;
}

.li-mockup-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-around;
    color: #8c9094;
    font-size: 0.85rem;
    font-weight: 600;
}

.li-footer-action {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: default;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text-primary);
    background-color: var(--bg-surface-subtle);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-help {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* File Upload Zone */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-surface-subtle);
    transition: all var(--transition-normal);
}

.file-upload-wrapper:hover, .file-upload-wrapper.dragover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2.25rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.file-upload-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.file-upload-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.file-preview-card {
    display: none;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 0.75rem;
}

.file-preview-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* Quick Hashtag Chips */
.hashtag-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.hashtag-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hashtag-chip:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 8, 16, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-surface);
    width: 100%;
    max-width: 650px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-dark);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.close-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-hover);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

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

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-width: 420px;
    pointer-events: none;
}

.toast {
    min-width: 290px;
    padding: 0.85rem 1.15rem;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.success i {
    color: var(--success);
    font-size: 1.15rem;
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.error i {
    color: var(--danger);
    font-size: 1.15rem;
}

.toast.info {
    border-left: 4px solid var(--primary);
}

.toast.info i {
    color: var(--primary);
    font-size: 1.15rem;
}

/* ==========================================================================
   Empty States & Skeletons
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.empty-state-desc {
    font-size: 0.88rem;
    max-width: 360px;
    margin: 0 auto 1.5rem;
}

/* ==========================================================================
   Responsive Adaptations (320px, 360px, 375px, 390px, 480px, 768px, 992px)
   ========================================================================== */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

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

    .sidebar-close-btn {
        display: flex;
    }

    .mobile-header {
        display: flex;
    }

    .top-bar-search {
        display: none;
    }

    .top-bar {
        padding: 0 1rem;
        height: 56px;
    }

    #content-area {
        padding: 1.25rem 1rem;
    }
}

@media (max-width: 768px) {
    .table-responsive {
        display: none; /* Hide heavy table on mobile */
    }

    .mobile-posts-list {
        display: flex; /* Show touch-friendly mobile cards */
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

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

    .global-actions .btn span {
        display: none; /* Icon-only buttons on small viewports */
    }

    .global-actions .btn {
        padding: 0.45rem 0.65rem;
    }

    .user-info-text {
        display: none;
    }

    .modal-content {
        max-height: 94vh;
        border-radius: var(--radius-lg);
    }

    #toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    #content-area {
        padding: 1rem 0.75rem;
    }

    .page-title {
        font-size: 1.1rem;
    }

    .card {
        padding: 1.15rem;
        border-radius: var(--radius-md);
    }

    .modal-body {
        padding: 1.15rem;
    }

    .btn {
        min-height: 44px; /* Ensure 44px touch target on mobile */
    }
}

/* ==========================================================================
   Phase 2: Calendar, Lifecycle Badges, Approvals & Audit Timeline Styles
   ========================================================================== */

/* Universal Lifecycle Status Badges */
.badge-draft { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.badge-pending_approval { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.badge-approved { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.35); }
.badge-scheduled { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.35); }
.badge-publishing { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.35); animation: pulse 2s infinite; }
.badge-published { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.badge-rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.badge-failed { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.badge-cancelled { background: rgba(100, 116, 139, 0.12); color: #94a3b8; border: 1px dashed rgba(100, 116, 139, 0.3); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Calendar Header & Controls */
.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    background: var(--bg-surface);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.calendar-nav-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.calendar-title-display {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 180px;
}

.calendar-filters-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.calendar-filters-group select {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* View Switcher (Month, Week, Day, List) */
.view-btn-group {
    display: inline-flex;
    border-radius: var(--radius-md);
    background: var(--bg-app);
    padding: 0.25rem;
    border: 1px solid var(--border);
}

.view-btn {
    border: none;
    background: transparent;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--bg-surface);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Month View Grid */
.calendar-grid-wrap {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.calendar-day-headers-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-app);
    border-bottom: 1px solid var(--border);
}

.calendar-day-header-cell {
    padding: 0.65rem 0.5rem;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-cell {
    min-height: 125px;
    padding: 0.5rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    transition: background 0.15s ease;
    display: flex;
    flex-direction: column;
}

.calendar-day-cell:nth-child(7n) {
    border-right: none;
}

.calendar-day-cell:hover {
    background: rgba(99, 102, 241, 0.02);
}

.calendar-day-cell.other-month {
    background: var(--bg-app);
    opacity: 0.45;
}

.calendar-day-cell.today {
    background: rgba(99, 102, 241, 0.05);
}

.calendar-day-cell.today .calendar-day-num span {
    background: var(--primary);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-num {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.calendar-events-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    max-height: 110px;
}

/* Event Pill */
.calendar-pill {
    padding: 0.25rem 0.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    background: var(--bg-app);
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.calendar-pill.pill-tour { border-left: 3px solid #38bdf8; }
.calendar-pill.pill-nz { border-left: 3px solid #4ade80; }
.calendar-pill.pill-gaatha { border-left: 3px solid #c084fc; }
.calendar-pill.pill-insta { border-left: 3px solid #f472b6; }

/* List / Agenda View */
.calendar-list-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.calendar-list-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-surface);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: box-shadow 0.15s ease;
}

.calendar-list-card:hover {
    box-shadow: var(--shadow-sm);
}

.calendar-list-date-badge {
    min-width: 80px;
    text-align: center;
    background: var(--bg-app);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.calendar-list-date-day {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.calendar-list-date-month {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Timeline Audit Trail Styles */
.audit-timeline {
    position: relative;
    padding-left: 1.75rem;
    border-left: 2px solid var(--border);
    margin-left: 0.5rem;
    margin-top: 0.75rem;
}

.audit-timeline-item {
    position: relative;
    margin-bottom: 1.15rem;
}

.audit-timeline-dot {
    position: absolute;
    left: -2.15rem;
    top: 0.2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-surface);
}

.audit-timeline-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.audit-timeline-action {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.audit-timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.audit-timeline-reason {
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--bg-app);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    margin-top: 0.3rem;
    border-left: 3px solid var(--primary);
}

/* Approvals Grid */
.approvals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.approval-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.approval-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Publishing Queue Table */
.queue-table-wrap {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.queue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.queue-table th {
    background: var(--bg-app);
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.queue-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.queue-table tr:hover td {
    background: var(--bg-surface-hover);
}

/* ==========================================================================
   AI MARKETING STUDIO DESIGN SYSTEM
   Brand-Aware Multi-Platform Copy Generation & Campaign Workspace
   ========================================================================== */

.studio-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1300px;
    margin: 0 auto;
}

.studio-header-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.studio-brand-selector-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.studio-campaign-selector-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.studio-brief-banner {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.04) 0%, rgba(192, 132, 252, 0.08) 100%);
    border: 1px solid rgba(192, 132, 252, 0.25);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.studio-brief-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.studio-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.studio-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.studio-generation-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.studio-platform-selector-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1rem 0 1.25rem 0;
}

.platform-pill-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-app);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.platform-pill-toggle:hover {
    background: var(--bg-surface-hover);
    border-color: var(--primary);
}

.platform-pill-toggle input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
}

.platform-pill-toggle.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.studio-drafts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.25rem;
}

.studio-draft-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.studio-draft-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.studio-draft-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.65rem;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-md);
}

.platform-badge.facebook {
    background: #e7f3ff;
    color: #1877f2;
}

.platform-badge.instagram {
    background: #fdf2f8;
    color: #db2777;
}

.platform-badge.linkedin {
    background: #e0f2fe;
    color: #0284c7;
}

.platform-badge.x {
    background: #f1f5f9;
    color: #0f172a;
}

.platform-badge.whatsapp {
    background: #ecfdf5;
    color: #059669;
}

.whatsapp-notice-banner {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    color: #065f46;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.studio-card-field-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.studio-draft-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

@media (max-width: 768px) {
    .studio-drafts-grid {
        grid-template-columns: 1fr;
    }
    .studio-header-card {
        flex-direction: column;
        align-items: stretch;
    }
    .studio-brand-selector-wrap,
    .studio-campaign-selector-wrap {
        width: 100%;
    }
    .studio-brand-selector-wrap select,
    .studio-campaign-selector-wrap select {
        flex: 1;
    }
}

/* ==========================================================================
   Brand Workspaces, Media Library, Analytics & Settings Styles (Unit L)
   ========================================================================== */
.brand-card,
.campaign-card,
.media-asset-card {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brand-card:hover,
.campaign-card:hover,
.media-asset-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.brand-avatar-pill {
    flex-shrink: 0;
}

.media-asset-card img {
    transition: transform var(--transition-normal);
}

.media-asset-card:hover img {
    transform: scale(1.05);
}

.analytics-view-container .stat-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    padding: 1.25rem;
}

@media (max-width: 640px) {
    .brands-grid,
    .campaigns-grid,
    .media-grid {
        grid-template-columns: 1fr !important;
    }
    .mobile-header {
        display: flex;
    }
}

/* ==========================================================================
   Premium Dark Scrollbars & Global Accents
   ========================================================================== */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ==========================================================================
   Guided 5-Step Post Composer (Step-by-Step SaaS Flow)
   ========================================================================== */
.composer-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
    padding: 0 1rem;
}

.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.step-node.active .step-number {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-glow);
    border-color: var(--primary);
}

.step-node.completed .step-number {
    background: var(--success);
    color: #ffffff;
    border-color: var(--success);
}

.step-node.active .step-label,
.step-node.completed .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface-subtle);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.step-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 -0.5rem;
    margin-top: -1.25rem;
    position: relative;
    z-index: 1;
    transition: background-color var(--transition-fast);
}

.step-line.completed {
    background: var(--primary);
}

.composer-step-pane {
    display: none;
}

.composer-step-pane.active {
    display: block;
    animation: fadeInCard 0.25s ease-out forwards;
}

/* Step 1: Destination Selection Cards */
.dest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.dest-card {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.dest-card:hover {
    border-color: var(--border-dark);
    background: var(--bg-surface-hover);
    transform: translateY(-1px);
}

.dest-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary);
}

.dest-card-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dest-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    flex-shrink: 0;
}

.dest-info-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.dest-info-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.dest-check-indicator {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: transparent;
    transition: all var(--transition-fast);
}

.dest-card.selected .dest-check-indicator {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* ==========================================================================
   Dashboard Executive Date Filter & Recent Successful Publishing Feed
   ========================================================================== */
.dash-executive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dash-filter-group {
    display: inline-flex;
    background: var(--bg-surface-subtle);
    padding: 3px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.dash-filter-btn {
    background: transparent;
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dash-filter-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.dash-filter-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* Recent Successful Publishing Cards */
.published-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.published-feed-card {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all var(--transition-fast);
}

.published-feed-card:hover {
    border-color: var(--border-dark);
    background: var(--bg-surface-hover);
    transform: translateX(2px);
}

.published-feed-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.published-thumb-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--bg-app);
    border: 1px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.published-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.published-meta-wrap {
    flex: 1;
    min-width: 0;
}

.published-headline-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.published-caption-snippet {
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.published-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Success Rate Progress Bar */
.success-rate-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg-app);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 0.6rem;
}

.success-rate-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Dedicated Drafts Workspace Styles
   ========================================================================== */
.drafts-workspace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.draft-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: all var(--transition-fast);
}

.draft-card:hover {
    border-color: var(--border-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ==========================================================================
   Dedicated WhatsApp Cloud API Interface
   ========================================================================== */
.wa-layout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.75rem;
    align-items: start;
}

@media (max-width: 991px) {
    .wa-layout-grid {
        grid-template-columns: 1fr;
    }
}

.wa-preview-phone {
    background: #0b141a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.wa-preview-phone-header {
    background: #202c33;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wa-preview-chat-body {
    padding: 1.25rem 1rem;
    background-color: #0b141a;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 16px 16px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.wa-msg-bubble-out {
    background: #005c4b;
    color: #e9edef;
    padding: 0.65rem 0.85rem;
    border-radius: 8px 8px 2px 8px;
    max-width: 85%;
    align-self: flex-end;
    font-size: 0.88rem;
    line-height: 1.45;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.wa-bubble-time {
    font-size: 0.68rem;
    color: rgba(233, 237, 239, 0.6);
    float: right;
    margin-left: 0.75rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}


