/* Sidebar + bottom nav layout */

.cm-site-body { background: var(--cm-surface); }
.cm-site-wrapper { display: flex; min-height: 100vh; }
.cm-site-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }

@media (max-width: 991.98px) {
    .cm-site-body { padding-bottom: 80px; }
    .cm-site-body.cm-sheet-open { overflow: hidden; }
}

/* Brand shared */
.brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-accent));
    border-radius: 0.6rem;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.1rem; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(15, 76, 117, 0.25);
}
.brand-icon.sm { width: 34px; height: 34px; font-size: 0.95rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 1rem; font-weight: 700; color: var(--cm-dark); }
.brand-tagline {
    font-size: 0.65rem; font-weight: 600; color: var(--cm-accent);
    text-transform: uppercase; letter-spacing: 0.04em;
}

/* ── Sidebar desktop ── */
.cm-sidebar {
    width: 272px; flex-shrink: 0;
    background: var(--cm-dark);
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: sticky; top: 0;
    height: 100vh; overflow-y: auto;
}
.cm-sidebar-brand {
    display: flex; align-items: center; gap: 0.75rem;
    text-decoration: none;
    padding: 0 0.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1.25rem;
}
.cm-sidebar-brand .brand-name { color: #fff; font-size: 0.95rem; }
.cm-sidebar-brand .brand-tagline { color: rgba(255,255,255,0.5); }

.cm-sidebar-search { position: relative; margin-bottom: 1.5rem; }
.cm-sidebar-search i {
    position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,0.4); font-size: 0.85rem;
}
.cm-sidebar-search input {
    width: 100%; padding: 0.55rem 0.85rem 0.55rem 2.25rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 0.5rem; color: #fff; font-size: 0.85rem;
}
.cm-sidebar-search input::placeholder { color: rgba(255,255,255,0.4); }
.cm-sidebar-search input:focus {
    outline: none; background: rgba(255,255,255,0.12); border-color: var(--cm-accent);
}

.cm-sidebar-label {
    display: block; font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 0 0.75rem; margin-bottom: 0.5rem;
}
.cm-sidebar-nav { display: flex; flex-direction: column; gap: 0.15rem; }
.cm-sidebar-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.75rem; border-radius: 0.5rem;
    color: rgba(255,255,255,0.7); text-decoration: none;
    font-weight: 500; font-size: 0.9rem;
    transition: all var(--cm-transition);
    border: none; background: none; width: 100%;
    cursor: pointer; text-align: left;
}
.cm-sidebar-link i { font-size: 1.1rem; width: 22px; text-align: center; opacity: 0.75; }
.cm-sidebar-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.cm-sidebar-link.active {
    background: var(--cm-primary); color: #fff; font-weight: 600;
}
.cm-sidebar-link.active i { opacity: 1; color: #7dd3c0; }
.cm-sidebar-spacer { flex: 1; min-height: 1rem; }
.cm-sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    display: flex; flex-direction: column; gap: 0.15rem;
}
.cm-sidebar-user {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem; margin: 0.5rem 0;
    background: rgba(255,255,255,0.06); border-radius: 0.65rem;
    text-decoration: none; transition: background var(--cm-transition);
}
.cm-sidebar-user:hover { background: rgba(255,255,255,0.1); }
.cm-sidebar-user-info { display: flex; flex-direction: column; min-width: 0; }
.cm-sidebar-user-info strong {
    color: #fff; font-size: 0.85rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cm-sidebar-user-info small { color: rgba(255,255,255,0.45); font-size: 0.75rem; }
.cm-sidebar-logout { color: rgba(255,255,255,0.55) !important; }
.cm-sidebar-logout:hover { color: #ff8a8a !important; background: rgba(255,100,100,0.1) !important; }
.cm-sidebar-register { margin-top: 0.5rem; font-size: 0.875rem; border-radius: 0.5rem !important; }
.cm-sidebar-copy { text-align: center; font-size: 0.7rem; color: rgba(255,255,255,0.25); margin: 1rem 0 0; }

.cm-user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--cm-primary-light), var(--cm-accent));
    color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}

