@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --sidebar: #151c2e;
    --sidebar-light: #202a43;
    --primary: #4f46f5;
    --primary-hover: #4038dc;
    --text: #182033;
    --muted: #78839a;
    --border: #e9edf5;
    --surface: #ffffff;
    --page-bg: #f5f7fc;
    --success: #16865a;
    --radius: 16px;
    --shadow: 0 5px 20px rgba(25, 39, 75, 0.045);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--page-bg);
    font-size: 13px;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
}

.app-layout {
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    padding: 26px 17px 18px;
    display: flex;
    flex-direction: column;
    color: #c5ccdc;
    background: var(--sidebar);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 0 9px 35px;
    white-space: nowrap;
}

.brand strong {
    color: #a9a7ff;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #8c65ff, #4b68f5);
    font-size: 16px;
}

.sidebar-label {
    margin: 0 10px 13px;
    color: #7e8aa4;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.3px;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.nav-link {
    min-height: 43px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 13px;
    color: #b9c3d8;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
}

.nav-link i {
    width: 17px;
    text-align: center;
    font-size: 15px;
}

.nav-link:hover {
    color: #fff;
    background: var(--sidebar-light);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(100deg, #514bf3, #4147cf);
    box-shadow: 0 5px 14px rgba(58, 67, 220, 0.22);
    font-weight: 600;
}

.sidebar-bottom {
    margin-top: auto;
}

.upgrade-card {
    margin: 0 2px 17px;
    padding: 17px 14px;
    border: 1px solid #303a52;
    border-radius: 13px;
    background: linear-gradient(145deg, #202b45, #1a2236);
}

.upgrade-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
    border-radius: 9px;
    color: #c1b7ff;
    background: #37365e;
}

.upgrade-card h4 {
    margin: 0 0 7px;
    color: #fff;
    font-size: 12px;
}

.upgrade-card p {
    margin: 0 0 13px;
    color: #9da9c0;
    font-size: 11px;
    line-height: 1.7;
}

.upgrade-link {
    color: #c2bcff;
    font-size: 11px;
    font-weight: 600;
}

.settings-link {
    margin-top: 6px;
}

/* Main content and header */
.main-content {
    margin-left: 248px;
    min-width: 0;
}

.topbar {
    height: 76px;
    padding: 0 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.breadcrumb,
.topbar-actions,
.profile {
    display: flex;
    align-items: center;
}

.breadcrumb {
    gap: 12px;
    color: var(--muted);
}

.breadcrumb i {
    font-size: 10px;
    color: #b5bdcc;
}

.breadcrumb strong {
    color: var(--text);
    font-weight: 600;
}

.topbar-actions {
    gap: 23px;
}

.today-date {
    color: var(--muted);
    font-size: 12px;
}

.icon-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #69758d;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.notification-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 6px;
    height: 6px;
    background: #f16b73;
    border: 1px solid #fff;
    border-radius: 50%;
}

.profile {
    gap: 10px;
    padding-left: 19px;
    border-left: 1px solid var(--border);
}

.avatar {
    display: grid;
    place-items: center;
    width: 37px;
    height: 37px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, #8278ff, #4e54d9);
    border-radius: 50%;
}

.profile-details {
    display: grid;
    gap: 4px;
}

.profile-details strong {
    font-size: 12px;
}

.profile-details span {
    color: var(--muted);
    font-size: 11px;
}

.profile-arrow {
    margin-left: 7px;
    color: var(--muted);
    font-size: 10px;
}

/* Page */
.page-content {
    max-width: 1700px;
    margin: 0 auto;
    padding: 30px 38px 20px;
}

.welcome-banner {
    position: relative;
    min-height: 205px;
    padding: 35px 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    border: 1px solid #e8e8ff;
    border-radius: 19px;
    background: linear-gradient(110deg, #f0efff 0%, #f5f4ff 53%, #e7f1ff 100%);
}

.welcome-content {
    position: relative;
    z-index: 2;
    max-width: 570px;
}

.eyebrow {
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.welcome-content h1 {
    margin: 12px 0 10px;
    font-size: clamp(20px, 2.2vw, 27px);
    letter-spacing: -1.1px;
}

.welcome-content p {
    max-width: 440px;
    margin: 0 0 22px;
    color: #68738d;
    line-height: 1.8;
    font-size: 13px;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    background: linear-gradient(110deg, #6558f5, #4844e8);
    box-shadow: 0 7px 16px rgba(79, 70, 245, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 245, 0.25);
}

.welcome-art {
    position: absolute;
    inset: 0 0 0 auto;
    width: 39%;
    overflow: hidden;
}

.art-circle {
    position: absolute;
    border-radius: 50%;
}

.circle-one {
    width: 230px;
    height: 230px;
    top: -72px;
    right: 55px;
    background: rgba(143, 130, 255, 0.15);
}

.circle-two {
    width: 165px;
    height: 165px;
    bottom: -100px;
    right: 120px;
    background: rgba(77, 147, 255, 0.15);
}

.art-icon {
    position: absolute;
    top: 50%;
    right: 115px;
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    color: #fff;
    font-size: 33px;
    border-radius: 25px;
    background: linear-gradient(145deg, #9d8bff, #5751e9);
    box-shadow: 0 20px 40px rgba(85, 75, 224, 0.25);
    transform: translateY(-50%) rotate(-10deg);
}

.floating-badge {
    position: absolute;
    right: 22px;
    bottom: 30px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #555078;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 11px;
    background: rgba(255,255,255,0.85);
    box-shadow: var(--shadow);
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 24px 0;
}

.stat-card {
    min-width: 0;
    padding: 22px 19px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-icon {
    flex: 0 0 45px;
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    font-size: 17px;
    border-radius: 13px;
}

.purple { color: #6954e8; background: #efebff; }
.green { color: #179c69; background: #e0f8ec; }
.orange { color: #e88a30; background: #fff0df; }
.blue { color: #4387e9; background: #e6f1ff; }

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

.stat-info span {
    display: block;
    color: #7b8499;
    font-size: 11px;
}

.stat-info h2 {
    margin: 8px 0 5px;
    font-size: 24.5px;
    line-height: 1;
    letter-spacing: -1px;
}

.stat-info small {
    display: block;
    color: #98a1b3;
    font-size: 10px;
    line-height: 1.6;
}

.stat-decoration {
    font-size: 14px;
}

.purple-text { color: #8776ed; }
.green-text { color: #27ae78; }
.orange-text { color: #eea04d; }
.blue-text { color: #6499eb; }

/* Panels */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr);
    align-items: start;
    gap: 22px;
}

.panel {
    min-width: 0;
    padding: 23px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.panel-header h3 {
    margin: 0 0 7px;
    font-size: 14px;
    letter-spacing: -0.3px;
}

.panel-header p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Recent posts */
.post-list {
    display: grid;
}

.post-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 0;
    border-bottom: 1px solid #eff1f7;
}

.post-row:first-child {
    padding-top: 0;
}

.post-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.post-thumbnail {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 21px;
    border-radius: 11px;
}

.sunset {
    background: linear-gradient(145deg, #f8bb85, #ef8c7b 48%, #4e6d91);
}

.city {
    background: linear-gradient(145deg, #c4b1a0, #526b88 50%, #1d304d);
}

.coffee {
    background: linear-gradient(145deg, #edc6a1, #a66e47 52%, #563b30);
}

.post-info {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 8px;
}

.post-info strong {
    overflow: hidden;
    color: #273148;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-info span {
    color: #8791a6;
    font-size: 10px;
}

.instagram-icon {
    margin-right: 4px;
    color: #df4b96;
    font-size: 12px;
}

.status-badge {
    padding: 6px 9px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
}

.published { color: #16865a; background: #e2f8ec; }
.scheduled { color: #3c6fd8; background: #e7efff; }
.draft { color: #c37b2a; background: #fff0dc; }

.more-button {
    width: 29px;
    height: 29px;
    color: #77839b;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* Right-side panels */
.right-column {
    display: grid;
    gap: 22px;
}

.account-count {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    color: var(--primary);
    font-weight: 600;
    border-radius: 9px;
    background: #f0efff;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 0;
    border-top: 1px solid #eff1f7;
    border-bottom: 1px solid #eff1f7;
}

.instagram-logo {
    flex: 0 0 43px;
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 22px;
    border-radius: 13px;
    background: linear-gradient(135deg, #833ab4, #e1306c, #f77737);
}

.account-info {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 6px;
}

.account-info strong {
    font-size: 12px;
}

.account-info span {
    color: var(--muted);
    font-size: 10px;
}

.connection-dot {
    width: 9px;
    height: 9px;
    background: #f0ad4e;
    border-radius: 50%;
}

.secondary-button {
    width: 100%;
    margin-top: 16px;
    padding: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #dcdcff;
    border-radius: 9px;
    background: #f8f7ff;
}

.secondary-button:hover {
    background: #efedff;
}

.quick-actions .panel-header {
    margin-bottom: 12px;
}

.action-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 9px;
    padding: 13px;
    color: #58647b;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: background 0.2s, border-color 0.2s;
}

.action-link > i:first-child {
    color: var(--primary);
    font-size: 15px;
}

.action-link:hover {
    border-color: #d8d7ff;
    background: #faf9ff;
}

.action-primary {
    color: #fff;
    border-color: var(--primary);
    background: linear-gradient(100deg, #5d54f4, #4945e6);
}

.action-primary > i:first-child {
    color: #fff;
}

.action-primary:hover {
    color: #fff;
    background: var(--primary-hover);
}

.action-arrow {
    margin-left: auto;
    font-size: 10px;
}

/* Footer */
.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 25px 2px 5px;
    color: #9aa3b5;
    font-size: 10px;
}

/* Responsive layout */
@media (min-width: 1500px) {
    .page-content {
        padding-top: 38px;
    }

    .welcome-banner {
        min-height: 225px;
    }
}

@media (max-width: 1200px) {
    .sidebar {
        width: 215px;
    }

    .main-content {
        margin-left: 215px;
    }

    .topbar {
        padding: 0 24px;
    }

    .page-content {
        padding: 24px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .right-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .welcome-art {
        width: 32%;
    }
}

@media (max-width: 760px) {
    .sidebar {
        position: static;
        width: 100%;
        padding: 15px;
    }

    .brand {
        padding: 0 5px 16px;
    }

    .sidebar-label,
    .sidebar-bottom {
        display: none;
    }

    .sidebar-nav {
        display: flex;
        gap: 7px;
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .nav-link {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 0 12px;
    }

    .nav-link span {
        font-size: 11px;
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        height: auto;
        min-height: 65px;
        padding: 14px 17px;
    }

    .today-date,
    .profile-details,
    .profile-arrow {
        display: none;
    }

    .topbar-actions {
        gap: 10px;
    }

    .profile {
        padding-left: 10px;
    }

    .page-content {
        padding: 18px 14px;
    }

    .welcome-banner {
        min-height: 220px;
        padding: 25px 22px;
    }

    .welcome-art {
        opacity: 0.28;
        width: 55%;
    }

    .art-icon {
        right: 50px;
    }

    .floating-badge {
        display: none;
    }

    .welcome-content p {
        max-width: 300px;
    }

    .stats-grid {
        gap: 11px;
        margin: 16px 0;
    }

    .stat-card {
        padding: 15px 12px;
        gap: 10px;
    }

    .stat-icon {
        flex-basis: 35px;
        width: 35px;
        height: 35px;
        font-size: 14px;
        border-radius: 10px;
    }

    .stat-info h2 {
        font-size: 20.5px;
    }

    .stat-info small,
    .stat-decoration {
        display: none;
    }

    .panel {
        padding: 17px;
    }

    .right-column {
        grid-template-columns: minmax(0, 1fr);
    }

    .post-row {
        gap: 9px;
    }

    .post-thumbnail {
        flex-basis: 43px;
        width: 43px;
        height: 43px;
    }

    .status-badge {
        padding: 5px 6px;
        font-size: 9px;
    }

    .more-button {
        display: none;
    }

    .page-footer {
        flex-direction: column;
        gap: 7px;
    }
}

@media (max-width: 380px) {
    .nav-link {
        gap: 7px;
        padding: 0 9px;
    }

    .nav-link span {
        font-size: 10px;
    }

    .stat-card {
        gap: 8px;
    }

    .stat-info span {
        font-size: 10px;
    }
}

/* Dashboard database states */

.alert-error {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 14px 16px;
    color: #a52d36;
    background: #fff0f0;
    border: 1px solid #ffd5d8;
    border-radius: 10px;
    font-size: 12px;
}

.empty-state {
    padding: 42px 15px;
    text-align: center;
}

.empty-state-icon,
.empty-account-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 15px;
    color: #6657ed;
    background: #f0eeff;
    border-radius: 15px;
    font-size: 20px;
}

.empty-state h4 {
    margin: 0 0 8px;
    font-size: 14px;
}

.empty-state p,
.empty-account p {
    margin: 0 0 15px;
    color: #8791a6;
    font-size: 11px;
    line-height: 1.7;
}

.empty-state .text-link {
    justify-content: center;
}

.empty-account {
    padding: 22px 8px;
    text-align: center;
    border-top: 1px solid #eff1f7;
    border-bottom: 1px solid #eff1f7;
}

.empty-account-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
    font-size: 16px;
}

.empty-account strong {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
}

.empty-account p {
    margin-bottom: 0;
}

.connected-dot {
    background: #21b477;
}
/* =========================================
   AUTH PAGES - LOGIN & REGISTER
========================================= */

.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    background: #f7f8fc;
    color: #172033;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* Left branding panel */

.auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px 52px;
    color: #ffffff;
    background: linear-gradient(145deg, #151b3d, #29265f 65%, #5042a8);
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: #ffffff;
    text-decoration: none;
    font-size: 20px;
    font-weight: 600;
}

.auth-logo strong {
    color: #b9b2ff;
}

.auth-logo-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #7565ee;
    font-size: 22px;
    font-weight: 600;
}

.auth-brand-content {
    max-width: 510px;
    margin: 60px auto;
}

.auth-eyebrow {
    display: inline-block;
    margin-bottom: 16px;
    color: #7766ee;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.8px;
}

.auth-brand .auth-eyebrow {
    color: #c3bcff;
}

.auth-brand-content h1 {
    margin: 0 0 22px;
    font-size: clamp(30px, 3.6vw, 48px);
    line-height: 1.16;
    letter-spacing: -1.5px;
}

.auth-brand-content h1 span {
    display: block;
    color: #b9b2ff;
}

.auth-brand-content p {
    max-width: 430px;
    color: #d0d3e8;
    font-size: 16px;
    line-height: 1.8;
}

.auth-brand-footer {
    color: #c0c4dd;
    font-size: 12px;
}

/* Right form panel */

.auth-form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 28px;
    background: #ffffff;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-heading {
    margin-bottom: 30px;
}

.auth-heading h2 {
    margin: 0 0 10px;
    color: #172033;
    font-size: 25.5px;
    letter-spacing: -0.8px;
}

.auth-heading p {
    margin: 0;
    color: #7b8498;
    font-size: 14px;
    line-height: 1.7;
}

/* Form fields */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.auth-form .form-group label {
    color: #30394d;
    font-size: 13px;
    font-weight: 600;
}

.auth-form .form-group input {
    width: 100%;
    min-height: 50px;
    padding: 0 15px;
    border: 1px solid #dfe3ed;
    border-radius: 10px;
    outline: none;
    background: #ffffff;
    color: #172033;
    font: inherit;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form .form-group input::placeholder {
    color: #a5acbb;
}

.auth-form .form-group input:focus {
    border-color: #7565ee;
    box-shadow: 0 0 0 3px rgba(117, 101, 238, 0.13);
}

.auth-submit-btn {
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    border: 0;
    border-radius: 10px;
    background: #6b5be7;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.auth-submit-btn:hover {
    background: #5746d2;
    transform: translateY(-1px);
}

.auth-alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.6;
}

.auth-alert-error {
    border: 1px solid #f5caca;
    background: #fff1f1;
    color: #a52c2c;
}

.auth-alert-success {
    border: 1px solid #bde8d0;
    background: #effcf4;
    color: #207447;
}

.auth-switch {
    margin-top: 28px;
    color: #7b8498;
    text-align: center;
    font-size: 13px;
}

.auth-switch a {
    color: #6252dd;
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Responsive layout */

@media (max-width: 800px) {
    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        min-height: 280px;
        padding: 28px;
    }

    .auth-brand-content {
        margin: 40px 0 20px;
    }

    .auth-brand-content h1 {
        font-size: 29px;
    }

    .auth-brand-footer {
        margin-top: 20px;
    }

    .auth-form-section {
        padding: 44px 24px;
    }
}

@media (max-width: 420px) {
    .auth-brand-content h1 {
        font-size: 26px;
    }

    .auth-heading h2 {
        font-size: 22.5px;
    }
}
/* Logout button in the topbar */

.profile {
    gap: 12px;
}

.profile form {
    margin: 0;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border: 1px solid #e1e5ee;
    border-radius: 8px;
    background: #ffffff;
    color: #475067;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.logout-button:hover {
    border-color: #f0caca;
    background: #fff2f2;
    color: #c03939;
}

.logout-button:focus-visible {
    outline: 2px solid #7565ee;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .profile-details {
        display: none;
    }

    .logout-button {
        padding: 9px;
        font-size: 0;
    }

    .logout-button i {
        font-size: 14px;
    }
}
.auth-form .password-input-wrapper {
    position: relative;
    width: 100%;
}

.auth-form .password-input-wrapper input {
    width: 100%;
    box-sizing: border-box;
    padding-right: 52px;
}

.auth-form .password-input-wrapper .password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 6px;
    border: none;
    background: transparent;
    color: #7b8498;
    cursor: pointer;
    z-index: 2;
}

.auth-form .password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}
.profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logout-form {
    margin: 0;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    border: 1px solid #e1e5ee;
    border-radius: 8px;
    background: #ffffff;
    color: #475067;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.logout-button:hover {
    background: #fff2f2;
    border-color: #f0caca;
    color: #c03939;
}

@media (max-width: 700px) {
    .profile-details {
        display: none;
    }
}
/* =========================================================
   POST PREVIEW (Facebook / Instagram phone mockup)
   Paste at the END of your main CSS file.
   Used on: Post Details page + Create Post (Step 3).
   ========================================================= */

.pv {
    padding: 18px;
    background: #fff;
    border: 1px solid #e6e9f2;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
}

.pv-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    border-radius: 11px;
    background: #f3f4fa;
}

.pv-tab {
    flex: 1;
    min-height: 36px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #536176;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, color .2s, box-shadow .2s;
}

.pv-tab:hover { color: #0f172a; }

.pv-tab.is-active {
    background: #fff;
    color: #3b4fe0;
    box-shadow: 0 2px 8px rgba(25, 39, 75, .1);
}

.pv-tab:focus-visible { outline: 2px solid #3b4fe0; outline-offset: 1px; }

.pv-stage {
    display: flex;
    justify-content: center;
    padding: 22px 12px;
    border: 1px solid #e8eaf6;
    border-radius: 14px;
    background: linear-gradient(160deg, #f0f2fc, #f7f3fc);
}

.pv-phone {
    width: 100%;
    max-width: 300px;
    overflow: hidden;
    border: 1px solid #e4e6eb;
    border-radius: 18px;
    background: #fff;
    color: #111827;
    font-size: 12px;
    box-shadow: 0 18px 40px rgba(21, 28, 46, .18);
}

.pv-phone[hidden] { display: none; }

/* ---------- Shared bits ---------- */
.pv-avatar {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #8278ff, #4e54d9);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.pv-avatar.is-ig {
    padding: 2px;
    background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
}

.pv-avatar.is-ig b {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #4e54d9;
    font-size: 12px;
}

.pv-who {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
}

.pv-who strong {
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pv-who small {
    min-height: 13px;
    overflow: hidden;
    color: #65676b;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pv-dots { color: #65676b; }

/* Media: shows the image in its natural ratio (no heavy crop) */
.pv-media {
    position: relative;
    overflow: hidden;
    background: #f0f2f5;
}

.pv-media img,
.pv-media video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: cover;
}

.pv-count {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .7);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
}

.pv-empty {
    display: grid;
    min-height: 220px;
    place-content: center;
    justify-items: center;
    gap: 8px;
    padding: 16px;
    color: #9aa4b8;
    font-size: 11.5px;
    text-align: center;
}

.pv-empty i { font-size: 24px; }

/* ---------- Instagram ---------- */
.pv-ig-logo {
    padding: 12px 0 6px;
    color: #111827;
    font-family: "Billabong", "Segoe Script", "Brush Script MT", cursive;
    font-size: 25px;
    font-weight: 700;
    text-align: center;
}

.pv-ig-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
}

.pv-ig-icons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 4px;
    font-size: 18px;
}

.pv-ig-icons span { display: inline-flex; gap: 14px; }
.pv-ig-icons .fa-heart { color: #ed4956; }

.pv-caption {
    display: -webkit-box;
    margin: 0;
    padding: 4px 12px 14px;
    overflow: hidden;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* ---------- Facebook ---------- */
.pv-fb-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px 6px;
}

.pv-fb-text {
    padding: 2px 12px 10px;
    font-size: 12.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.pv-fb-react {
    display: flex;
    justify-content: space-between;
    padding: 9px 12px;
    color: #65676b;
    font-size: 11px;
}

.pv-fb-actions {
    display: flex;
    justify-content: space-around;
    padding: 8px 6px 12px;
    border-top: 1px solid #e4e6eb;
    color: #65676b;
    font-size: 11.5px;
    font-weight: 600;
}

.pv-fb-actions i { margin-right: 4px; }

/* Post Details: let the side column grow with the preview */
.pd-side { position: static; }
.pd-preview { margin-top: 20px; }

/* Create Post step 3: center the preview card */
.step-panel .pv { max-width: 380px; margin: 0 auto; }

/* =========================================================
   Create Post: matches the SocialMedia Pro design (v3)
   ========================================================= */

.composer-page {
    --c-primary: #3b4fe0;
    --c-primary-dark: #2f3fc4;
    --c-primary-soft: #eef1ff;
    --c-primary-ring: rgba(59, 79, 224, 0.16);
    --c-chip-bg: #e8eeff;
    --c-chip-text: #3b5bdb;
    --c-text: #0f172a;
    --c-muted: #64748b;
    --c-border: #e6e9f2;
    --c-surface: #ffffff;
    --c-danger: #dc2626;
    --radius: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);

    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 4px 48px;
    color: var(--c-text);
}

/* ---------- Heading ---------- */
.composer-heading { margin-bottom: 20px; }
.composer-heading h1 {
    margin: 0 0 6px;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.composer-heading p {
    margin: 0;
    font-size: 14.5px;
    color: var(--c-muted);
}

/* ---------- Stepper (flat, with connector lines) ---------- */
.composer-steps {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 2px;
}

.composer-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--c-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s;
}
.composer-step:last-child { flex: 0 0 auto; }

.composer-step:not(:last-child)::after {
    content: "";
    flex: 1;
    height: 2px;
    margin: 0 16px;
    background: var(--c-border);
    border-radius: 2px;
    transition: background 0.2s;
}
.composer-step.completed:not(:last-child)::after { background: var(--c-primary); }

.composer-step span {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-muted);
    background: #eef0f6;
    border-radius: 50%;
    transition: all 0.2s;
}
.composer-step:hover { color: var(--c-text); }

.composer-step.completed { color: var(--c-text); }
.composer-step.completed span {
    color: #fff;
    background: var(--c-primary);
    font-size: 0;
}
.composer-step.completed span::before { content: "✓"; font-size: 14px; }

.composer-step.active { color: var(--c-text); }
.composer-step.active span {
    color: #fff;
    background: var(--c-primary);
    box-shadow: 0 0 0 4px var(--c-primary-ring);
}

/* ---------- Alerts ---------- */
.composer-alert {
    margin-bottom: 18px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid;
    border-radius: 12px;
}
.composer-alert.is-success { color: #065f46; background: #ecfdf5; border-color: #a7f3d0; }
.composer-alert.is-error   { color: #991b1b; background: #fef2f2; border-color: #fecaca; }

/* ---------- Layout ---------- */
.composer-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.composer-workspace[hidden],
.step-panel[hidden] { display: none; }

.composer-workspace:not([hidden]),
.step-panel:not([hidden]) { animation: stepFade 0.25s ease; }
@keyframes stepFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.composer-card {
    padding: 24px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.composer-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.composer-card-title h2 { margin: 0; font-size: 16px; font-weight: 600; }
.composer-card-title span {
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-primary);
    background: var(--c-primary-soft);
    border-radius: 999px;
}

.step-panel { max-width: 760px; margin: 0 auto; }

/* ---------- Left column: media ---------- */
.media-column { min-width: 0; }

.upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 250px;
    padding: 28px 20px;
    text-align: center;
    background: #fff;
    border: 2px dashed #cdd3ee;
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.upload-dropzone:hover,
.upload-dropzone.is-dragging {
    border-color: var(--c-primary);
    background: var(--c-primary-soft);
}
.upload-dropzone strong { font-size: 15px; font-weight: 600; color: #334155; }
.upload-dropzone small { font-size: 12px; color: var(--c-muted); }
.upload-or { font-size: 13.5px; color: var(--c-muted); }
.browse-link { font-weight: 600; color: var(--c-primary); }
.upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    color: var(--c-primary);
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}
.upload-icon svg { width: 24px; height: 24px; }

/* "or" divider + Media Library button */
.media-source-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}
.source-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}
.source-divider::before,
.source-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--c-border);
}
.library-open-btn { width: 100%; }
.library-open-btn svg { color: var(--c-primary); }

/* Thumbnails below the dropzone */
.media-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.media-preview-grid:empty { display: none; }

.media-preview-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eef0f6;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}
.selected-media { display: block; width: 100%; height: 100%; object-fit: cover; }

.remove-media-button {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 15px;
    line-height: 1;
    color: #fff;
    background: rgba(15, 23, 42, 0.85);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s;
}
.remove-media-button:hover { background: var(--c-danger); }

.add-more-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    aspect-ratio: 1 / 1;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-muted);
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.add-more-tile:hover {
    color: var(--c-primary);
    background: var(--c-primary-soft);
    border-color: var(--c-primary);
}
.add-more-plus { font-size: 21.5px; line-height: 1; font-weight: 400; }

.upload-note {
    margin: 12px 2px 0;
    font-size: 12.5px;
    color: var(--c-muted);
}

/* ---------- Right card: Post Details ---------- */
.details-card { display: flex; flex-direction: column; }
.details-card .composer-card-title {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--c-border);
}

.composer-field { margin-bottom: 18px; }
.composer-field > label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.composer-field textarea,
.composer-field input[type="text"],
.composer-field input[type="datetime-local"],
.hashtag-box {
    width: 100%;
    padding: 11px 14px;
    font: inherit;
    font-size: 14px;
    color: var(--c-text);
    background: #fff;
    border: 1px solid #dbe0ec;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.composer-field textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.composer-field textarea:focus,
.composer-field input:focus,
.hashtag-box:focus-within {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 4px var(--c-primary-ring);
}
::placeholder { color: #94a3b8; }

.caption-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    font-size: 12px;
    color: var(--c-muted);
}

/* Hashtag chips */
.hashtag-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
}
.hashtag-chips { display: contents; }
.hashtag-chip {
    padding: 5px 12px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--c-chip-text);
    background: var(--c-chip-bg);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.hashtag-chip:hover { background: #d9e3ff; }
.hashtag-input {
    flex: 1;
    min-width: 110px;
    padding: 5px !important;
    border: 0 !important;
    box-shadow: none !important;
}
.hashtag-add {
    width: 28px;
    height: 28px;
    font-size: 18px;
    line-height: 1;
    color: var(--c-primary);
    background: var(--c-primary-soft);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}
.hashtag-add:hover { background: #dfe5ff; }

/* Location */
.input-with-icon { position: relative; }
.input-with-icon svg {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--c-muted);
    pointer-events: none;
}
.input-with-icon input { padding-left: 40px !important; }

/* Platform */
.platform-option {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    font-weight: 600;
    background: #fff;
    border: 1px solid #dbe0ec;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.platform-option:has(input:checked) {
    background: var(--c-primary-soft);
    border-color: #c7d0fb;
}
.platform-option input { accent-color: var(--c-primary); width: 16px; height: 16px; }
.platform-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #fff;
    background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
    border-radius: 7px;
}
.platform-name { font-size: 14px; }

/* ---------- Buttons ---------- */
.composer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--c-border);
}
.composer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.composer-btn:active { transform: translateY(1px); }
.composer-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--c-primary-ring); }

.composer-btn-primary {
    color: #fff;
    background: var(--c-primary);
    box-shadow: 0 2px 6px rgba(59, 79, 224, 0.3);
}
.composer-btn-primary:hover { background: var(--c-primary-dark); }

/* Light-blue button (Save as Draft / Back) */
.composer-btn-soft {
    color: var(--c-primary);
    background: var(--c-primary-soft);
}
.composer-btn-soft:hover { background: #dfe5ff; }

.composer-btn-secondary { color: var(--c-text); background: #fff; border-color: #dbe0ec; }
.composer-btn-secondary:hover { background: #f8fafc; border-color: #b9c1d3; }

/* ---------- Review summary (steps 2 and 4) ---------- */
.review-summary {
    padding: 20px 22px;
    background: #fafbfe;
    border: 1px solid var(--c-border);
    border-radius: 14px;
}
.review-summary strong {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--c-muted);
}
.review-summary p {
    margin: 4px 0 16px;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}
.review-summary p:last-child { margin-bottom: 0; }

.publish-note {
    margin: 0 0 18px;
    padding: 12px 16px;
    font-size: 13px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
}

/* ---------- Final preview (post mockup) ---------- */
.preview-post {
    max-width: 420px;
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}
.final-preview-media {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    background: #0f172a;
}
.final-preview-media:empty { min-height: 180px; background: #f1f5f9; }
.preview-media {
    flex: 0 0 100%;
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    scroll-snap-align: center;
}
.final-preview-caption {
    margin: 0;
    padding: 16px 18px;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

/* =========================================================
   Media Library modal
   ========================================================= */
.media-library-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}
.media-library-modal[hidden] { display: none; }

.media-library-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 880px;
    max-height: 88vh;
    padding: 24px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
}
.media-library-dialog > p { margin: 4px 0 0; font-size: 14px; color: var(--c-muted); }
.media-library-header { display: flex; align-items: center; justify-content: space-between; }
.media-library-header h2 { margin: 0; font-size: 18px; font-weight: 600; }
.media-library-header button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    color: var(--c-muted);
    background: #f1f5f9;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.media-library-header button:hover { background: #e2e8f0; color: var(--c-text); }

.media-library-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin: 18px 0;
    padding: 6px;
    overflow-y: auto;
}
.media-library-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
}

.library-media-card {
    position: relative;
    display: block;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.library-media-card:hover { border-color: #c4ccf7; box-shadow: var(--shadow-md); }
.library-media-card img,
.library-media-card video { display: block; width: 100%; height: 130px; object-fit: cover; }
.library-name {
    display: block;
    padding: 9px 11px;
    font-size: 12px;
    font-weight: 600;
    color: #2b2d42;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.library-media-checkbox { position: absolute; opacity: 0; pointer-events: none; }
.library-check {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: transparent;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid #c9ccd6;
    border-radius: 50%;
    transition: all 0.15s;
}
.library-media-card[data-type="video"]::after {
    content: "▶ Video";
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: rgba(15, 23, 42, 0.7);
    border-radius: 999px;
    pointer-events: none;
}
.library-media-card:has(.library-media-checkbox:checked) {
    background: var(--c-primary-soft);
    border-color: var(--c-primary);
    box-shadow: 0 0 0 4px var(--c-primary-ring);
}
.library-media-checkbox:checked ~ .library-check {
    color: #fff;
    background: var(--c-primary);
    border-color: var(--c-primary);
}
.library-media-checkbox:checked ~ .library-name { color: var(--c-primary); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .composer-workspace { grid-template-columns: 1fr; }
    .upload-dropzone { min-height: 210px; }
}
@media (max-width: 640px) {
    .composer-card { padding: 18px; }
    .composer-step { font-size: 0; gap: 0; }          /* numbers only */
    .composer-step span { font-size: 13px; }
    .composer-step.completed span { font-size: 0; }
    .composer-step:not(:last-child)::after { margin: 0 8px; }
    .composer-actions .composer-btn { flex: 1; }
}

/* ---------- Step 1 validation ---------- */
.step-error {
    margin: 12px 0 0;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    animation: errorShake 0.35s ease;
}
.step-error[hidden] { display: none; }

.upload-dropzone.has-error {
    border-color: #ef4444;
    background: #fff5f5;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-5px); }
    75%      { transform: translateX(5px); }
}

/* Steps 2-4 look greyed out until step 1 is complete */
.composer-step.is-locked { opacity: 0.55; }
.composer-step.is-locked:hover { color: var(--c-muted); }



/* ===================================
   DASHBOARD (hero, accounts, stats, lists)
=================================== */

.dash { display: block; }

/* entrance animation */
@keyframes dashIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.dash-in {
    animation: dashIn .5s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: var(--d, 0ms);
}

@keyframes dashFloat {
    from { transform: translateY(0); }
    to   { transform: translateY(-7px); }
}

@media (prefers-reduced-motion: reduce) {
    .dash-in, .dash-chip { animation: none !important; }
}

/* ---------- Buttons ---------- */
.dash-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, background .2s;
}

.dash-btn:hover { transform: translateY(-2px); }

.dash-btn-primary {
    color: #fff;
    background: linear-gradient(110deg, #5a52f6, #4338e8);
    box-shadow: 0 8px 18px rgba(79, 70, 245, .3);
}

.dash-btn-primary:hover { box-shadow: 0 12px 24px rgba(79, 70, 245, .36); }
.dash-btn-primary i { font-size: 11px; }

.dash-btn-sm { min-height: 38px; padding: 0 16px; font-size: 12px; }
.dash-btn-sm i { font-size: 14px; }

.dash-btn-soft {
    min-height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    color: #4f46f5;
    background: #eaedff;
}

.dash-btn-soft:hover { background: #dde1ff; }

/* ---------- Top row ---------- */
.dash-top {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(310px, 1fr);
    gap: 20px;
    align-items: stretch;
}

.dash-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 220px;
    padding: 34px 40px;
    overflow: hidden;
    border: 1px solid #e9e5fb;
    border-radius: 20px;
    background:
        radial-gradient(110% 90% at 72% 125%, #ffd6b3 0%, rgba(255, 214, 179, 0) 58%),
        radial-gradient(60% 80% at 0% 0%, #dcd3fb 0%, rgba(220, 211, 251, 0) 70%),
        linear-gradient(120deg, #e7e1fb 0%, #f0ebfc 48%, #fbebe4 100%);
}

.dash-hero-text {
    position: relative;
    z-index: 3;
    max-width: 430px;
}

.dash-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .65);
    color: #5a4fe0;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .3px;
    backdrop-filter: blur(4px);
}

.dash-hero-text h1 {
    margin: 0 0 10px;
    color: #131a2e;
    font-size: clamp(19px, 2.1vw, 26px);
    font-weight: 700;
    letter-spacing: -.7px;
    line-height: 1.2;
}

.dash-wave {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: dashWave 2.6s ease-in-out 1s 2;
}

@keyframes dashWave {
    0%, 60%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(14deg); }
    20%, 40% { transform: rotate(-8deg); }
    50% { transform: rotate(10deg); }
}

.dash-hero-text p {
    max-width: 320px;
    margin: 0 0 22px;
    color: #4f5a75;
    font-size: 13px;
    line-height: 1.7;
}

.dash-hero-art {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
    width: 64%;
    height: 100%;
    pointer-events: none;
}

.dash-hero-art svg {
    display: block;
    width: 100%;
    height: 100%;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24%);
            mask-image: linear-gradient(to right, transparent 0, #000 24%);
}

.dash-chip {
    position: absolute;
    z-index: 2;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 10px 24px rgba(70, 60, 160, .18);
    font-size: 16px;
    animation: dashFloat 3.6s ease-in-out infinite alternate;
}

.dash-chip-a { top: 12%; left: 31%; color: #e1306c; }
.dash-chip-b { top: 6%; right: 3%; color: #4f46f5; animation-delay: -1.2s; }
.dash-chip-c { top: 42%; right: 1.5%; color: #e7842a; width: 34px; height: 34px; font-size: 14px; border-radius: 11px; animation-delay: -2.2s; }

/* ---------- Connected accounts ---------- */
.dash-accounts {
    display: flex;
    flex-direction: column;
    padding: 22px 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.dash-accounts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.dash-accounts h3 {
    margin: 0;
    color: #1a2238;
    font-size: 14px;
    font-weight: 600;
}

.dash-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e5f7ee;
    color: #17874f;
    font-size: 10px;
    font-weight: 600;
}

.dash-live i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #21b477;
    box-shadow: 0 0 0 3px rgba(33, 180, 119, .2);
}

.dash-accounts-body {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 16px;
}

.dash-accounts-left {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 16px;
}

.dash-account-main {
    display: flex;
    align-items: center;
    gap: 13px;
}

.dash-ig-logo {
    display: grid;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    font-size: 27px;
    background: linear-gradient(135deg, #833ab4, #e1306c 55%, #f77737);
    box-shadow: 0 8px 18px rgba(225, 48, 108, .25);
}

.dash-ig-logo.is-off {
    background: #e6e9f2;
    color: #9aa3b8;
    box-shadow: none;
}

.dash-account-count { min-width: 0; }

.dash-account-count strong {
    display: block;
    color: #131a2e;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.dash-account-count span {
    display: block;
    margin-top: 6px;
    overflow: hidden;
    color: #8a94aa;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-add-account {
    display: flex;
    flex: 0 0 38%;
    min-height: 112px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1.5px dashed #cdd5e6;
    border-radius: 15px;
    background: #f7f9fd;
    color: #4f5a75;
    font-size: 11px;
    font-weight: 600;
    transition: background .2s, border-color .2s, transform .2s;
}

.dash-add-plus {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #eaedff;
    color: #4f46f5;
    font-size: 13px;
    transition: background .2s, color .2s;
}

.dash-add-account:hover { border-color: #5d50f0; background: #f3f2ff; transform: translateY(-2px); }
.dash-add-account:hover .dash-add-plus { background: #4f46f5; color: #fff; }

/* ---------- Stats ---------- */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 20px 0;
}

.dash-stat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 20px 22px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    transition: transform .25s, box-shadow .25s;
}

.dash-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(25, 39, 75, .09);
}

.dash-stat::after {
    content: "";
    position: absolute;
    right: -26px;
    bottom: -34px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    opacity: .3;
    background: currentColor;
    filter: blur(26px);
    pointer-events: none;
}

.dash-stat:nth-child(1) { color: #9fc2ff; }
.dash-stat:nth-child(2) { color: #9fe2bf; }
.dash-stat:nth-child(3) { color: #ffcf9c; }
.dash-stat:nth-child(4) { color: #c9bdff; }

.dash-stat-icon {
    display: grid;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    place-items: center;
    border-radius: 50%;
    font-size: 22px;
}

.dash-stat-icon.is-blue   { color: #3d7be8; background: linear-gradient(145deg, #e8f1ff, #c9deff); }
.dash-stat-icon.is-green  { color: #1f9d62; background: linear-gradient(145deg, #e6f9ef, #c5eed8); }
.dash-stat-icon.is-orange { color: #e7842a; background: linear-gradient(145deg, #fff3e6, #ffdfbb); }
.dash-stat-icon.is-purple { color: #6a54e6; background: linear-gradient(145deg, #f1eeff, #dcd5ff); }

.dash-stat strong {
    display: block;
    color: #131a2e;
    font-size: 23.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.6px;
}

.dash-stat span {
    display: block;
    margin-top: 7px;
    color: #7b869c;
    font-size: 11.5px;
}

/* ---------- Lists ---------- */
.dash-lists {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

.dash-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 22px 22px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.dash-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.dash-panel-head h3 {
    margin: 0;
    color: #131a2e;
    font-size: 14px;
    font-weight: 600;
}

.dash-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4f46f5;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.dash-link i { font-size: 9px; transition: transform .2s; }
.dash-link:hover i { transform: translateX(3px); }

.dash-rows { display: flex; flex: 1; flex-direction: column; }

.dash-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    margin: 0 -10px;
    padding: 12px 10px;
    border-radius: 12px;
    transition: background .2s;
}

.dash-row { position: relative; }

.dash-row + .dash-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10px;
    right: 10px;
    height: 1px;
    background: #eff1f7;
}

.dash-row:hover { background: #f8f9fe; }
.dash-row:hover::before,
.dash-row:hover + .dash-row::before { opacity: 0; }

.dash-thumb {
    position: relative;
    display: grid;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    color: #fff;
    font-size: 20px;
}

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

.dash-thumb-tag {
    position: absolute;
    top: 5px;
    right: 5px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 6px;
    background: rgba(20, 26, 46, .6);
    font-size: 8px;
}

.dash-thumb-image    { background: linear-gradient(145deg, #f8bb85, #ef8c7b 48%, #4e6d91); }
.dash-thumb-video    { background: linear-gradient(145deg, #c4b1a0, #526b88 50%, #1d304d); }
.dash-thumb-carousel { background: linear-gradient(145deg, #edc6a1, #a66e47 52%, #563b30); }

.dash-row-info {
    display: grid;
    flex: 1;
    min-width: 0;
    gap: 7px;
}

.dash-row-info strong {
    overflow: hidden;
    color: #1b2339;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-row-info span {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    color: #8791a6;
    font-size: 11px;
    white-space: nowrap;
}

.dash-row-info em { font-style: normal; font-weight: 500; color: #66718a; }
.dash-row-info em.is-muted { color: #a2abbd; }
.dash-row-info b { font-weight: 400; color: #c4cada; }
.dash-row-info time { overflow: hidden; text-overflow: ellipsis; }

.dash-ig-mini {
    display: inline-grid;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    place-items: center;
    border-radius: 5px;
    color: #fff;
    font-size: 10px;
    background: linear-gradient(135deg, #833ab4, #e1306c 55%, #f77737);
}

.dash-share-mini { flex: 0 0 auto; color: #a2abbd; font-size: 11px; }

.dash-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.dash-badge.is-published { color: #17874f; background: #dff6e8; }
.dash-badge.is-scheduled { color: #3566d6; background: #e3ecff; }
.dash-badge.is-draft     { color: #cf7a1f; background: #ffecd6; }
.dash-badge.is-failed    { color: #c0392b; background: #ffe6e3; }

.dash-more {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid #e3e7f1;
    border-radius: 10px;
    background: #fff;
    color: #5b6781;
    font-size: 13px;
    transition: background .2s, border-color .2s, color .2s;
}

.dash-more:hover { border-color: #cfd4ff; background: #f1f0ff; color: #4f46f5; }

.dash-panel .empty-state {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .dash-top { grid-template-columns: minmax(0, 1fr); }
    .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-lists { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    .dash-hero { padding: 26px 22px; min-height: 230px; }
    .dash-hero-art { width: 85%; opacity: .4; }
    .dash-chip { display: none; }
    .dash-stats { gap: 12px; }
    .dash-stat { padding: 14px; gap: 12px; }
    .dash-stat-icon { flex-basis: 44px; width: 44px; height: 44px; font-size: 18px; }
    .dash-stat strong { font-size: 20px; }
    .dash-accounts-body { flex-direction: column; align-items: stretch; }
    .dash-add-account { flex: none; min-height: 84px; }
    .dash-row { flex-wrap: wrap; gap: 10px; }
    .dash-row-info { flex-basis: calc(100% - 76px); }
    .dash-more { display: none; }
}

/* =========================================
   ALL POSTS PAGE
   (re-uses the dashboard's .dash-hero, .dash-stat,
    .dash-btn and .dash-in styles defined above)
========================================= */

.ap-page {
    --ap-line: #e9edf5;
    --ap-line-soft: #f0f2f7;
    --ap-ink: #131a2e;
    --ap-text: #344059;
    --ap-muted: #7d889f;
    --ap-brand: #4f46f5;
    color: var(--ap-text);
}

.ap-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Banner ---------- */
.ap-hero { min-height: 190px; padding: 28px 40px; }
.ap-hero .dash-hero-text p { margin-bottom: 18px; }
.ap-hero .dash-chip-a { top: 14%; left: 28%; }
.ap-hero .dash-chip-b { top: 8%; right: 4%; }
.ap-hero .dash-chip-c { top: 46%; right: 2%; color: #17874f; }

/* ---------- Summary cards ---------- */
a.ap-stat { cursor: pointer; }

.ap-stat.is-active {
    border-color: #cfd4ff;
    box-shadow: 0 0 0 3px rgba(93, 80, 240, .1), 0 10px 24px rgba(25, 39, 75, .06);
}

/* ---------- Panel ---------- */
.ap-card {
    padding: 8px 22px 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

/* ---------- Flash ---------- */
.ap-flash-list { display: grid; gap: 8px; padding-top: 14px; }

.ap-flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 12.5px;
}

.ap-flash.is-success { border: 1px solid #c8ecd8; background: #effaf4; color: #17683a; }
.ap-flash.is-error   { border: 1px solid #f7d0d0; background: #fff3f3; color: #a52a2a; }

/* ---------- Tabs ---------- */
.ap-tabs {
    display: flex;
    gap: 26px;
    margin: 0 -22px 18px;
    padding: 0 22px;
    border-bottom: 1px solid var(--ap-line);
    overflow-x: auto;
}

.ap-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 2px 14px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: #66718a;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
}

.ap-count {
    display: inline-grid;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    place-items: center;
    border-radius: 999px;
    background: #eff1f6;
    color: #66718a;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: background .2s, color .2s;
}

.ap-tab:hover { color: #2c3550; }
.ap-tab:hover:not(.is-active) { border-bottom-color: #d5dae6; }

.ap-tab.is-active { border-bottom-color: var(--ap-brand); color: var(--ap-brand); }
.ap-tab.is-active .ap-count { background: #ecebff; color: var(--ap-brand); }

/* ---------- Toolbar ---------- */
.ap-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.ap-search {
    position: relative;
    display: block;
    flex: 0 1 360px;
    min-width: 200px;
}

.ap-search i {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    color: #94a0b6;
    font-size: 12px;
    pointer-events: none;
}

.ap-search input,
.ap-select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #dfe4ee;
    border-radius: 10px;
    background: #fff;
    color: var(--ap-text);
    font-family: inherit;
    font-size: 12.5px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.ap-search input { padding: 0 13px 0 36px; }
.ap-search input::placeholder { color: #9aa4b8; }

.ap-select {
    width: auto;
    min-width: 160px;
    padding: 0 34px 0 13px;
    cursor: pointer;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7690' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}

.ap-search input:hover,
.ap-select:hover { border-color: #cdd4e2; }

.ap-search input:focus,
.ap-select:focus {
    border-color: #5d50f0;
    box-shadow: 0 0 0 3px rgba(93, 80, 240, .12);
}

.ap-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--ap-brand);
    font-size: 12px;
    font-weight: 600;
}

.ap-reset i { font-size: 11px; }
.ap-reset:hover { background: #f1f0ff; }

.ap-total {
    margin-left: auto;
    color: var(--ap-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Table ---------- */
.ap-table-scroll { overflow-x: auto; }

.ap-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.ap-table th {
    padding: 11px 14px;
    border-top: 1px solid var(--ap-line);
    border-bottom: 1px solid var(--ap-line);
    background: #f8f9fc;
    color: #8590a6;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ap-table th:first-child { padding-left: 16px; border-left: 1px solid var(--ap-line); border-radius: 10px 0 0 10px; }
.ap-table th:last-child  { border-right: 1px solid var(--ap-line); border-radius: 0 10px 10px 0; }

.ap-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--ap-line-soft);
    color: var(--ap-text);
    font-size: 12.5px;
    vertical-align: middle;
}

.ap-table td:first-child { padding-left: 16px; }
.ap-table tbody tr:last-child td { border-bottom: 0; }
.ap-table tbody tr { transition: background .15s; }
.ap-table tbody tr:not(.ap-empty-row):hover { background: #f8f9fe; }

.ap-c-platform { width: 170px; }
.ap-c-status   { width: 150px; }
.ap-c-date     { width: 150px; }
.ap-c-actions  { width: 70px; text-align: right; }
.ap-table td.ap-c-actions { padding-right: 16px; }

/* post cell */
.ap-post {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ap-thumb {
    position: relative;
    display: grid;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: #eef0f7;
    color: #fff;
    font-size: 18px;
}

.ap-thumb img,
.ap-thumb video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* same gradient placeholders as the dashboard */
.ap-thumb.is-empty.is-image    { background: linear-gradient(145deg, #f8bb85, #ef8c7b 48%, #4e6d91); }
.ap-thumb.is-empty.is-video    { background: linear-gradient(145deg, #c4b1a0, #526b88 50%, #1d304d); }
.ap-thumb.is-empty.is-carousel { background: linear-gradient(145deg, #edc6a1, #a66e47 52%, #563b30); }

.ap-thumb-tag {
    position: absolute;
    top: 4px;
    right: 4px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 6px;
    background: rgba(20, 26, 46, .62);
    color: #fff;
    font-size: 8px;
}

.ap-post-text { min-width: 0; }

.ap-caption {
    display: -webkit-box;
    max-width: 380px;
    overflow: hidden;
    color: var(--ap-ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

a.ap-caption:hover { color: var(--ap-brand); }
.ap-caption.is-empty { color: #9aa4b8; font-weight: 500; }

.ap-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    color: #96a0b5;
    font-size: 11px;
}

.ap-meta i { font-size: 10px; }
.ap-meta b { font-weight: 400; color: #c4cada; }

/* platform */
.ap-plat {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ap-text);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

.ap-plat.is-none { color: #a0aabd; font-weight: 400; }

.ap-plat-ico {
    display: inline-flex;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
}

.ap-plat-ico i {
    display: block;
    width: auto;
    line-height: 1;
}

.ap-plat-ico.is-instagram { background: linear-gradient(135deg, #833ab4, #e1306c 55%, #f77737); font-size: 14px; }
.ap-plat-ico.is-facebook  { background: #1877f2; font-size: 12px; }
.ap-plat-ico.is-linkedin  { background: #0a66c2; font-size: 12px; }
.ap-plat-ico.is-twitter   { background: #111827; font-size: 12px; }
.ap-plat-ico.is-other     { background: #8c97ad; font-size: 12px; }
.ap-plat-ico.is-none      { background: #f0f2f7; color: #a9b2c5; font-size: 11px; }

/* status (same family as the dashboard badges) */
.ap-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 98px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.ap-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ap-status.is-published  { color: #17874f; background: #dff6e8; }
.ap-status.is-scheduled  { color: #3566d6; background: #e3ecff; }
.ap-status.is-publishing { color: #3566d6; background: #e3ecff; }
.ap-status.is-draft      { color: #cf7a1f; background: #ffecd6; }
.ap-status.is-failed     { color: #c0392b; background: #ffe6e3; }

/* date */
.ap-date { color: var(--ap-ink); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ap-time { margin-top: 3px; color: #8a95ab; font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* actions */
.ap-actions { display: inline-block; }

.ap-more {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid #e3e7f1;
    border-radius: 10px;
    background: #fff;
    color: #5b6781;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.ap-more:hover,
.ap-more[aria-expanded="true"] {
    border-color: #cfd4ff;
    background: #f1f0ff;
    color: var(--ap-brand);
}

.ap-menu {
    position: fixed;
    z-index: 60;
    min-width: 176px;
    padding: 6px;
    border: 1px solid #e5e9f3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 16px 36px rgba(16, 24, 40, .14);
    text-align: left;
}

.ap-menu[hidden] { display: none !important; }
.ap-menu form { margin: 0; }
.ap-menu-sep { height: 1px; margin: 5px 4px; background: var(--ap-line-soft); }

.ap-menu a,
.ap-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ap-text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.ap-menu i { width: 14px; color: #8a95ab; text-align: center; }
.ap-menu a:hover,
.ap-menu button:hover { background: #f4f5fb; }
.ap-menu .is-danger,
.ap-menu .is-danger i { color: #c0392b; }
.ap-menu .is-danger:hover { background: #fff1f0; }

/* empty state */
.ap-empty { padding: 56px 16px 60px; text-align: center; }

.ap-empty-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 15px;
    background: #f0eeff;
    color: #6657ed;
    font-size: 20px;
}

.ap-empty h3 { margin: 0 0 8px; color: var(--ap-ink); font-size: 15px; }
.ap-empty p  { max-width: 360px; margin: 0 auto 20px; color: #8791a6; font-size: 12.5px; line-height: 1.7; }

.ap-empty-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ap-page .page-footer { padding-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    .ap-hero { min-height: 200px; padding: 24px 22px; }
    .ap-hero .dash-hero-art { opacity: .2; }
    .ap-card { padding: 4px 14px 6px; border-radius: 16px; }

    .ap-tabs { gap: 20px; margin: 0 -14px 16px; padding: 0 14px; }
    .ap-search { flex: 1 1 100%; }
    .ap-select { flex: 1 1 140px; min-width: 0; }
    .ap-total { display: none; }

    .ap-table { min-width: 0; }
    .ap-table thead { display: none; }
    .ap-table tbody { display: block; }

    .ap-table tbody tr {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px 16px;
        padding: 14px 0;
        border-bottom: 1px solid var(--ap-line-soft);
    }

    .ap-table tbody tr:last-child { border-bottom: 0; }
    .ap-table td { width: auto; padding: 0; border: 0; text-align: left; }
    .ap-table td:first-child { padding-left: 0; }
    .ap-table .ap-c-post { flex: 1 1 100%; padding-right: 46px; }
    .ap-table .ap-c-actions { position: absolute; top: 14px; right: 0; padding-right: 0; }
    .ap-table .ap-c-date { display: flex; align-items: baseline; gap: 8px; }
    .ap-time { margin-top: 0; }
    .ap-caption { max-width: none; }
    .ap-table .ap-empty-row,
    .ap-table .ap-empty-row td { display: block; }
}

.ap-table {
    table-layout: fixed;
}

.ap-table th.ap-c-post,
.ap-table td.ap-c-post       { width: 34%; }
.ap-table th.ap-c-platform,
.ap-table td.ap-c-platform   { width: 20%; }
.ap-table th.ap-c-status,
.ap-table td.ap-c-status     { width: 17%; }
.ap-table th.ap-c-date,
.ap-table td.ap-c-date       { width: 17%; }
.ap-table th.ap-c-actions,
.ap-table td.ap-c-actions    { width: 12%; text-align: right; }

.ap-caption { max-width: 100%; }


/* =========================================
   POST DETAILS PAGE
   (re-uses .ap-page, .ap-hero, .ap-card, .ap-status, .dash-btn)
========================================= */

.pd-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

.pd-card { padding: 24px 26px; }

/* ---------- Header ---------- */
.pd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ap-line);
}

.pd-label {
    display: block;
    margin-bottom: 6px;
    color: #8590a6;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pd-head h2 {
    margin: 0;
    color: var(--ap-ink);
    font-size: 23.5px;
    font-weight: 700;
    letter-spacing: -.5px;
}

.pd-head-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.pd-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f1f3f9;
    color: #55617a;
    font-size: 11.5px;
    font-weight: 600;
}

.pd-type i { font-size: 11px; }

/* ---------- Sections ---------- */
.pd-section { padding-top: 24px; }

.pd-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    color: var(--ap-ink);
    font-size: 14px;
    font-weight: 600;
}

.pd-title > i {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 8px;
    background: #eeecff;
    color: var(--ap-brand);
    font-size: 12px;
}

.pd-count {
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff1f6;
    color: #66718a;
    font-size: 11px;
    font-weight: 600;
}

.pd-caption {
    padding: 16px 18px;
    border: 1px solid var(--ap-line);
    border-radius: 12px;
    background: #fafbff;
    color: #2c3550;
    font-size: 13.5px;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.pd-caption.is-empty { color: #9aa4b8; font-style: italic; }

/* ---------- Media ---------- */
.pd-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.pd-media-grid.is-single { grid-template-columns: minmax(0, 460px); }

.pd-media { margin: 0; min-width: 0; }

.pd-media a,
.pd-media video,
.pd-media img {
    display: block;
    width: 100%;
}

.pd-media img,
.pd-media video {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--ap-line);
    border-radius: 14px;
    background: #eef0f7;
    transition: transform .2s, box-shadow .2s;
}

.pd-media-grid.is-single img,
.pd-media-grid.is-single video { aspect-ratio: auto; max-height: 520px; object-fit: contain; }

.pd-media a:hover img { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(25, 39, 75, .12); }

.pd-media figcaption {
    margin-top: 8px;
    color: #8a95ab;
    font-size: 11.5px;
    text-align: center;
}

.pd-no-media {
    display: grid;
    padding: 34px 16px;
    place-items: center;
    gap: 8px;
    border: 1.5px dashed #cdd5e6;
    border-radius: 14px;
    background: #f9fafe;
    color: #9aa4b8;
    text-align: center;
}

.pd-no-media i { font-size: 21.5px; }
.pd-no-media p { margin: 0; font-size: 12.5px; }

/* ---------- Side info ---------- */
.pd-side { position: sticky; top: 20px; }

.pd-info { margin: 0; padding: 0; list-style: none; }

.pd-info li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--ap-line-soft);
}

.pd-info li:last-child { border-bottom: 0; }

.pd-info-ico {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    background: #f1f3f9;
    color: #6a7690;
    font-size: 14px;
}

.pd-info small {
    display: block;
    margin-bottom: 4px;
    color: #8a95ab;
    font-size: 11px;
}

.pd-info strong {
    display: block;
    color: var(--ap-ink);
    font-size: 12.5px;
    font-weight: 600;
}

.pd-info strong.is-muted { color: #a2abbd; font-weight: 500; }

/* ---------- Actions ---------- */
.pd-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding-top: 20px;
    border-top: 1px solid var(--ap-line);
}

.pd-actions form { margin: 0; }
.pd-actions .dash-btn { width: 100%; }

.pd-delete {
    display: inline-flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid #f3c9c4;
    border-radius: 10px;
    background: #fff;
    color: #c0392b;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

.pd-delete:hover { border-color: #c0392b; background: #c0392b; color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .pd-layout { grid-template-columns: minmax(0, 1fr); }
    .pd-side { position: static; }
}

@media (max-width: 600px) {
    .pd-card { padding: 18px 16px; }
    .pd-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pd-media-grid.is-single { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================
   EDIT POST PAGE
   (re-uses .ap-page, .ap-card, .pd-title, .pd-label, .pd-count,
    .pd-no-media, .ap-status, .ap-flash and .dash-btn)
========================================= */

/* Keep [hidden] working even when a component sets its own display */
.ap-page [hidden] { display: none !important; }

.pe-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

.pe-card { padding: 24px 26px; }

.pe-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 20px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--ap-line);
}

.pe-head h2 {
    margin: 0;
    color: var(--ap-ink);
    font-size: 21.5px;
    font-weight: 700;
    letter-spacing: -.5px;
}

.pe-flash { padding-top: 18px; }

.pe-inline-error { margin-top: 18px; }

/* ---------- Fields ---------- */
.pe-field { position: relative; padding-top: 22px; }

.pe-field textarea,
.pe-field input[type="datetime-local"] {
    display: block;
    width: 100%;
    border: 1px solid #dfe4ee;
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: #2c3550;
    font-family: inherit;
    font-size: 13.5px;
    transition: border-color .2s, box-shadow .2s;
}

.pe-field textarea {
    min-height: 160px;
    padding: 14px 16px;
    line-height: 1.7;
    resize: vertical;
}

.pe-field input[type="datetime-local"] {
    min-height: 46px;
    padding: 0 16px;
    cursor: pointer;
}

.pe-field textarea::placeholder { color: #a2abbd; }

.pe-field textarea:hover,
.pe-field input[type="datetime-local"]:hover { border-color: #cdd4e2; }

.pe-field textarea:focus,
.pe-field input[type="datetime-local"]:focus {
    border-color: #5d50f0;
    box-shadow: 0 0 0 3px rgba(93, 80, 240, .12);
}

.pe-counter {
    margin-top: 8px;
    color: #8a95ab;
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.pe-upload-help,
.pe-current-help {
    margin: 0 0 12px;
    color: #8a95ab;
    font-size: 12px;
    line-height: 1.6;
}

.pe-field > input[type="datetime-local"] + .pe-upload-help { margin: 8px 0 0; }

/* ---------- Media type cards ---------- */
.pe-types {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pe-type { position: relative; display: block; cursor: pointer; }

.pe-type input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.pe-type-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 12px;
    border: 1px solid #dfe4ee;
    border-radius: 14px;
    background: #fff;
    color: #66718a;
    transition: border-color .2s, background .2s, box-shadow .2s, transform .2s;
}

.pe-type-box i {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    background: #f1f3f9;
    color: #6a7690;
    font-size: 16px;
    transition: background .2s, color .2s;
}

.pe-type-box strong { color: #2c3550; font-size: 12.5px; font-weight: 600; }

.pe-type:hover .pe-type-box { border-color: #cfd4ff; transform: translateY(-2px); }

.pe-type input:checked + .pe-type-box {
    border-color: var(--ap-brand);
    background: #f6f5ff;
    box-shadow: 0 0 0 3px rgba(93, 80, 240, .12);
}

.pe-type input:checked + .pe-type-box i { background: var(--ap-brand); color: #fff; }
.pe-type input:checked + .pe-type-box strong { color: var(--ap-brand); }

.pe-type input:focus-visible + .pe-type-box { box-shadow: 0 0 0 3px rgba(93, 80, 240, .3); }

/* ---------- Upload dropzone (matches Create Post) ---------- */
/* The real input stays focusable for keyboard users but is visually hidden */
.pe-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    clip: rect(0 0 0 0);
    pointer-events: none;
}

.pe-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 230px;
    padding: 28px 20px;
    border: 2px dashed #cdd3ee;
    border-radius: 14px;
    background: #fff;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.pe-dropzone:hover,
.pe-dropzone.is-dragging {
    border-color: var(--ap-brand);
    background: #f3f2ff;
}

.pe-drop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    border-radius: 16px;
    background: #fff;
    color: #3b4fe0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.pe-dropzone strong { color: #334155; font-size: 15px; font-weight: 600; }
.pe-drop-or         { color: #64748b; font-size: 13.5px; }
.pe-browse          { color: #3b4fe0; font-weight: 600; }
.pe-dropzone small  { color: #64748b; font-size: 12px; }

.pe-file-input:focus-visible + .pe-dropzone {
    border-color: var(--ap-brand);
    box-shadow: 0 0 0 4px rgba(59, 79, 224, .16);
}

.pe-dropzone.is-attention {
    border-color: #ef4444;
    background: #fff5f5;
}

.pe-dropzone.is-attention .pe-drop-icon { color: #c0392b; }

/* "OR" divider + Media Library button */
.pe-source-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 12px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.pe-source-divider::before,
.pe-source-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e6e9f2;
}

.pe-library-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid #cfd6e6;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}

.pe-library-btn svg { color: #3b4fe0; }

.pe-library-btn:hover { background: #fff; border-color: #b9c1d3; }

.pe-library-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 79, 224, .16);
}

.pe-clear-files {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 14px;
    border: 1px solid #e3e7f1;
    border-radius: 9px;
    background: #fff;
    color: #5b6781;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.pe-clear-files:hover { border-color: #f3c9c4; background: #fff1f0; color: #c0392b; }

/* ---------- Actions ---------- */
.pe-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--ap-line);
}

/* ---------- Media grids (current + newly selected) ---------- */
.pe-media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pe-field .pe-media-grid:not(:empty) { margin-top: 14px; }

.pe-media { margin: 0; min-width: 0; }

.pe-media img,
.pe-media video {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--ap-line);
    border-radius: 12px;
    background: #eef0f7;
}

.pe-media a:hover img { box-shadow: 0 10px 22px rgba(25, 39, 75, .12); }

.pe-media figcaption {
    margin-top: 7px;
    overflow: hidden;
    color: #8a95ab;
    font-size: 11px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Side: current media ---------- */
.pe-side { position: sticky; top: 20px; }

.pe-side .pe-media-grid { transition: opacity .2s, filter .2s; }

.pe-side.is-replacing .pe-media-grid {
    opacity: .45;
    filter: grayscale(1);
}

/* ---------- Notes ---------- */
.pe-note {
    display: flex;
    gap: 10px;
    margin: 18px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f6f7fc;
    color: #6f7b94;
    font-size: 12px;
    line-height: 1.6;
}

.pe-note i { margin-top: 2px; color: var(--ap-brand); }

.pe-note.is-warn {
    background: #fff7ea;
    color: #a2691a;
}

.pe-note.is-warn i { color: #d9822b; }

.pe-side .pe-note.is-warn { margin: 0 0 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .pe-layout { grid-template-columns: minmax(0, 1fr); }
    .pe-side { position: static; }
}

@media (max-width: 600px) {
    .pe-card { padding: 18px 16px; }
    .pe-types { gap: 8px; }
    .pe-type-box { padding: 14px 6px; }
    .pe-dropzone { min-height: 190px; padding: 22px 14px; }
    .pe-actions { flex-direction: column-reverse; align-items: stretch; }
    .pe-actions .dash-btn { width: 100%; }
}

/* ---------- Media Library picker modal ---------- */
.pe-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
}

.pe-modal[hidden] { display: none !important; }

.pe-modal-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 880px;
    max-height: 88vh;
    padding: 24px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
}

.pe-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 4px;
}

.pe-modal-header h2 { margin: 0 0 4px; color: #0f172a; font-size: 18px; font-weight: 600; }
.pe-modal-header p  { margin: 0; color: #64748b; font-size: 13.5px; }

.pe-modal-close {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 15px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.pe-modal-close:hover { background: #e2e8f0; color: #0f172a; }

.pe-modal-error { margin: 14px 0 0; }

.pe-lib-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin: 18px 0;
    padding: 6px;
    overflow-y: auto;
}

.pe-lib-card {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid #e6e9f2;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.pe-lib-card:hover { border-color: #c4ccf7; box-shadow: 0 8px 24px rgba(15, 23, 42, .08); }

.pe-lib-card img,
.pe-lib-card video {
    display: block;
    width: 100%;
    height: 130px;
    object-fit: cover;
    background: #eef0f7;
}

.pe-lib-check { position: absolute; opacity: 0; pointer-events: none; }

.pe-lib-tick {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 2px solid #c9ccd6;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: transparent;
    font-size: 11px;
    transition: all .15s;
}

.pe-lib-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .7);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
}

.pe-lib-badge i { margin-right: 4px; font-size: 8px; }

.pe-lib-name {
    display: block;
    padding: 9px 11px;
    overflow: hidden;
    color: #2b2d42;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-lib-card:has(.pe-lib-check:checked) {
    border-color: #3b4fe0;
    background: #eef1ff;
    box-shadow: 0 0 0 4px rgba(59, 79, 224, .16);
}

.pe-lib-check:checked ~ .pe-lib-tick { border-color: #3b4fe0; background: #3b4fe0; color: #fff; }
.pe-lib-check:checked ~ .pe-lib-name { color: #3b4fe0; }
.pe-lib-check:focus-visible ~ .pe-lib-tick { box-shadow: 0 0 0 3px rgba(59, 79, 224, .3); }

.pe-lib-card.is-disabled { opacity: .4; cursor: not-allowed; }
.pe-lib-card.is-disabled:hover { border-color: #e6e9f2; box-shadow: none; }

.pe-lib-empty { margin: 18px 0; }

.pe-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--ap-line);
}

.pe-lib-count { color: #64748b; font-size: 12.5px; font-weight: 600; }

.pe-modal-actions { display: flex; gap: 10px; }

@media (max-width: 600px) {
    .pe-modal-dialog { padding: 18px; }
    .pe-lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pe-modal-footer { flex-direction: column; align-items: stretch; }
    .pe-modal-actions .dash-btn { flex: 1; }
}

/* ==============================
   CONTENT CALENDAR
   Replace your whole existing "CONTENT CALENDAR" section
   (from its header comment down to the end of its
   @media (max-width: 560px) block) with this file.
   Also delete the small "Content Calendar post media"
   block at the very end of your CSS file.
============================== */

.calendar-page {
    padding: 24px;
    min-width: 0;
}

.calendar-card {
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(30, 41, 59, 0.06);
}

.calendar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
}

.calendar-heading h1 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 22.5px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.calendar-heading p {
    margin: 0;
    color: #7b879c;
    font-size: 13px;
}

.calendar-schedule-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 22px;
    background: #4f46f5;
    color: #fff;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(79, 70, 245, 0.25);
    transition: background 0.2s, transform 0.2s;
}

.calendar-schedule-btn:hover {
    background: #4038df;
    transform: translateY(-1px);
}

/* Toolbar */
.calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 20px;
}

.calendar-btn {
    min-height: 40px;
    padding: 0 18px;
    background: #fff;
    border: 1px solid #e1e7f0;
    border-radius: 9px;
    color: #344054;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.calendar-btn:hover {
    background: #f4f5fb;
}

.calendar-navigation {
    display: flex;
    border: 1px solid #e1e7f0;
    border-radius: 9px;
    overflow: hidden;
}

.calendar-navigation .calendar-btn {
    width: 38px;
    padding: 0;
    border: 0;
    border-radius: 0;
    font-size: 11px;
}

.calendar-navigation .calendar-btn + .calendar-btn {
    border-left: 1px solid #e1e7f0;
}

#calendarMonthTitle {
    margin: 0 0 0 4px;
    color: #202b40;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.calendar-view-switch {
    display: flex;
    margin-left: auto;
    background: #f3f4fa;
    border: 1px solid #e1e7f0;
    border-radius: 9px;
    overflow: hidden;
}

.calendar-view-btn {
    min-width: 66px;
    padding: 11px 16px;
    background: transparent;
    border: 0;
    color: #536176;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.calendar-view-btn.active {
    background: #4f46f5;
    color: #fff;
    font-weight: 600;
}

/* Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid #edf0f6;
    border-left: 1px solid #edf0f6;
}

.calendar-weekday {
    padding: 13px 14px;
    background: #fff;
    border-right: 1px solid #edf0f6;
    border-bottom: 1px solid #edf0f6;
    color: #7b879c;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
}

.calendar-day {
    min-width: 0;
    min-height: 118px;
    padding: 10px 12px;
    background: #fff;
    border-right: 1px solid #edf0f6;
    border-bottom: 1px solid #edf0f6;
}

.calendar-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    color: #182033;
    font-size: 12px;
    font-weight: 600;
}

.calendar-day-outside {
    background: #fbfcfe;
}

.calendar-day-outside .calendar-day-number {
    color: #b3bdcc;
}

.calendar-day-today .calendar-day-number {
    background: #4f46f5;
    color: #fff;
    border-radius: 50%;
}

/* ---------- Post chips ---------- */
.calendar-post-item {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.calendar-post-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(25, 39, 75, 0.1);
}

.calendar-post-item:focus-visible {
    outline: 2px solid #4f46f5;
    outline-offset: 2px;
}

/* Status colours */
.calendar-post-purple { background: #e9e2fb; color: #4b36b3; }
.calendar-post-green  { background: #dcf3e4; color: #1f7a45; }
.calendar-post-orange { background: #fdeccc; color: #a96a14; }
.calendar-post-red    { background: #fde0e0; color: #b4322a; }

/* Thumbnail */
.calendar-post-thumb {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.55);
}

.calendar-post-thumb img,
.calendar-post-thumb video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.calendar-post-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.28);
    color: #fff;
    font-size: 11px;
}

/* Small platform badge on the thumbnail corner */
.calendar-post-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 1.5px solid #fff;
    border-radius: 6px;
    color: #fff;
    font-size: 9px;
}

/* Logo tile when the post has no media */
.calendar-post-logo {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
}

.platform-instagram { background: linear-gradient(135deg, #833ab4, #e1306c 55%, #f77737); }
.platform-facebook  { background: #1877f2; }
.platform-linkedin  { background: #0a66c2; }
.platform-youtube   { background: #ef3b3b; }
.platform-twitter   { background: #111827; }
.platform-other     { background: #8c97ad; }

.calendar-post-logo.platform-facebook { border-radius: 50%; }

/* Text */
.calendar-post-body {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.calendar-post-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-post-pico { font-size: 12px; }

.platform-text-instagram { color: #e1306c; }
.platform-text-facebook  { color: #1877f2; }
.platform-text-linkedin  { color: #0a66c2; }
.platform-text-youtube   { color: #ef3b3b; }
.platform-text-twitter   { color: #111827; }
.platform-text-other     { color: #8c97ad; }

.calendar-post-time {
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
}

.calendar-post-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-radius: 50%;
}

.calendar-post-caption {
    display: -webkit-box;
    overflow: hidden;
    font-weight: 600;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* List view */
.calendar-list-view {
    grid-template-columns: 1fr;
}

.calendar-list-view .calendar-weekday {
    display: none;
}

.calendar-list-row {
    display: flex;
    gap: 20px;
    padding: 14px 24px;
    border-right: 1px solid #edf0f6;
    border-bottom: 1px solid #edf0f6;
}

.calendar-list-date {
    flex: 0 0 110px;
    color: #344054;
    font-size: 12.5px;
    font-weight: 600;
}

.calendar-list-posts {
    display: grid;
    flex: 1;
    gap: 6px;
    min-width: 0;
}

.calendar-list-posts .calendar-post-item {
    margin-top: 0;
}

.calendar-empty-state {
    padding: 24px;
    color: #7b879c;
    text-align: center;
}

/* ---------- Legend ---------- */
.calendar-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 22px;
    padding: 16px 24px;
    border-top: 1px solid #edf0f6;
    color: #536176;
    font-size: 12.5px;
}

.calendar-legend strong {
    color: #111827;
    font-size: 13px;
}

.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.calendar-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-green  { background: #2fb36b; }
.dot-purple { background: #5b4fe8; }
.dot-orange { background: #f0b429; }
.dot-red    { background: #e5484d; }

/* Responsive */
@media (max-width: 900px) {
    .calendar-page { padding: 14px; }
    .calendar-heading { padding: 18px; }
    .calendar-toolbar { flex-wrap: wrap; padding: 0 18px 18px; }
    .calendar-day { min-height: 80px; padding: 6px; }
    .calendar-weekday { padding: 10px 6px; }
    .calendar-legend { padding: 14px 18px; }
}

@media (max-width: 560px) {
    .calendar-heading { align-items: flex-start; flex-direction: column; }
    .calendar-toolbar { gap: 7px; }

    #calendarMonthTitle {
        order: 3;
        flex-basis: 100%;
        margin: 5px 0;
    }

    .calendar-view-btn { min-width: 48px; padding: 9px 10px; }
    .calendar-day { min-height: 62px; padding: 3px; }
    .calendar-day-number { min-width: 20px; height: 20px; font-size: 11px; }

    .calendar-post-item { padding: 4px 5px; gap: 5px; }
    .calendar-post-thumb { flex-basis: 32px; width: 32px; height: 32px; }
    .calendar-post-meta { display: none; }

    .calendar-list-row { padding: 12px 14px; gap: 12px; }
    .calendar-list-date { flex-basis: 80px; }
}
/* ==============================
   SOCIAL ACCOUNTS PAGE
   (append to the end of your CSS file)
============================== */

.sa-page {
    padding: 24px;
    min-width: 0;
}

.sa-card {
    padding: 28px;
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(30, 41, 59, 0.06);
}

/* ---------- Heading ---------- */
.sa-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 26px;
}

.sa-heading h1 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 22.5px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.sa-heading p {
    margin: 0;
    color: #7b879c;
    font-size: 13px;
}

/* ---------- Buttons ---------- */
.sa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.sa-btn-lg {
    padding: 0 22px;
}

.sa-btn-primary {
    background: #4f46f5;
    color: #fff;
    box-shadow: 0 6px 14px rgba(79, 70, 245, 0.25);
}

.sa-btn-primary:hover {
    background: #4038df;
    transform: translateY(-1px);
}

.sa-btn-soft {
    padding: 0 30px;
    border-color: #dfe4f2;
    background: #eef0fb;
    color: #4f46f5;
}

.sa-btn-soft:hover {
    background: #e3e6f8;
}

.sa-btn-muted,
.sa-btn-done {
    cursor: not-allowed;
    box-shadow: none;
}

.sa-btn-muted {
    background: #eceef6;
    color: #9aa3b8;
    font-weight: 500;
}

.sa-btn-done {
    background: #e5f7ee;
    color: #17874f;
}

.sa-btn:focus-visible,
.sa-icon-btn:focus-visible {
    outline: 2px solid #4f46f5;
    outline-offset: 2px;
}

.sa-icon-btn {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #e1e7f0;
    border-radius: 9px;
    background: #fff;
    color: #536176;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.sa-icon-btn:hover {
    border-color: #cfd4ff;
    background: #f1f0ff;
    color: #4f46f5;
}

/* ---------- Platform logos ---------- */
.sa-logo {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
}

.sa-logo-lg {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 34px;
    box-shadow: 0 8px 18px rgba(25, 39, 75, 0.14);
}

.sa-logo-md {
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    border-radius: 14px;
    font-size: 24px;
}

.platform-instagram { background: linear-gradient(135deg, #833ab4, #e1306c 55%, #f77737); }
.platform-facebook  { background: #1877f2; border-radius: 50%; }
.platform-linkedin  { background: #0a66c2; }
.platform-youtube   { background: #ef3b3b; }
.platform-tiktok    { background: #111827; }
.platform-x,
.platform-twitter   { background: #111827; }

.sa-logo-lg.platform-facebook { font-size: 32px; }
.sa-logo-md.platform-youtube  { font-size: 20px; border-radius: 12px; }
.sa-logo-md.platform-facebook { font-size: 22px; }

/* ---------- Account row ---------- */
.sa-list {
    display: grid;
    gap: 14px;
}

.sa-account {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 22px 26px;
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(25, 39, 75, 0.045);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sa-account:hover {
    border-color: #dcdffa;
    box-shadow: 0 8px 26px rgba(25, 39, 75, 0.08);
}

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

.sa-account-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.sa-account-title h3 {
    margin: 0;
    color: #131a2e;
    font-size: 17px;
    font-weight: 600;
}

.sa-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.sa-badge i {
    font-size: 11px;
}

.sa-badge.is-connected {
    background: #e5f7ee;
    color: #17874f;
}

.sa-badge.is-off {
    background: #fff0dc;
    color: #c37b2a;
}

.sa-username {
    margin: 0 0 5px;
    overflow: hidden;
    color: #344054;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sa-meta {
    margin: 0;
    color: #7b879c;
    font-size: 13px;
}

.sa-account-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- Connect a new account ---------- */
.sa-new {
    margin-top: 34px;
    outline: none;
}

.sa-new h2 {
    margin: 0 0 16px;
    color: #131a2e;
    font-size: 16px;
    font-weight: 600;
}

.sa-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.sa-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 26px 22px 24px;
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(25, 39, 75, 0.045);
    transition: transform 0.2s, box-shadow 0.2s;
}

.sa-tile:not(.is-soon):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(25, 39, 75, 0.09);
}

.sa-tile h3 {
    margin: 0 0 6px;
    color: #131a2e;
    font-size: 15px;
    font-weight: 600;
}

.sa-tile p {
    margin: 0 0 16px;
    color: #7b879c;
    font-size: 12px;
}

.sa-tile .sa-btn {
    width: 100%;
    max-width: 190px;
    margin-top: auto;
}

.sa-tile.is-soon {
    background: #f6f7fc;
    border-color: #eceff6;
    box-shadow: none;
}

.sa-tile.is-soon .sa-logo {
    opacity: 0.75;
}

.sa-tile.is-soon h3 {
    margin-bottom: 18px;
}

/* ---------- Empty state ---------- */
.sa-empty {
    padding: 38px 16px;
    border: 1.5px dashed #cdd5e6;
    border-radius: 16px;
    background: #f9fafe;
    text-align: center;
}

.sa-empty-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 15px;
    background: #f0eeff;
    color: #6657ed;
    font-size: 20px;
}

.sa-empty h3 {
    margin: 0 0 6px;
    color: #131a2e;
    font-size: 15px;
}

.sa-empty p {
    margin: 0;
    color: #8791a6;
    font-size: 12.5px;
}

/* ---------- Toast ---------- */
.sa-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    max-width: 340px;
    padding: 13px 18px;
    border-radius: 12px;
    background: #151c2e;
    color: #fff;
    font-size: 12.5px;
    line-height: 1.5;
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s;
}

.sa-toast.is-visible {
    opacity: 1;
    transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .sa-page { padding: 14px; }
    .sa-card { padding: 20px; }
    .sa-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .sa-heading .sa-btn { width: 100%; }

    .sa-account {
        flex-wrap: wrap;
        gap: 16px;
        padding: 18px;
    }

    .sa-logo-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 26px; }
    .sa-account-info { flex: 1 1 calc(100% - 80px); }
    .sa-account-actions { width: 100%; }
    .sa-account-actions .sa-btn { flex: 1; }

    .sa-tiles { grid-template-columns: minmax(0, 1fr); }
    .sa-toast { right: 14px; left: 14px; bottom: 14px; max-width: none; }
}
/* ==============================
   SOCIAL ACCOUNTS PAGE
   Everything is scoped under .accounts-page so it cannot
   clash with .primary-button / .instagram-icon used elsewhere.
   Append to the end of your CSS file.
============================== */

.accounts-page {
    margin: 24px;
    padding: 28px;
    min-width: 0;
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(30, 41, 59, 0.06);
}

/* ---------- Header ---------- */
.accounts-page .accounts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 26px;
}

.accounts-page .accounts-header h1 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 22.5px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.accounts-page .accounts-header p {
    margin: 0;
    color: #7b879c;
    font-size: 13px;
}

/* ---------- Buttons ---------- */
.accounts-page .primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 22px;
    border: 0;
    border-radius: 9px;
    background: #4f46f5;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(79, 70, 245, 0.25);
    transition: background 0.2s, transform 0.2s;
}

.accounts-page .primary-button:hover {
    background: #4038df;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(79, 70, 245, 0.25);
}

.accounts-page .primary-button:focus-visible {
    outline: 2px solid #4f46f5;
    outline-offset: 2px;
}

.accounts-page .coming-soon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 190px;
    min-height: 42px;
    margin-top: auto;
    padding: 0 20px;
    border: 0;
    border-radius: 9px;
    background: #eceef6;
    color: #9aa3b8;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: not-allowed;
}

/* ---------- Empty state ---------- */
.accounts-page .empty-accounts {
    padding: 38px 16px;
    border: 1.5px dashed #cdd5e6;
    border-radius: 16px;
    background: #f9fafe;
    text-align: center;
}

.accounts-page .empty-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 15px;
    background: #f0eeff;
    color: #6657ed;
    font-size: 20px;
}

.accounts-page .empty-accounts h3 {
    margin: 0 0 6px;
    color: #131a2e;
    font-size: 15px;
    font-weight: 600;
}

.accounts-page .empty-accounts p {
    margin: 0;
    color: #8791a6;
    font-size: 12.5px;
}

/* ---------- Platforms ---------- */
.accounts-page .platform-section {
    margin-top: 34px;
    scroll-margin-top: 20px;
}

.accounts-page .platform-section h2 {
    margin: 0 0 16px;
    color: #131a2e;
    font-size: 16px;
    font-weight: 600;
}

.accounts-page .platform-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.accounts-page .platform-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 26px 22px 24px;
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(25, 39, 75, 0.045);
    transition: transform 0.2s, box-shadow 0.2s;
}

.accounts-page .platform-card:not(.coming-soon-card):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(25, 39, 75, 0.09);
}

.accounts-page .platform-card h3 {
    margin: 0 0 6px;
    color: #131a2e;
    font-size: 15px;
    font-weight: 600;
}

.accounts-page .platform-card p {
    margin: 0 0 16px;
    color: #7b879c;
    font-size: 12px;
}

.accounts-page .platform-button {
    width: 100%;
    max-width: 190px;
    margin-top: auto;
}

/* Coming soon cards */
.accounts-page .coming-soon-card {
    background: #f6f7fc;
    border-color: #eceff6;
    box-shadow: none;
}

.accounts-page .coming-soon-card h3 {
    margin-bottom: 18px;
}

/* ---------- Platform icons ---------- */
.accounts-page .platform-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    font-size: 24px;
}
/* =====================================================================
   Dashboard: 3-dot post menu, popups (schedule + delete) and toasts
   Paste at the END of your main CSS file.
   If you pasted an older version of this block, REPLACE it with this one.
   ===================================================================== */

/* ---------- 3-dot menu ---------- */
.dash-post-actions {
    position: relative;
    flex: 0 0 auto;
}

.dash-post-menu[hidden] { display: none !important; }

.dash-post-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    min-width: 190px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e5e9f3;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 16px 36px rgba(16, 24, 40, .14);
    text-align: left;
}

.dash-post-menu form { margin: 0; }

.dash-post-menu a,
.dash-post-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #344059;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.dash-post-menu i {
    width: 14px;
    text-align: center;
    color: #8a95ab;
}

.dash-post-menu a:hover,
.dash-post-menu button:hover { background: #f4f5fb; }

.dash-post-menu-divider {
    height: 1px;
    margin: 5px 4px;
    background: #f0f2f7;
}

.dash-post-delete,
.dash-post-delete i { color: #c0392b !important; }
.dash-post-delete:hover { background: #fff1f0 !important; }

/* video thumbnails */
.dash-thumb video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- Popups (schedule + delete) ---------- */
body.dash-modal-open { overflow: hidden; }

.dash-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dash-modal[hidden] { display: none !important; }

.dash-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
}

.dash-modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    animation: dashModalIn .22s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes dashModalIn {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.dash-modal-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.dash-modal-head > div { flex: 1; min-width: 0; }

.dash-modal-icon {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 13px;
    background: #eeecff;
    color: #5b4fe8;
    font-size: 18px;
}

.dash-modal-icon.is-danger {
    background: #ffe6e3;
    color: #c0392b;
}

.dash-modal-head h3 {
    margin: 2px 0 5px;
    color: #131a2e;
    font-size: 16px;
    font-weight: 600;
}

.dash-modal-head p {
    margin: 0;
    color: #7b879c;
    font-size: 12.5px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.dash-modal-head p:empty { display: none; }

.dash-modal-x {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.dash-modal-x:hover { background: #e2e8f0; color: #0f172a; }

.dash-modal-label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
}

.dash-modal-card input[type="datetime-local"] {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #dbe0ec;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: #0f172a;
    font-family: inherit;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}

.dash-modal-card input[type="datetime-local"]:hover { border-color: #cdd4e2; }

.dash-modal-card input[type="datetime-local"]:focus {
    border-color: #3b4fe0;
    box-shadow: 0 0 0 4px rgba(59, 79, 224, .16);
}

.dash-modal-hint {
    margin: 10px 0 0;
    color: #8a95ab;
    font-size: 12px;
    line-height: 1.5;
}

.dash-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eef0f6;
}

.dash-modal-cancel,
.dash-modal-save,
.dash-modal-danger {
    min-height: 42px;
    padding: 0 22px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s;
}

.dash-modal-cancel:active,
.dash-modal-save:active,
.dash-modal-danger:active { transform: translateY(1px); }

.dash-modal-cancel {
    border: 1px solid #dbe0ec;
    background: #fff;
    color: #475569;
}

.dash-modal-cancel:hover { background: #f8fafc; border-color: #b9c1d3; }

.dash-modal-save {
    border: 0;
    background: #4f46f5;
    color: #fff;
    box-shadow: 0 6px 14px rgba(79, 70, 245, .25);
}

.dash-modal-save:hover { background: #4038df; }

.dash-modal-danger {
    border: 0;
    background: #d9382c;
    color: #fff;
    box-shadow: 0 6px 14px rgba(217, 56, 44, .25);
}

.dash-modal-danger:hover { background: #c0392b; }

.dash-modal-save:disabled,
.dash-modal-danger:disabled { opacity: .6; cursor: progress; }

/* ---------- Toast popups (duplicated, deleted, rescheduled ...) ---------- */
.dash-toasts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.dash-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px 14px 16px;
    background: #fff;
    border: 1px solid #e5e9f3;
    border-left: 4px solid #21b477;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 18px 40px rgba(16, 24, 40, .16);
    pointer-events: auto;
    animation: dashToastIn .35s cubic-bezier(.2, .8, .2, 1) both;
}

.dash-toast.is-error { border-left-color: #e5534b; }
.dash-toast.is-leaving { animation: dashToastOut .25s ease forwards; }

.dash-toast-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #e5f7ee;
    color: #17874f;
    font-size: 15px;
}

.dash-toast.is-error .dash-toast-icon { background: #ffe6e3; color: #c0392b; }

.dash-toast-text { flex: 1; min-width: 0; padding-top: 1px; }

.dash-toast-text strong {
    display: block;
    margin-bottom: 3px;
    color: #131a2e;
    font-size: 13px;
    font-weight: 600;
}

.dash-toast-text span {
    display: block;
    color: #66718a;
    font-size: 12.5px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.dash-toast-close {
    display: grid;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
}

.dash-toast-close:hover { background: #f1f5f9; color: #334155; }

@keyframes dashToastIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: none; }
}

@keyframes dashToastOut {
    to { opacity: 0; transform: translateX(24px); }
}

@media (max-width: 600px) {
    .dash-toasts { top: 12px; right: 12px; }
    .dash-modal-card { padding: 20px; }
    .dash-modal-actions { flex-direction: column-reverse; }
    .dash-modal-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .dash-toast, .dash-modal-card { animation: none !important; }
}

/* IMPORTANT: delete this rule from your existing 760px media query,
   otherwise the 3-dot button is hidden on mobile:
       .dash-more { display: none; }
*/
/* Overrides the old dashboard .instagram-icon rule */
.accounts-page .platform-icon.instagram-icon {
    margin: 0 0 14px;
    color: #fff;
    font-size: 24px;
    background: linear-gradient(135deg, #833ab4, #e1306c 55%, #f77737);
}

.accounts-page .platform-icon.facebook-icon {
    border-radius: 50%;
    background: #1877f2;
    font-size: 22px;
}

/* The YouTube glyph already includes the rounded box, so just color it */
.accounts-page .platform-icon.youtube-icon {
    background: none;
    color: #ff2d2d;
    font-size: 46px;
}

.accounts-page .coming-soon-card .platform-icon {
    opacity: 0.85;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .accounts-page {
        margin: 14px;
        padding: 20px;
    }

    .accounts-page .platform-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .accounts-page .accounts-header .primary-button {
        width: 100%;
    }

    .accounts-page .platform-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
/* ==============================
   ANALYTICS PAGE
   Scoped under .analytics-page so it cannot clash with the
   .platform-icon / .instagram-icon rules used on other pages.
   Append to the end of your CSS file.
============================== */

.analytics-page {
    padding: 24px;
    min-width: 0;
    color: #344059;
}

/* ---------- Header ---------- */
.analytics-page .analytics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 22px;
}

.analytics-page .analytics-header h1 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 22.5px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.analytics-page .analytics-header p {
    margin: 0;
    color: #7b879c;
    font-size: 13px;
}

.analytics-page .analytics-select {
    min-width: 160px;
    min-height: 40px;
    padding: 0 34px 0 14px;
    border: 1px solid #dfe4ee;
    border-radius: 10px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7690' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    color: #344059;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
}

.analytics-page .analytics-select:focus {
    border-color: #5d50f0;
    box-shadow: 0 0 0 3px rgba(93, 80, 240, 0.12);
}

/* ---------- Main statistic cards ---------- */
.analytics-page .analytics-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.analytics-page .analytics-card {
    min-width: 0;
    padding: 22px;
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 18px;
    box-shadow: 0 5px 20px rgba(25, 39, 75, 0.045);
    transition: transform 0.25s, box-shadow 0.25s;
}

.analytics-page .analytics-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(25, 39, 75, 0.09);
}

.analytics-page .analytics-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    place-items: center;
    border-radius: 14px;
    font-size: 19px;
}

.analytics-page .reach-icon     { color: #3d7be8; background: linear-gradient(145deg, #e8f1ff, #c9deff); }
.analytics-page .published-icon { color: #1f9d62; background: linear-gradient(145deg, #e6f9ef, #c5eed8); }
.analytics-page .scheduled-icon { color: #e7842a; background: linear-gradient(145deg, #fff3e6, #ffdfbb); }
.analytics-page .draft-icon     { color: #6a54e6; background: linear-gradient(145deg, #f1eeff, #dcd5ff); }

.analytics-page .analytics-card > p {
    margin: 0 0 8px;
    color: #7b869c;
    font-size: 12.5px;
    font-weight: 500;
}

.analytics-page .analytics-card h2 {
    margin: 0 0 8px;
    color: #131a2e;
    font-size: 25.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.8px;
}

.analytics-page .analytics-card-description {
    color: #98a1b3;
    font-size: 11.5px;
}

/* ---------- Secondary statistic cards ---------- */
.analytics-page .analytics-secondary-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.analytics-page .analytics-mini-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 18px 22px;
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(25, 39, 75, 0.045);
}

.analytics-page .analytics-mini-icon {
    display: grid;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 50%;
    background: #eeecff;
    color: #5b4fe8;
    font-size: 18px;
}

.analytics-page .analytics-mini-icon.failed-mini-icon {
    background: #ffe6e3;
    color: #c0392b;
}

.analytics-page .analytics-mini-card p {
    margin: 0 0 4px;
    color: #7b869c;
    font-size: 12px;
}

.analytics-page .analytics-mini-card h3 {
    margin: 0 0 4px;
    color: #131a2e;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
}

.analytics-page .analytics-mini-card span {
    color: #98a1b3;
    font-size: 11.5px;
}

/* ---------- Panels ---------- */
.analytics-page .analytics-panel {
    min-width: 0;
    margin-bottom: 20px;
    padding: 24px;
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 18px;
    box-shadow: 0 5px 20px rgba(25, 39, 75, 0.045);
}

.analytics-page .analytics-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.analytics-page .analytics-bottom-grid .analytics-panel {
    margin-bottom: 0;
}

.analytics-page .analytics-bottom-grid {
    margin-bottom: 20px;
}

.analytics-page .analytics-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
}

.analytics-page .analytics-panel-header h2 {
    margin: 0 0 6px;
    color: #131a2e;
    font-size: 16px;
    font-weight: 600;
}

.analytics-page .analytics-panel-header p {
    margin: 0;
    color: #7b879c;
    font-size: 12.5px;
}

.analytics-page .analytics-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #e5f7ee;
    color: #17874f;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.analytics-page .analytics-live-badge span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #21b477;
    box-shadow: 0 0 0 3px rgba(33, 180, 119, 0.2);
}

.analytics-page .analytics-chart {
    position: relative;
    height: 300px;
}

.analytics-page .analytics-view-all {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #4f46f5;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.analytics-page .analytics-view-all i {
    font-size: 10px;
    transition: transform 0.2s;
}

.analytics-page .analytics-view-all:hover i {
    transform: translateX(3px);
}

/* ---------- Platform performance ---------- */
.analytics-page .platform-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f2f7;
}

.analytics-page .platform-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.analytics-page .platform-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.analytics-page .platform-info strong {
    display: block;
    margin-bottom: 4px;
    color: #131a2e;
    font-size: 13.5px;
    font-weight: 600;
}

.analytics-page .platform-info small {
    color: #8a95ab;
    font-size: 11.5px;
}

.analytics-page .platform-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin: 0;
    place-items: center;
    border-radius: 12px;
    background: #8c97ad;
    color: #fff;
    font-size: 18px;
}

/* Overrides the old dashboard .instagram-icon rule */
.analytics-page .platform-icon.instagram-icon {
    margin: 0;
    color: #fff;
    font-size: 18px;
    background: linear-gradient(135deg, #833ab4, #e1306c 55%, #f77737);
}

.analytics-page .platform-icon.facebook-icon {
    border-radius: 50%;
    background: #1877f2;
    font-size: 16px;
}

.analytics-page .platform-icon.youtube-icon {
    background: none;
    color: #ff2d2d;
    font-size: 34px;
}

.analytics-page .platform-result {
    text-align: right;
}

.analytics-page .platform-result strong {
    display: block;
    margin-bottom: 3px;
    color: #131a2e;
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
}

.analytics-page .platform-result span {
    color: #8a95ab;
    font-size: 11px;
}

/* ---------- Publishing history ---------- */
.analytics-page .publishing-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
    padding: 14px 16px;
    border: 1px solid #eef0f6;
    border-radius: 12px;
    background: #f9fafe;
}

.analytics-page .publishing-status-row:last-child {
    margin-bottom: 0;
}

.analytics-page .publishing-status-label {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #344059;
    font-size: 13px;
    font-weight: 500;
}

.analytics-page .publishing-status-row strong {
    color: #131a2e;
    font-size: 16px;
    font-weight: 700;
}

.analytics-page .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.analytics-page .status-success { background: #21b477; box-shadow: 0 0 0 3px rgba(33, 180, 119, 0.18); }
.analytics-page .status-failed  { background: #e5534b; box-shadow: 0 0 0 3px rgba(229, 83, 75, 0.18); }
.analytics-page .status-other   { background: #8c97ad; box-shadow: 0 0 0 3px rgba(140, 151, 173, 0.2); }

/* ---------- Recent posts table ---------- */
.analytics-page .analytics-table-wrapper {
    overflow-x: auto;
}

.analytics-page .analytics-table {
    width: 100%;
    min-width: 600px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.analytics-page .analytics-table th {
    padding: 11px 14px;
    border-top: 1px solid #e9edf5;
    border-bottom: 1px solid #e9edf5;
    background: #f8f9fc;
    color: #8590a6;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.analytics-page .analytics-table th:first-child {
    padding-left: 16px;
    border-left: 1px solid #e9edf5;
    border-radius: 10px 0 0 10px;
}

.analytics-page .analytics-table th:last-child {
    border-right: 1px solid #e9edf5;
    border-radius: 0 10px 10px 0;
}

.analytics-page .analytics-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #f0f2f7;
    color: #344059;
    font-size: 12.5px;
    vertical-align: middle;
}

.analytics-page .analytics-table td:first-child {
    padding-left: 16px;
}

.analytics-page .analytics-table tbody tr:last-child td {
    border-bottom: 0;
}

.analytics-page .analytics-table tbody tr {
    transition: background 0.15s;
}

.analytics-page .analytics-table tbody tr:hover {
    background: #f8f9fe;
}

.analytics-page .analytics-post-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.analytics-page .analytics-post-icon {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    background: #eeecff;
    color: #5b4fe8;
    font-size: 14px;
}

.analytics-page .analytics-post-title strong {
    display: block;
    margin-bottom: 3px;
    color: #131a2e;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.analytics-page .analytics-post-title small {
    color: #96a0b5;
    font-size: 11px;
}

.analytics-page .analytics-muted {
    color: #a0aabd;
}

.analytics-page .analytics-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.analytics-page .analytics-status-published { color: #17874f; background: #dff6e8; }
.analytics-page .analytics-status-scheduled { color: #3566d6; background: #e3ecff; }
.analytics-page .analytics-status-failed    { color: #c0392b; background: #ffe6e3; }
.analytics-page .analytics-status-draft     { color: #cf7a1f; background: #ffecd6; }

/* ---------- Empty states ---------- */
.analytics-page .analytics-empty-state {
    padding: 34px 16px;
    border: 1.5px dashed #cdd5e6;
    border-radius: 14px;
    background: #f9fafe;
    text-align: center;
}

.analytics-page .analytics-empty-state > i {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 15px;
    background: #f0eeff;
    color: #6657ed;
    font-size: 20px;
}

.analytics-page .analytics-empty-state h3 {
    margin: 0 0 6px;
    color: #131a2e;
    font-size: 15px;
    font-weight: 600;
}

.analytics-page .analytics-empty-state p {
    max-width: 340px;
    margin: 0 auto 16px;
    color: #8791a6;
    font-size: 12.5px;
    line-height: 1.6;
}

.analytics-page .analytics-empty-state p:last-child {
    margin-bottom: 0;
}

.analytics-page .analytics-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 20px;
    border-radius: 9px;
    background: #4f46f5;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(79, 70, 245, 0.25);
    transition: background 0.2s, transform 0.2s;
}

.analytics-page .analytics-action-button:hover {
    background: #4038df;
    transform: translateY(-1px);
}

/* ---------- Information note ---------- */
.analytics-page .analytics-demo-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border: 1px solid #e6e8fb;
    border-radius: 14px;
    background: #f6f7ff;
}

.analytics-page .analytics-demo-note i {
    margin-top: 2px;
    color: #4f46f5;
    font-size: 15px;
}

.analytics-page .analytics-demo-note p {
    margin: 0;
    color: #66718a;
    font-size: 12.5px;
    line-height: 1.7;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .analytics-page .analytics-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-page .analytics-bottom-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .analytics-page .analytics-bottom-grid .analytics-panel {
        margin-bottom: 0;
    }

    .analytics-page .analytics-bottom-grid {
        gap: 20px;
    }
}

@media (max-width: 800px) {
    .analytics-page {
        padding: 14px;
    }

    .analytics-page .analytics-secondary-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .analytics-page .analytics-panel {
        padding: 18px;
    }

    .analytics-page .analytics-chart {
        height: 240px;
    }
}

@media (max-width: 520px) {
    .analytics-page .analytics-stats {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .analytics-page .analytics-header .analytics-select {
        width: 100%;
    }
}
/* ==============================
   MEDIA LIBRARY PAGE
   Append to the end of your CSS file.
============================== */

.media-library-page {
    margin: 24px;
    padding: 28px;
    min-width: 0;
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(30, 41, 59, 0.06);
}

/* ---------- Header ---------- */
.media-library-page .media-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 22px;
}

.media-library-page .media-header h1 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 22.5px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.media-library-page .media-header p {
    margin: 0;
    color: #7b879c;
    font-size: 13px;
}

.media-upload-button,
.media-empty-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 22px;
    border: 0;
    border-radius: 9px;
    background: #4f46f5;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(79, 70, 245, 0.25);
    transition: background 0.2s, transform 0.2s;
}

.media-upload-button:hover,
.media-empty-button:hover {
    background: #4038df;
    transform: translateY(-1px);
}

.media-upload-button:focus-visible,
.media-empty-button:focus-visible {
    outline: 2px solid #4f46f5;
    outline-offset: 2px;
}

/* ---------- Flash messages ---------- */
.media-flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 16px;
    border: 1px solid #e1e7f0;
    border-radius: 10px;
    background: #f6f7fc;
    color: #344059;
    font-size: 12.5px;
}

.media-flash button {
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 19px;
    line-height: 1;
    opacity: 0.6;
    cursor: pointer;
}

.media-flash button:hover {
    opacity: 1;
}

.media-flash-success {
    border-color: #c8ecd8;
    background: #effaf4;
    color: #17683a;
}

.media-flash-error,
.media-flash-danger {
    border-color: #f7d0d0;
    background: #fff3f3;
    color: #a52a2a;
}

.media-flash-warning {
    border-color: #f5e0b8;
    background: #fff8ea;
    color: #a2691a;
}

/* ---------- Toolbar ---------- */
.media-library-page .media-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}

.media-library-page .media-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.media-library-page .media-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #f3f4fa;
    color: #536176;
    font-size: 12.5px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.media-library-page .media-tab span {
    font-weight: 600;
}

.media-library-page .media-tab span::before { content: "("; }
.media-library-page .media-tab span::after  { content: ")"; }

.media-library-page .media-tab:hover {
    background: #eaecf7;
}

.media-library-page .media-tab.active {
    border-color: #e1e0ff;
    background: #fff;
    color: #4f46f5;
    box-shadow: inset 0 -2px 0 #4f46f5, 0 2px 8px rgba(79, 70, 245, 0.08);
}

/* Search + selects */
.media-library-page .media-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.media-library-page .media-search {
    position: relative;
    display: block;
    width: 280px;
}

.media-library-page .media-search i {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    color: #94a0b6;
    font-size: 12px;
    pointer-events: none;
}

.media-library-page .media-search input,
.media-library-page .media-select {
    min-height: 40px;
    border: 1px solid #dfe4ee;
    border-radius: 10px;
    background-color: #fff;
    color: #344059;
    font-family: inherit;
    font-size: 12.5px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.media-library-page .media-search input {
    width: 100%;
    padding: 0 13px 0 36px;
}

.media-library-page .media-search input::placeholder {
    color: #9aa4b8;
}

.media-library-page .media-select {
    min-width: 140px;
    padding: 0 34px 0 13px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7690' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    cursor: pointer;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
}

.media-library-page .media-search input:hover,
.media-library-page .media-select:hover {
    border-color: #cdd4e2;
}

.media-library-page .media-search input:focus,
.media-library-page .media-select:focus {
    border-color: #5d50f0;
    box-shadow: 0 0 0 3px rgba(93, 80, 240, 0.12);
}

.media-library-page .media-search-submit {
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid #dfe4f2;
    border-radius: 10px;
    background: #eef0fb;
    color: #4f46f5;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.media-library-page .media-search-submit:hover {
    background: #e3e6f8;
}

/* ---------- Media grid ---------- */
.media-library-page .media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

.media-library-page .media-item {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(25, 39, 75, 0.04);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.media-library-page .media-item:hover {
    transform: translateY(-3px);
    border-color: #dcdffa;
    box-shadow: 0 14px 30px rgba(25, 39, 75, 0.1);
}

.media-library-page .media-preview {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eef0f7;
}

.media-library-page .media-thumbnail {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.35s;
}

.media-library-page .media-item:hover .media-thumbnail {
    transform: scale(1.05);
}

/* Type badge (top-left) */
.media-library-page .media-type-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 7px;
    background: rgba(20, 26, 46, 0.62);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.media-library-page .media-type-badge i {
    font-size: 10px;
}

/* Video label (bottom-right) */
.media-library-page .media-video-duration {
    position: absolute;
    right: 9px;
    bottom: 9px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 7px;
    background: rgba(20, 26, 46, 0.7);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    pointer-events: none;
}

.media-library-page .media-video-duration i {
    font-size: 8px;
}

/* Centered play button */
.media-library-page .media-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    background: rgba(20, 26, 46, 0.55);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(3px);
    transition: transform 0.2s, background 0.2s;
}

.media-library-page .media-video-play i {
    margin-left: 3px;
}

.media-library-page .media-video-play:hover {
    background: rgba(79, 70, 245, 0.85);
    transform: translate(-50%, -50%) scale(1.08);
}

/* Delete (top-right, shown on hover) */
.media-library-page .media-delete-form {
    position: absolute;
    top: 9px;
    right: 9px;
    margin: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s, transform 0.2s;
}

.media-library-page .media-item:hover .media-delete-form,
.media-library-page .media-delete-form:focus-within {
    opacity: 1;
    transform: none;
}

.media-library-page .media-delete-button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.95);
    color: #c0392b;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.18);
    transition: background 0.2s, color 0.2s;
}

.media-library-page .media-delete-button:hover {
    background: #c0392b;
    color: #fff;
}

/* File information */
.media-library-page .media-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
}

.media-library-page .media-file-icon {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    background: #eeecff;
    color: #5b4fe8;
    font-size: 12px;
}

.media-library-page .media-file-details {
    flex: 1;
    min-width: 0;
}

.media-library-page .media-filename {
    margin: 0 0 3px;
    overflow: hidden;
    color: #1b2339;
    font-size: 12.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-library-page .media-file-meta {
    display: block;
    color: #8a95ab;
    font-size: 11px;
}

/* ---------- Empty state ---------- */
.media-library-page .media-empty-state {
    padding: 56px 16px 60px;
    border: 1.5px dashed #cdd5e6;
    border-radius: 16px;
    background: #f9fafe;
    text-align: center;
}

.media-library-page .media-empty-icon {
    display: grid;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 16px;
    background: #f0eeff;
    color: #6657ed;
    font-size: 22px;
}

.media-library-page .media-empty-state h2 {
    margin: 0 0 8px;
    color: #131a2e;
    font-size: 16px;
    font-weight: 600;
}

.media-library-page .media-empty-state p {
    max-width: 360px;
    margin: 0 auto 20px;
    color: #8791a6;
    font-size: 12.5px;
    line-height: 1.7;
}

/* ---------- Preview modal ---------- */
body.media-modal-open {
    overflow: hidden;
}

.media-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.media-preview-modal[hidden] {
    display: none;
}

.media-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 20, 40, 0.72);
    backdrop-filter: blur(4px);
}

.media-preview-dialog {
    position: relative;
    width: 100%;
    max-width: 960px;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 30px 70px rgba(10, 14, 30, 0.45);
}

.media-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px 14px 22px;
    border-bottom: 1px solid #e9edf5;
}

.media-preview-header h3 {
    margin: 0;
    overflow: hidden;
    color: #131a2e;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-preview-close {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid #e1e7f0;
    border-radius: 50%;
    background: #fff;
    color: #536176;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.media-preview-close:hover {
    background: #fff1f0;
    color: #c0392b;
}

.media-preview-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #0f1424;
}

.media-preview-full {
    display: block;
    max-width: 100%;
    max-height: 74vh;
    border-radius: 8px;
    object-fit: contain;
}

/* ---------- Responsive ---------- */
@media (hover: none) {
    .media-library-page .media-delete-form {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 900px) {
    .media-library-page {
        margin: 14px;
        padding: 20px;
    }

    .media-library-page .media-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .media-library-page .media-search {
        flex: 1 1 100%;
        width: auto;
    }
}

@media (max-width: 560px) {
    .media-library-page .media-header .media-upload-button {
        width: 100%;
    }

    .media-library-page .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .media-library-page .media-select {
        flex: 1 1 120px;
        min-width: 0;
    }

    .media-library-page .media-item-info {
        padding: 9px 10px;
    }

    .media-library-page .media-file-icon {
        display: none;
    }

    .media-preview-modal {
        padding: 12px;
    }
}
/* =========================================================
   AD CAMPAIGNS: complete stylesheet (Ads Manager, Create, Edit, View,
   popups and the Meta ad preview).

   HOW TO USE
   1. Delete the OLD ad-campaign CSS from your main CSS file
      (the "AD CAMPAIGNS ... META AD PREVIEW" block and the "POLISH LAYER" block,
      and any popup CSS I gave you before).
   2. Paste this whole file at the END of your main CSS file
      (or save it as static/css/ad_campaigns.css and link it in base.html).
   Everything here is prefixed ac- / adp- so it cannot clash with other pages.
   ========================================================= */

.ac-page,
.ac-toasts,
.ac-modal {
    --ac-brand: #3b4fe0;
    --ac-brand-dark: #2f3fc4;
    --ac-brand-soft: #eef1ff;
    --ac-ring: rgba(59, 79, 224, 0.16);
    --ac-ink: #0f172a;
    --ac-text: #334155;
    --ac-muted: #64748b;
    --ac-line: #e6e9f2;
    --ac-danger: #d9382c;
    --ac-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.05);
    --ac-shadow-lg: 0 1px 2px rgba(15, 23, 42, 0.05), 0 16px 36px rgba(15, 23, 42, 0.12);
}

.ac-page {
    color: var(--ac-text);
}

/* ---------- Header ---------- */
.ac-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 22px;
}

.ac-header h1 {
    margin: 0 0 6px;
    color: var(--ac-ink);
    font-size: 21.5px;
    font-weight: 700;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.ac-header p {
    max-width: 580px;
    margin: 0;
    color: var(--ac-muted);
    font-size: 13.5px;
    line-height: 1.6;
}

.ac-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ac-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 10px;
    color: #8a95ab;
    font-size: 12px;
    font-weight: 500;
}

.ac-crumbs a {
    color: var(--ac-muted);
    transition: color 0.2s;
}

.ac-crumbs a:hover {
    color: var(--ac-brand);
}

.ac-crumbs i {
    color: #c4cada;
    font-size: 8px;
}

.ac-crumbs span {
    color: var(--ac-ink);
    font-weight: 600;
}

/* ---------- Buttons ---------- */
.ac-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.ac-btn:active {
    transform: translateY(1px);
}

.ac-btn:focus-visible,
.ac-icon-btn:focus-visible,
.ac-tab:focus-visible {
    outline: 2px solid var(--ac-brand);
    outline-offset: 2px;
}

.ac-btn i {
    font-size: 12px;
}

.ac-btn-primary {
    background: var(--ac-brand);
    color: #fff;
    box-shadow: 0 2px 6px rgba(59, 79, 224, 0.3);
}

.ac-btn-primary:hover {
    background: var(--ac-brand-dark);
}

.ac-btn-soft {
    background: var(--ac-brand-soft);
    color: var(--ac-brand);
}

.ac-btn-soft:hover {
    background: #dfe5ff;
}

.ac-btn-ghost {
    border-color: #dbe0ec;
    background: #fff;
    color: #475569;
}

.ac-btn-ghost:hover {
    border-color: #b9c1d3;
    background: #f8fafc;
}

.ac-btn-danger {
    background: var(--ac-danger);
    color: #fff;
    box-shadow: 0 2px 6px rgba(217, 56, 44, 0.3);
}

.ac-btn-danger:hover {
    background: #c0392b;
}

.ac-btn-sm {
    min-height: 36px;
    padding: 0 16px;
    font-size: 12.5px;
}

/* ---------- Cards ---------- */
.ac-card {
    min-width: 0;
    padding: 24px 26px;
    background: #fff;
    border: 1px solid var(--ac-line);
    border-radius: 16px;
    box-shadow: var(--ac-shadow);
}

.ac-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
    color: var(--ac-ink);
    font-size: 15.5px;
    font-weight: 600;
}

.ac-title > i {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    background: var(--ac-brand-soft);
    color: var(--ac-brand);
    font-size: 12px;
}

.ac-sub {
    margin: 0 0 20px 40px;
    color: #8a95ab;
    font-size: 12.5px;
    line-height: 1.5;
}

/* ---------- Tabs (like All Posts) ---------- */
.ac-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.ac-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: #f3f5fa;
    color: #536176;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.ac-tab:hover {
    background: #e9edf8;
}

.ac-tab.is-active {
    border-color: #c7d0fb;
    background: var(--ac-brand-soft);
    color: var(--ac-brand);
}

.ac-count {
    font-variant-numeric: tabular-nums;
}

.ac-count::before {
    content: "(";
}

.ac-count::after {
    content: ")";
}

/* ---------- Filters ---------- */
.ac-list-card {
    padding: 20px 22px 10px;
}

.ac-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.ac-search {
    position: relative;
    display: block;
    flex: 0 1 340px;
    min-width: 200px;
}

.ac-search i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: #94a0b6;
    font-size: 12px;
    pointer-events: none;
    transform: translateY(-50%);
}

.ac-search input,
.ac-select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #dbe0ec;
    border-radius: 10px;
    background-color: #fff;
    color: var(--ac-text);
    font-family: inherit;
    font-size: 12.5px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ac-search input {
    padding: 0 13px 0 36px;
}

.ac-search input::placeholder {
    color: #9aa4b8;
}

.ac-select,
select.ac-input {
    padding-right: 34px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7690' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}

.ac-select {
    width: auto;
    min-width: 150px;
    padding-left: 13px;
}

.ac-search input:hover,
.ac-select:hover {
    border-color: #cdd4e2;
}

.ac-search input:focus,
.ac-select:focus {
    border-color: var(--ac-brand);
    box-shadow: 0 0 0 3px var(--ac-ring);
}

.ac-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--ac-brand);
    font-size: 12.5px;
    font-weight: 600;
}

.ac-reset:hover {
    background: var(--ac-brand-soft);
}

/* ---------- Table ---------- */
.ac-table-scroll {
    overflow-x: auto;
}

.ac-table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.ac-table th {
    padding: 11px 14px;
    border-top: 1px solid var(--ac-line);
    border-bottom: 1px solid var(--ac-line);
    background: #f8f9fc;
    color: #8590a6;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ac-table th:first-child {
    padding-left: 16px;
    border-left: 1px solid var(--ac-line);
    border-radius: 10px 0 0 10px;
}

.ac-table th:last-child {
    border-right: 1px solid var(--ac-line);
    border-radius: 0 10px 10px 0;
}

.ac-table td {
    padding: 16px 14px;
    border-bottom: 1px solid #f0f2f7;
    color: var(--ac-text);
    font-size: 12.5px;
    vertical-align: middle;
}

.ac-table td:first-child {
    padding-left: 16px;
}

.ac-table tbody tr:last-child td {
    border-bottom: 0;
}

.ac-table tbody tr:hover {
    background: #f8f9fe;
}

.ac-th-actions,
.ac-td-actions {
    text-align: right;
}

.ac-camp {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ac-camp-ico {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #8c7bff, #4b58e8);
    color: #fff;
    font-size: 16px;
}

.ac-camp-text {
    min-width: 0;
}

.ac-name {
    display: block;
    max-width: 280px;
    overflow: hidden;
    color: var(--ac-ink);
    font-size: 13.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-name:hover {
    color: var(--ac-brand);
}

.ac-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    color: #96a0b5;
    font-size: 11.5px;
}

.ac-meta i {
    font-size: 10px;
}

.ac-num {
    font-variant-numeric: tabular-nums;
}

.ac-date {
    display: block;
    color: var(--ac-ink);
    font-size: 12.5px;
    font-weight: 500;
}

.ac-time {
    display: block;
    margin-top: 3px;
    color: #8a95ab;
    font-size: 11.5px;
}

.ac-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.ac-row-actions form {
    margin: 0;
}

.ac-icon-btn {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 1px solid #e3e7f1;
    border-radius: 10px;
    background: #fff;
    color: #5b6781;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ac-icon-btn:hover {
    border-color: #cfd4ff;
    background: #f1f0ff;
    color: var(--ac-brand);
}

.ac-icon-btn.is-danger:hover {
    border-color: #f3c9c4;
    background: #fff1f0;
    color: #c0392b;
}

/* ---------- Status pills ---------- */
.ac-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 98px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    background: #eff1f6;
    color: #66718a;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.ac-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ac-status.is-draft {
    background: #ffecd6;
    color: #cf7a1f;
}

.ac-status.is-active {
    background: #dff6e8;
    color: #17874f;
}

.ac-status.is-paused {
    background: #ffecd6;
    color: #cf7a1f;
}

.ac-status.is-publishing,
.ac-status.is-pending_review {
    background: #e3ecff;
    color: #3566d6;
}

.ac-status.is-failed {
    background: #ffe6e3;
    color: #c0392b;
}

/* ---------- Empty state ---------- */
.ac-empty {
    padding: 56px 16px 60px;
    text-align: center;
}

.ac-empty-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 15px;
    background: #f0eeff;
    color: #6657ed;
    font-size: 20px;
}

.ac-empty h3 {
    margin: 0 0 8px;
    color: var(--ac-ink);
    font-size: 15px;
}

.ac-empty p {
    max-width: 360px;
    margin: 0 auto 20px;
    color: #8791a6;
    font-size: 12.5px;
    line-height: 1.7;
}

.ac-empty-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- KPI cards (view page) ---------- */
.ac-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.ac-kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--ac-line);
    border-radius: 16px;
    box-shadow: var(--ac-shadow);
}

.ac-kpi > div {
    min-width: 0;
}

.ac-kpi strong {
    display: block;
    overflow: hidden;
    color: var(--ac-ink);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-kpi span:not(.ac-kpi-icon) {
    display: block;
    margin-top: 5px;
    color: #7b869c;
    font-size: 11.5px;
}

.ac-kpi-icon {
    display: grid;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 50%;
    font-size: 17px;
}

.ac-kpi-icon.is-purple {
    background: linear-gradient(145deg, #f1eeff, #dcd5ff);
    color: #6a54e6;
}

.ac-kpi-icon.is-green {
    background: linear-gradient(145deg, #e6f9ef, #c5eed8);
    color: #1f9d62;
}

.ac-kpi-icon.is-orange {
    background: linear-gradient(145deg, #fff3e6, #ffdfbb);
    color: #e7842a;
}

.ac-kpi-icon.is-blue {
    background: linear-gradient(145deg, #e8f1ff, #c9deff);
    color: #3d7be8;
}

/* ---------- Two-column layout ---------- */
.ac-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
    gap: 22px;
    align-items: start;
}

.ac-main {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.ac-side {
    position: sticky;
    top: 20px;
    min-width: 0;
}

/* ---------- Fields ---------- */
.ac-field {
    min-width: 0;
    margin-bottom: 16px;
}

.ac-field:last-child {
    margin-bottom: 0;
}

.ac-field > label {
    display: block;
    margin-bottom: 7px;
    color: #2c3550;
    font-size: 12.5px;
    font-weight: 600;
}

.ac-input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #dbe0ec;
    border-radius: 10px;
    outline: none;
    background-color: #fff;
    color: #1b2339;
    font-family: inherit;
    font-size: 13.5px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ac-input::placeholder {
    color: #a2abbd;
}

.ac-input:hover {
    border-color: #c5cddd;
}

.ac-input:focus {
    border-color: var(--ac-brand);
    box-shadow: 0 0 0 4px var(--ac-ring);
}

.ac-input.is-invalid {
    border-color: #e5534b;
    box-shadow: 0 0 0 4px rgba(229, 83, 75, 0.12);
    animation: acShake 0.35s ease;
}

.ac-help {
    display: block;
    margin-top: 7px;
    color: #8a95ab;
    font-size: 12px;
    line-height: 1.5;
}

.ac-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ac-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ac-row .ac-field {
    margin-bottom: 16px;
}

.ac-row:last-child .ac-field {
    margin-bottom: 0;
}

/* ---------- Chips ---------- */
.ac-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.ac-chips[hidden] {
    display: none;
}

.ac-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 8px;
    background: #f1f3f9;
    color: #55617a;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: capitalize;
}

.ac-meta-chip i {
    color: #8a95ab;
    font-size: 11px;
}

.ac-placements {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ac-chip {
    position: relative;
    cursor: pointer;
}

.ac-chip input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.ac-chip span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #dbe0ec;
    border-radius: 10px;
    background: #fff;
    color: #55617a;
    font-size: 12.5px;
    font-weight: 600;
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.ac-chip:hover span {
    border-color: #c7d0fb;
}

.ac-chip input:checked + span {
    border-color: var(--ac-brand);
    background: var(--ac-brand-soft);
    color: var(--ac-brand);
    box-shadow: 0 0 0 3px rgba(59, 79, 224, 0.1);
}

.ac-chip input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(59, 79, 224, 0.3);
}

.ac-caption {
    margin: 14px 0 0;
    padding: 14px 16px;
    border: 1px solid var(--ac-line);
    border-radius: 12px;
    background: #fafbff;
    color: #2c3550;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ac-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.ac-thumb {
    width: 96px;
    height: 96px;
    overflow: hidden;
    border: 1px solid var(--ac-line);
    border-radius: 12px;
    background: #eef0f7;
}

.ac-thumb img,
.ac-thumb video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac-empty-note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1.5px dashed #cdd5e6;
    border-radius: 12px;
    background: #f9fafe;
    color: #8791a6;
    font-size: 12.5px;
}

/* ---------- Bottom action bar ---------- */
.ac-actions {
    position: sticky;
    bottom: 16px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    border: 1px solid var(--ac-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--ac-shadow-lg);
}

/* ---------- Summary list (view page) ---------- */
.ac-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
    margin: 0;
}

.ac-list > div {
    min-width: 0;
    padding: 14px 0;
    border-bottom: 1px solid #f0f2f7;
}

.ac-list > div.is-wide {
    grid-column: 1 / -1;
}

.ac-list dt {
    margin-bottom: 5px;
    color: #8a95ab;
    font-size: 11.5px;
}

.ac-list dd {
    margin: 0;
    color: var(--ac-ink);
    font-size: 13.5px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* =========================================================
   POPUPS: toasts + confirm dialog
   ========================================================= */
.ac-toasts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1200;
    display: grid;
    gap: 12px;
    width: min(390px, calc(100vw - 32px));
    pointer-events: none;
}

.ac-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 15px 12px 17px 16px;
    overflow: hidden;
    border: 1px solid #e5e9f3;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--ac-shadow-lg);
    pointer-events: auto;
    animation: acToastIn 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ac-toast.is-leaving {
    animation: acToastOut 0.26s ease forwards;
}

.ac-toast-icon {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    font-size: 16px;
}

.ac-toast.is-success .ac-toast-icon {
    background: #e5f7ee;
    color: #17874f;
}

.ac-toast.is-error .ac-toast-icon {
    background: #ffe6e3;
    color: #c0392b;
}

.ac-toast.is-warning .ac-toast-icon {
    background: #fff1d9;
    color: #cf7a1f;
}

.ac-toast.is-info .ac-toast-icon {
    background: #e8edff;
    color: var(--ac-brand);
}

.ac-toast-text {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.ac-toast-text strong {
    display: block;
    margin-bottom: 3px;
    color: #131a2e;
    font-size: 13.5px;
    font-weight: 600;
}

.ac-toast-text span {
    display: block;
    color: #66718a;
    font-size: 12.5px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.ac-toast-close {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ac-toast-close:hover {
    background: #f1f5f9;
    color: #334155;
}

.ac-toast-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    transform-origin: left;
    animation: acToastBar linear forwards;
}

.ac-toast.is-success .ac-toast-bar {
    background: #21b477;
}

.ac-toast.is-error .ac-toast-bar {
    background: #e5534b;
}

.ac-toast.is-warning .ac-toast-bar {
    background: #f0a23b;
}

.ac-toast.is-info .ac-toast-bar {
    background: var(--ac-brand);
}

body.ac-modal-open {
    overflow: hidden;
}

.ac-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ac-modal[hidden] {
    display: none;
}

.ac-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.ac-modal-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 28px 26px 22px;
    border-radius: 20px;
    background: #fff;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
    animation: acModalIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ac-modal-icon {
    display: grid;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 50%;
    background: var(--ac-brand-soft);
    color: var(--ac-brand);
    font-size: 22px;
}

.ac-modal-icon.is-danger {
    background: #ffe6e3;
    color: #c0392b;
}

.ac-modal-card h3 {
    margin: 0 0 8px;
    color: #131a2e;
    font-size: 16px;
    font-weight: 600;
}

.ac-modal-card p {
    margin: 0;
    color: #66718a;
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.ac-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.ac-modal-actions .ac-btn {
    flex: 1;
}

@keyframes acToastIn {
    from { opacity: 0; transform: translateX(26px); }
    to { opacity: 1; transform: none; }
}

@keyframes acToastOut {
    to { opacity: 0; transform: translateX(26px); }
}

@keyframes acToastBar {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@keyframes acModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

@keyframes acShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* =========================================================
   META AD PREVIEW (_ad_preview.html)
   ========================================================= */
.adp {
    padding: 22px;
    border: 1px solid var(--ac-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--ac-shadow);
}

.adp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ac-line);
}

.adp-head h2 {
    margin: 0;
    color: var(--ac-ink);
    font-size: 15px;
    font-weight: 600;
}

.adp-pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: #ffecd6;
    color: #cf7a1f;
    font-size: 11px;
    font-weight: 600;
}

.adp-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    padding: 4px;
    border-radius: 11px;
    background: #f3f4fa;
}

.adp-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #536176;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.adp-tab:hover {
    color: var(--ac-ink);
}

.adp-tab.is-active {
    background: #fff;
    color: var(--ac-brand);
    box-shadow: 0 2px 8px rgba(25, 39, 75, 0.1);
}

.adp-tab:focus-visible {
    outline: 2px solid var(--ac-brand);
    outline-offset: 1px;
}

.adp-stage {
    display: flex;
    justify-content: center;
    padding: 26px 14px;
    border: 1px solid #e8eaf6;
    border-radius: 14px;
    background: linear-gradient(160deg, #f0f2fc, #f7f3fc);
}

.adp-phone {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border-radius: 38px;
    background: linear-gradient(160deg, #232c45, #121827);
    box-shadow: 0 24px 48px rgba(21, 28, 46, 0.3);
}

.adp-phone[hidden] {
    display: none;
}

.adp-screen {
    position: relative;
    overflow: hidden;
    border-radius: 31px;
    background: #fff;
    color: #111827;
    font-size: 12px;
}

.adp-screen::before {
    content: "";
    display: block;
    width: 84px;
    height: 20px;
    margin: 0 auto;
    border-radius: 0 0 14px 14px;
    background: #151c2e;
}

.adp-avatar {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #8278ff, #4e54d9);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.adp-avatar-ig {
    padding: 2px;
    background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
}

.adp-avatar-ig b {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #4e54d9;
    font-size: 12px;
}

.adp-who {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
}

.adp-who strong {
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adp-who small {
    color: #65676b;
    font-size: 11px;
}

.adp-dots {
    color: #65676b;
}

.adp-media {
    position: relative;
    overflow: hidden;
    background: #f0f2f5;
}

/* Show the whole image: natural ratio, never cropped */
.adp-media img,
.adp-media video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 380px;
    margin: 0 auto;
    object-fit: contain;
}

.adp-count {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
}

.adp-empty {
    display: grid;
    min-height: 220px;
    place-content: center;
    justify-items: center;
    gap: 8px;
    padding: 16px;
    color: #9aa4b8;
    font-size: 11.5px;
    text-align: center;
}

.adp-empty i {
    font-size: 23.5px;
}

.adp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.adp-btn-light {
    background: #e4e6eb;
    color: #050505;
}

.adp-fb-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px 6px;
}

.adp-text,
.adp-ig-caption {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.adp-text {
    padding: 2px 12px 10px;
    font-size: 12.5px;
}

.adp-cta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: #f0f2f5;
}

.adp-cta-bar div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.adp-cta-bar small {
    color: #65676b;
    font-size: 10.5px;
    text-transform: uppercase;
}

.adp-cta-bar strong {
    overflow: hidden;
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adp-react {
    display: flex;
    justify-content: space-between;
    padding: 9px 12px;
    color: #65676b;
    font-size: 11px;
}

.adp-react-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    vertical-align: -1px;
    border-radius: 50%;
    background: #1877f2;
}

.adp-actions {
    display: flex;
    justify-content: space-around;
    padding: 8px 6px 14px;
    border-top: 1px solid #e4e6eb;
    color: #65676b;
    font-size: 11.5px;
    font-weight: 600;
}

.adp-actions i {
    margin-right: 4px;
}

.adp-ig-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
}

.adp-ig-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #0095f6;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.adp-ig-icons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 4px;
    font-size: 18px;
}

.adp-ig-icons span {
    display: inline-flex;
    gap: 14px;
}

.adp-ig-caption {
    padding: 4px 12px 16px;
    font-size: 12px;
}

.adp-story {
    aspect-ratio: 9 / 18;
    background: #000;
    color: #fff;
}

.adp-story::before {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 5;
    background: #000;
    transform: translateX(-50%);
}

.adp-story::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0, transparent 22%, transparent 55%, rgba(0, 0, 0, 0.72) 100%);
    pointer-events: none;
}

.adp-media-full {
    position: absolute;
    inset: 0;
    background: #000;
}

.adp-media-full img,
.adp-media-full video {
    height: 100%;
    max-height: none;
    object-fit: contain;
}

.adp-media-full .adp-empty {
    height: 100%;
    color: #cbd5e1;
}

.adp-story .adp-who small,
.adp-story .adp-who strong {
    color: #fff;
}

.adp-story-top {
    position: absolute;
    top: 28px;
    right: 12px;
    left: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 9px;
}

.adp-story-rail {
    position: absolute;
    right: 10px;
    bottom: 96px;
    z-index: 3;
    display: grid;
    gap: 16px;
    justify-items: center;
    font-size: 10.5px;
    font-weight: 600;
}

.adp-story-rail span {
    display: grid;
    justify-items: center;
    gap: 3px;
}

.adp-story-rail i {
    font-size: 19px;
}

.adp-story-bottom {
    position: absolute;
    right: 12px;
    bottom: 14px;
    left: 12px;
    z-index: 3;
    display: grid;
    gap: 10px;
}

.adp-story-bottom p {
    display: -webkit-box;
    max-width: 82%;
    margin: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.adp-btn-glass {
    width: 100%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.adp-note {
    display: flex;
    gap: 8px;
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f6f7fc;
    color: #8a95ab;
    font-size: 11.5px;
    line-height: 1.6;
}

.adp-note i {
    margin-top: 2px;
    color: var(--ac-brand);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
    .ac-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .ac-side {
        position: static;
        order: -1;
    }

    .ac-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ac-card {
        padding: 18px 16px;
    }

    .ac-sub {
        margin-left: 0;
    }

    .ac-row,
    .ac-row-3,
    .ac-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .ac-kpis {
        gap: 10px;
    }

    .ac-kpi {
        gap: 10px;
        padding: 14px;
    }

    .ac-kpi-icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .ac-kpi strong {
        font-size: 15px;
    }

    .ac-header .ac-btn,
    .ac-header-actions {
        width: 100%;
    }

    .ac-header-actions .ac-btn {
        flex: 1;
    }

    .ac-actions {
        bottom: 8px;
        padding: 10px;
    }

    .ac-actions .ac-btn {
        flex: 1;
    }

    .ac-search {
        flex: 1 1 100%;
    }

    .ac-select {
        flex: 1 1 140px;
        min-width: 0;
    }

    .ac-toasts {
        top: 12px;
        right: 12px;
    }

    .ac-modal-card {
        padding: 24px 20px 18px;
    }

    .ac-modal-actions {
        flex-direction: column-reverse;
    }

    .adp-tab {
        gap: 0;
        font-size: 0;
    }

    .adp-tab i {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ac-toast,
    .ac-modal-card,
    .ac-input.is-invalid {
        animation: none;
    }
}

/* =========================================================
   MANAGE ADS (Ads Manager index): summary cards, chart,
   top campaign, campaign table, row menu
   ========================================================= */
.ac-btn-lg {
    min-height: 46px;
    padding: 0 24px;
    border-radius: 11px;
    font-size: 14px;
}

.ac-status.is-completed {
    background: #eceff5;
    color: #536176;
}

/* Summary cards */
.ac-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.ac-stat {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
    padding: 20px 22px;
    border: 1px solid var(--ac-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--ac-shadow);
}

.ac-stat-ico {
    display: grid;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    place-items: center;
    border-radius: 16px;
    font-size: 22px;
}

.ac-stat-ico.is-blue {
    background: #e3ecff;
    color: #3566d6;
}

.ac-stat-ico.is-purple {
    background: #ece8ff;
    color: #6a54e6;
}

.ac-stat-ico.is-green {
    background: #dff6e8;
    color: #1f9d62;
}

.ac-stat-ico.is-orange {
    background: #ffecd6;
    color: #e7842a;
}

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

.ac-stat-label {
    display: block;
    color: var(--ac-ink);
    font-size: 13px;
    font-weight: 600;
}

.ac-stat-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 6px 0 4px;
}

.ac-stat-row strong {
    color: var(--ac-ink);
    font-size: 23.5px;
    font-weight: 700;
    letter-spacing: -0.6px;
    line-height: 1.1;
}

.ac-stat-body small {
    display: block;
    color: #7b869c;
    font-size: 12px;
}

.ac-delta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dff6e8;
    color: #17874f;
    font-size: 11.5px;
    font-weight: 600;
}

.ac-delta i {
    font-size: 10px;
}

.ac-delta.is-down {
    background: #ffe6e3;
    color: #c0392b;
}

/* Chart + top campaign */
.ac-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.ac-panel {
    padding: 22px 24px;
}

.ac-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.ac-panel-head h2 {
    margin: 0;
    color: var(--ac-ink);
    font-size: 16px;
    font-weight: 600;
}

.ac-link {
    color: var(--ac-brand);
    font-size: 13px;
    font-weight: 600;
}

.ac-link:hover {
    text-decoration: underline;
}

.ac-legend {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #536176;
    font-size: 12.5px;
}

.ac-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.ac-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.ac-legend-dot.is-a {
    background: #3b4fe0;
}

.ac-legend-dot.is-b {
    background: #a99cf5;
}

.ac-chart svg {
    display: block;
    width: 100%;
    height: auto;
}

.ac-chart .ac-grid {
    stroke: #e9edf5;
    stroke-width: 1;
}

.ac-chart .ac-axis {
    fill: #7b869c;
    font-size: 11px;
}

.ac-chart .ac-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

.ac-chart .ac-line.is-a {
    stroke: #3b4fe0;
}

.ac-chart .ac-line.is-b {
    stroke: #a99cf5;
}

.ac-chart .ac-area.is-a {
    fill: rgba(59, 79, 224, 0.1);
}

.ac-chart .ac-area.is-b {
    fill: rgba(169, 156, 245, 0.1);
}

.ac-chart .ac-dot-pt.is-a {
    fill: #3b4fe0;
}

.ac-chart .ac-dot-pt.is-b {
    fill: #a99cf5;
}

.ac-chart-empty {
    display: grid;
    min-height: 220px;
    place-content: center;
    justify-items: center;
    gap: 8px;
    padding: 20px;
    border: 1.5px dashed #cdd5e6;
    border-radius: 14px;
    background: #f9fafe;
    color: #8791a6;
    font-size: 12.5px;
    text-align: center;
}

.ac-chart-empty i {
    color: #6657ed;
    font-size: 23.5px;
}

.ac-chart-empty strong {
    color: var(--ac-ink);
    font-size: 14px;
}

.ac-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ac-top-media {
    display: grid;
    flex: 0 0 112px;
    width: 112px;
    height: 112px;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(145deg, #8c7bff, #4b58e8);
    color: #fff;
    font-size: 30px;
}

.ac-top-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac-top-info {
    min-width: 0;
}

.ac-top-info strong {
    display: block;
    margin-bottom: 10px;
    color: var(--ac-ink);
    font-size: 16px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.ac-top-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ac-top-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--ac-line);
}

.ac-top-metrics > div {
    padding: 0 10px;
    border-left: 1px solid var(--ac-line);
}

.ac-top-metrics > div:first-child {
    padding-left: 0;
    border-left: 0;
}

.ac-top-metrics strong {
    display: block;
    color: var(--ac-ink);
    font-size: 16px;
    font-weight: 700;
}

.ac-top-metrics span {
    display: block;
    margin-top: 4px;
    color: #7b869c;
    font-size: 11.5px;
}

/* Platform */
.ac-plat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ac-ink);
    font-size: 12.5px;
    font-weight: 500;
}

.ac-plat-ico {
    display: inline-grid;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
}

.ac-plat-ico.is-instagram {
    background: linear-gradient(135deg, #833ab4, #e1306c 55%, #f77737);
}

.ac-plat-ico.is-facebook {
    border-radius: 50%;
    background: #1877f2;
    font-size: 12px;
}

.ac-plat-ico.is-auto {
    background: #8c97ad;
    font-size: 12px;
}

/* Table toolbar */
.ac-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.ac-toolbar-title {
    margin: 0;
    color: var(--ac-ink);
    font-size: 17px;
    font-weight: 600;
}

.ac-toolbar .ac-filters {
    margin: 0;
}

.ac-select-wrap {
    position: relative;
    display: block;
}

.ac-select-wrap > i {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    color: #66718a;
    font-size: 13px;
    pointer-events: none;
    transform: translateY(-50%);
}

.ac-select-wrap .ac-select {
    padding-left: 36px;
}

/* Table cells */
.ac-ctable {
    min-width: 1040px;
}

.ac-camp-thumb {
    display: grid;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(145deg, #8c7bff, #4b58e8);
    color: #fff;
    font-size: 18px;
}

.ac-camp-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac-ctable .ac-name {
    max-width: 260px;
    white-space: normal;
}

.ac-desc {
    display: -webkit-box;
    max-width: 260px;
    margin: 4px 0 0;
    overflow: hidden;
    color: #7b869c;
    font-size: 12px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ac-budget strong {
    display: block;
    color: var(--ac-ink);
    font-size: 13px;
    font-weight: 600;
}

.ac-budget strong small {
    color: #536176;
    font-size: 12px;
    font-weight: 500;
}

.ac-budget span {
    display: block;
    margin: 4px 0 8px;
    color: #7b869c;
    font-size: 12px;
}

.ac-progress {
    width: 120px;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9edf5;
}

.ac-progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--ac-brand);
}

.ac-results {
    display: flex;
    gap: 22px;
}

.ac-results strong {
    display: block;
    color: var(--ac-ink);
    font-size: 14px;
    font-weight: 600;
}

.ac-results span {
    display: block;
    margin-top: 3px;
    color: #7b869c;
    font-size: 11.5px;
}

/* Row menu */
.ac-actions-cell {
    display: inline-block;
}

.ac-more {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 1px solid #dbe0ec;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ac-more:hover,
.ac-more[aria-expanded="true"] {
    border-color: #c7d0fb;
    background: var(--ac-brand-soft);
    color: var(--ac-brand);
}

.ac-more:focus-visible {
    outline: 2px solid var(--ac-brand);
    outline-offset: 2px;
}

.ac-menu {
    position: fixed;
    z-index: 60;
    min-width: 180px;
    padding: 6px;
    border: 1px solid #e5e9f3;
    border-radius: 12px;
    background: #fff;
    text-align: left;
    box-shadow: var(--ac-shadow-lg);
}

.ac-menu[hidden] {
    display: none;
}

.ac-menu form {
    margin: 0;
}

.ac-menu a,
.ac-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ac-text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.ac-menu i {
    width: 14px;
    color: #8a95ab;
    text-align: center;
}

.ac-menu a:hover,
.ac-menu button:hover {
    background: #f4f5fb;
}

.ac-menu .is-danger,
.ac-menu .is-danger i {
    color: #c0392b;
}

.ac-menu .is-danger:hover {
    background: #fff1f0;
}

.ac-menu-sep {
    height: 1px;
    margin: 5px 4px;
    background: #f0f2f7;
}

@media (max-width: 1200px) {
    .ac-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ac-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .ac-stats {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .ac-panel {
        padding: 18px 16px;
    }

    .ac-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .ac-top-media {
        flex-basis: auto;
        width: 100%;
        height: 160px;
    }

    .ac-toolbar .ac-filters,
    .ac-toolbar .ac-select-wrap {
        width: 100%;
    }

    .ac-toolbar .ac-select-wrap .ac-select {
        width: 100%;
    }
}
.ac-camp-thumb { overflow: hidden; }
.ac-camp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
} 
/* =========================================================
   MANAGE ADS: UI fixes (paste at the END of the CSS file)
   ========================================================= */

/* ---------- Stat cards: vertically centred ---------- */
.ac-stat { align-items: center; }

/* ---------- Chart + Top Campaign: equal height, no dead space ---------- */
.ac-grid-2 { align-items: stretch; }

.ac-grid-2 > .ac-panel {
    display: flex;
    flex-direction: column;
}

.ac-grid-2 .ac-chart {
    display: flex;
    flex: 1;
    align-items: center;
}

.ac-grid-2 .ac-chart-empty {
    flex: 1;
    min-height: 200px;
}

.ac-top { margin-bottom: 22px; }

.ac-top-media {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    border: 1px solid var(--ac-line);
}

/* pushes the metrics row to the bottom of the card */
.ac-top-metrics { margin-top: auto; }

/* ---------- Toolbar: title left, filters right, one row ---------- */
.ac-toolbar {
    flex-wrap: nowrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.ac-toolbar-title { flex: 0 0 auto; }

.ac-toolbar .ac-filters {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    min-width: 0;
}

.ac-toolbar .ac-search {
    flex: 1 1 220px;
    min-width: 150px;
    max-width: 360px;
}

.ac-toolbar .ac-select,
.ac-toolbar .ac-select-wrap {
    flex: 0 0 auto;
}

/* ---------- Table: balanced columns ---------- */
.ac-ctable {
    table-layout: fixed;
    min-width: 1000px;
}

.ac-ctable th:nth-child(1) { width: 25%; }
.ac-ctable th:nth-child(2) { width: 15%; }
.ac-ctable th:nth-child(3) { width: 14%; }
.ac-ctable th:nth-child(4) { width: 20%; }
.ac-ctable th:nth-child(5) { width: 12%; }
.ac-ctable th:nth-child(6) { width: 12%; }
.ac-ctable th:nth-child(7) { width: 70px; }

.ac-camp-text { min-width: 0; }

.ac-ctable .ac-name,
.ac-ctable .ac-desc { max-width: 100%; }

/* Results: numbers and labels line up */
.ac-results { gap: 18px; }

.ac-results > div { min-width: 46px; }

.ac-results span { white-space: nowrap; }

/* ---------- Thumbnails: visible edge on light images ---------- */
.ac-camp-thumb {
    flex: 0 0 56px;
    border: 1px solid var(--ac-line);
    background-color: #f1f3f9;
}

/* ---------- Smaller screens: let the toolbar wrap ---------- */
@media (max-width: 1100px) {
    .ac-toolbar { flex-wrap: wrap; }

    .ac-toolbar .ac-filters {
        flex: 1 1 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .ac-toolbar .ac-search {
        flex: 1 1 100%;
        max-width: none;
    }
} 
/* ---------- Pagination ---------- */
.ac-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 6px;
    padding: 16px 4px 12px;
    border-top: 1px solid #f0f2f7;
}

.ac-pager-info {
    color: var(--ac-text);
    font-size: 14px;
    text-align: center;
}

.ac-pager-info strong {
    color: var(--ac-ink);
    font-weight: 700;
}

.ac-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    min-height: 44px;
    padding: 0 22px;
    border: 1px solid #e6e9f2;
    border-radius: 12px;
    background: #fff;
    color: var(--ac-ink);
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

a.ac-pager-btn:hover {
    border-color: #c7d0fb;
    background: var(--ac-brand-soft);
    color: var(--ac-brand);
}

a.ac-pager-btn:focus-visible {
    outline: 2px solid var(--ac-brand);
    outline-offset: 2px;
}

.ac-pager-btn.is-disabled {
    border-color: #eef0f6;
    background: #fafbfe;
    color: #b6bfd0;
    cursor: not-allowed;
}

@media (max-width: 520px) {
    .ac-pager-btn { min-width: 0; padding: 0 16px; }
    .ac-pager-info { font-size: 13px; }
}


/* Content Calendar post media */
.calendar-post-media {
    display: block;
    width: 100%;
    max-height: 90px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 5px;
}

.calendar-post-platform {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    margin-bottom: 3px;
}

.calendar-post-caption {
    display: block;
    overflow-wrap: anywhere;
}

/* ---------- Unscheduled posts (Content Calendar) ---------- */
.unscheduled-posts-section {
    padding: 22px 24px 24px;
    border-top: 1px solid #edf0f6;
    background: #fbfcfe;
}

.unscheduled-posts-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    color: #111827;
    font-size: 15px;
    font-weight: 600;
}

.unscheduled-posts-section h3 > i {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    background: #eeecff;
    color: #4f46f5;
    font-size: 13px;
}

#unscheduledPostsCount {
    min-width: 24px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #eaedff;
    color: #4f46f5;
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.unscheduled-posts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.unscheduled-posts-list:empty {
    display: none;
}

.unscheduled-posts-list .calendar-post-item {
    margin-top: 0;
    padding: 10px 12px;
    background-clip: padding-box;
}

.unscheduled-posts-list .calendar-post-thumb {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
}

#unscheduledPostsEmpty {
    margin: 0;
    padding: 22px 16px;
    border: 1.5px dashed #cdd5e6;
    border-radius: 14px;
    background: #f9fafe;
    color: #8791a6;
    font-size: 12.5px;
    text-align: center;
}

#unscheduledPostsEmpty[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .unscheduled-posts-section { padding: 18px; }
}

@media (max-width: 560px) {
    .unscheduled-posts-list { grid-template-columns: minmax(0, 1fr); }
    .unscheduled-posts-list .calendar-post-meta { display: flex; }
}

.audience-row {
    margin-bottom: 22px;
}

.audience-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 9px;
}

.audience-row-header span {
    font-size: 14px;
    color: #374151;
}

.audience-row-header strong {
    font-size: 14px;
    color: #111827;
}

.analytics-audience-track {
    width: 100%;
    height: 9px;
    overflow: hidden;
    border-radius: 20px;
    background-color: #e5e7eb;
}

.analytics-audience-track > span {
    display: block;
    width: var(--audience-width, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5145ff, #8b5cf6);
    transition: width 0.3s ease;
}
/* =========================================
   SETTINGS PAGE
   Paste at the END of your main CSS file.
========================================= */

.st-page { color: #344059; }

/* hero tweaks */
.st-hero { min-height: 190px; padding: 28px 40px; }
.st-hero .dash-hero-text p { margin-bottom: 18px; }
.st-hero .dash-chip-a { top: 14%; left: 30%; color: #4f46f5; }
.st-hero .dash-chip-b { top: 8%; right: 4%; color: #e7842a; }
.st-hero .dash-chip-c { top: 46%; right: 2%; color: #17874f; }

/* layout */
.st-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

.st-card {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.st-side {
    position: sticky;
    top: 20px;
    display: grid;
    gap: 16px;
}

/* user card */
.st-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
}

.st-user-avatar,
.st-picture-avatar {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #8278ff, #4e54d9);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.st-user-text { min-width: 0; }

.st-user-text strong {
    display: block;
    overflow: hidden;
    color: #131a2e;
    font-size: 13.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.st-user-text span {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: #8a95ab;
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* nav */
.st-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
}

.st-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #66718a;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.st-nav-item i { width: 17px; text-align: center; font-size: 14px; }
.st-nav-item:hover { background: #f5f6ff; color: #4f46f5; }

.st-nav-item.active {
    background: #eeefff;
    color: #4f46f5;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #4f46f5;
}

.st-nav-item:focus-visible { outline: 2px solid #4f46f5; outline-offset: 2px; }

/* content */
.st-content { padding: 26px 28px 0; }

.st-section { display: none; padding-bottom: 8px; }
.st-section.active { display: block; animation: stFade .25s ease; }

@keyframes stFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.st-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eff1f7;
}

.st-head-ico {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: #eeecff;
    color: #4f46f5;
    font-size: 16px;
}

.st-head h2 { margin: 0 0 5px; color: #131a2e; font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.st-head p  { margin: 0; color: #8490a4; font-size: 12.5px; }

/* rows */
.st-row {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    padding: 20px 0;
    border-bottom: 1px solid #f0f2f7;
}

.st-row-top { align-items: start; }

.st-label {
    display: block;
    color: #1b2339;
    font-size: 13px;
    font-weight: 600;
}

.st-label small {
    display: block;
    margin-top: 5px;
    color: #8a95ab;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.5;
}

.st-control { min-width: 0; max-width: 460px; }

.st-input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #dbe0ec;
    border-radius: 10px;
    outline: none;
    background-color: #fff;
    color: #1b2339;
    font-family: inherit;
    font-size: 13.5px;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}

.st-input::placeholder { color: #a2abbd; }
.st-input:hover { border-color: #c5cddd; }
.st-input:focus { border-color: #4f46f5; box-shadow: 0 0 0 4px rgba(79, 70, 245, .14); }

.st-select {
    padding-right: 36px;
    cursor: pointer;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7690' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* profile picture */
.st-picture {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid #eff1f7;
    border-radius: 14px;
    background: #fafbff;
}

.st-picture-avatar { flex-basis: 64px; width: 64px; height: 64px; font-size: 20px; }

.st-picture-info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.st-picture-info small { color: #8a95ab; font-size: 11.5px; }
.st-file-name { color: #4f46f5 !important; font-weight: 600; }
.st-file-name:empty { display: none; }

/* buttons */
.st-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s;
}

.st-btn:active { transform: translateY(1px); }
.st-btn:focus-visible { outline: 2px solid #4f46f5; outline-offset: 2px; }
.st-btn i { font-size: 12px; }

.st-btn-primary { background: #4f46f5; color: #fff; box-shadow: 0 6px 14px rgba(79, 70, 245, .25); }
.st-btn-primary:hover { background: #4038df; }

.st-btn-soft { min-height: 38px; background: #eaedff; color: #4f46f5; }
.st-btn-soft:hover { background: #dde1ff; }

.st-btn-ghost { border-color: #dbe0ec; background: #fff; color: #475569; }
.st-btn-ghost:hover { border-color: #b9c1d3; background: #f8fafc; }

/* toggle rows */
.st-toggle {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid #f0f2f7;
    cursor: pointer;
}

.st-toggle:last-of-type { border-bottom: 0; }

.st-toggle-ico {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    font-size: 15px;
}

.st-toggle-ico.is-green  { background: #e0f8ec; color: #179c69; }
.st-toggle-ico.is-blue   { background: #e6f1ff; color: #4387e9; }
.st-toggle-ico.is-red    { background: #ffe6e3; color: #c0392b; }
.st-toggle-ico.is-purple { background: #efebff; color: #6954e8; }

.st-toggle-text { flex: 1; min-width: 0; }

.st-toggle-text strong {
    display: block;
    margin-bottom: 4px;
    color: #1b2339;
    font-size: 13.5px;
    font-weight: 600;
}

.st-toggle-text small { display: block; color: #8a95ab; font-size: 12px; line-height: 1.5; }

.st-toggle input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.st-switch {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 25px;
    border-radius: 999px;
    background: #d5dae6;
    transition: background .2s;
}

.st-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(16, 24, 40, .25);
    transition: transform .2s;
}

.st-toggle input:checked ~ .st-switch { background: #4f46f5; }
.st-toggle input:checked ~ .st-switch::after { transform: translateX(19px); }
.st-toggle input:focus-visible ~ .st-switch { box-shadow: 0 0 0 4px rgba(79, 70, 245, .25); }

/* theme cards */
.st-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.st-theme { position: relative; display: block; cursor: pointer; }

.st-theme input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.st-theme-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dbe0ec;
    border-radius: 14px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s, background .2s, transform .2s;
}

.st-theme:hover .st-theme-box { border-color: #cfd4ff; transform: translateY(-2px); }

.st-theme input:checked + .st-theme-box {
    border-color: #4f46f5;
    background: #f6f5ff;
    box-shadow: 0 0 0 3px rgba(79, 70, 245, .14);
}

.st-theme input:focus-visible + .st-theme-box { box-shadow: 0 0 0 3px rgba(79, 70, 245, .3); }

.st-theme-box strong { color: #2c3550; font-size: 12.5px; font-weight: 600; text-align: center; }
.st-theme input:checked + .st-theme-box strong { color: #4f46f5; }

.st-theme-preview {
    display: grid;
    grid-template-columns: 26% 1fr;
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
    height: 82px;
    padding: 8px;
    border-radius: 9px;
}

.st-theme-preview i { display: block; border-radius: 4px; }
.st-theme-preview i:first-child { grid-row: 1 / 4; }

.st-theme-preview.is-light { background: #f5f7fc; }
.st-theme-preview.is-light i { background: #fff; border: 1px solid #e9edf5; }
.st-theme-preview.is-light i:first-child { background: #e2e6f3; border: 0; }

.st-theme-preview.is-dark { background: #0f1424; }
.st-theme-preview.is-dark i { background: #1f2942; }
.st-theme-preview.is-dark i:first-child { background: #151c2e; }

/* security */
.st-info {
    display: flex;
    gap: 14px;
    margin-top: 20px;
    padding: 18px;
    border: 1px solid #e4e8ff;
    border-radius: 14px;
    background: #f7f7ff;
}

.st-info-ico {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 11px;
    background: #eeecff;
    color: #4f46f5;
}

.st-info strong { display: block; margin-bottom: 6px; color: #131a2e; font-size: 13.5px; }
.st-info p { margin: 0; color: #66718a; font-size: 12.5px; line-height: 1.7; }

.st-muted {
    display: flex;
    gap: 10px;
    margin: 16px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f6f7fc;
    color: #6f7b94;
    font-size: 12px;
    line-height: 1.6;
}

.st-muted i { margin-top: 2px; color: #4f46f5; }

/* action bar */
.st-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 8px -28px 0;
    padding: 16px 28px;
    border-top: 1px solid #eff1f7;
    border-radius: 0 0 18px 18px;
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
}

/* responsive */
@media (max-width: 1000px) {
    .st-layout { grid-template-columns: minmax(0, 1fr); }
    .st-side { position: static; }
    .st-user { display: none; }

    .st-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
    }

    .st-nav-item { flex: 0 0 auto; width: auto; padding: 0 16px; }
    .st-nav-item.active { box-shadow: inset 0 -3px 0 #4f46f5; }
}

@media (max-width: 760px) {
    .st-hero { min-height: 200px; padding: 24px 22px; }
    .st-hero .dash-hero-art { opacity: .2; }
    .st-content { padding: 20px 18px 0; }
    .st-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px 0; }
    .st-control { max-width: none; }
    .st-actions { margin: 8px -18px 0; padding: 14px 18px; }
}

@media (max-width: 480px) {
    .st-picture { flex-direction: column; align-items: flex-start; }
    .st-themes { gap: 10px; }
    .st-actions .st-btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .st-section.active { animation: none; }
}

/* Profile picture images (settings + topbar) */
.st-user-avatar,
.st-picture-avatar { overflow: hidden; }

.st-user-avatar img,
.st-picture-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar { overflow: hidden; }

.avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* =========================================
   ADD SOCIAL ACCOUNT PAGE
   Paste at the END of your main CSS file.
   Re-uses: .dash-hero, .dash-btn, .ap-flash, .sa-logo, .platform-*
========================================= */

.aa-page { color: #344059; }

/* hero tweaks */
.aa-hero { min-height: 190px; padding: 28px 40px; }
.aa-hero .dash-hero-text p { margin-bottom: 18px; }
.aa-hero .dash-chip-a { top: 14%; left: 30%; }
.aa-hero .dash-chip-b { top: 8%; right: 4%; }
.aa-hero .dash-chip-c { top: 46%; right: 2%; }

/* layout */
.aa-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

.aa-side {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.aa-card {
    min-width: 0;
    padding: 24px 26px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

/* card headings */
.aa-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eff1f7;
}

.aa-head-ico {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    background: #eeecff;
    color: #4f46f5;
    font-size: 15px;
}

.aa-head h2 {
    margin: 0;
    color: #131a2e;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.3px;
}

.aa-head p {
    margin: 4px 0 0;
    color: #8490a4;
    font-size: 12.5px;
}

.aa-head-sm {
    margin-bottom: 14px;
    padding-bottom: 14px;
}

.aa-head-sm .aa-head-ico {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 13px;
}

.aa-head-sm h2 { font-size: 14.5px; }

/* platform list */
.aa-platforms { display: grid; }

.aa-platform {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 0;
    border-bottom: 1px solid #f0f2f7;
}

.aa-platform:last-child { border-bottom: 0; padding-bottom: 4px; }

.aa-platform .aa-logo {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    margin: 0;
    border-radius: 16px;
    font-size: 26px;
    box-shadow: 0 8px 18px rgba(25, 39, 75, .14);
}

.aa-platform.is-soon .aa-logo { opacity: .7; box-shadow: none; }

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

.aa-platform-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}

.aa-platform-title h3 {
    margin: 0;
    color: #131a2e;
    font-size: 15.5px;
    font-weight: 600;
}

.aa-platform-info > p {
    margin: 0 0 10px;
    color: #7b879c;
    font-size: 12.5px;
    line-height: 1.6;
}

.aa-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.aa-badge i { font-size: 10px; }
.aa-badge.is-connected { background: #e5f7ee; color: #17874f; }
.aa-badge.is-ready     { background: #e3ecff; color: #3566d6; }
.aa-badge.is-soon      { background: #eff1f6; color: #7b869c; }

.aa-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.aa-tags li {
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f4fa;
    color: #66718a;
    font-size: 11px;
    font-weight: 600;
}

.aa-platform-action { flex: 0 0 auto; }

/* buttons */
.aa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 150px;
    min-height: 42px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, transform .15s, box-shadow .15s;
}

.aa-btn:active { transform: translateY(1px); }
.aa-btn:focus-visible { outline: 2px solid #4f46f5; outline-offset: 2px; }
.aa-btn i { font-size: 12px; }

.aa-btn-primary {
    background: #4f46f5;
    color: #fff;
    box-shadow: 0 6px 14px rgba(79, 70, 245, .25);
}

.aa-btn-primary:hover { background: #4038df; transform: translateY(-1px); }

.aa-btn-soft { background: #eaedff; color: #4f46f5; }
.aa-btn-soft:hover { background: #dde1ff; }

.aa-btn-muted {
    background: #eceef6;
    color: #9aa3b8;
    font-weight: 500;
    cursor: not-allowed;
}

.aa-btn.is-loading { opacity: .75; pointer-events: none; }

/* how it works */
.aa-steps {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.aa-steps li { display: flex; gap: 14px; }

.aa-step-num {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: #4f46f5;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.aa-steps strong {
    display: block;
    margin-bottom: 3px;
    color: #1b2339;
    font-size: 13px;
    font-weight: 600;
}

.aa-steps p {
    margin: 0;
    color: #7b879c;
    font-size: 12px;
    line-height: 1.6;
}

/* checklists */
.aa-checks,
.aa-perms {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.aa-checks li,
.aa-perms li {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    color: #44506a;
    font-size: 12.5px;
    line-height: 1.5;
}

.aa-checks i { margin-top: 2px; color: #21b477; }
.aa-perms i  { width: 16px; margin-top: 2px; color: #4f46f5; text-align: center; }

/* security note */
.aa-secure {
    display: flex;
    gap: 13px;
    padding: 16px 18px;
    border: 1px solid #e4e8ff;
    border-radius: 14px;
    background: #f7f7ff;
}

.aa-secure-ico {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px;
    background: #eeecff;
    color: #4f46f5;
    font-size: 14px;
}

.aa-secure p {
    margin: 0;
    color: #66718a;
    font-size: 12px;
    line-height: 1.7;
}

.aa-secure strong { color: #131a2e; }

/* responsive */
@media (max-width: 1000px) {
    .aa-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    .aa-hero { min-height: 200px; padding: 24px 22px; }
    .aa-hero .dash-hero-art { opacity: .2; }
    .aa-card { padding: 20px 18px; }
}

@media (max-width: 640px) {
    .aa-platform { flex-wrap: wrap; gap: 14px; }
    .aa-platform-info { flex: 1 1 calc(100% - 76px); }
    .aa-platform-action { flex: 1 1 100%; }
    .aa-platform-action .aa-btn { width: 100%; }
}
/* =========================================
   NOTIFICATIONS PAGE + TOPBAR BELL
   Paste at the END of your main CSS file.
========================================= */

/* ---------- Topbar bell (now a link) ---------- */
a.icon-button { color: #69758d; }
a.icon-button:hover { background: #f4f5fb; color: #4f46f5; }

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    display: grid;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #f16b73;
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
}

/* ---------- Page ---------- */
.nt-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 30px 38px 40px;
    color: #344059;
}

.nt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.nt-header h1 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 22.5px;
    font-weight: 700;
    letter-spacing: -.4px;
}

.nt-header p { margin: 0; color: #7b879c; font-size: 13px; }

.nt-header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.nt-header-actions form { margin: 0; }

.nt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.nt-btn i { font-size: 12px; }
.nt-btn:focus-visible { outline: 2px solid #4f46f5; outline-offset: 2px; }
.nt-btn:disabled { opacity: .5; cursor: not-allowed; }

.nt-btn-soft { background: #eaedff; color: #4f46f5; }
.nt-btn-soft:hover:not(:disabled) { background: #dde1ff; }

.nt-btn-ghost { border-color: #dbe0ec; background: #fff; color: #475569; }
.nt-btn-ghost:hover { border-color: #b9c1d3; background: #f8fafc; }

.nt-card {
    padding: 8px 22px 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

/* ---------- Tabs ---------- */
.nt-tabs {
    display: flex;
    gap: 26px;
    margin: 0 -22px 6px;
    padding: 0 22px;
    border-bottom: 1px solid #e9edf5;
}

.nt-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -1px;
    padding: 16px 2px 14px;
    border-bottom: 2px solid transparent;
    color: #66718a;
    font-size: 13px;
    font-weight: 600;
    transition: color .2s, border-color .2s;
}

.nt-tab:hover { color: #2c3550; }
.nt-tab.is-active { border-bottom-color: #4f46f5; color: #4f46f5; }

.nt-count {
    display: inline-grid;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    place-items: center;
    border-radius: 999px;
    background: #ecebff;
    color: #4f46f5;
    font-size: 11px;
    font-weight: 600;
}

/* ---------- List ---------- */
.nt-list { margin: 0; padding: 0; list-style: none; }

.nt-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0 -10px;
    padding: 16px 10px;
    border-radius: 12px;
    transition: background .2s;
}

.nt-item + .nt-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10px;
    right: 10px;
    height: 1px;
    background: #eff1f7;
}

.nt-item:hover { background: #f8f9fe; }
.nt-item.is-unread { background: #f7f6ff; }
.nt-item.is-unread:hover { background: #f1f0ff; }

.nt-ico {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    font-size: 16px;
}

.nt-ico.is-green { background: #e0f8ec; color: #179c69; }
.nt-ico.is-blue  { background: #e6f1ff; color: #4387e9; }
.nt-ico.is-red   { background: #ffe6e3; color: #c0392b; }
.nt-ico.is-amber { background: #fff0df; color: #e88a30; }

.nt-body {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.nt-title-row { display: flex; align-items: center; gap: 8px; }

.nt-title-row strong {
    overflow: hidden;
    color: #131a2e;
    font-size: 13.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nt-item:not(.is-unread) .nt-title-row strong { font-weight: 500; color: #44506a; }

.nt-body:hover .nt-title-row strong { color: #4f46f5; }

.nt-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4f46f5;
}

.nt-msg {
    color: #66718a;
    font-size: 12.5px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.nt-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #96a0b5;
    font-size: 11.5px;
}

.nt-meta em { font-style: normal; font-weight: 600; color: #7b879c; }
.nt-meta b { font-weight: 400; color: #c4cada; }

.nt-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.nt-actions form { margin: 0; }

.nt-icon-btn {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid #e3e7f1;
    border-radius: 9px;
    background: #fff;
    color: #5b6781;
    font-size: 12px;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.nt-icon-btn:hover { border-color: #cfd4ff; background: #f1f0ff; color: #4f46f5; }
.nt-icon-btn.is-danger:hover { border-color: #f3c9c4; background: #fff1f0; color: #c0392b; }
.nt-icon-btn:focus-visible { outline: 2px solid #4f46f5; outline-offset: 2px; }

/* ---------- Empty ---------- */
.nt-empty { padding: 56px 16px 60px; text-align: center; }

.nt-empty-ico {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 15px;
    background: #f0eeff;
    color: #6657ed;
    font-size: 20px;
}
.icon-button { position: relative; }

.icon-button.active {
    background: #eef0ff;
    color: #4f46e5;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid #fff;
    box-sizing: content-box;
}
.nt-empty h3 { margin: 0 0 8px; color: #131a2e; font-size: 15px; }
.nt-empty p  { max-width: 360px; margin: 0 auto; color: #8791a6; font-size: 12.5px; line-height: 1.7; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    .nt-page { padding: 18px 14px 30px; }
    .nt-card { padding: 4px 14px 6px; border-radius: 16px; }
    .nt-tabs { margin: 0 -14px 6px; padding: 0 14px; }
    .nt-item { flex-wrap: wrap; }
    .nt-body { flex: 1 1 calc(100% - 60px); }
    .nt-actions { width: 100%; justify-content: flex-end; }
    .nt-header-actions { width: 100%; }
    .nt-header-actions form, .nt-header-actions .nt-btn { flex: 1; width: 100%; }
}
/* =========================================
   SOCIAL ACCOUNTS PAGE (accounts/index.html)
   Re-uses: .dash-hero, .aa-card, .aa-head, .aa-btn, .aa-badge,
            .sa-logo, .platform-*, .sa-toast, .ap-flash
========================================= */

.sacc-page { color: #344059; }

/* ---------- Stats ---------- */
.sacc-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 20px 0;
}

.sacc-stat {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    transition: transform .25s, box-shadow .25s;
}

.sacc-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(25, 39, 75, .09);
}

.sacc-stat-ico {
    display: grid;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 50%;
    font-size: 20px;
}

.sacc-stat-ico.is-violet { color: #6a54e6; background: linear-gradient(145deg, #f1eeff, #dcd5ff); }
.sacc-stat-ico.is-green  { color: #1f9d62; background: linear-gradient(145deg, #e6f9ef, #c5eed8); }
.sacc-stat-ico.is-amber  { color: #e7842a; background: linear-gradient(145deg, #fff3e6, #ffdfbb); }
.sacc-stat-ico.is-blue   { color: #3d7be8; background: linear-gradient(145deg, #e8f1ff, #c9deff); }

.sacc-stat > div { min-width: 0; }

.sacc-stat strong {
    display: block;
    color: #131a2e;
    font-size: 23.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.6px;
}

.sacc-stat > div > span {
    display: block;
    margin-top: 7px;
    color: #7b869c;
    font-size: 11.5px;
}

/* ---------- Sections ---------- */
.sacc-section { margin-top: 20px; }

.sacc-head-btn {
    min-width: 0;
    min-height: 38px;
    margin-left: auto;
    padding: 0 16px;
}

.aa-badge.is-warn { background: #fff0dc; color: #c37b2a; }

/* ---------- Account rows ---------- */
.sacc-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.sacc-account {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 16px;
    transition: border-color .2s, box-shadow .2s;
}

.sacc-account:hover {
    border-color: #dcdffa;
    box-shadow: 0 8px 26px rgba(25, 39, 75, .08);
}

.sacc-account.is-off {
    background: #fffdf8;
    border-color: #f6e7c8;
}

.sacc-logo {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    margin: 0;
    border-radius: 16px;
    font-size: 26px;
    box-shadow: 0 8px 18px rgba(25, 39, 75, .14);
}

.sacc-logo.platform-facebook { border-radius: 50%; font-size: 24px; }
.sacc-logo.platform-youtube  { font-size: 22px; }

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

.sacc-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}

.sacc-title h3 {
    margin: 0;
    color: #131a2e;
    font-size: 15.5px;
    font-weight: 600;
}

.sacc-username {
    margin: 0 0 5px;
    overflow: hidden;
    color: #344054;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sacc-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #7b879c;
    font-size: 12px;
}

.sacc-meta i { font-size: 11px; }

.sacc-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.sacc-btn {
    min-width: 0;
    min-height: 40px;
    padding: 0 18px;
}

.sacc-icon-btn {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0;
    border: 1px solid #e1e7f0;
    border-radius: 10px;
    background: #fff;
    color: #536176;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.sacc-icon-btn:hover { border-color: #cfd4ff; background: #f1f0ff; color: #4f46f5; }
.sacc-icon-btn:focus-visible { outline: 2px solid #4f46f5; outline-offset: 2px; }

/* ---------- Empty state ---------- */
.sacc-empty {
    padding: 38px 16px;
    border: 1.5px dashed #cdd5e6;
    border-radius: 16px;
    background: #f9fafe;
    text-align: center;
}

.sacc-empty-ico {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 15px;
    background: #f0eeff;
    color: #6657ed;
    font-size: 20px;
}

.sacc-empty h3 { margin: 0 0 6px; color: #131a2e; font-size: 15px; }
.sacc-empty p  { max-width: 340px; margin: 0 auto 18px; color: #8791a6; font-size: 12.5px; line-height: 1.6; }

/* ---------- Connect tiles ---------- */
.sacc-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.sacc-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 26px 22px 24px;
    background: #fff;
    border: 1px solid #e9edf5;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}

.sacc-tile:not(.is-soon):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(25, 39, 75, .09);
}

.sacc-tile.is-soon {
    background: #f6f7fc;
    border-color: #eceff6;
    box-shadow: none;
}

.sacc-tile .sacc-logo { margin-bottom: 14px; }
.sacc-tile.is-soon .sacc-logo { opacity: .75; box-shadow: none; }

.sacc-tile h3 { margin: 0 0 6px; color: #131a2e; font-size: 15px; font-weight: 600; }
.sacc-tile p  { margin: 0 0 18px; color: #7b879c; font-size: 12px; line-height: 1.5; }

.sacc-tile .aa-btn {
    width: 100%;
    max-width: 190px;
    min-width: 0;
    margin-top: auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .sacc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sacc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .sacc-stats { gap: 12px; }
    .sacc-stat { gap: 12px; padding: 14px; }
    .sacc-stat-ico { flex-basis: 40px; width: 40px; height: 40px; font-size: 16px; }
    .sacc-stat strong { font-size: 20px; }

    .sacc-account { flex-wrap: wrap; gap: 14px; padding: 18px; }
    .sacc-logo { flex-basis: 48px; width: 48px; height: 48px; font-size: 22px; }
    .sacc-info { flex: 1 1 calc(100% - 70px); }
    .sacc-actions { width: 100%; }
    .sacc-actions .sacc-btn { flex: 1; }

    .sacc-tiles { grid-template-columns: minmax(0, 1fr); }
    .sacc-head-btn { display: none; }
}