/* =====================================================
   Page Manager — Design System v2.0
   Professional light-only theme. No dark mode.
   ===================================================== */

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

:root {
    /* Brand */
    --fb-blue:        #1458D6;
    --fb-blue-dark:   #0F45AD;
    --fb-blue-tint:   #EBF1FC;

    /* Neutrals */
    --fb-bg:          #F4F5F8;
    --fb-white:       #FFFFFF;
    --fb-border:      #DFE2E8;
    --fb-border-soft: #EAECF0;
    --fb-text:        #14171F;
    --fb-text-sec:    #5B6270;
    --fb-hover:        #EEF0F4;

    /* Status */
    --signal:       var(--fb-blue);
    --success:      #17864B;
    --success-tint: #E9F7EF;
    --error:        #D6293E;
    --error-tint:   #FCEBEC;
    --warning:      #B4720A;
    --warning-tint: #FDF3E2;
    --info-tint:    var(--fb-blue-tint);
    --text-muted:   var(--fb-text-sec);

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(20, 23, 31, 0.06);
    --shadow-sm: 0 1px 2px rgba(20, 23, 31, 0.05), 0 4px 10px rgba(20, 23, 31, 0.05);
    --shadow-md: 0 4px 12px rgba(20, 23, 31, 0.08), 0 1px 2px rgba(20, 23, 31, 0.06);
    --shadow-lg: 0 12px 28px rgba(20, 23, 31, 0.16);

    /* Shape */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --sidebar-width: 272px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--fb-bg) !important;
    color: var(--fb-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Icons — consistent baseline alignment everywhere */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.btn .icon, .btn-icon svg { vertical-align: middle; }

:focus-visible {
    outline: 2px solid var(--fb-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background-color: #FFFFFF !important;
    border-right: 1px solid var(--fb-border-soft);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    margin-bottom: 22px;
}

.sidebar-brand-mark {
    background: linear-gradient(155deg, var(--fb-blue), var(--fb-blue-dark));
    color: white;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
}

.sidebar-brand-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--fb-text);
    letter-spacing: -0.2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar-nav-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #A7ACB9;
    padding: 14px 12px 6px;
}
.sidebar-nav-group-label:first-child { padding-top: 4px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--fb-text-sec);
    font-size: 14.5px;
    font-weight: 600;
    position: relative;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
    background-color: var(--fb-hover);
    color: var(--fb-text);
}

.sidebar-nav a.active {
    background-color: var(--fb-blue-tint);
    color: var(--fb-blue);
}

.sidebar-nav a.active .nav-icon {
    color: var(--fb-blue);
}

.sidebar-nav a.active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background-color: var(--fb-blue);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #9CA2B0;
}
.sidebar-nav a:hover .nav-icon { color: var(--fb-text-sec); }

/* ---------- Sidebar: expandable submenu (Settings, etc.) ---------- */
.sidebar-nav-item.has-submenu { display: flex; flex-direction: column; }

.sidebar-nav-parent {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    color: var(--fb-text-sec);
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar-nav-parent:hover { background-color: var(--fb-hover); color: var(--fb-text); }
.sidebar-nav-parent:hover .nav-icon { color: var(--fb-text-sec); }

.sidebar-nav-parent.active { background-color: var(--fb-blue-tint); color: var(--fb-blue); }
.sidebar-nav-parent.active .nav-icon { color: var(--fb-blue); }

.sidebar-nav-parent span:nth-child(2) { flex: 1; }

.nav-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA2B0;
    transition: transform 0.18s ease;
    flex-shrink: 0;
}
.sidebar-nav-item.open .nav-chevron { transform: rotate(180deg); }

.sidebar-submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0 4px 34px;
}

.sidebar-submenu a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--fb-text-sec);
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar-submenu a::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    width: 8px;
    height: 1px;
    background-color: var(--fb-border);
}

.sidebar-submenu a:hover { background-color: var(--fb-hover); color: var(--fb-text); }

.sidebar-submenu a:target,
.sidebar-submenu a.active {
    background-color: var(--fb-blue-tint);
    color: var(--fb-blue);
    font-weight: 600;
}

.sidebar-nav-divider {
    height: 1px;
    background-color: var(--fb-border-soft);
    margin: 10px 12px;
}

.sidebar-nav-external {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--fb-text-sec);
    font-size: 13.5px;
    font-weight: 600;
}
.sidebar-nav-external span:nth-child(2) { flex: 1; }
.sidebar-nav-external:hover { background-color: var(--fb-hover); color: var(--fb-text); }
.nav-external-icon { color: #9CA2B0; flex-shrink: 0; }

.sidebar-footer {
    border-top: 1px solid var(--fb-border-soft);
    padding-top: 12px;
    margin-top: 12px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--fb-blue-tint);
    color: var(--fb-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 13.5px;
    font-weight: 600;
}

.sidebar-logout {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--fb-text-sec);
    margin-top: 1px;
}

.sidebar-logout:hover {
    color: var(--error);
}

/* ---------- Mobile topbar + off-canvas drawer ---------- */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--fb-border-soft);
    z-index: 1100;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
}
.mobile-topbar-brand { display: flex; align-items: center; gap: 10px; font-size: 15.5px; font-weight: 700; color: var(--fb-text); }
.mobile-topbar-brand img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.mobile-topbar-brand-mark {
    background: linear-gradient(155deg, var(--fb-blue), var(--fb-blue-dark));
    color: white; width: 26px; height: 26px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-toggle-btn {
    background: none; border: none; cursor: pointer;
    color: var(--fb-text); padding: 6px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
}
.sidebar-toggle-btn:hover { background-color: var(--fb-hover); }
.sidebar-close-btn { display: none; }
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 17, 24, 0.45);
    z-index: 999;
}
.sidebar-backdrop.open { display: block; }

/* ---------- Main Content ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 28px 40px 48px;
    min-height: 100vh;
    max-width: 1320px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.topbar h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

.topbar-actions {
    display: flex;
    gap: 8px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
    line-height: 1.2;
    white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background-color: var(--fb-blue);
    color: white;
    box-shadow: 0 1px 2px rgba(20, 88, 214, 0.25);
}

.btn-primary:hover { background-color: var(--fb-blue-dark); }

.btn-secondary {
    background-color: var(--fb-white);
    color: var(--fb-text);
    border-color: var(--fb-border);
}

.btn-secondary:hover { background-color: var(--fb-hover); border-color: #CBD1DA; }

.btn-ghost {
    background-color: transparent;
    color: var(--fb-text-sec);
}

.btn-ghost:hover {
    background-color: var(--fb-hover);
    color: var(--fb-text);
}

.btn-icon { display: inline-flex; align-items: center; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Cards & Panels ---------- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--fb-white);
    border: 1px solid var(--fb-border-soft);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
}

.stat-card-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.stat-card-label {
    font-size: 12.5px;
    color: var(--fb-text-sec);
    font-weight: 600;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.panel {
    background-color: var(--fb-white);
    border: 1px solid var(--fb-border-soft);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    box-shadow: var(--shadow-xs);
}

.panel-title {
    font-size: 15.5px;
    font-weight: 700;
    margin: 0 0 16px 0;
    letter-spacing: -0.1px;
}

.panel-empty {
    font-size: 13.5px;
    color: var(--fb-text-sec);
    margin: 0;
    line-height: 1.5;
}

/* Top performing page card (dashboard) */
.top-page-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s;
}
.top-page-card:hover { background-color: var(--fb-hover); }
.top-page-card img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--fb-hover);
    flex-shrink: 0;
}
.top-page-card h3 { font-size: 14.5px; font-weight: 700; margin: 0 0 3px; }
.top-page-card p { font-size: 12.5px; color: var(--fb-text-sec); margin: 0; }

/* Activity badges (dashboard recent activity) */
.activity-badge-info    { background-color: var(--info-tint);    color: var(--fb-blue); }
.activity-badge-warning { background-color: var(--warning-tint); color: var(--warning); }
.activity-badge-error   { background-color: var(--error-tint);   color: var(--error); }
.activity-badge-muted   { background-color: var(--fb-hover);     color: var(--fb-text-sec); }

