*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: #f5f6f8;
    color: #172033;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.4;
}

.impersonation-banner {
    width: 100%;
    background: #fff4e5;
    border-bottom: 1px solid #fdb022;
}

.impersonation-banner-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.impersonation-message {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #93370d;
    font-size: 0.9rem;
}

.impersonation-message > strong {
    color: #7a2e0e;
}

.impersonation-return-button {
    border: 1px solid #dc6803;
    border-radius: 7px;
    background: #ffffff;
    color: #b54708;
    padding: 7px 13px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.impersonation-return-button:hover {
    background: #fffaeb;
}

.impersonation-return-button:focus-visible {
    outline: 2px solid #f79009;
    outline-offset: 2px;
}

@media (max-width: 700px) {
    .impersonation-banner-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .impersonation-message {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
}

.navbar {
    position: relative;
    z-index: 100;
    min-height: 62px;
    background: #111827;
    color: #fff;
    box-shadow: 0 2px 10px rgb(16 24 40 / 16%);
}

.navbar-inner {
    display: flex;
    align-items: stretch;
    width: min(calc(100% - 32px), 1500px);
    min-height: 62px;
    margin: 0 auto;
}

.navbar-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    margin-right: 22px;
    color: #fff;
    font-size: .96rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgb(255 255 255 / 24%);
    border-radius: 8px;
    background: #fff;
    font-size: 1rem;
}

.navbar-groups,
.navbar-account {
    display: flex;
    align-items: stretch;
}

.navbar-groups {
    min-width: 0;
}

.navbar-account {
    flex: 0 0 auto;
    margin-left: auto;
}

.nav-group {
    position: relative;
}

.nav-group > summary {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 62px;
    padding: 0 13px;
    border-bottom: 3px solid transparent;
    color: #f8fafc;
    font-size: .88rem;
    font-weight: 700;
    list-style: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 150ms ease;
}

.nav-group > summary::-webkit-details-marker {
    display: none;
}

.nav-group > summary:hover,
.nav-group[open] > summary {
    background: rgb(255 255 255 / 8%);
}

.nav-group.active > summary {
    border-bottom-color: #60a5fa;
    background: rgb(255 255 255 / 6%);
}

.nav-group > summary:focus-visible,
.navbar-brand:focus-visible,
.nav-menu-link:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: -3px;
}

.nav-chevron {
    width: 7px;
    height: 7px;
    border-right: 2px solid #aebbd0;
    border-bottom: 2px solid #aebbd0;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 150ms ease;
}

.nav-group[open] .nav-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.nav-menu {
    position: absolute;
    z-index: 110;
    top: calc(100% + 7px);
    left: 0;
    width: 245px;
    overflow: hidden;
    padding: 7px;
    border: 1px solid #d7deea;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 16px 35px rgb(16 24 40 / 20%);
}

.nav-menu::before {
    position: absolute;
    top: -7px;
    left: 20px;
    width: 12px;
    height: 12px;
    border-top: 1px solid #d7deea;
    border-left: 1px solid #d7deea;
    background: #fff;
    content: "";
    transform: rotate(45deg);
}

.nav-menu-right {
    right: 0;
    left: auto;
}

.nav-menu-right::before {
    right: 22px;
    left: auto;
}

.nav-menu-title {
    display: block;
    padding: 7px 10px 6px;
    color: #7b879e;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.nav-menu-link {
    display: flex;
    align-items: center;
    min-height: 39px;
    padding: 8px 10px;
    border-radius: 7px;
    color: #26334a;
    font-size: .86rem;
    font-weight: 600;
    text-decoration: none;
}

.nav-menu-link:hover {
    background: #f0f5ff;
    color: #1849a9;
}

.nav-menu-link.active {
    background: #e7efff;
    color: #1849a9;
    font-weight: 800;
}

.logout-link {
    margin-top: 4px;
    border-top: 1px solid #e5e9f0;
    border-radius: 0 0 7px 7px;
    color: #b42318;
}

.logout-link:hover {
    background: #fff1f0;
    color: #b42318;
}

.account-group > summary {
    padding-right: 8px;
    padding-left: 12px;
}

.account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #315fce;
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
}

.account-name {
    max-width: 125px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.container {
    width: min(calc(100% - 40px), 1200px);
    margin: 30px auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background: #f0f0f0;
}

.flash-list {
    margin-bottom: 18px;
}

.flash {
    margin-bottom: 10px;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.flash-success {
    border-color: #75e0a7;
    background: #ecfdf3;
    color: #067647;
}

.flash-danger,
.flash-error {
    border-color: #fda29b;
    background: #fef3f2;
    color: #b42318;
}

.flash-warning {
    border-color: #fec84b;
    background: #fffaeb;
    color: #b54708;
}

.flash-info {
    border-color: #84adff;
    background: #eff4ff;
    color: #1849a9;
}

.actions {
    margin-bottom: 20px;
}

@media (max-width: 980px) {
    .navbar-inner {
        flex-wrap: wrap;
        width: min(calc(100% - 24px), 1500px);
    }

    .navbar-brand {
        min-height: 56px;
    }

    .navbar-account {
        min-height: 56px;
        order: 2;
    }

    .navbar-groups {
        flex: 0 0 100%;
        order: 3;
        border-top: 1px solid rgb(255 255 255 / 12%);
    }

    .nav-group > summary {
        min-height: 46px;
    }
}

@media (max-width: 700px) {
    .navbar-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        width: 100%;
        padding: 0 12px;
    }

    .navbar-brand {
        grid-column: 1;
        grid-row: 1;
    }

    .navbar-account {
        grid-column: 2;
        grid-row: 1;
    }

    .account-name {
        display: none;
    }

    .navbar-groups {
        display: block;
        grid-column: 1 / -1;
        grid-row: 2;
        padding: 6px 0 9px;
    }

    .nav-group > summary {
        min-height: 42px;
        border: 0;
        border-radius: 7px;
    }

    .nav-group.active > summary {
        box-shadow: inset 3px 0 #60a5fa;
    }

    .nav-menu,
    .nav-menu-right {
        position: static;
        width: 100%;
        margin: 2px 0 6px;
        box-shadow: none;
    }

    .nav-menu::before {
        display: none;
    }

    .account-group .nav-menu {
        position: absolute;
        top: 54px;
        right: 0;
        left: auto;
        width: 220px;
        box-shadow: 0 16px 35px rgb(16 24 40 / 20%);
    }

    .container {
        width: min(calc(100% - 24px), 1200px);
        margin-top: 20px;
    }
}
