:root {
    --app-sidebar-width: 17.5rem;
    --app-topbar-height: 4.25rem;
    --app-border: #ded6cc;
    --app-border-strong: #c9b9a8;
    --app-bg: #f7f3ee;
    --app-surface: #fffdfa;
    --app-surface-soft: #fbf7f1;
    --app-text: #28231f;
    --app-muted: #766d64;
    --app-accent: #9f6a55;
    --app-accent-dark: #714635;
    --app-accent-soft: #f2e3da;
    --app-secondary: #1f6f68;
    --app-sidebar: #221b18;
    --app-sidebar-muted: #c8bbb0;
    --app-shadow: 0 14px 35px rgba(49, 36, 29, .08);
}

html,
body {
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at top left, rgba(159, 106, 85, .14), transparent 28rem),
        linear-gradient(135deg, #fbf8f3 0%, var(--app-bg) 48%, #f2ede7 100%);
    color: var(--app-text);
    font-family: var(--font-sans);
    margin: 0;
}

a {
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 14rem),
        var(--app-sidebar);
    bottom: 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    left: 0;
    position: fixed;
    top: 0;
    width: var(--app-sidebar-width);
    z-index: 1040;
    box-shadow: 12px 0 34px rgba(36, 27, 23, .16);
}

.sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.15rem 1.25rem;
}

.brand-link {
    align-items: center;
    color: #fff;
    display: flex;
    gap: .75rem;
}

.brand-link:hover {
    color: #fff;
}

.brand-mark {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: .7rem;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .2);
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.75rem;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    width: 2.75rem;
}

.brand-mark img {
    border-radius: .7rem;
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.brand-text {
    display: flex;
    flex-direction: column;
    letter-spacing: .01em;
    line-height: 1.18;
}

.brand-text small {
    color: var(--app-sidebar-muted);
    font-size: .75rem;
}

.sidebar-nav {
    display: grid;
    gap: .55rem;
    overflow-y: auto;
    padding: 1rem .9rem 1.25rem;
}

.sidebar-section {
    display: grid;
    gap: .28rem;
}

.sidebar-section-toggle {
    align-items: center;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 250, 245, .035);
    border: 1px solid rgba(215, 170, 134, .13);
    border-radius: .68rem;
    color: rgba(234, 219, 208, .78);
    cursor: pointer;
    display: flex;
    font-size: .68rem;
    font-weight: 850;
    justify-content: space-between;
    letter-spacing: .13em;
    min-height: 2.35rem;
    padding: .64rem .72rem;
    text-align: left;
    text-transform: uppercase;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
    width: 100%;
}

.sidebar-section-toggle i {
    color: #d7aa86;
    font-size: .82rem;
    transition: transform .22s ease;
}

.sidebar-section-toggle:hover,
.sidebar-section-toggle:focus-visible {
    background: rgba(255, 255, 255, .075);
    border-color: rgba(215, 170, 134, .25);
    color: #fff8ef;
    outline: 0;
}

.sidebar-section-toggle:focus-visible {
    box-shadow: 0 0 0 .16rem rgba(215, 170, 134, .16);
}

.sidebar-section.is-open .sidebar-section-toggle {
    background: linear-gradient(135deg, rgba(255, 250, 245, .09), rgba(215, 170, 134, .08));
    border-color: rgba(215, 170, 134, .28);
    color: #fff8ef;
}

.sidebar-section.is-open .sidebar-section-toggle i {
    transform: rotate(180deg);
}

.sidebar-section-panel {
    display: grid;
    gap: .28rem;
    max-height: 18rem;
    opacity: 1;
    overflow: hidden;
    padding-top: .08rem;
    transition: max-height .24s ease, opacity .18s ease, padding-top .18s ease;
}

.sidebar-section.is-collapsed .sidebar-section-panel {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    pointer-events: none;
}

