/* ============================================================
   LAYOUT COMPARTIDO
============================================================ */

.app-shell-bar {
    align-items: center;
    display: flex;
    left: 18px;
    position: fixed;
    top: 16px;
    z-index: 1030;
}

.app-menu-button {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d9e3ea;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(36, 49, 58, 0.12);
    color: #136f93;
    display: inline-flex;
    font-size: 1.25rem;
    height: 42px;
    justify-content: center;
    overflow: visible;
    width: 42px;
}

.app-menu-button:hover {
    background: #eaf6fb;
    border-color: #9fd1e4;
}

.app-menu-button .app-menu-alert {
    background-color: #ee1c25 !important;
    border-color: #fff !important;
    box-shadow: 0 0 0 1px rgba(238, 28, 37, 0.25);
    height: 0.7rem;
    padding: 0 !important;
    width: 0.7rem;
}

.app-shell-main {
    padding: 18px 22px 28px;
}

.app-shell-main-fluid {
    margin: 0 auto;
    max-width: 1480px;
    padding-left: 22px;
    padding-right: 22px;
    width: 100%;
}

.app-offcanvas {
    border-right: 1px solid #dce5eb;
    width: min(320px, 88vw) !important;
}

.app-offcanvas-header {
    background: #000000;
    border-bottom: 1px solid #2a2a2a;
    padding: 18px 20px;
}

.app-offcanvas-brand {
    align-items: center;
    display: inline-flex;
    min-width: 0;
}

.app-offcanvas-brand img {
    display: block;
    height: auto;
    max-height: 72px;
    max-width: 180px;
    object-fit: contain;
}

.app-offcanvas-header .btn-close {
    filter: invert(1);
}

.app-offcanvas-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
}

.app-offcanvas-role {
    background: #f6f9fb;
    border: 1px solid #e3ebf0;
    border-radius: 8px;
    padding: 12px;
}