/* Read-only connection status rows (settings page) */
.status-ok  { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-weight: 600; }
.status-bad { display: inline-flex; align-items: center; gap: 6px; color: var(--error); font-weight: 600; }

/* ---------- Customize View ---------- */
.customize-view {
    position: relative;
}

.customize-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #FFFFFF;
    border: 1px solid var(--fb-border);
    border-radius: 8px;
    padding: 16px;
    min-width: 240px;
    z-index: 2000;
    box-shadow: 0 12px 28px rgba(0,0,0,0.2);
    margin-top: 8px;
}

.customize-panel.open {
    display: block;
}

.customize-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
}

.customize-panel-item input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .mobile-topbar { display: flex; }
    .sidebar-backdrop { z-index: 1150; }

    .sidebar {
        top: 0; bottom: 0; left: 0;
        width: min(84vw, 300px);
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: var(--shadow-lg);
        z-index: 1200;
        padding: 14px 14px 16px;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-brand { justify-content: space-between; margin-bottom: 14px; }
    .sidebar-close-btn {
        display: flex; align-items: center; justify-content: center;
        background: none; border: none; color: var(--fb-text-sec); cursor: pointer;
        padding: 6px; border-radius: var(--radius-sm);
    }
    .sidebar-close-btn:hover { background-color: var(--fb-hover); color: var(--fb-text); }
    .sidebar-footer { display: block; }

    .main-content { margin-left: 0; padding: 76px 16px 40px; }
    .topbar { flex-direction: column; align-items: stretch; gap: 12px; }
    .topbar-actions { flex-wrap: wrap; }
    .topbar-actions .btn { flex: 1; justify-content: center; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
    .panel:has(.data-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 460px; }
}

@media (max-width: 480px) {
    .main-content { padding: 72px 12px 36px; }
    .stat-cards { grid-template-columns: 1fr; }
    .topbar h1 { font-size: 19px; }
    .panel { padding: 16px; }
    .topbar-actions { width: 100%; }
    .topbar-actions .btn { flex: 1; }
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--fb-hover);
}

.activity-row:last-child {
    border-bottom: none;
}

.activity-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.activity-badge-success { background-color: var(--success-tint); color: var(--success); }

.activity-text {
    flex: 1;
    font-size: 14px;
}

.activity-time {
    font-size: 12px;
    color: var(--fb-text-sec);
}

/* =====================================================
   Shared: Alerts / Empty States
   ===================================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.alert-icon { flex-shrink: 0; margin-top: 1px; }
.alert p { margin: 4px 0; font-size: 13.5px; line-height: 1.45; }
.alert p:first-child { margin-top: 0; }
.alert p:last-child { margin-bottom: 0; }

.alert-success { background-color: var(--success-tint); border-color: #C7E8D4; color: var(--success); }
.alert-error   { background-color: var(--error-tint);   border-color: #F3C4CA; color: var(--error); }
.alert-warning { background-color: var(--warning-tint); border-color: #F0DCAE; color: var(--warning); }

.empty-state {
    background-color: var(--fb-white);
    border: 1px solid var(--fb-border-soft);
    border-radius: var(--radius-md);
    padding: 64px 24px;
    text-align: center;
    box-shadow: var(--shadow-xs);
}
.empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background-color: var(--fb-blue-tint);
    color: var(--fb-blue);
}
.empty-state h2 { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.empty-state p {
    font-size: 13.5px;
    color: var(--fb-text-sec);
    max-width: 420px;
    line-height: 1.5;
    margin: 0 auto 20px;
}

/* =====================================================
   Accounts page
   ===================================================== */
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.account-card {
    background-color: var(--fb-white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}
.account-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--fb-hover);
}
.account-info h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.account-meta { margin: 0; font-size: 13px; color: var(--fb-text-sec); }
.btn-view-pages { width: 100%; }

.account-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.btn-danger {
    background-color: var(--error-tint);
    color: var(--error);
    border-color: #F3C4CA;
    width: 100%;
}
.btn-danger:hover { background-color: #F8D6DA; border-color: var(--error); }

/* Compact inline buttons, e.g. inside table rows (Manage Users) */
.btn-sm {
    width: auto;
    padding: 5px 10px;
    font-size: 12.5px;
    margin-right: 6px;
}

/* Modal (View All Pages) */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background-color: var(--fb-white);
    border-radius: 8px;
    width: 100%;
    max-width: 480px;
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 28px rgba(0,0,0,0.3);
    margin: 16px;
}
.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--fb-border);
}
.modal-account-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--fb-hover);
}
.modal-header h2 { flex: 1; font-size: 16px; font-weight: 700; margin: 0; }
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--fb-text-sec);
    padding: 4px;
}
.modal-close:hover { color: var(--fb-text); }
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.modal-hint { font-size: 13px; color: var(--fb-text-sec); margin-bottom: 14px; line-height: 1.4; }
.modal-pages-list { display: flex; flex-direction: column; gap: 4px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--fb-border);
}
.loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--fb-hover);
    border-top-color: var(--fb-blue);
    border-radius: 50%;
    margin: 24px auto;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-flex; animation: spin 0.9s linear infinite; }

/* =====================================================
   All Pages
   ===================================================== */
.pages-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.search-input {
    flex: 1;
    max-width: 320px;
    padding: 8px 12px;
    border: 1px solid var(--fb-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--fb-blue); }
.pages-count { font-size: 13px; color: var(--fb-text-sec); white-space: nowrap; }

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.page-card {
    background-color: var(--fb-white);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}
.page-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.page-card-top { position: relative; margin-bottom: 10px; }
.page-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--fb-hover);
}
.page-token-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #FEF6E6;
    color: #8A6D1D;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
}
.page-card-name { font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.page-card-parent { font-size: 12px; color: var(--fb-text-sec); margin: 0 0 12px; }
.page-card-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}
.page-card-stat { display: flex; flex-direction: column; }
.stat-value { font-size: 16px; font-weight: 700; }
.stat-label { font-size: 11px; color: var(--fb-text-sec); }
.page-card-cta {
    margin-top: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--fb-blue);
}

/* Toast (all-pages.js) */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: #050505;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 4000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background-color: #050505; }
.toast-error { background-color: var(--error); }

/* =====================================================
   Analytics
   ===================================================== */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    background-color: var(--fb-white);
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--fb-text-sec);
}
.filter-group select,
.filter-group input[type="date"] {
    padding: 7px 10px;
    border: 1px solid var(--fb-border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background-color: #fff;
}
.view-toggle-group { margin-left: auto; }

.sort-toggle {
    display: flex;
    border: 1px solid var(--fb-border);
    border-radius: 6px;
    overflow: hidden;
}
.sort-toggle a {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fb-text-sec);
}
.sort-toggle a:hover { background-color: var(--fb-hover); }
.sort-toggle a.active { background-color: var(--fb-blue); color: #fff; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--fb-text-sec);
    text-transform: uppercase;
    padding: 10px 12px;
    border-bottom: 2px solid var(--fb-border);
}
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--fb-hover);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table code {
    background-color: var(--fb-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
}

.ranking-page-cell { display: flex; align-items: center; gap: 10px; }
.ranking-page-cell img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--fb-hover);
}
.ranking-page-cell a { font-weight: 600; }
.ranking-page-cell a:hover { text-decoration: underline; }
.sparkline { display: block; }

/* =====================================================
   Failed Posts
   ===================================================== */
.failed-posts-list { display: flex; flex-direction: column; gap: 10px; }
.failed-post-row {
    background-color: var(--fb-white);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: flex;
    gap: 12px;
    border-left: 3px solid var(--error);
}
.failed-post-row img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--fb-hover);
    flex-shrink: 0;
}
.failed-post-info { flex: 1; min-width: 0; }
.failed-post-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.failed-post-top strong { font-size: 14px; }
.failed-post-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fb-text-sec);
    background-color: var(--fb-hover);
    padding: 2px 8px;
    border-radius: 6px;
}
.failed-post-date { font-size: 12px; color: var(--fb-text-sec); margin-left: auto; }
.failed-post-caption { font-size: 14px; margin: 0 0 4px; color: var(--fb-text); }
.failed-post-error { font-size: 13px; color: var(--error); margin: 0; }
.failed-post-attempts { color: var(--fb-text-sec); font-weight: 600; }

