:root {
    --sp-primary: #5c3cf2;
    --sp-primary-dark: #4b2ee0;
    --sp-primary-soft: #f3f0ff;
    --sp-primary-mid: #ede9fe;
    --sp-bg: #f6f7fb;
    --sp-sidebar: #ffffff;
    --sp-text: #111827;
    --sp-muted: #6b7280;
    --sp-border: #e5e7eb;
    --sp-success: #10b981;
    --sp-danger: #ef4444;
    --sp-warning: #f59e0b;
    --sp-info: #3b82f6;
    --sp-sidebar-w: 260px;
    --sp-radius: 12px;
    --sp-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
    --sp-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.08);
    --fb: #1877f2;
    --ig: #e4405f;
    --yt: #ff0000;
    --li: #0a66c2;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.app-body {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--sp-bg);
    color: var(--sp-text);
    margin: 0;
}

a { color: var(--sp-primary); text-decoration: none; }
a:hover { color: var(--sp-primary-dark); }

.btn-primary {
    --bs-btn-bg: var(--sp-primary);
    --bs-btn-border-color: var(--sp-primary);
    --bs-btn-hover-bg: var(--sp-primary-dark);
    --bs-btn-hover-border-color: var(--sp-primary-dark);
    --bs-btn-active-bg: var(--sp-primary-dark);
    --bs-btn-active-border-color: var(--sp-primary-dark);
    --bs-btn-disabled-bg: var(--sp-primary);
    --bs-btn-disabled-border-color: var(--sp-primary);
    font-weight: 600;
    border-radius: 10px;
    padding: 0.55rem 1rem;
}

.btn-outline-primary {
    --bs-btn-color: var(--sp-primary);
    --bs-btn-border-color: var(--sp-primary);
    --bs-btn-hover-bg: var(--sp-primary);
    --bs-btn-hover-border-color: var(--sp-primary);
    font-weight: 600;
    border-radius: 10px;
}

.btn-outline-secondary {
    border-color: var(--sp-border);
    color: #374151;
    background: #fff;
    font-weight: 600;
    border-radius: 10px;
}

.btn-outline-secondary:hover {
    background: #f9fafb;
    color: #111827;
    border-color: #d1d5db;
}

.form-control, .form-select {
    border-color: var(--sp-border);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    box-shadow: none;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 4px rgba(92, 60, 242, 0.12);
}

.form-check-input:checked {
    background-color: var(--sp-primary);
    border-color: var(--sp-primary);
}

.form-switch .form-check-input {
    width: 2.4em;
    height: 1.25em;
    cursor: pointer;
}

.account-select-card .form-check-input {
    position: absolute;
    top: 10px;
    left: 10px;
}

.text-primary { color: var(--sp-primary) !important; }
.bg-primary { background-color: var(--sp-primary) !important; }

/* Loader */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    pointer-events: all;
}

.app-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app-loader-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--sp-shadow);
    padding: 28px 36px;
    text-align: center;
    min-width: 220px;
}

.app-loader .spinner-border {
    width: 2.4rem;
    height: 2.4rem;
    color: var(--sp-primary) !important;
    border-width: 0.22rem;
}

body.is-loading { overflow: hidden; }

/* Shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sp-sidebar-w);
    background: var(--sp-sidebar);
    border-right: 1px solid var(--sp-border);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    z-index: 30;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 18px;
}

.brand-name {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: #111827;
    line-height: 1.1;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--sp-muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #374151;
    font-weight: 500;
    font-size: 0.92rem;
}

.sidebar-link i { font-size: 1.05rem; width: 18px; }

.sidebar-link:hover {
    background: var(--sp-primary-soft);
    color: var(--sp-primary);
}

.sidebar-link.active {
    background: var(--sp-primary);
    color: #fff;
}

.sidebar-promo {
    background: var(--sp-primary-soft);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    margin: 12px 4px;
}

.promo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fff;
    color: var(--sp-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.sidebar-promo h6 {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.88rem;
}

.sidebar-promo p {
    color: var(--sp-muted);
    font-size: 0.75rem;
    margin-bottom: 12px;
}

.sidebar-user { margin-top: auto; padding-top: 8px; }

.sidebar-user-btn {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 12px;
}

.sidebar-user-btn::after { margin-left: auto; }
.sidebar-user-btn strong { display: block; font-size: 0.86rem; }
.sidebar-user-btn small { color: var(--sp-muted); font-size: 0.72rem; }

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-backdrop {
    display: none;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 28px 8px;
    flex-wrap: wrap;
}

.header-left, .header-right {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.header-right {
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.page-title {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0;
}

.page-subtitle {
    color: var(--sp-muted);
    font-size: 0.92rem;
    margin-top: 4px;
}

.page-breadcrumb {
    font-size: 0.8rem;
    color: var(--sp-muted);
    margin-top: 2px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.header-chip {
    background: #fff;
    border: 1px solid var(--sp-border);
    border-radius: 10px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 500;
    color: #374151;
}

.agency-chip { padding-left: 8px; }

.agency-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--sp-primary-soft);
    color: var(--sp-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--sp-border);
    background: #fff;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    font-size: 0.65rem;
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.app-content {
    padding: 12px 28px 32px;
    flex: 1;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    padding: 12px 28px 20px;
    color: var(--sp-muted);
    font-size: 0.78rem;
}

.chat-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--sp-primary);
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 10px 24px rgba(92, 60, 242, 0.35);
    z-index: 40;
}

/* Cards */
.sp-card {
    background: #fff;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow-sm);
}

.kpi-card {
    background: #fff;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 18px;
    box-shadow: var(--sp-shadow-sm);
    height: 100%;
}

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.kpi-label { color: var(--sp-muted); font-size: 0.84rem; margin-bottom: 2px; }
.kpi-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.kpi-trend { font-size: 0.78rem; font-weight: 600; margin-top: 6px; }
.kpi-trend.up { color: var(--sp-success); }
.kpi-trend.down { color: var(--sp-danger); }
.kpi-meta { color: var(--sp-muted); font-size: 0.75rem; }