.app-offcanvas-role span {
    color: #7b858d;
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.app-offcanvas-role strong {
    color: #24313a;
    display: block;
    font-size: 1rem;
}

.app-offcanvas-role small {
    color: #7b858d;
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-offcanvas-nav {
    display: grid;
    gap: 8px;
}

.app-offcanvas-section-label {
    color: #7b858d;
    font-size: 0.76rem;
    font-weight: 800;
    margin: 8px 0 0;
    padding: 0 12px;
    text-transform: uppercase;
}

.app-offcanvas-group {
    margin: 0;
}

.app-offcanvas-group-summary {
    align-items: center;
    border-radius: 8px;
    color: #4d5963;
    cursor: pointer;
    display: flex;
    font-weight: 700;
    gap: 10px;
    list-style: none;
    min-height: 42px;
    padding: 10px 12px;
    user-select: none;
}

.app-offcanvas-group-summary::-webkit-details-marker {
    display: none;
}

.app-offcanvas-group-summary::marker {
    content: '';
}

.app-offcanvas-group-summary:hover {
    background: #eaf6fb;
    color: #136f93;
}

.app-offcanvas-group-summary i:first-child {
    font-size: 1.08rem;
    line-height: 1;
}

.app-offcanvas-group-chevron {
    font-size: 0.85rem;
    line-height: 1;
    margin-left: auto;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.app-offcanvas-group[open] > .app-offcanvas-group-summary .app-offcanvas-group-chevron {
    transform: rotate(180deg);
}

.app-offcanvas-group-body {
    display: grid;
    gap: 4px;
    padding: 0 0 4px 12px;
}

.app-offcanvas-group-body .app-offcanvas-link {
    min-height: 38px;
    padding: 8px 12px;
}

.app-offcanvas-form,
.app-offcanvas-logout-form {
    margin: 0;
}

.app-offcanvas-link,
.app-offcanvas-logout {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #4d5963;
    display: flex;
    font-weight: 700;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.app-offcanvas-link:hover {
    background: #eaf6fb;
    color: #136f93;
}

.app-offcanvas-link.is-alert {
    color: #b31218;
}

.app-offcanvas-link.is-alert:hover {
    background: rgba(238, 28, 37, 0.08);
    color: #ee1c25;
}

.app-offcanvas-link-count {
    background: rgba(238, 28, 37, 0.12);
    border-radius: 999px;
    color: #b31218;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-left: auto;
    min-width: 1.5rem;
    padding: 2px 7px;
    text-align: center;
}

.app-offcanvas-link:disabled {
    cursor: default;
    opacity: 1;
}

.app-offcanvas-link:disabled:hover {
    background: transparent;
    color: #4d5963;
}

.app-offcanvas-link.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}

.app-offcanvas-link i,
.app-offcanvas-logout i {
    font-size: 1.08rem;
    line-height: 1;
}

.app-offcanvas-spacer {
    flex: 1;
}

.app-theme-toggle {
    align-items: center;
    background: #f8fafb;
    border: 1px solid #e3ebf0;
    border-radius: 8px;
    color: #4d5963;
    cursor: pointer;
    display: flex;
    font-weight: 700;
    justify-content: space-between;
    min-height: 48px;
    padding: 10px 12px;
}

.app-theme-toggle span {
    align-items: center;
    display: flex;
    gap: 10px;
}

.app-theme-toggle input {
    accent-color: #136f93;
    height: 18px;
    width: 34px;
}

.app-offcanvas-logout {
    background: #fbecec;
    color: #a12f2f;
}

.app-offcanvas-logout:hover {
    background: #f7dfdf;
}

[data-bs-theme="dark"] body.bg-light {
    background: #121820 !important;
    color: #dbe5ea;
}

[data-bs-theme="dark"] .app-menu-button {
    background: #1b2430;
    border-color: #344454;
    color: #8fd3f0;
}

[data-bs-theme="dark"] .app-offcanvas,
[data-bs-theme="dark"] .offcanvas {
    background: #151d27;
    color: #dbe5ea;
}

[data-bs-theme="dark"] .app-offcanvas-header {
    border-bottom-color: #2a3643;
}

[data-bs-theme="dark"] .app-offcanvas-role,
[data-bs-theme="dark"] .app-theme-toggle {
    background: #1b2430;
    border-color: #2f3d4b;
    color: #dbe5ea;
}

[data-bs-theme="dark"] .app-offcanvas-role strong {
    color: #f2f7fa;
}

[data-bs-theme="dark"] .app-offcanvas-role small,
[data-bs-theme="dark"] .app-offcanvas-section-label {
    color: #9dacb7;
}

[data-bs-theme="dark"] .app-offcanvas-link,
[data-bs-theme="dark"] .app-offcanvas-group-summary {
    color: #dbe5ea;
}

[data-bs-theme="dark"] .app-offcanvas-logout {
    background: rgba(238, 28, 37, 0.16);
    color: #ff9aa0;
}

[data-bs-theme="dark"] .app-offcanvas-link:hover,
[data-bs-theme="dark"] .app-offcanvas-group-summary:hover {
    background: #203344;
    color: #8fd3f0;
}

[data-bs-theme="dark"] .app-offcanvas-logout:hover {
    background: rgba(238, 28, 37, 0.28);
    color: #ffc4c7;
}

[data-bs-theme="dark"] .app-offcanvas-link:disabled:hover {
    background: transparent;
    color: #dbe5ea;
}

[data-bs-theme="dark"] .text-muted {
    color: #9dacb7 !important;
}

@media (max-width: 900px) {
    .app-shell-bar {
        left: auto;
        right: max(12px, env(safe-area-inset-right));
        top: max(10px, env(safe-area-inset-top));
    }
}

@media (max-width: 480px) {
    .app-shell-main,
    .app-shell-main-fluid {
        padding: 20px 12px 22px;
    }
}