/* =====================================================
   Auth pages (login / register) — split brand/form layout
   ===================================================== */
.auth-body {
    margin: 0;
    background-color: var(--fb-bg) !important;
    min-height: 100vh;
}
.auth-shell {
    display: flex;
    min-height: 100vh;
}

/* ---------- Left brand panel ---------- */
.auth-side {
    flex: 1 1 46%;
    max-width: 560px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: 52px 56px;
    color: #fff;
    background: linear-gradient(155deg, var(--fb-blue-dark) 0%, var(--fb-blue) 58%, #3D6FE0 100%);
    overflow: hidden;
}
.auth-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.14) 1px, transparent 0);
    background-size: 26px 26px;
    opacity: 0.55;
    pointer-events: none;
}
.auth-side::after {
    content: '';
    position: absolute;
    width: 440px; height: 440px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
    top: -140px; right: -150px;
    pointer-events: none;
}
.auth-side-top, .auth-side-content, .auth-side-footer { position: relative; z-index: 1; }

.auth-side-brand { display: flex; align-items: center; gap: 10px; }
.auth-side-brand-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.3);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.auth-side-brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.2px; }

.auth-side-content { max-width: 380px; }
.auth-side-heading { font-size: 30px; font-weight: 800; line-height: 1.28; margin: 0 0 14px; letter-spacing: -0.5px; }
.auth-side-text { font-size: 14.5px; line-height: 1.65; color: rgba(255,255,255,0.82); margin: 0 0 32px; }

.auth-feature-list { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.auth-feature-item { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.95); }
.auth-feature-icon {
    flex-shrink: 0;
    width: 32px; height: 32px; border-radius: 9px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.24);
    display: flex; align-items: center; justify-content: center;
}

.auth-side-footer { font-size: 12.5px; color: rgba(255,255,255,0.62); }

/* ---------- Right form panel ---------- */
.auth-main {
    flex: 1 1 54%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--fb-white);
}
.auth-card { width: 100%; max-width: 380px; }

.auth-mobile-brand { display: none; }

.auth-card h1 { font-size: 25px; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.3px; }
.auth-sub { font-size: 14px; color: var(--fb-text-sec); margin: 0 0 28px; }

.auth-form { display: flex; flex-direction: column; gap: 17px; }
.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fb-text);
}
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-icon {
    position: absolute;
    left: 13px;
    color: var(--fb-text-sec);
    display: flex;
    pointer-events: none;
}
.auth-form input {
    width: 100%;
    padding: 12px 13px 12px 40px;
    border: 1.5px solid var(--fb-border);
    border-radius: 10px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--fb-text);
    background: var(--fb-bg);
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--fb-blue);
    background: var(--fb-white);
    box-shadow: 0 0 0 3.5px var(--fb-blue-tint);
}
.btn-block {
    width: 100%;
    margin-top: 6px;
    padding: 12.5px;
    font-size: 15px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(20, 88, 214, 0.24);
}
.auth-switch { text-align: center; font-size: 13px; color: var(--fb-text-sec); margin: 18px 0 0; }
.auth-switch a { color: var(--fb-blue); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* =====================================================
   Page Profile
   ===================================================== */
.back-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--fb-text-sec);
    margin-bottom: 16px;
}
.back-link:hover { color: var(--fb-blue); }

.profile-header {
    background-color: var(--fb-white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.profile-header-main { display: flex; align-items: center; gap: 16px; }
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--fb-hover);
}
.profile-header-main h1 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.profile-meta { font-size: 13px; color: var(--fb-text-sec); margin: 0; }
.profile-followers { font-weight: 600; color: var(--fb-text); }
.last-synced { font-size: 12px; color: var(--fb-text-sec); margin: 0 0 20px; }

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.country-list { display: flex; flex-direction: column; gap: 10px; }
.country-row { display: flex; align-items: center; gap: 10px; }
.country-code { font-size: 13px; font-weight: 700; width: 32px; flex-shrink: 0; }
.country-bar-track {
    flex: 1;
    height: 8px;
    background-color: var(--fb-hover);
    border-radius: 4px;
    overflow: hidden;
}
.country-bar-fill { height: 100%; background-color: var(--fb-blue); border-radius: 4px; }
.country-pct { font-size: 12px; color: var(--fb-text-sec); width: 44px; text-align: right; flex-shrink: 0; }

.content-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 16px;
}
.content-grid-header h2 { font-size: 18px; font-weight: 700; margin: 0; }

.content-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.content-card {
    background-color: var(--fb-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.content-card-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background-color: var(--fb-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}
.content-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.content-card-type-icon { font-size: 28px; color: var(--fb-text-sec); }
.content-card-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 6px;
}
.content-card-body { padding: 10px 12px; }
.content-card-caption { font-size: 13px; margin: 0 0 8px; line-height: 1.35; }
.content-card-stats {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--fb-text-sec);
}
.content-card-date { margin-left: auto; }

/* =====================================================
   Settings — subnav between the two settings pages
   ===================================================== */
.settings-subnav {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--fb-border-soft);
    margin-bottom: 22px;
    overflow-x: auto;
}
.settings-subnav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 6px;
    margin-bottom: -1px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fb-text-sec);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.settings-subnav a:hover { color: var(--fb-text); }
.settings-subnav a.active { color: var(--fb-blue); border-bottom-color: var(--fb-blue); }
.settings-subnav a .nav-icon { color: inherit; }

.settings-panel-group { display: flex; flex-direction: column; gap: 20px; }

.settings-form { display: flex; flex-direction: column; gap: 16px; }
.settings-field { display: flex; flex-direction: column; gap: 6px; }
.settings-field span:first-child { font-size: 13px; font-weight: 600; color: var(--fb-text-sec); }
.settings-field input {
    padding: 9px 12px;
    border: 1px solid var(--fb-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--fb-text);
}
.settings-field input:focus { outline: none; border-color: var(--fb-blue); }
.settings-field em { font-style: normal; }

/* Password field with a show/hide eye toggle button, used on the
   login form and anywhere else a password input appears. */
.password-input-wrap { position: relative; display: flex; }
.password-input-wrap input {
    flex: 1;
    padding-right: 40px !important; /* room for the eye button */
}
.password-toggle-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--fb-text-sec);
    display: flex;
    align-items: center;
}
.password-toggle-btn:hover { color: var(--fb-text); }
.password-toggle-btn:focus { outline: none; }

.scope-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--fb-border);
    border-radius: 8px;
    overflow: hidden;
}
.scope-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--fb-border);
}
.scope-item:last-child { border-bottom: none; }
.scope-item:hover { background-color: var(--fb-hover); }
.scope-item input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--fb-blue);
}
.scope-item-text { display: flex; flex-direction: column; gap: 2px; }
.scope-item-name { font-size: 13.5px; font-weight: 600; color: var(--fb-text); font-family: monospace; }
.scope-item-desc { font-size: 12px; color: var(--fb-text-sec); }

/* =====================================================
   Content Studio
   ===================================================== */
