/* CMP Platform — Shell layout overrides v1.0.0 */

/* ── Body reset ───────────────────────────────────────────────────────────── */
html,
body.cmp-platform-body {
    margin: 0;
    padding: 0 !important;
    background: var(--cmp-bg, #FAF8F5);
    overflow-x: hidden;
}

body.cmp-platform-body {
    min-height: 100vh;
    width: 100%;
}

/* Ensure app fills viewport on dashboard (shortcode renders .cmp-app directly in body) */
body.cmp-platform-body > .cmp-app {
    width: 100%;
    min-height: 100vh;
}

/* Remove any theme wrapper spacing */
body.cmp-platform-body .kca-main,
body.cmp-platform-body .kca-container,
body.cmp-platform-body .site-content,
body.cmp-platform-body .entry-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}

/* ── Mobile topbar ────────────────────────────────────────────────────────── */
.cmp-platform-topbar {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    height: 54px;
    background: #fff;
    border-bottom: 1px solid rgba(14,14,26,.08);
    position: sticky;
    top: 0;
    z-index: 90;
    flex-shrink: 0;
}
.admin-bar .cmp-platform-topbar {
    top: 46px;
}
@media (min-width: 782px) {
    .admin-bar .cmp-platform-topbar {
        top: 32px;
    }
}

.cmp-platform-topbar__brand {
    flex: 1;
    font-family: "Geist", system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--cmp-text, #0E0E1A);
    text-decoration: none;
    letter-spacing: -.02em;
    text-align: center;
}

.cmp-platform-topbar__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: rgba(14,14,26,.55);
    text-decoration: none;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.cmp-platform-topbar__back:hover {
    background: rgba(14,14,26,.06);
    color: var(--cmp-text, #0E0E1A);
}

/* Hamburger inside platform topbar */
.cmp-platform-hamburger {
    flex-shrink: 0;
}

/* ── Platform main ────────────────────────────────────────────────────────── */
.cmp-platform-main {
    overflow-y: auto;
    min-height: 100vh;
}

/* ── Mobile breakpoint ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .cmp-platform-topbar {
        display: flex;
    }
    /* Override: don't let existing .cmp-hamburger display rule double-show */
    .cmp-platform-hamburger {
        display: inline-flex !important;
    }
    .cmp-platform-main {
        min-height: calc(100vh - 54px);
    }
}

/* ── Admin bar adjustments ────────────────────────────────────────────────── */
body.admin-bar.cmp-platform-body .cmp-sidebar {
    top: 32px !important;
    height: calc(100vh - 32px) !important;
}
@media (max-width: 782px) {
    body.admin-bar.cmp-platform-body .cmp-sidebar {
        top: 46px !important;
        height: calc(100vh - 46px) !important;
    }
}
