/* =========== VARIABLES =========== */
:root {
    --primary: #8C52FF;
    --secondary: #FF66C4;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --dark: #0F172A;
    --bg: #F0F4FF;
    --card: #FFFFFF;
    --border: #E2E8F0;
    --text: #1E293B;
    --muted: #64748B;
    --sidebar-w: 240px;
    --font: 'Inter', sans-serif;
    --heading: 'Outfit', sans-serif;
    --transition: all 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* =========== APP SHELL =========== */
.app-shell {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* =========== SIDEBAR =========== */
.app-sidebar {
    width: var(--sidebar-w);
    background: var(--dark);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
    z-index: 100;
}

.sidebar-logo {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-logo i {
    color: var(--primary);
    font-size: 1.6rem;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-radius: 0 50px 50px 0;
    margin-right: 12px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(140, 82, 255, 0.4), rgba(140, 82, 255, 0.1));
    border-left: 3px solid var(--primary);
}

.sidebar-bottom {
    padding: 16px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* =========== APP CONTENT =========== */
.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* =========== TOP BAR =========== */
.app-topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    height: 64px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--muted);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    color: var(--primary);
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    flex: 1;
    font-family: var(--heading);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.platform-badges {
    display: flex;
    gap: 10px;
}

.platform-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.platform-badge:hover {
    transform: scale(1.15);
}

.platform-badge.fb {
    background: #1877F2;
}

.platform-badge.ig {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.platform-badge.tw {
    background: #000;
}

.platform-badge.li {
    background: #0A66C2;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* =========== SECTIONS =========== */
.page-section {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 32px 28px;
    flex-direction: column;
    gap: 24px;
}

.page-section.active {
    display: flex;
}

.page-header {
    margin-bottom: 8px;
}

.page-header h1 {
    font-family: var(--heading);
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.page-header p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* =========== CARDS =========== */
.card {
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.card-link {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.card-link:hover {
    text-decoration: underline;
}

/* =========== STATS =========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon.orange {
    background: linear-gradient(135deg, #F97316, #EA580C);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10B981, #059669);
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8C52FF, #6D28D9);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--heading);
}

.stat-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 4px;
}

/* =========== DASHBOARD GRID =========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: auto auto;
    gap: 20px;
}

.chart-card {
    grid-column: 1;
}

.upcoming-card {
    grid-column: 2;
    grid-row: 1 / 3;
}

.platforms-card {
    grid-column: 1;
}

.chart-area {
    height: 200px;
    position: relative;
}

.legend {
    display: flex;
    gap: 14px;
}

.legend-item {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-item::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-item.purple::before {
    background: var(--primary);
}

.legend-item.blue::before {
    background: var(--info);
}

.legend-item.green::before {
    background: var(--success);
}

/* =========== UPCOMING POSTS =========== */
.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.upcoming-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.upcoming-item:hover {
    background: #f8fafd;
}

.upcoming-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    flex-shrink: 0;
}

.upcoming-thumb.fb {
    background: #1877F2;
}

.upcoming-thumb.ig {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.upcoming-thumb.tw {
    background: #000;
}

.upcoming-thumb.li {
    background: #0A66C2;
}

.upcoming-info {
    flex: 1;
    min-width: 0;
}

.upcoming-info p {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.upcoming-info span {
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.upcoming-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    white-space: nowrap;
}

.upcoming-status.scheduled {
    background: #D1FAE5;
    color: #059669;
}

.upcoming-status.draft {
    background: #FEF3C7;
    color: #D97706;
}

/* =========== PLATFORM PERFORMANCE =========== */
.platform-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.platform-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.platform-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: white;
    flex-shrink: 0;
}

.platform-icon.fb {
    background: #1877F2;
}

.platform-icon.ig {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743);
}

.platform-icon.tw {
    background: #000;
}

.platform-icon.li {
    background: #0A66C2;
}

.platform-details {
    flex: 1;
}

.platform-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.platform-bar {
    height: 6px;
    background: var(--border);
    border-radius: 50px;
    overflow: hidden;
}

.platform-fill {
    height: 100%;
    border-radius: 50px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.platform-pct {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    width: 36px;
    text-align: right;
}

/* =========== QUICK ACTIONS =========== */
.quick-actions-card {
    grid-column: 1 / -1;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quick-action-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.quick-action-btn i {
    font-size: 1.1rem;
    color: var(--primary);
}

.quick-action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.quick-action-btn:hover i {
    color: white;
}

/* =========== CREATE POST =========== */
.create-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}

.composer-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.platform-selector h3,
.schedule-options h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 12px;
}

.platform-toggles {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.platform-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.platform-toggle input[type="checkbox"] {
    display: none;
}

.platform-toggle.active {
    color: white;
}

.fb-toggle.active {
    background: #1877F2;
    border-color: #1877F2;
}

.ig-toggle.active {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366);
    border-color: #dc2743;
}

.tw-toggle.active {
    background: #000;
    border-color: #000;
}

.li-toggle.active {
    background: #0A66C2;
    border-color: #0A66C2;
}

.compose-area {
    position: relative;
}

.compose-area textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: var(--font);
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: var(--transition);
    background: #FAFCFF;
    color: var(--text);
}

.compose-area textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(140, 82, 255, 0.12);
}

.compose-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.compose-tool {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.compose-tool:hover {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--primary);
}

.ai-compose-tool {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white !important;
    border: none !important;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-compose-tool:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.char-count {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--muted);
}

.ai-suggestion {
    background: linear-gradient(135deg, rgba(140, 82, 255, 0.06), rgba(255, 102, 196, 0.06));
    border: 1px solid rgba(140, 82, 255, 0.25);
    border-radius: 12px;
    padding: 16px;
    animation: fadeIn 0.3s ease;
}

.ai-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-suggestion p {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 12px;
}

.ai-actions {
    display: flex;
    gap: 8px;
}

.btn-xs {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.btn-primary-xs {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary-xs:hover {
    background: #7c3aed;
}

.btn-outline-xs {
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline-xs:hover {
    background: rgba(140, 82, 255, 0.1);
}

.schedule-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.datetime-row {
    display: flex;
    gap: 12px;
}

.datetime-row input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    flex: 1;
}

.datetime-row input:focus {
    border-color: var(--primary);
}

.compose-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-compose {
    padding: 12px 24px;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    transition: var(--transition);
}

.btn-compose.draft {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--muted);
}

.btn-compose.draft:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-compose.cta {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 14px rgba(140, 82, 255, 0.3);
}

.btn-compose.cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* PREVIEW */
.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.preview-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.preview-tab {
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.preview-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.preview-mockup {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    font-size: 0.88rem;
    background: #fafcff;
}

.mockup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.mockup-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.mockup-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.mockup-time {
    font-size: 0.75rem;
    color: var(--muted);
}

.mockup-text {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text);
    min-height: 40px;
}

.mockup-img-placeholder {
    background: linear-gradient(135deg, #e2e8f0, #f0f4ff);
    height: 120px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.mockup-actions {
    display: flex;
    gap: 16px;
    color: var(--muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.mockup-actions span {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* =========== SCHEDULER =========== */
.calendar-card {
    padding: 20px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.calendar-header button {
    background: var(--bg);
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--muted);
    transition: var(--transition);
}

.calendar-header button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays div {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    padding: 6px 0;
    text-transform: uppercase;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-day {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
}

.cal-day:hover {
    background: var(--bg);
    border-color: var(--border);
}

.cal-day.today {
    background: rgba(140, 82, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}

.cal-day.other-month {
    color: #c4c8d0;
}

.cal-day .cal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 4px;
}

.cal-dot.fb {
    background: #1877F2;
}

.cal-dot.ig {
    background: #dc2743;
}

.cal-dot.tw {
    background: #000;
}

.cal-dot.mixed {
    background: var(--primary);
}

/* =========== QUEUE =========== */
.queue-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--card);
    border: 1px solid var(--border);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.queue-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.queue-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.queue-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    flex-shrink: 0;
}

.queue-info {
    flex: 1;
    min-width: 0;
}

.queue-text {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.queue-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--muted);
}

.queue-time,
.queue-platforms {
    display: flex;
    align-items: center;
    gap: 5px;
}

.queue-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
}

.queue-badge.status-scheduled {
    background: #D1FAE5;
    color: #059669;
}

.queue-badge.status-draft {
    background: #FEF3C7;
    color: #D97706;
}

.queue-badge.status-published {
    background: #DBEAFE;
    color: #2563EB;
}

.queue-actions {
    display: flex;
    gap: 8px;
}

.queue-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.queue-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.queue-btn.del:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* =========== ANALYTICS =========== */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}

.analytics-img {
    width: 100%;
    border-radius: 10px;
    margin-top: 10px;
}

.top-posts-card .card-header {
    margin-bottom: 14px;
}

.top-post-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.top-post-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.tp-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    flex-shrink: 0;
}

.tp-thumb.fb {
    background: #1877F2;
}

.tp-thumb.ig {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366);
}

.tp-thumb.li {
    background: #0A66C2;
}

.tp-info {
    flex: 1;
}

.tp-info p {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.tp-meta {
    display: flex;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--muted);
}

.tp-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.period-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

/* =========== ACCOUNTS =========== */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.account-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    transition: var(--transition);
    border-top: 4px solid var(--border);
}

.account-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}

.fb-card {
    border-top-color: #1877F2;
}

.ig-card {
    border-top-color: #dc2743;
}

.tw-card {
    border-top-color: #000;
}

.li-card {
    border-top-color: #0A66C2;
}

.yt-card {
    border-top-color: #FF0000;
}

.tt-card {
    border-top-color: #010101;
}

.account-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
}

.fb-card .account-icon {
    background: #1877F2;
}

.ig-card .account-icon {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.tw-card .account-icon {
    background: #000;
}

.li-card .account-icon {
    background: #0A66C2;
}

.yt-card .account-icon {
    background: #FF0000;
}

.tt-card .account-icon {
    background: #010101;
}

.account-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.account-info p {
    font-size: 0.82rem;
    color: var(--muted);
}

.account-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
}

.connected-badge {
    background: #D1FAE5;
    color: #059669;
}

.disconnected-badge {
    background: #F1F5F9;
    color: var(--muted);
}

.account-action {
    padding: 10px 24px;
    border-radius: 50px;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.account-action.connect {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.account-action.connect:hover {
    opacity: 0.9;
}

.account-action.disconnect {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--muted);
}

.account-action.disconnect:hover {
    background: #FEE2E2;
    color: var(--danger);
    border-color: #FECACA;
}

/* =========== TOAST =========== */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--dark);
    color: white;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========== RESPONSIVE =========== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .upcoming-card {
        grid-column: 1;
        grid-row: auto;
    }

    .create-grid,
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .accounts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: -260px;
        height: 100vh;
        transition: left 0.3s ease;
    }

    .app-sidebar.open {
        left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .accounts-grid {
        grid-template-columns: 1fr;
    }
}