.studio-layout {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    gap: 20px;
    align-items: start;
}
.studio-col {
    background-color: var(--fb-white);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.studio-col-title { font-size: 14px; font-weight: 700; margin: 0 0 6px; }
.studio-col-hint { font-size: 12px; color: var(--fb-text-sec); margin: 0 0 14px; }

.studio-page-list { display: flex; flex-direction: column; gap: 4px; }
.studio-page-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.studio-page-item:hover { background-color: var(--fb-hover); }
.studio-page-checkbox { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.studio-page-item img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--fb-hover);
    flex-shrink: 0;
}
.studio-page-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.studio-page-badge {
    background-color: var(--fb-blue);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

.content-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--fb-border);
    padding-bottom: 12px;
}
.type-btn {
    background-color: transparent;
    border: 1px solid var(--fb-border);
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fb-text-sec);
    cursor: pointer;
}
.type-btn:hover:not(:disabled) { background-color: var(--fb-hover); }
.type-btn.active { background-color: var(--fb-blue); border-color: var(--fb-blue); color: #fff; }
.type-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.studio-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.studio-field > span:first-child { font-size: 13px; font-weight: 600; color: var(--fb-text-sec); }
.studio-field textarea {
    padding: 10px 12px;
    border: 1px solid var(--fb-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}
.studio-field textarea:focus { outline: none; border-color: var(--fb-blue); }

.media-dropzone {
    border: 2px dashed var(--fb-border);
    border-radius: 8px;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: border-color 0.2s, background-color 0.2s;
}
.media-dropzone.dragover { border-color: var(--fb-blue); background-color: var(--fb-blue-tint); }
.media-dropzone-empty { text-align: center; padding: 20px; }
.dropzone-icon { font-size: 24px; display: block; margin-bottom: 6px; color: var(--fb-text-sec); }
.media-dropzone-empty p { margin: 2px 0; font-size: 13px; color: var(--fb-text-sec); }
.dropzone-browse { color: var(--fb-blue); font-weight: 600; cursor: pointer; }
.dropzone-hint { font-size: 11.5px !important; }

.media-progress { width: 100%; padding: 20px; }
.media-progress-bar {
    height: 8px;
    background-color: var(--fb-hover);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.media-progress-fill { height: 100%; width: 0%; background-color: var(--fb-blue); transition: width 0.2s; }
#progressLabel { font-size: 12px; color: var(--fb-text-sec); }

.media-preview-wrap { width: 100%; height: 100%; position: relative; }
.media-preview-wrap img, .media-preview-wrap video {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 6px;
}
.media-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

.studio-actions { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.studio-actions .btn { flex: 1; min-width: 100px; }
.schedule-picker {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background-color: var(--fb-bg);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 6px;
}
.schedule-picker label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--fb-text-sec); flex: 1; }
.schedule-picker input {
    padding: 8px 10px;
    border: 1px solid var(--fb-border);
    border-radius: 6px;
    font-family: inherit;
}
.studio-status { font-size: 13px; color: var(--fb-text-sec); min-height: 18px; }

.publish-progress { margin-bottom: 6px; }
.publish-progress-bar {
    height: 10px;
    background-color: var(--fb-hover);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 6px;
}
.publish-progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--fb-blue);
    transition: width 0.3s ease;
}
.publish-progress-fill.publish-progress-success { background-color: #2E9E5B; }
.publish-progress-fill.publish-progress-error { background-color: var(--error); }
.publish-progress-fill.publish-progress-processing {
    background-image: repeating-linear-gradient(
        45deg,
        var(--fb-blue), var(--fb-blue) 10px,
        #6EA0F0 10px, #6EA0F0 20px
    );
    background-size: 28px 28px;
    animation: publish-stripes 1s linear infinite;
}
@keyframes publish-stripes {
    from { background-position: 0 0; }
    to { background-position: 28px 0; }
}
.publish-progress-label { font-size: 12.5px; color: var(--fb-text-sec); }

.fb-preview-card {
    background-color: #fff;
    border: 1px solid var(--fb-border);
    border-radius: 8px;
    overflow: hidden;
}
.fb-preview-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.fb-preview-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--fb-hover);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.fb-preview-name { font-size: 13px; font-weight: 700; }
.fb-preview-time { font-size: 11px; color: var(--fb-text-sec); }
.fb-preview-caption { padding: 0 12px 10px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.fb-preview-media {
    aspect-ratio: 1 / 1;
    background-color: var(--fb-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.fb-preview-media img, .fb-preview-media video { width: 100%; height: 100%; object-fit: cover; }
.fb-preview-media-placeholder { font-size: 12px; color: var(--fb-text-sec); }
.fb-preview-actions {
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid var(--fb-hover);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fb-text-sec);
}
.fb-preview-comment { display: flex; gap: 8px; padding: 0 12px 12px; }
.fb-preview-comment-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--fb-hover);
    flex-shrink: 0;
}
.fb-preview-comment-bubble {
    background-color: var(--fb-bg);
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 12.5px;
}
.fb-preview-comment-bubble strong { display: block; font-size: 12px; }

/* =====================================================
   Extra responsive rules for new components
   ===================================================== */
@media (max-width: 900px) {
    .studio-layout { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; align-items: flex-start; }
    .content-grid-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .pages-toolbar { flex-direction: column; align-items: stretch; }
    .search-input { max-width: none; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .view-toggle-group { margin-left: 0; }
}

/* =====================================================
   Icon alignment helpers for newly added SVG icons
   ===================================================== */
.failed-post-error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}
.failed-post-error-icon { flex-shrink: 0; margin-top: 1px; color: var(--error); }

.fb-preview-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.fb-preview-globe { display: inline-flex; color: var(--fb-text-sec); }

.fb-preview-actions span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.content-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.content-card-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-token-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.page-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dropzone-browse { text-decoration: underline; }
.media-dropzone-empty p { display: block; }

/* Modal page rows (rendered dynamically by accounts.js inside #modalPagesList) */
.page-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.page-row:hover { background-color: var(--fb-hover); }
.page-row img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--fb-hover);
    flex-shrink: 0;
}
.page-row-info { flex: 1; min-width: 0; }
.page-row-name {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.page-row-cat {
    font-size: 12px;
    color: var(--fb-text-sec);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.page-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    cursor: pointer;
}
/* page-token-badge used standalone (no icon) inside the modal row */
.page-row .page-token-badge {
    background-color: var(--warning-tint);
    color: var(--warning);
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* =====================================================
   Public marketing site — homepage, about, contact,
   privacy, terms, data deletion. Reuses the same design
   tokens as the dashboard so the whole product feels
   like one consistent, professional brand.
   ===================================================== */

.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: var(--radius-md); }

.public-body { background: var(--fb-white) !important; }

/* ---------- Top nav ---------- */
.public-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--fb-border-soft);
}
.public-nav-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.public-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: var(--fb-text);
    letter-spacing: -0.2px;
}
.public-nav-brand img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.public-nav-brand-mark {
    background: linear-gradient(155deg, var(--fb-blue), var(--fb-blue-dark));
    color: white;
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.public-nav-links { display: flex; align-items: center; gap: 26px; }
.public-nav-links a { font-size: 14px; font-weight: 600; color: var(--fb-text-sec); }
.public-nav-links a:hover, .public-nav-links a.active { color: var(--fb-blue); }
.public-nav-links a.public-nav-login {
    color: white;
    margin-left: 6px;
}
.public-nav-toggle {
    display: none;
    background: none; border: none; cursor: pointer; color: var(--fb-text);
    padding: 4px;
    position: relative;
    z-index: 60;
}

/* ---------- Hero ---------- */
.public-hero {
    position: relative;
    overflow: hidden;
    background: var(--fb-white);
    padding: 56px 24px 70px;
}
.public-hero::before,
.public-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    z-index: 0;
    pointer-events: none;
}
.public-hero::before {
    width: 680px; height: 680px;
    top: -320px; left: 8%;
    background: radial-gradient(circle, var(--fb-blue-tint) 0%, transparent 70%);
}
.public-hero::after {
    width: 460px; height: 460px;
    bottom: -240px; right: 4%;
    background: radial-gradient(circle, #E9F7EE 0%, transparent 70%);
}
.public-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
    gap: 36px;
}
.public-hero-text { text-align: left; padding-top: 18px; }
.public-hero h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1.3px;
    line-height: 1.08;
    margin: 0 0 18px;
    color: var(--fb-text);
}
.public-hero-tagline {
    font-size: 18px;
    color: var(--fb-text-sec);
    line-height: 1.55;
    margin: 0 0 32px;
    max-width: 480px;
}
.public-hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.public-hero-note {
    margin: 24px 0 0;
    font-size: 12.5px;
    color: var(--fb-text-sec);
    display: flex; align-items: center; gap: 6px;
}