.sidebar-link {
    align-items: center;
    border: 1px solid transparent;
    border-radius: .65rem;
    color: var(--app-sidebar-muted);
    display: flex;
    gap: .75rem;
    min-height: 2.75rem;
    outline: 0 !important;
    padding: .66rem .78rem;
    position: relative;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.sidebar-link i {
    color: #d4ad8c;
    font-size: 1.05rem;
    width: 1.25rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: transparent;
    border-color: transparent;
    color: #fff;
}

.sidebar-link:hover {
    box-shadow: inset 2px 0 0 rgba(215, 170, 134, .45);
}

.sidebar-link:focus,
.sidebar-link:focus-visible {
    background: transparent;
    border-color: transparent;
    box-shadow: inset 2px 0 0 rgba(215, 170, 134, .78) !important;
    color: #fff;
    outline: 0 !important;
}

.sidebar-link:hover {
    transform: translateX(1px);
}

.sidebar-link.active {
    box-shadow: inset 2px 0 0 rgba(215, 170, 134, .82);
}

.app-content {
    display: flex;
    flex-direction: column;
    margin-left: var(--app-sidebar-width);
    min-height: 100vh;
}

.app-topbar {
    align-items: center;
    backdrop-filter: blur(18px);
    background: rgba(255, 253, 250, .86);
    border-bottom: 1px solid var(--app-border);
    display: flex;
    gap: 1rem;
    height: var(--app-topbar-height);
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-title {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    margin-right: auto;
}

.topbar-title span,
.profile-meta small {
    font-size: .75rem;
}

.topbar-title strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: .02em;
}

.topbar-actions {
    align-items: center;
    display: flex;
    gap: .75rem;
}

.topbar-actions .dropdown-menu {
    background: rgba(255, 253, 250, .98);
    opacity: 0;
    pointer-events: none;
    scale: .96;
    transform-origin: top right;
    translate: 0 .55rem;
    transition:
        opacity .2s ease,
        scale .2s cubic-bezier(.2, .8, .2, 1),
        translate .2s cubic-bezier(.2, .8, .2, 1);
    will-change: opacity, scale, translate;
    z-index: 1080;
}

.topbar-actions .dropdown-menu.show {
    animation: topbar-popover-in .22s cubic-bezier(.2, .8, .2, 1);
    opacity: 1;
    pointer-events: auto;
    scale: 1;
    translate: 0 0;
}

@keyframes topbar-popover-in {
    from {
        opacity: 0;
        scale: .94;
        translate: 0 .7rem;
    }

    to {
        opacity: 1;
        scale: 1;
        translate: 0 0;
    }
}

.icon-btn {
    align-items: center;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: .65rem;
    color: var(--app-text);
    display: inline-flex;
    height: 2.5rem;
    justify-content: center;
    padding: 0;
    width: 2.5rem;
}

.icon-btn:hover {
    background: var(--app-accent-soft);
    border-color: #d8b8a7;
    color: var(--app-accent-dark);
}

.notification-dot {
    background: #dc2626;
    border: 2px solid #fff;
    border-radius: 999px;
    height: .65rem;
    position: absolute;
    right: .55rem;
    top: .55rem;
    width: .65rem;
}

.notification-menu {
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    box-shadow: 0 24px 54px rgba(49, 36, 29, .18), 0 1px 0 rgba(255, 255, 255, .85) inset;
    margin-top: .85rem !important;
    min-width: 21rem;
    padding: .65rem;
}

.notification-menu::before {
    background: var(--app-surface);
    border-left: 1px solid var(--app-border);
    border-top: 1px solid var(--app-border);
    content: "";
    height: .85rem;
    position: absolute;
    right: 1rem;
    top: -.45rem;
    transform: rotate(45deg);
    width: .85rem;
}

.notification-menu-header {
    align-items: center;
    background: linear-gradient(135deg, #fff8f3, #f1dfd4);
    border: 1px solid #ead4c7;
    border-radius: .8rem;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    padding: .85rem;
}

.notification-menu-header span:first-child {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.notification-menu-header small {
    color: var(--app-muted);
    font-size: .74rem;
    margin-top: .18rem;
}

.notification-count {
    align-items: center;
    background: #271d18;
    border-radius: 999px;
    color: #f7d9c4;
    display: inline-flex;
    font-size: .8rem;
    font-weight: 800;
    height: 2rem;
    justify-content: center;
    min-width: 2rem;
    padding: 0 .55rem;
}

.notification-menu-list {
    display: grid;
    gap: .35rem;
    padding-top: .55rem;
}

.notification-menu-item {
    align-items: center;
    border-radius: .8rem;
    color: var(--app-text);
    display: flex;
    gap: .7rem;
    padding: .72rem .65rem;
    text-decoration: none;
    transition: background-color .16s ease, transform .16s ease;
}

.notification-menu-item:hover {
    background: rgba(255, 248, 243, .92);
    color: var(--app-accent-dark);
    transform: translateY(-1px);
}

.notification-menu-item span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.notification-menu-item small {
    color: var(--app-muted);
    font-size: .74rem;
    margin-top: .18rem;
}

.notification-menu-icon,
.notification-menu-empty i {
    align-items: center;
    background: var(--app-accent-soft);
    border: 1px solid #ead4c7;
    border-radius: .7rem;
    color: var(--app-accent-dark);
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.2rem;
    justify-content: center;
    width: 2.2rem;
}

.notification-menu-empty {
    align-items: center;
    color: var(--app-muted);
    display: flex;
    gap: .7rem;
    padding: .85rem .55rem .35rem;
}

.profile-button {
    align-items: center;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    display: inline-flex;
    gap: .6rem;
    min-height: 2.5rem;
    padding: .25rem .65rem .25rem .35rem;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.profile-button:hover,
.profile-button.show {
    background: #fff8f3;
    border-color: #d5b39f;
    box-shadow: 0 10px 24px rgba(49, 36, 29, .1);
}

.profile-avatar {
    align-items: center;
    background: var(--app-accent-soft);
    border-radius: .58rem;
    color: var(--app-accent-dark);
    display: inline-flex;
    font-size: .72rem;
    font-weight: 800;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.profile-meta {
    line-height: 1.1;
    text-align: left;
}

.profile-meta small {
    color: var(--app-muted);
    display: block;
}

.account-menu {
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    box-shadow: 0 24px 54px rgba(49, 36, 29, .18), 0 1px 0 rgba(255, 255, 255, .85) inset;
    margin-top: .85rem !important;
    min-width: 19rem;
    padding: .65rem;
}

.account-menu::before {
    background: var(--app-surface);
    border-left: 1px solid var(--app-border);
    border-top: 1px solid var(--app-border);
    content: "";
    height: .85rem;
    position: absolute;
    right: 1.45rem;
    top: -.45rem;
    transform: rotate(45deg);
    width: .85rem;
}

.account-menu-header {
    align-items: center;
    background: linear-gradient(135deg, #fff8f3, #f1dfd4);
    border: 1px solid #ead4c7;
    border-radius: .8rem;
    display: flex;
    gap: .75rem;
    padding: .85rem;
}

.account-menu-header span:last-child,
.account-menu-item span {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.account-menu-header small,
.account-menu-item small {
    color: var(--app-muted);
    font-size: .74rem;
    margin-top: .18rem;
}

.account-avatar {
    align-items: center;
    background: #271d18;
    border-radius: .75rem;
    color: #f7d9c4;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .8rem;
    font-weight: 800;
    height: 2.65rem;
    justify-content: center;
    width: 2.65rem;
}

.account-menu-status {
    align-items: center;
    color: var(--app-muted);
    display: flex;
    font-size: .78rem;
    gap: .45rem;
    padding: .75rem .55rem .55rem;
}

.status-dot {
    background: #1f9d73;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(31, 157, 115, .12);
    height: .48rem;
    width: .48rem;
}

.account-menu-list {
    display: grid;
    gap: .3rem;
}

.account-menu-item {
    border-radius: .7rem;
    color: var(--app-text);
    gap: .7rem;
    padding: .72rem .65rem;
    white-space: normal;
}

.account-menu-item i {
    align-items: center;
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: .6rem;
    color: var(--app-accent-dark);
    display: inline-flex;
    flex: 0 0 auto;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.account-menu-item.disabled,
.account-menu-item:disabled {
    opacity: .72;
}

.account-menu-item-danger i {
    background: #fff1f0;
    border-color: #f2c9c4;
    color: #a33b30;
}

.app-main {
    background:
        linear-gradient(120deg, rgba(255, 253, 250, .96) 0%, rgba(250, 239, 231, .92) 34%, rgba(247, 243, 238, .94) 68%, rgba(255, 248, 243, .96) 100%);
    background-size: 180% 180%;
    flex: 1;
    overflow: hidden;
    padding: 1.65rem;
    position: relative;
    animation: pageEnter .32s cubic-bezier(.2, .7, .2, 1) both;
}

.app-main::before {
    background:
        linear-gradient(120deg, rgba(255, 253, 250, .08), rgba(215, 170, 134, .22), rgba(255, 248, 243, .1)),
        radial-gradient(circle at 70% 28%, rgba(159, 106, 85, .12), transparent 30rem);
    content: "";
    inset: 0;
    opacity: .34;
    pointer-events: none;
    position: absolute;
    transform: scale(1);
    transform-origin: center;
    animation: appMainBreath 5.8s ease-in-out infinite;
}

.app-main > * {
    position: relative;
    z-index: 1;
}

[data-page-body] {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .2s ease, transform .2s ease;
}

.app-main.is-page-loading [data-page-body] {
    opacity: .45;
    pointer-events: none;
    transform: translateY(.35rem);
}

[data-page-body].page-enter {
    animation: pageEnter .26s ease both;
}

.page-heading {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.page-heading h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: .01em;
    margin: 0 0 .35rem;
}

.breadcrumb-shell .breadcrumb {
    font-size: .9rem;
}

.breadcrumb-shell a {
    color: var(--app-accent-dark);
}

.app-footer {
    align-items: center;
    border-top: 1px solid var(--app-border);
    color: var(--app-muted);
    display: flex;
    font-size: .875rem;
    justify-content: flex-end;
    min-height: 3.5rem;
    padding: .75rem 1.65rem;
    text-align: right;
}

.sidebar-backdrop {
    background: rgba(17, 24, 39, .55);
    bottom: 0;
    display: none;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-open .sidebar-backdrop {
        display: block;
    }

    .app-content {
        margin-left: 0;
    }

    .app-main {
        padding: 1rem;
    }

    .app-footer {
        justify-content: flex-end;
        padding-inline: 1rem;
    }
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(.55rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes appMainBreath {
    0%,
    100% {
        opacity: .22;
        transform: scale(1);
    }

    50% {
        opacity: .58;
        transform: scale(1.035);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
    }
}
