.site-header,
.site-main,
.flash-stack {
    width: min(1448px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.site-header {
    position: relative;
    z-index: 50;
    padding-top: 18px;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 88px;
    padding: 18px 28px 18px 34px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 34px rgba(74, 106, 61, 0.08);
    backdrop-filter: blur(18px);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    min-width: 0;
    color: var(--green-900);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.site-brand svg,
.site-nav svg,
.site-header__actions svg,
.filter-bar svg,
.field__control svg,
.panel-card svg,
.side-nav__icon svg,
.app-stat-card__icon svg,
.admin-stat-card__icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-brand svg {
    width: 44px;
    height: 44px;
    color: var(--green-700);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex: 1 1 auto;
    min-width: 0;
}

.site-nav a {
    position: relative;
    padding: 14px 12px 16px;
    color: #28352c;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.site-nav a.is-active {
    color: var(--green-800);
}

.site-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 64px;
    height: 4px;
    border-radius: 999px;
    background: var(--green-700);
    transform: translateX(-50%);
}

.site-header__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex: 0 0 auto;
}

.site-header__actions--guest .site-action-login {
    min-width: 104px;
}

.profile-menu {
    position: relative;
}

.profile-menu summary {
    list-style: none;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.profile-menu__summary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 6px 18px 6px 8px;
    border: 1px solid rgba(35, 76, 43, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
    color: #24312a;
}

.profile-menu__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: linear-gradient(180deg, #5b9a5f 0%, #2f7338 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

.profile-menu__name {
    font-size: 18px;
    font-weight: 700;
}

.profile-menu__summary svg {
    width: 16px;
    height: 16px;
}

.profile-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 100;
    min-width: 188px;
    padding: 10px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(35, 76, 43, 0.08);
}

.profile-menu__panel a {
    display: block;
    padding: 11px 12px;
    border-radius: 12px;
    color: #24312a;
    font-size: 14px;
    font-weight: 600;
}

.profile-menu__panel a:hover {
    background: var(--green-200);
}

.flash-stack {
    margin-top: 16px;
}

.flash-item {
    margin: 0 0 10px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(68, 125, 76, 0.15);
    box-shadow: var(--shadow-md);
    color: var(--green-900);
}

.site-main {
    padding: 18px 0 60px;
}

.page-auth .site-main,
.page-not-found .site-main {
    padding-top: 22px;
}

.page-app .site-main {
    padding-top: 26px;
}

.page-app .site-nav {
    display: none;
}

.site-action-home {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    font-size: 14px;
}

.site-action-home svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.page-app .site-action-home {
    display: inline-flex;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 28px;
    box-sizing: border-box;
}

.app-sidebar {
    position: sticky;
    top: 18px;
    align-self: start;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 36px 20px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-md);
}

.app-sidebar--admin {
    background: linear-gradient(180deg, #0f3619 0%, #143f20 100%);
    color: rgba(255, 255, 255, 0.88);
}

.app-content {
    min-width: 0;
}

.side-nav {
    display: grid;
    gap: 14px;
}

.side-nav__item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 0 20px;
    border-radius: 18px;
    color: #2b342d;
    font-size: 17px;
    font-weight: 700;
}

.side-nav__item.is-active {
    color: var(--green-700);
    background: linear-gradient(90deg, rgba(229, 241, 226, 0.92) 0%, rgba(243, 248, 241, 0.92) 100%);
}

.app-sidebar--admin .side-nav__item {
    color: rgba(255, 255, 255, 0.86);
}

.app-sidebar--admin .side-nav__item.is-active {
    color: #fff;
    background: rgba(76, 156, 78, 0.32);
}

.side-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: currentColor;
}

.side-nav__icon svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 1260px) {
    .site-header__inner {
        padding-left: 24px;
        padding-right: 24px;
    }

    .auth-shell,
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 920px) {
    .site-header,
    .site-main,
    .flash-stack {
        width: min(100% - 24px, 1448px);
    }

    .site-header__inner {
        flex-wrap: wrap;
        justify-content: center;
        gap: 18px 26px;
        padding-top: 22px;
        padding-bottom: 20px;
    }

    .site-brand,
    .site-header__actions {
        width: 100%;
        justify-content: center;
    }

    .site-header__inner--guest {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 14px;
    }

    .site-header__inner--guest .site-brand,
    .site-header__inner--guest .site-header__actions {
        width: auto;
        flex: 0 1 auto;
    }

    .site-header__inner--guest .site-header__actions {
        justify-content: flex-end;
    }

    .site-nav {
        display: none;
    }

    .site-header__actions--guest {
        width: auto;
        justify-content: flex-end;
    }

    .site-header__actions--guest .site-action-login {
        min-width: 116px;
    }
}

@media (max-width: 640px) {
    .site-header {
        padding-top: 12px;
    }

    .site-header__inner {
        min-height: 0;
        padding: 18px 18px 16px;
        border-radius: 24px;
    }

    .site-brand {
        gap: 10px;
    }

    .site-brand svg {
        width: 36px;
        height: 36px;
    }

    .site-brand span {
        font-size: 17px;
    }

    .site-header__actions {
        gap: 10px;
    }

    .site-header__inner--guest {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .site-header__inner--guest .site-brand {
        min-width: 0;
    }

    .site-header__inner--guest .site-brand span {
        font-size: 15px;
        line-height: 1.2;
    }

    .site-header__inner--guest .site-action-login {
        min-width: 92px;
        min-height: 42px;
        padding-left: 18px;
        padding-right: 18px;
        font-size: 14px;
    }

    .site-main {
        padding-top: 14px;
        padding-bottom: 44px;
    }

    .app-sidebar {
        border-radius: 24px;
    }
}
