:root {
    --sp-sidebar-width: 240px;
    --sp-sidebar-bg: #1c1e26;
    --sp-sidebar-active: #2f80ed;
    --sp-body-bg: #f4f6f9;
}

body {
    background-color: var(--sp-body-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.95rem;
}

/* ---------- Sidebar ---------- */
.sp-sidebar {
    width: var(--sp-sidebar-width);
    min-height: 100vh;
    background: var(--sp-sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}

.sp-sidebar .sp-brand {
    padding: 1.1rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sp-nav {
    padding: 0.5rem 0;
    flex: 1;
    overflow-y: auto;
}

.sp-nav .sp-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1.25rem;
    color: #a9b0c2;
    text-decoration: none;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
}

.sp-nav .sp-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sp-nav .sp-nav-link.active {
    color: #fff;
    background: rgba(47, 128, 237, 0.18);
    border-left-color: var(--sp-sidebar-active);
}

.sp-nav .sp-nav-link .bi {
    font-size: 1rem;
}

.sp-sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #8d94a8;
    font-size: 0.8rem;
}

/* ---------- Main ---------- */
.sp-main {
    margin-left: var(--sp-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sp-topbar {
    background: #fff;
    border-bottom: 1px solid #e4e7ec;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.sp-content {
    padding: 1.5rem;
    flex: 1;
}

/* ---------- Cards ---------- */
.sp-card {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 0.6rem;
    padding: 1.25rem;
}

.sp-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sp-stat .sp-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.sp-stat .sp-stat-label {
    color: #667085;
    font-size: 0.85rem;
}

/* ---------- Status badges ---------- */
.sp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

.sp-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sp-badge-connected { background: #ecfdf3; color: #027a48; }
.sp-badge-connected .dot { background: #12b76a; }
.sp-badge-attention { background: #fef9e7; color: #b54708; }
.sp-badge-attention .dot { background: #f79009; }
.sp-badge-reconnect { background: #fef3f2; color: #b42318; }
.sp-badge-reconnect .dot { background: #f04438; }
.sp-badge-disconnected { background: #f2f4f7; color: #475467; }
.sp-badge-disconnected .dot { background: #98a2b3; }

.sp-badge-draft { background: #f2f4f7; color: #475467; }
.sp-badge-scheduled { background: #eff4ff; color: #3538cd; }
.sp-badge-publishing { background: #fef9e7; color: #b54708; }
.sp-badge-published { background: #ecfdf3; color: #027a48; }
.sp-badge-partially_published { background: #fef9e7; color: #b54708; }
.sp-badge-failed { background: #fef3f2; color: #b42318; }
.sp-badge-cancelled { background: #f2f4f7; color: #475467; }

/* ---------- Platform icons ---------- */
.sp-platform {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
}

.sp-platform-facebook { color: #1877f2; }
.sp-platform-instagram { color: #e1306c; }

/* ---------- Auth ---------- */
.sp-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sp-body-bg);
    padding: 1rem;
}

.sp-auth-card {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 0.75rem;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
}

.sp-auth-card .sp-auth-logo {
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ---------- Mobile ---------- */
.sp-sidebar-toggle {
    display: none;
}

@media (max-width: 991.98px) {
    .sp-sidebar {
        transform: translateX(-100%);
    }
    .sp-sidebar.show {
        transform: translateX(0);
    }
    .sp-main {
        margin-left: 0;
    }
    .sp-sidebar-toggle {
        display: inline-flex;
    }
    .sp-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1035;
    }
}