/* =========== ACCOUNT CARD ALIASES =========== */
.facebook-card {
    border-top-color: #1877F2 !important;
}

.instagram-card {
    border-top-color: #dc2743 !important;
}

.twitter-card {
    border-top-color: #000 !important;
}

.linkedin-card {
    border-top-color: #0A66C2 !important;
}

.youtube-card {
    border-top-color: #FF0000 !important;
}

.tiktok-card {
    border-top-color: #010101 !important;
}

.facebook-card .account-icon {
    background: #1877F2;
}

.instagram-card .account-icon {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.twitter-card .account-icon {
    background: #000;
}

.linkedin-card .account-icon {
    background: #0A66C2;
}

.youtube-card .account-icon {
    background: #FF0000;
}

.tiktok-card .account-icon {
    background: #010101;
}

/* =========== OAUTH MODAL =========== */
.oauth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.oauth-overlay.visible {
    opacity: 1;
}

.oauth-modal {
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px 32px;
    width: 420px;
    max-width: 96vw;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(24px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Inter', sans-serif;
}

.oauth-overlay.visible .oauth-modal {
    transform: translateY(0);
}

.oauth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #64748b;
    transition: all 0.2s;
}

.oauth-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.oauth-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin: 0 auto 20px;
}

.oauth-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}

.oauth-subtitle {
    text-align: center;
    font-size: 0.88rem;
    color: #64748b;
    margin-bottom: 24px;
}

.oauth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oauth-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    color: #1e293b;
    background: #fafcff;
}

.oauth-input:focus {
    border-color: #8C52FF;
    box-shadow: 0 0 0 3px rgba(140, 82, 255, 0.12);
}

.oauth-permission-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.83rem;
    color: #1e293b;
    margin-top: 4px;
}

.oauth-permission-box b {
    display: block;
    margin-bottom: 8px;
    color: #0f172a;
}

.oauth-permission-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.oauth-permission-box li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
}

.oauth-permission-box li i {
    color: #10B981;
    font-size: 0.75rem;
}

.oauth-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #8C52FF, #FF66C4);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-top: 4px;
    box-shadow: 0 4px 14px rgba(140, 82, 255, 0.3);
}

.oauth-submit:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.oauth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.oauth-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.oauth-footer-note {
    text-align: center;
    margin-top: 16px;
    font-size: 0.78rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}