.icon-purple { background: #eee8ff; color: var(--sp-primary); }
.icon-blue { background: #e8f1ff; color: #2563eb; }
.icon-green { background: #e9f8f1; color: #059669; }
.icon-orange { background: #fff3e6; color: #ea580c; }
.icon-pink { background: #fde8f0; color: #db2777; }
.icon-red { background: #feecec; color: #dc2626; }
.icon-cyan { background: #e7f8fb; color: #0891b2; }

/* Tables */
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }

.sp-table {
    width: 100%;
    margin: 0;
}

.sp-table thead th {
    background: #fafbff;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--sp-border);
    padding: 12px 16px;
    white-space: nowrap;
}

.sp-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 0.88rem;
}

.sp-table tbody tr:last-child td { border-bottom: 0; }
.sp-table tbody tr:hover { background: #fbfbfe; }

.entity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.entity-avatar,
.client-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.entity-name { font-weight: 700; color: #111827; }
.entity-meta { color: var(--sp-muted); font-size: 0.78rem; }

.badge-soft {
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.74rem;
    padding: 0.35em 0.7em;
}

.badge-hospital { background: #e8f1ff; color: #2563eb; }
.badge-clinic { background: #e9f8f1; color: #059669; }
.badge-active { background: #e9f8f1; color: #059669; }
.badge-paused { background: #fff3e6; color: #c2410c; }
.badge-inactive { background: #f3f4f6; color: #6b7280; }
.badge-connected { background: #e9f8f1; color: #059669; }
.badge-scheduled { background: #eee8ff; color: var(--sp-primary); }
.badge-published { background: #e9f8f1; color: #059669; }
.badge-draft { background: #fff3e6; color: #c2410c; }
.badge-failed { background: #feecec; color: #dc2626; }
.badge-pending { background: #fff3e6; color: #c2410c; }
.badge-approved { background: #e9f8f1; color: #059669; }
.badge-rejected { background: #feecec; color: #dc2626; }
.badge-changes { background: #eee8ff; color: var(--sp-primary); }
.badge-invited { background: #fff3e6; color: #c2410c; }
.badge-role-super { background: #eee8ff; color: var(--sp-primary); }
.badge-role-manager { background: #e8f1ff; color: #2563eb; }
.badge-role-creator { background: #e9f8f1; color: #059669; }
.badge-role-reviewer { background: #fff3e6; color: #c2410c; }
.badge-role-analyst { background: #f3e8ff; color: #7c3aed; }

.action-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--sp-border);
    background: #fff;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
}

.action-btn:hover { background: #f9fafb; color: var(--sp-primary); }
.action-btn.success { color: #059669; }
.action-btn.warning { color: #ea580c; }
.action-btn.danger { color: #dc2626; }
.action-btn:disabled { opacity: 0.35; }

.platform-pills { display: flex; align-items: center; gap: 4px; }
.platform-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}
.platform-dot.facebook { background: var(--fb); }
.platform-dot.instagram { background: radial-gradient(circle at 30% 30%, #f9ce34, #ee2a7b 55%, #6228d7); }
.platform-dot.youtube { background: var(--yt); }
.platform-dot.linkedin { background: var(--li); }
.platform-plus {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px dashed #cbd5e1;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-dot.green { background: #10b981; }
.status-dot.orange { background: #f59e0b; }
.status-dot.red { background: #ef4444; }

/* Tabs / toolbar */
.sp-tabs {
    display: flex;
    gap: 18px;
    border-bottom: 1px solid var(--sp-border);
    margin-bottom: 16px;
    overflow-x: auto;
}

.sp-tabs .nav-link {
    border: 0;
    background: none;
    color: var(--sp-muted);
    font-weight: 600;
    padding: 10px 0;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

.sp-tabs .nav-link.active {
    color: var(--sp-primary);
    border-bottom-color: var(--sp-primary);
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    min-width: 220px;
}

.search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-wrap .form-control { padding-left: 36px; }

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    flex-wrap: wrap;
    color: var(--sp-muted);
    font-size: 0.84rem;
}

.pagination .page-link {
    color: #374151;
    border-color: var(--sp-border);
    min-width: 34px;
    text-align: center;
    border-radius: 8px !important;
    margin: 0 3px;
}

.pagination .page-item.active .page-link {
    background: var(--sp-primary);
    border-color: var(--sp-primary);
}

/* Login */
.auth-body { margin: 0; font-family: Inter, sans-serif; background: #fff; }
.login-split { min-height: 100vh; }
.login-left {
    background: linear-gradient(180deg, #f7f5ff 0%, #f3f0ff 100%);
    position: relative;
    overflow: hidden;
    padding: 40px 56px;
}
.login-left::before {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(92, 60, 242, 0.12);
    right: -80px;
    bottom: 80px;
}
.dot-grid {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 140px;
    height: 90px;
    background-image: radial-gradient(#c4b5fd 1.4px, transparent 1.4px);
    background-size: 12px 12px;
    opacity: 0.7;
}
.login-heading { font-size: 2.15rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.login-heading span { color: var(--sp-primary); }
.feature-item { display: flex; gap: 12px; margin-bottom: 16px; }
.feature-ico {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #ece7ff;
    color: var(--sp-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.login-preview {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(76, 29, 149, 0.12);
    padding: 16px;
    max-width: 340px;
    position: relative;
    z-index: 1;
    margin-left: auto;
}
.login-right { padding: 40px 56px; display: flex; flex-direction: column; }
.login-form-wrap { max-width: 420px; margin: auto 0; width: 100%; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control { padding-left: 42px; }
.input-icon-wrap > i.leading {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: #9ca3af;
}
.or-sep { display: flex; align-items: center; gap: 12px; color: #9ca3af; }
.or-sep::before, .or-sep::after { content: ""; height: 1px; background: var(--sp-border); flex: 1; }

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.stepper-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sp-muted);
    font-weight: 600;
    font-size: 0.86rem;
}
.stepper-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}
.stepper-item.active .stepper-num,
.stepper-item.done .stepper-num {
    background: var(--sp-primary);
    color: #fff;
}
.stepper-item.active { color: var(--sp-text); }
.stepper-line {
    height: 2px;
    width: 48px;
    background: #e5e7eb;
    margin: 0 10px;
}
.stepper-item.done .stepper-line { background: var(--sp-primary); }

.platform-card {
    border: 1.5px solid var(--sp-border);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    height: 100%;
    position: relative;
}
.platform-card input { display: none; }
.platform-card.selected {
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 4px rgba(92, 60, 242, 0.12);
}
.platform-card .check {
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--sp-primary);
    display: none;
}
.platform-card.selected .check { display: block; }
.hex-step {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--sp-primary-soft);
    color: var(--sp-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.info-alert {
    background: var(--sp-primary-soft);
    border: 0;
    color: #3730a3;
    border-radius: 12px;
}
.warn-alert {
    background: #fff7ed;
    border: 0;
    color: #9a3412;
    border-radius: 12px;
}

.account-option {
    border: 1.5px solid var(--sp-border);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
}
.account-option.selected {
    border-color: var(--sp-primary);
    background: #faf8ff;
}
.success-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #e9f8f1;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 12px;
}

.section-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sp-primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.account-select-card {
    border: 1.5px solid var(--sp-border);
    border-radius: 12px;
    padding: 28px 12px 12px;
    min-width: 150px;
    position: relative;
    background: #fff;
}
.account-select-card.selected { border-color: var(--sp-primary); }
.add-more-card {
    border: 1.5px dashed #c4b5fd;
    background: #faf8ff;
    color: var(--sp-primary);
    min-width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 12px;
    padding: 12px;
}

.composer {
    border: 1px solid var(--sp-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.composer textarea {
    border: 0;
    min-height: 150px;
    resize: none;
    box-shadow: none !important;
}
.composer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid var(--sp-border);
    background: #fafbff;
}

.preview-social {
    border: 1px solid var(--sp-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.preview-social img.preview-media {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* Calendar */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--sp-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.cal-head, .cal-cell {
    min-height: 118px;
    border-right: 1px solid var(--sp-border);
    border-bottom: 1px solid var(--sp-border);
    padding: 8px;
}
.cal-head {
    min-height: auto;
    background: #fafbff;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--sp-muted);
    text-transform: uppercase;
}
.cal-grid > :nth-child(7n) { border-right: 0; }
.cal-event {
    font-size: 0.7rem;
    border-radius: 6px;
    padding: 3px 6px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}
.cal-event.fb { background: #e8f1ff; color: #1d4ed8; }
.cal-event.ig { background: #fde8f0; color: #be185d; }
.cal-event.yt { background: #feecec; color: #b91c1c; }
.cal-event.li { background: #e7f0fb; color: #1e40af; }
.day-num.today {
    background: var(--sp-primary);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.library-card { overflow: hidden; height: 100%; }
.library-thumb {
    height: 140px;
    background: #eef2ff;
    position: relative;
    overflow: hidden;
}
.library-thumb img { width: 100%; height: 100%; object-fit: cover; }
.type-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
}

.settings-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid #f1f5f9;
    color: #111827;
    font-weight: 500;
}
.settings-link:last-child { padding-bottom: 0; }
.settings-link i.leading { color: var(--sp-muted); }
.danger-zone {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 18px 20px;
}

.access-card {
    border: 1.5px solid var(--sp-border);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    height: 100%;
}
.access-card.selected {
    border-color: var(--sp-primary);
    background: #faf8ff;
}

.progress-thin { height: 8px; border-radius: 999px; background: #f1f5f9; }
.progress-thin .bar {
    height: 100%;
    border-radius: 999px;
    background: var(--sp-primary);
}

.chart-box { height: 240px; }

@media (max-width: 1199.98px) {
    .cal-cell { min-height: 96px; }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--sp-shadow);
    }
    .app-sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.35);
        z-index: 20;
    }
    .login-left, .login-right { padding: 32px 24px; }
    .app-header, .app-content, .app-footer { padding-left: 16px; padding-right: 16px; }
}

.btn-primary, .btn-outline-primary, .btn-outline-secondary, .btn-icon, .action-btn, .sidebar-link, .platform-card, .header-chip {
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 16px rgba(92, 60, 242, 0.22); }
.btn-icon:hover { color: var(--sp-primary); border-color: #ddd6fe; background: #faf8ff; }

.sp-card, .kpi-card {
    transition: box-shadow .18s ease, transform .18s ease;
}
.kpi-card:hover { box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08); }

.sidebar-link { position: relative; }
.sidebar-link i { opacity: .9; }
.sidebar-link:focus-visible, .btn:focus-visible, .form-control:focus, .form-select:focus {
    outline: none;
}

.sidebar-promo {
    background: linear-gradient(180deg, #f4f0ff 0%, #ece7ff 100%);
    border: 1px solid #e4dcff;
}
.sidebar-promo .btn { width: 100%; font-size: .8rem; padding: .45rem .7rem; }

.header-chip:hover { border-color: #ddd6fe; background: #faf8ff; }

.notif-badge {
    top: 4px;
    right: 4px;
}

.table-footer { border-top: 1px solid var(--sp-border); }

.settings-tile {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 12px;
    margin-bottom: 8px;
}
.settings-tile h6 { margin: 0; font-weight: 700; }
.settings-link:hover { color: var(--sp-primary); }
.settings-link .bi-chevron-right { margin-left: auto; color: #9ca3af; }

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.list-row:last-child { border-bottom: 0; }

.tip-box {
    background: #eef4ff;
    color: #1e3a8a;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: .84rem;
}

.login-left::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(92, 60, 242, 0.08);
    left: -90px;
    top: 120px;
}
.feature-ico { border-radius: 50%; }

.preview-fb-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 0; }
.preview-actions { display: flex; justify-content: space-around; border-top: 1px solid var(--sp-border); padding: 8px; color: #6b7280; font-size: .82rem; font-weight: 600; }

.cal-event { cursor: pointer; }
.cal-event:hover { filter: brightness(.96); }
.cal-cell.is-muted { background: #fafafa; }
.day-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sp-muted);
}

.account-select-card .form-check-input { display: none; }
.account-select-card .check {
    position: absolute;
    top: 8px;
    left: 8px;
    color: var(--sp-primary);
    display: none;
    font-size: 1rem;
}
.account-select-card.selected {
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 4px rgba(92, 60, 242, 0.12);
}
.account-select-card.selected .check { display: block; }
.account-select-card:hover { border-color: #c4b5fd; }

.preview-tabs { display: flex; gap: 8px; }
.preview-tab {
    border: 1.5px solid var(--sp-border);
    background: #fff;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.preview-tab.active {
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 4px rgba(92, 60, 242, 0.12);
}

.library-pick { display: block; cursor: pointer; }
.library-pick.selected .library-thumb {
    outline: 2px solid var(--sp-primary);
    outline-offset: 2px;
}

.sticky-preview { position: sticky; top: 24px; }
.composer-toolbar .btn:hover { color: var(--sp-primary) !important; }

.library-card { position: relative; }
.library-card .card-check {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}
.library-card:hover { transform: translateY(-2px); }

@media (min-width: 768px) {
    .d-md-grid { display: grid !important; }
}

@media (max-width: 767.98px) {
    .page-title { font-size: 1.35rem; }
    .login-heading { font-size: 1.6rem; }
    .cal-grid { display: none; }
    .header-chip span { display: none; }
    .agency-chip span:last-child { display: inline; }
    .sticky-preview { position: static; }
}