/* Hero illustration */
.public-hero-visual { position: relative; display: flex; justify-content: center; align-items: center; min-height: 380px; }
.public-hero-visual svg {
    width: 100%; max-width: 460px; height: auto; display: block;
    filter: drop-shadow(0 24px 48px rgba(20, 88, 214, .18));
    position: relative; z-index: 1;
}
.public-hero-float {
    position: absolute;
    z-index: 2;
    display: flex; align-items: center; gap: 9px;
    background: var(--fb-white);
    border: 1px solid var(--fb-border-soft);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: var(--shadow-lg);
    animation: heroFloat 5s ease-in-out infinite;
}
.public-hero-float strong { display: block; font-size: 12.5px; font-weight: 700; color: var(--fb-text); white-space: nowrap; }
.public-hero-float span { display: block; font-size: 11px; font-weight: 500; color: var(--fb-text-sec); white-space: nowrap; }
.public-hero-float .icon-wrap {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.public-hero-float-1 { top: 2%; right: -4%; animation-delay: 0s; }
.public-hero-float-1 .icon-wrap { background: #E6F7EC; color: #1C9A4B; }
.public-hero-float-2 { bottom: 4%; left: -6%; animation-delay: 1.6s; }
.public-hero-float-2 .icon-wrap { background: var(--fb-blue-tint); color: var(--fb-blue); }
@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}

/* ---------- Trust strip (fills the gap under the hero) ---------- */
.public-trust-strip {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px 64px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.public-trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--fb-border-soft);
    border-radius: var(--radius-md);
}
.public-trust-item .feature-icon { margin-bottom: 0; }
.public-trust-item strong { display: block; font-size: 13.5px; color: var(--fb-text); }
.public-trust-item span { display: block; font-size: 12px; color: var(--fb-text-sec); margin-top: 1px; }

/* ---------- Generic section ---------- */
.public-section { padding: 64px 24px; border-top: 1px solid var(--fb-border-soft); }
.public-section-alt { background: var(--fb-white); }
.public-section-inner { max-width: 1080px; margin: 0 auto; }
.public-section-title {
    font-size: 30px; font-weight: 800; letter-spacing: -0.6px;
    text-align: center; margin: 0 0 12px; color: var(--fb-text);
}
.public-section-sub {
    text-align: center; color: var(--fb-text-sec); font-size: 15.5px;
    max-width: 620px; margin: 0 auto 44px; line-height: 1.55;
}

/* ---------- Feature grid ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.feature-card {
    background: var(--fb-white);
    border: 1px solid var(--fb-border-soft);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--fb-border); }
.feature-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    background: var(--fb-blue-tint); color: var(--fb-blue);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.feature-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; color: var(--fb-text); }
.feature-card p { font-size: 13.5px; color: var(--fb-text-sec); line-height: 1.55; margin: 0; }

/* ---------- Steps ---------- */
.steps-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; position: relative; }
.step-card {
    background: var(--fb-white);
    border: 1px solid var(--fb-border-soft);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
}
.step-number {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(155deg, var(--fb-blue), var(--fb-blue-dark));
    color: white; font-weight: 800; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.step-card h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; color: var(--fb-text); }
.step-card p { font-size: 13px; color: var(--fb-text-sec); line-height: 1.5; margin: 0; }