/* ── Mobile header ── */
.cm-mobile-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--cm-space-md, 1rem) var(--cm-page-x, 1.125rem);
    background: #fff;
    border-bottom: 1px solid var(--cm-border);
    position: sticky; top: 0; z-index: 100;
}
.cm-mobile-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.cm-mobile-brand .brand-name { font-size: 0.9rem; }
.cm-mobile-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--cm-primary), var(--cm-accent));
    color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; text-decoration: none;
}

/* ── Bottom nav ── */
.cm-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040;
    display: flex; background: #fff;
    border-top: 1px solid var(--cm-border);
    box-shadow: 0 -4px 20px rgba(11, 37, 69, 0.08);
    padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
}
.cm-bottom-link {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 0.15rem;
    padding: 0.45rem 0.25rem;
    color: var(--cm-text-muted); text-decoration: none;
    font-size: 0.65rem; font-weight: 600;
    border: none; background: none; cursor: pointer;
    transition: color var(--cm-transition);
}
.cm-bottom-link i { font-size: 1.25rem; }
.cm-bottom-link.active { color: var(--cm-primary); }
.cm-bottom-link.active i { color: var(--cm-accent); }

/* ── Sheet (sobe de baixo) ── */
.cm-sheet-overlay {
    position: fixed; inset: 0;
    background: rgba(11, 37, 69, 0.5);
    z-index: 1045; opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cm-sheet-overlay.open { opacity: 1; visibility: visible; }

.cm-mobile-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050;
    background: #fff;
    border-radius: 1.25rem 1.25rem 0 0;
    max-height: 88vh; overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    padding: 0 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 40px rgba(11, 37, 69, 0.15);
}
.cm-mobile-sheet.open { transform: translateY(0); }

.cm-sheet-handle {
    width: 40px; height: 4px; background: var(--cm-border);
    border-radius: 2px; margin: 0.75rem auto 1rem;
}
.cm-sheet-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem;
}
.cm-sheet-header strong { display: block; font-size: 1.1rem; color: var(--cm-dark); }
.cm-sheet-header small { color: var(--cm-text-muted); font-size: 0.8rem; }
.cm-sheet-close {
    width: 36px; height: 36px;
    border: 1px solid var(--cm-border); border-radius: 50%;
    background: var(--cm-surface); color: var(--cm-text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--cm-transition);
}
.cm-sheet-close:hover { background: var(--cm-accent-light); color: var(--cm-primary); }

.cm-sheet-search { position: relative; margin-bottom: 1rem; }
.cm-sheet-search i {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--cm-text-muted);
}
.cm-sheet-search input {
    width: 100%; padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--cm-border); border-radius: 0.65rem;
    background: var(--cm-surface); font-size: 0.9rem;
}
.cm-sheet-search input:focus {
    outline: none; border-color: var(--cm-primary-light);
    box-shadow: 0 0 0 3px rgba(15, 76, 117, 0.1);
}

.cm-sheet-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.cm-sheet-link {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.85rem 1rem; border-radius: 0.65rem;
    color: var(--cm-text); text-decoration: none;
    font-weight: 500; font-size: 0.95rem;
    transition: all var(--cm-transition);
    border: none; background: none; width: 100%;
    cursor: pointer; text-align: left;
}
.cm-sheet-link i:first-child { width: 22px; text-align: center; font-size: 1.15rem; color: var(--cm-text-muted); }
.cm-sheet-link .bi-chevron-right { font-size: 0.75rem; color: var(--cm-border); }
.cm-sheet-link:hover, .cm-sheet-link.active { background: var(--cm-accent-light); color: var(--cm-primary); }
.cm-sheet-link.active i:first-child { color: var(--cm-accent); }
.cm-sheet-divider { height: 1px; background: var(--cm-border); margin: 1rem 0; }
.cm-sheet-auth { padding-bottom: 0.5rem; }
.cm-sheet-logout { color: #dc3545 !important; }
.cm-sheet-logout:hover { background: #fde8e8 !important; }

/* Page sections inside main */
.cm-site-main .cm-section-alt { background: var(--cm-surface); }
.cm-site-main .cm-page-header { background: var(--cm-surface); }
