/* ── Dashboard shell ── */
.dashboard-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; transition: grid-template-columns .24s ease; }
body.sidebar-hidden .dashboard-shell { grid-template-columns: 84px 1fr; }

/* ── Sidebar ── */
.dash-sidebar {
    background: #f7f7f8;
    border-right: 1px solid #d1d1d4;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width .24s ease, border-color .2s ease;
    transform: translateX(0);
    opacity: 1;
    height: 100vh;
}
body.sidebar-hidden .dash-sidebar { transform: translateX(0); opacity: 1; }

.mobile-sidebar-backdrop { display: none; }

.brand-strip {
    height: 72px;
    background: #0a3f8f;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px 0 22px;
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -1px;
}
.brand-label { display: inline-flex; align-items: center; background: #ffffff; padding: 8px 12px; border-radius: 8px; }
.brand-image { display: block; height: 34px; width: auto; max-width: 168px; object-fit: contain; }

body.sidebar-hidden .brand-strip { padding: 0 10px; justify-content: center; }
body.sidebar-hidden .brand-label { width: 0; opacity: 0; overflow: hidden; }

.menu-group { padding: 18px 18px 8px; }
.menu-item { display: flex; align-items: center; gap: 10px; color: #6f6f74; font-size: 1.07rem; padding: 10px 8px; border-radius: 8px; margin-bottom: 2px; }
.menu-item.active { color: #191919; font-weight: 700; }
.menu-item:hover { background: #ececef; color: #191919; }
.menu-subgroup { margin: 2px 0 10px 32px; display: none; gap: 8px; }
.menu-subgroup.open { display: grid; }
.menu-subitem { color: #8b8b91; font-size: 0.95rem; }
.menu-subitem.active { color: #191919; font-weight: 700; }
.menu-icon { width: 22px; text-align: center; color: #7d7d82; font-size: 1.1rem; }
.menu-text { white-space: nowrap; }

body.sidebar-hidden .menu-group { padding: 18px 10px 8px; }
body.sidebar-hidden .menu-item { justify-content: center; gap: 0; padding: 11px 0; }
body.sidebar-hidden .menu-item .menu-text,
body.sidebar-hidden .menu-subgroup,
body.sidebar-hidden .help-text { display: none; }
body.sidebar-hidden .menu-icon { width: auto; font-size: 1.18rem; }

.help-link { margin-top: auto; border-top: 1px solid #d1d1d4; padding: 18px; display: flex; align-items: center; gap: 10px; font-size: 1.02rem; color: #2b2b2b; text-decoration: none; }
.help-link:hover { background: #ececef; color: #191919; }
.help-circle { width: 30px; height: 30px; border: 2px solid #171717; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.help-circle-whatsapp {
    border: none;
    background: #25d366;
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.help-whatsapp-icon {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}
body.sidebar-hidden .help-link { justify-content: center; padding: 18px 10px; }

/* ── Main area ── */
.dash-main { display: flex; flex-direction: column; position: relative; min-width: 0; height: 100vh; overflow: hidden; border: none; box-shadow: none; }
.dash-topbar { height: 72px; background: #0a3f8f; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fff; border: none; box-shadow: none; }
.topbar-left,
.topbar-right { display: flex; align-items: center; gap: 12px; }
.top-help-link {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.38);
    background: radial-gradient(circle at 30% 25%, #80c7ff 0%, #1f74d1 45%, #0a3f8f 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(2, 24, 59, .38), inset 0 1px 0 rgba(255,255,255,.28);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.top-help-link::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.28);
    pointer-events: none;
}
.top-help-link-glyph {
    font-size: 1.05rem;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.top-help-link:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 12px 24px rgba(4, 31, 76, .45), inset 0 1px 0 rgba(255,255,255,.32);
    border-color: rgba(255,255,255,.58);
    color: #ffffff;
}
.top-help-link:focus-visible {
    outline: 2px solid #9ed0ff;
    outline-offset: 2px;
}
.top-help-link.is-active {
    background: #ffffff;
    color: #0a3f8f;
    border-color: #ffffff;
    box-shadow: 0 10px 22px rgba(4, 31, 76, .22);
}
.top-help-link.is-active .top-help-link-glyph { text-shadow: none; }
.top-help-menu {
    position: relative;
}
.top-help-menu summary {
    list-style: none;
    cursor: pointer;
}
.top-help-menu summary::-webkit-details-marker { display: none; }
.top-help-menu[open] .top-help-dropdown { display: grid; }
.top-help-dropdown {
    min-width: 210px;
}
.top-user-dropdown-link {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    color: #1d437f;
    font-size: .86rem;
    font-weight: 700;
    text-decoration: none;
}
.top-user-dropdown-link:hover {
    background: #eef4ff;
    color: #123a6d;
}
.top-user-dropdown-link.is-active {
    background: #0c56b4;
    color: #ffffff;
}
.functional-doc-card {
    border: 1px solid #dce4ef;
    border-radius: 12px;
    background: #ffffff;
    padding: 14px;
}
.functional-doc-markdown { color: #1f2f48; line-height: 1.55; }
.functional-doc-markdown h1,
.functional-doc-markdown h2,
.functional-doc-markdown h3,
.functional-doc-markdown h4,
.functional-doc-markdown h5,
.functional-doc-markdown h6 { color: #123a6d; margin: 16px 0 8px; line-height: 1.25; }
.functional-doc-markdown h1 { font-size: 1.35rem; }
.functional-doc-markdown h2 { font-size: 1.14rem; }
.functional-doc-markdown h3 { font-size: 1.02rem; }
.functional-doc-markdown p { margin: 0 0 10px; }
.functional-doc-markdown ul,
.functional-doc-markdown ol { margin: 0 0 12px 20px; }
.functional-doc-markdown li { margin: 0 0 5px; }
.functional-doc-markdown code {
    background: #eef4ff;
    border: 1px solid #d9e5f7;
    border-radius: 6px;
    padding: 1px 6px;
    font-family: Consolas, "Courier New", monospace;
    font-size: .86em;
    color: #0f3f7a;
}
.functional-doc-markdown pre {
    margin: 12px 0;
    background: #f4f8ff;
    border: 1px solid #d6e2f7;
    border-radius: 10px;
    padding: 12px;
    overflow-x: auto;
}
.functional-doc-markdown pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #1f2f48;
}
.functional-doc-markdown a { color: #0a4ca0; font-weight: 600; text-decoration: none; }
.functional-doc-markdown a:hover { text-decoration: underline; }

.sidebar-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 12px;
    background: rgba(255,255,255,.1);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.16); }
.mobile-sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 12px;
    background: rgba(255,255,255,.1);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
}
.mobile-sidebar-toggle:hover { background: rgba(255,255,255,.16); }
.topbar-title { color: rgba(255,255,255,.92); font-size: .96rem; font-weight: 600; }
.top-pill { background: #1b5fc4; border-radius: 18px; padding: 8px 14px; font-weight: 600; }
.top-user-menu { position: relative; }
.top-user-trigger {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.top-user-trigger::-webkit-details-marker { display: none; }
.top-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 170px;
    background: #ffffff;
    border: 1px solid #d6dfef;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 12px 26px rgba(7, 23, 52, .2);
    display: none;
    gap: 8px;
}
.top-user-menu[open] .top-user-dropdown { display: grid; }
.top-role-pill {
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 18px;
    padding: 7px 12px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.top-user-dropdown .top-role-pill {
    background: transparent;
    border: none;
    color: #1f4b8a;
    text-align: center;
    padding: 7px 0;
    font-size: .8rem;
    font-weight: 600;
}
.top-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #15c2bf; font-weight: 700; }
.logout-button {
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.1);
    color: #ffffff;
    font-weight: 700;
    font-size: .86rem;
    line-height: 1;
    border-radius: 999px;
    padding: 9px 14px;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.logout-button:hover {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.58);
    color: #ffffff;
    transform: translateY(-1px);
}
.logout-button:focus-visible {
    outline: 2px solid #9ed0ff;
    outline-offset: 2px;
}
.top-user-dropdown .logout-button {
    width: 100%;
    background: #f2f6fd;
    border-color: #c6d4eb;
    color: #18457f;
}
.top-user-dropdown .logout-button:hover {
    background: #e7effb;
    border-color: #9fb8de;
    color: #123a6d;
    transform: none;
}

.dash-content { padding: 22px 24px 28px; min-width: 0; height: calc(100vh - 72px); overflow-x: hidden; overflow-y: auto; }