/* ---------- CTA band ---------- */
.public-cta { padding: 20px 24px 84px; background: var(--fb-white); }
.public-cta-card {
    position: relative;
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(155deg, var(--fb-blue), var(--fb-blue-dark));
    border-radius: 28px;
    padding: 56px 40px;
    text-align: center;
    box-shadow: 0 24px 56px rgba(20, 88, 214, 0.28);
}
.public-cta-card::before,
.public-cta-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}
.public-cta-card::before { width: 260px; height: 260px; top: -120px; right: -60px; }
.public-cta-card::after { width: 200px; height: 200px; bottom: -100px; left: -40px; }
.public-cta-icon {
    position: relative;
    z-index: 1;
    width: 52px; height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    color: white;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
.public-cta-inner { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; }
.public-cta h2 { color: white; font-size: 27px; font-weight: 800; margin: 0 0 10px; letter-spacing: -0.5px; }
.public-cta p { color: rgba(255,255,255,0.85); font-size: 15px; margin: 0 0 26px; }
.public-cta .btn-primary { background: white; color: var(--fb-blue-dark); box-shadow: none; }
.public-cta .btn-primary:hover { background: #EEF1FC; }

/* ---------- Footer ---------- */
.public-footer { background: #10131A; color: #C7CBD6; padding: 56px 24px 24px; }
.public-footer-inner {
    max-width: 1160px; margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr;
    gap: 28px;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.public-footer .public-nav-brand { color: white; margin-bottom: 12px; }
.public-footer-brand p { font-size: 13px; color: #8B90A0; line-height: 1.55; margin: 0; max-width: 260px; }
.public-footer-col h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.6px; color: #6E7383; margin: 0 0 14px; }
.public-footer-col { display: flex; flex-direction: column; gap: 10px; }
.public-footer-col a, .public-footer-address {
    font-size: 13.5px; color: #C7CBD6; display: flex; align-items: center; gap: 7px;
}
.public-footer-col a:hover { color: white; }
.public-footer-bottom {
    max-width: 1160px; margin: 20px auto 0;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    font-size: 12.5px; color: #6E7383;
}
.public-footer-bottom span { display: flex; align-items: center; gap: 6px; }

/* ---------- Static content pages (about / privacy / terms / data-deletion) ---------- */
.public-page { padding: 64px 24px 90px; }
.public-page-inner { max-width: 760px; margin: 0 auto; }
.public-page-eyebrow {
    display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--fb-blue);
    text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 10px;
}
.public-page h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.6px; margin: 0 0 12px; color: var(--fb-text); }
.public-page-lead { font-size: 15.5px; color: var(--fb-text-sec); margin: 0 0 36px; line-height: 1.55; }
.public-page-content h2 { font-size: 19px; font-weight: 700; margin: 34px 0 12px; color: var(--fb-text); }
.public-page-content p { font-size: 14.5px; line-height: 1.7; color: #333A48; margin: 0 0 14px; }
.public-page-content a { color: var(--fb-blue); text-decoration: underline; }
.public-page-list { margin: 0 0 16px; padding-left: 20px; }
.public-page-list li { font-size: 14.5px; line-height: 1.7; color: #333A48; margin-bottom: 8px; }

/* ---------- Contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.4fr; gap: 40px; align-items: start; }
.contact-info { display: flex; flex-direction: column; gap: 22px; }
.contact-info-item { display: flex; align-items: flex-start; gap: 12px; }
.contact-info-item div { font-size: 13.5px; color: var(--fb-text-sec); line-height: 1.5; }
.contact-info-item strong { color: var(--fb-text); font-size: 13.5px; }
.contact-info-item a { color: var(--fb-blue); }
.contact-info-icon {
    width: 34px; height: 34px; flex-shrink: 0;
    background: var(--fb-blue-tint); color: var(--fb-blue);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.contact-form-wrap .panel-empty { margin: 0; }
.settings-field textarea {
    padding: 10px 12px;
    border: 1px solid var(--fb-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    resize: vertical;
}
.settings-field textarea:focus { outline: none; border-color: var(--fb-blue); }

/* ---------- Login page back-link (sits below the Log in button) ---------- */
.auth-back-link {
    margin-top: 22px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 13.5px; font-weight: 600; color: var(--fb-text-sec);
    padding-top: 20px;
    border-top: 1px solid var(--fb-border-soft);
    text-decoration: none;
}
.auth-back-link:hover { color: var(--fb-blue); }

/* ---------- Auth page responsiveness ---------- */
/* Below ~900px there isn't room for both panels: the brand panel is
   dropped and its logo/title move into the top of the form card instead. */
@media (max-width: 900px) {
    .auth-side { display: none; }
    .auth-main { flex: 1 1 100%; background: var(--fb-bg); padding: 24px; }
    .auth-mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 26px;
    }
    .auth-mobile-brand-mark {
        background: linear-gradient(155deg, var(--fb-blue), var(--fb-blue-dark));
        color: #fff;
        width: 38px;
        height: 38px;
        border-radius: 11px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-xs);
        flex-shrink: 0;
    }
    .auth-mobile-brand-name { font-size: 19px; font-weight: 700; color: var(--fb-text); letter-spacing: -0.2px; }
    .auth-card {
        background: var(--fb-white);
        border: 1px solid var(--fb-border-soft);
        border-radius: 16px;
        box-shadow: var(--shadow-lg);
        padding: 32px 28px;
    }
}

@media (max-width: 480px) {
    .auth-main { padding: 16px; align-items: flex-start; padding-top: 40px; }
    .auth-card { padding: 26px 20px; border-radius: 14px; max-width: 100%; }
    .auth-mobile-brand { margin-bottom: 20px; }
    .auth-mobile-brand-mark { width: 34px; height: 34px; border-radius: 10px; }
    .auth-mobile-brand-name { font-size: 18px; }
    .auth-card h1 { font-size: 21px; }
    .auth-sub { font-size: 13.5px; margin-bottom: 20px; }
    .auth-form { gap: 14px; }
    .auth-form input { padding: 11px 12px 11px 38px; font-size: 16px; } /* 16px avoids iOS zoom-on-focus */
    .auth-input-icon { left: 12px; }
    .btn-block { padding: 12px; font-size: 15px; }
    .auth-back-link { margin-top: 16px; padding-top: 14px; font-size: 13px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .public-hero-inner { grid-template-columns: 1fr; gap: 10px; text-align: center; }
    .public-hero-text { text-align: center; padding-top: 0; }
    .public-hero-tagline { margin-left: auto; margin-right: auto; }
    .public-hero-actions { justify-content: center; }
    .public-hero-note { justify-content: center; }
    .public-hero-visual { order: -1; min-height: 0; margin-bottom: 4px; }
    .public-hero-visual svg { max-width: 320px; }
    .public-hero-float { display: none; }
}

@media (max-width: 860px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .steps-row { grid-template-columns: repeat(2, 1fr); }
    .public-trust-strip { grid-template-columns: 1fr; }
    .public-footer-inner { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
    .public-hero h1 { font-size: 34px; }
}

@media (max-width: 640px) {
    .public-nav-toggle { display: flex; }
    .public-nav-links {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--fb-white);
        border-bottom: 1px solid var(--fb-border-soft);
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 10px 24px 20px;
        display: none;
        z-index: 55;
    }
    .public-nav-links.open { display: flex; }
    .public-nav-links a { width: 100%; padding: 11px 0; border-bottom: 1px solid var(--fb-border-soft); }
    .public-nav-links a.public-nav-login {
        width: 100%; margin-left: 0; margin-top: 10px; border-bottom: none;
        justify-content: center; padding: 11px 0;
    }
    .feature-grid { grid-template-columns: 1fr; }
    .steps-row { grid-template-columns: 1fr; }
    .public-footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .public-hero { padding: 36px 20px 48px; }
    .public-hero-visual svg { max-width: 260px; }
    .public-hero h1 { font-size: 27px; margin-bottom: 12px; }
    .public-hero-tagline { font-size: 15px; margin-bottom: 22px; max-width: 320px; }
    .public-hero-actions { flex-direction: column; gap: 10px; margin-bottom: 16px; }
    .public-hero-actions .btn {
        width: 100%;
        padding: 12px 18px;
        font-size: 14px;
        border-radius: 10px;
    }
    .public-hero-note { font-size: 11.5px; }
    .public-section { padding: 40px 20px; }
    .public-section-title { font-size: 22px; }
    .public-section-sub { font-size: 14px; }
    .public-cta { padding: 4px 16px 56px; }
    .public-cta-card { padding: 36px 22px; border-radius: 20px; }
    .public-cta h2 { font-size: 20px; }
    .public-cta .btn-lg { padding: 12px 22px; font-size: 14px; }
    .contact-grid { gap: 24px; }
}

@media (max-width: 420px) {
    .public-hero h1 { font-size: 24px; }
    .public-hero-tagline { font-size: 14.5px; }
    .public-section-title { font-size: 21px; }
    .public-nav-inner { padding: 12px 16px; }
    .public-hero { padding: 32px 16px 44px; }
    .public-section { padding: 36px 16px; }
}
/* =========================================================
   Postiz-inspired application shell
   ========================================================= */
:root {
    --pz-ink: #17151f;
    --pz-muted: #777482;
    --pz-line: #eceaf1;
    --pz-canvas: #fbfbfd;
    --pz-lilac: #f0eaff;
    --pz-purple: #6d3df5;
    --pz-purple-dark: #5630cf;
    --pz-rail-width: 86px;
}

body:has(.postiz-sidebar) { background: var(--pz-canvas) !important; color: var(--pz-ink); }
.postiz-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1000; width: var(--pz-rail-width); display: flex; flex-direction: column; align-items: center; background: #fff; border-right: 1px solid var(--pz-line); padding: 12px 8px 14px; }
.postiz-sidebar-brand { width: 100%; display: flex; justify-content: center; }
.postiz-brand-link { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; color: var(--pz-ink); text-decoration: none; }
.postiz-brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #ddd8ea; border-radius: 13px; background: #fff; color: var(--pz-purple); }
.postiz-brand-image { width: 40px; height: 40px; border-radius: 13px; object-fit: cover; }
.postiz-close-button { display: none; }
.postiz-rail-nav { width: 100%; display: flex; flex: 1; flex-direction: column; align-items: center; gap: 7px; padding-top: 18px; }
.postiz-rail-item { position: relative; width: 68px; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #85818e; background: transparent; border: 0; border-radius: 13px; text-decoration: none; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.postiz-rail-item:hover { color: var(--pz-purple); background: #faf8ff; }
.postiz-rail-item.active { color: var(--pz-purple); background: var(--pz-lilac); }
.postiz-rail-icon { width: 24px; height: 24px; display: grid; place-items: center; }
.postiz-rail-label { font-size: 10px; line-height: 1; font-weight: 600; letter-spacing: .01em; }
.postiz-rail-spacer { flex: 1; min-height: 16px; }
.postiz-rail-settings { width: 100%; position: relative; display: flex; justify-content: center; }
.postiz-settings-toggle { font: inherit; }
.postiz-settings-menu { position: absolute; left: 78px; bottom: 0; min-width: 128px; padding: 7px; border: 1px solid var(--pz-line); border-radius: 12px; background: #fff; box-shadow: 0 12px 30px rgba(30, 22, 55, .08); }
.postiz-settings-link { display: block; padding: 9px 10px; border-radius: 8px; color: var(--pz-muted); font-size: 12px; text-decoration: none; }
.postiz-settings-link:hover, .postiz-settings-link.active { background: var(--pz-lilac); color: var(--pz-purple); }
.postiz-sidebar-account { width: 100%; display: flex; justify-content: center; align-items: center; padding-top: 12px; border-top: 1px solid var(--pz-line); }
.postiz-account-avatar, .postiz-mobile-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e9e2ff; color: var(--pz-purple-dark); font-size: 13px; font-weight: 700; }
.postiz-account-details { display: none; }
.postiz-mobile-topbar { display: none; }
.postiz-sidebar-backdrop { display: none; }
.main-content { margin-left: var(--pz-rail-width); min-height: 100vh; padding: 0 28px 36px; background: var(--pz-canvas); }
.main-content > .topbar, .main-content > header.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; margin: 0 -28px 22px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--pz-line); }
.main-content > .topbar h1, .main-content > header.topbar h1 { margin: 0; color: var(--pz-ink); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.main-content .card, .main-content .panel, .main-content .stat-card, .main-content .table-card { border: 1px solid var(--pz-line); border-radius: 12px; box-shadow: none; background: #fff; }
.main-content .btn { border-radius: 9px; box-shadow: none; font-weight: 650; }
.main-content .btn-primary { background: var(--pz-purple); border-color: var(--pz-purple); }
.main-content .btn-primary:hover { background: var(--pz-purple-dark); border-color: var(--pz-purple-dark); box-shadow: none; }
@media (max-width: 900px) {
    :root { --pz-rail-width: 0px; }
    .postiz-sidebar { width: 246px; align-items: stretch; padding: 14px 12px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 12px 0 32px rgba(30, 22, 55, .08); }
    .postiz-sidebar.open { transform: translateX(0); }
    .postiz-sidebar-brand { justify-content: space-between; align-items: center; }
    .postiz-brand-link { justify-content: flex-start; width: auto; gap: 10px; }
    .postiz-brand-link::after { content: 'Page Manager'; font-size: 14px; font-weight: 750; color: var(--pz-ink); }
    .postiz-close-button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: #f7f5fb; color: var(--pz-muted); cursor: pointer; }
    .postiz-rail-nav { align-items: stretch; gap: 4px; padding-top: 24px; }
    .postiz-rail-item { width: 100%; min-height: 46px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; }
    .postiz-rail-label { font-size: 13px; }
    .postiz-rail-spacer { min-height: 12px; }
    .postiz-sidebar-account { justify-content: flex-start; gap: 10px; padding: 14px 10px 0; }
    .postiz-account-details { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
    .postiz-account-name { overflow: hidden; color: var(--pz-ink); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
    .postiz-account-logout { color: var(--pz-muted); font-size: 11px; text-decoration: none; }
    .postiz-settings-menu { position: static; margin: 4px 14px 8px 50px; box-shadow: none; }
    .postiz-mobile-topbar { position: sticky; top: 0; z-index: 900; height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--pz-line); }
    .postiz-menu-button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: #f7f5fb; color: var(--pz-ink); cursor: pointer; }
    .postiz-mobile-brand { display: flex; align-items: center; gap: 8px; color: var(--pz-ink); font-size: 14px; font-weight: 700; text-decoration: none; }
    .postiz-mobile-brand .postiz-brand-mark { width: 30px; height: 30px; border-radius: 9px; }
    .postiz-mobile-avatar { width: 30px; height: 30px; font-size: 11px; }
    .postiz-sidebar-backdrop { position: fixed; inset: 0; z-index: 999; display: block; background: rgba(24, 19, 36, .28); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    .postiz-sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
    .main-content { margin-left: 0; padding: 0 16px 28px; }
    .main-content > .topbar, .main-content > header.topbar { min-height: 64px; margin: 0 -16px 18px; padding: 0 16px; }
    .main-content > .topbar h1, .main-content > header.topbar h1 { font-size: 19px; }
}
/* Postiz-inspired Calendar and composer */
[hidden] { display: none !important; }
.postiz-content-header { margin-bottom: 0 !important; }
.postiz-header-subtitle { margin: 6px 0 0; color: var(--pz-muted); font-size: 12px; }
.postiz-header-actions { display: flex; align-items: center; gap: 8px; }
.postiz-icon-action { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--pz-line); border-radius: 10px; background: #fff; color: #777482; cursor: pointer; }
.postiz-icon-action:hover { color: var(--pz-purple); background: #faf8ff; }
.postiz-profile-chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 1px solid var(--pz-line); border-radius: 10px; background: #fff; color: var(--pz-muted); font-size: 12px; font-weight: 650; }
.postiz-profile-chip:hover { color: var(--pz-purple); background: #faf8ff; }
.postiz-calendar-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 100px); background: #fff; border: 1px solid var(--pz-line); border-radius: 13px; overflow: hidden; }
.postiz-channel-panel { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--pz-line); background: #fff; }
.postiz-panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 16px 12px; }
.postiz-panel-heading h2 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.postiz-channel-count { display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 7px; background: var(--pz-lilac); color: var(--pz-purple); font-size: 11px; font-weight: 700; }
.postiz-add-channel, .postiz-create-post { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0 12px 8px; min-height: 37px; border-radius: 9px; font-size: 12px; font-weight: 650; cursor: pointer; }
.postiz-add-channel { border: 1px solid var(--pz-line); color: var(--pz-muted); }
.postiz-add-channel:hover { color: var(--pz-purple); background: #faf8ff; }
.postiz-create-post { border: 1px solid var(--pz-purple); background: var(--pz-purple); color: #fff; }
.postiz-create-post:hover { background: var(--pz-purple-dark); }
.postiz-channel-list { flex: 1; overflow-y: auto; padding: 8px 10px; }
.postiz-channel-row { display: flex; align-items: center; width: 100%; gap: 9px; padding: 8px 7px; border: 0; border-radius: 9px; background: transparent; color: var(--pz-ink); text-align: left; cursor: pointer; }
.postiz-channel-row:hover, .postiz-channel-row:focus-visible { background: #faf8ff; }
.postiz-channel-row img { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; object-fit: cover; background: #f2f0f7; }
.postiz-channel-row-name { overflow: hidden; flex: 1; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.postiz-channel-badge { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px; background: #eff9f3; color: var(--pz-green); font-size: 10px; font-weight: 700; }
.postiz-empty-channel { margin: 25px 8px; color: var(--pz-muted); text-align: center; font-size: 11px; line-height: 1.5; }
.postiz-empty-channel span { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto 10px; border-radius: 11px; background: var(--pz-lilac); color: var(--pz-purple); }
.postiz-empty-channel p { margin: 0 0 9px; }
.postiz-empty-channel a { color: var(--pz-purple); font-weight: 650; }
.postiz-channel-footer { padding: 14px 16px; border-top: 1px solid var(--pz-line); color: #aaa6b2; font-size: 10px; }
.postiz-channel-footer span { float: right; color: var(--pz-purple); }
.postiz-calendar-board { min-width: 0; background: #fff; }
.postiz-calendar-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 0 18px; border-bottom: 1px solid var(--pz-line); }
.postiz-view-tabs { display: flex; align-items: center; gap: 3px; }
.postiz-view-tab { padding: 8px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--pz-muted); font: inherit; font-size: 12px; cursor: pointer; }
.postiz-view-tab:hover, .postiz-view-tab.active { background: var(--pz-lilac); color: var(--pz-purple); font-weight: 650; }
.postiz-board-tools { display: flex; gap: 6px; }
.postiz-board-tools .postiz-icon-action { width: 31px; height: 31px; border: 0; }
.postiz-calendar-empty { display: grid; justify-items: center; align-content: center; min-height: 510px; padding: 40px 20px; text-align: center; }
.postiz-empty-glyph { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 15px; border-radius: 17px; background: var(--pz-lilac); color: var(--pz-purple); }
.postiz-calendar-empty h2 { margin: 0 0 7px; font-size: 18px; }
.postiz-calendar-empty p { max-width: 320px; margin: 0 0 18px; color: var(--pz-muted); font-size: 12px; line-height: 1.55; }
.postiz-empty-action { min-height: 36px; padding: 0 14px; border: 1px solid var(--pz-purple); border-radius: 9px; background: var(--pz-purple); color: #fff; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.postiz-empty-action:hover { background: var(--pz-purple-dark); }
.postiz-modal-open { overflow: hidden; }
.postiz-composer-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 22px; }
.postiz-composer-backdrop { position: absolute; inset: 0; background: rgba(26, 21, 39, .38); }
.postiz-composer-dialog { position: relative; z-index: 1; width: min(1180px, 100%); max-height: calc(100vh - 44px); overflow: hidden; border: 1px solid var(--pz-line); border-radius: 15px; background: #fff; box-shadow: 0 18px 54px rgba(29, 19, 54, .16); }
.postiz-composer-header { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 20px; border-bottom: 1px solid var(--pz-line); }
.postiz-composer-header h2 { margin: 0; font-size: 16px; }
.postiz-modal-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: #f7f5fb; color: var(--pz-muted); cursor: pointer; }
.postiz-composer-body.studio-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 340px; gap: 0; max-height: calc(100vh - 102px); overflow-y: auto; }
.postiz-composer-body .studio-col { min-width: 0; padding: 18px; border: 0; border-right: 1px solid var(--pz-line); background: #fff; }
.postiz-composer-body .studio-col:last-child { border-right: 0; }
.postiz-composer-col-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; color: var(--pz-ink); font-size: 12px; font-weight: 700; }
.postiz-composer-col-title span { color: var(--pz-muted); font-weight: 500; }
.postiz-composer-pages .studio-page-list { max-height: 350px; overflow-y: auto; }
.postiz-composer-pages .studio-page-item { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 5px 4px; border-radius: 8px; }
.postiz-composer-pages .studio-page-item:hover { background: #faf8ff; }
.postiz-composer-pages .studio-page-item img { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.postiz-composer-pages .studio-page-name { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.postiz-composer-typebar { display: inline-flex; gap: 3px; margin-bottom: 15px; padding: 3px; border: 1px solid var(--pz-line); border-radius: 9px; }
.postiz-composer-typebar .type-btn { padding: 7px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--pz-muted); font: inherit; font-size: 11px; cursor: pointer; }
.postiz-composer-typebar .type-btn.active { background: var(--pz-lilac); color: var(--pz-purple); font-weight: 700; }
.postiz-composer-editor .studio-field { display: block; margin-bottom: 13px; }
.postiz-composer-editor .studio-field > span { display: block; margin-bottom: 6px; color: var(--pz-muted); font-size: 11px; font-weight: 650; }
.postiz-composer-editor textarea { width: 100%; resize: vertical; min-height: 45px; padding: 10px 11px; border: 1px solid var(--pz-line); border-radius: 9px; background: #fff; color: var(--pz-ink); font: inherit; font-size: 12px; outline: none; }
.postiz-composer-editor textarea:focus { border-color: #c7b7ff; box-shadow: 0 0 0 3px rgba(109, 61, 245, .08); }
.postiz-composer-editor .media-dropzone { min-height: 125px; border: 1px dashed #d7d1e5; border-radius: 10px; background: #fcfbff; }
.postiz-composer-editor .media-dropzone-empty { gap: 5px; min-height: 125px; padding: 18px 10px; }
.postiz-composer-editor .dropzone-icon { color: var(--pz-purple); }
.postiz-composer-editor .media-dropzone-empty p { margin: 0; color: var(--pz-muted); font-size: 11px; text-align: center; }
.postiz-composer-editor .dropzone-hint { font-size: 10px !important; color: #aaa6b2 !important; }
.postiz-composer-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--pz-line); }
.postiz-composer-actions .btn { min-height: 34px; padding: 0 11px; font-size: 11px; }
.postiz-composer-actions .btn-primary { background: var(--pz-purple); border-color: var(--pz-purple); }
.postiz-composer-preview { background: #fcfbff !important; }
.postiz-composer-preview .fb-preview-card { margin: 0; border-color: var(--pz-line); box-shadow: none; }
.postiz-composer-preview .fb-preview-media { min-height: 150px; }
@media (max-width: 950px) {
    .postiz-calendar-layout { grid-template-columns: 205px minmax(0, 1fr); }
    .postiz-composer-body.studio-layout { grid-template-columns: 185px minmax(0, 1fr); }
    .postiz-composer-preview { grid-column: 1 / -1; border-top: 1px solid var(--pz-line) !important; border-right: 0 !important; }
}
@media (max-width: 700px) {
    .postiz-calendar-main { padding-left: 12px; padding-right: 12px; }
    .postiz-content-header { margin-left: -12px !important; margin-right: -12px !important; padding-left: 12px !important; padding-right: 12px !important; }
    .postiz-header-subtitle, .postiz-profile-chip span { display: none; }
    .postiz-calendar-layout { display: block; min-height: auto; }
    .postiz-channel-panel { border-right: 0; border-bottom: 1px solid var(--pz-line); }
    .postiz-channel-list { display: flex; gap: 5px; max-height: 86px; padding: 5px 10px 10px; overflow-x: auto; }
    .postiz-channel-row { min-width: 145px; }
    .postiz-channel-footer { display: none; }
    .postiz-calendar-toolbar { min-height: 56px; padding: 0 10px; overflow-x: auto; }
    .postiz-view-tab { padding-left: 8px; padding-right: 8px; font-size: 11px; }
    .postiz-calendar-empty { min-height: 330px; }
    .postiz-composer-modal { align-items: start; padding: 8px; }
    .postiz-composer-dialog { max-height: calc(100vh - 16px); border-radius: 12px; }
    .postiz-composer-body.studio-layout { display: block; max-height: calc(100vh - 74px); }
    .postiz-composer-body .studio-col { border-right: 0; border-bottom: 1px solid var(--pz-line); }
    .postiz-composer-pages .studio-page-list { max-height: 150px; }
    .postiz-composer-preview { border-bottom: 0 !important; }
}
/* Postiz-inspired Integrations screen */
.postiz-integration-page .main-content { max-width: 1320px; }
.postiz-integration-page .account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px; }
.postiz-integration-page .account-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 16px; border: 1px solid var(--pz-line); border-radius: 12px; background: #fff; box-shadow: none; }
.postiz-integration-page .account-card .account-avatar { width: 48px; height: 48px; border-radius: 13px; object-fit: cover; }
.postiz-integration-page .account-info { min-width: 0; }
.postiz-integration-page .account-info h3 { margin: 2px 0 5px; color: var(--pz-ink); font-size: 13px; }
.postiz-integration-page .account-meta { margin: 0; color: var(--pz-muted); font-size: 11px; }
.postiz-integration-page .account-card-actions { grid-column: 1 / -1; display: flex; gap: 7px; padding-top: 12px; border-top: 1px solid var(--pz-line); }
.postiz-integration-page .account-card-actions .btn { min-height: 32px; padding: 0 10px; font-size: 11px; }
.postiz-integration-page .account-card-actions .btn-view-pages { flex: 1; border-color: var(--pz-line); color: var(--pz-muted); }
.postiz-integration-page .account-card-actions .btn-view-pages:hover { background: #faf8ff; color: var(--pz-purple); }
.postiz-integration-page .account-card-actions .btn-danger { border: 1px solid #f0d7dc; background: #fff; color: #c54b5c; }
.postiz-integration-page .account-card-actions .btn-danger:hover { background: #fff6f7; }
.postiz-integration-page .empty-state { min-height: 460px; display: grid; justify-items: center; align-content: center; padding: 36px 20px; border: 1px solid var(--pz-line); border-radius: 13px; background: #fff; box-shadow: none; text-align: center; }
.postiz-integration-page .empty-state-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 14px; border-radius: 17px; background: var(--pz-lilac); color: var(--pz-purple); }
.postiz-integration-page .empty-state h2 { margin: 0 0 7px; color: var(--pz-ink); font-size: 17px; }
.postiz-integration-page .empty-state p { max-width: 360px; margin: 0 0 18px; color: var(--pz-muted); font-size: 12px; line-height: 1.55; }
.postiz-integration-page .modal-overlay { background: rgba(26, 21, 39, .38); }
.postiz-integration-page .modal { border: 1px solid var(--pz-line); border-radius: 14px; box-shadow: 0 18px 54px rgba(29, 19, 54, .16); }
@media (max-width: 600px) { .postiz-integration-page .account-grid { grid-template-columns: 1fr; } .postiz-integration-page .postiz-header-subtitle { display: none; } }
.postiz-integration-page .modal { border: 1px solid var(--pz-line); border-radius: 14px; box-shadow: 0 18px 54px rgba(29, 19, 54, .16); }
@media (max-width: 600px) { .postiz-integration-page .account-grid { grid-template-columns: 1fr; } .postiz-integration-page .postiz-header-subtitle { display: none; } }

/* Final card alignment correction */
.postiz-integration-page .account-card-actions { flex-direction: row; align-items: center; justify-content: flex-start; }
.postiz-integration-page .account-card-actions .btn-view-pages { flex: 0 1 auto; }
.postiz-integration-page .account-card-actions .btn-danger { flex: 0 0 auto; }
