/* header of the cabinet: one line with brand, menu and user; the menu opens from a button on narrow screens */
header {
    color: var(--color-header-text);
    background-color: var(--brand);
}

.cab-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
    min-height: 56px;
}

.cab-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    white-space: nowrap;
    min-height: var(--tap);
}

.cab-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: auto;
}

.cab-nav a, .cab-user {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: var(--radius);
    color: inherit;
    font-size: 15px;
    text-decoration: none;
}

/* leaving is a form with a button that looks as the other items of the menu */
.cab-logout {
    display: contents;
}

.cab-logout button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: var(--radius);
    color: inherit;
    background: none;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
}

.cab-logout button:hover {
    background-color: var(--brand-strong);
}

.cab-nav a:hover {
    background-color: var(--brand-strong);
}

.cab-nav a[aria-current="page"] {
    background-color: var(--surface);
    color: var(--brand);
    font-weight: 600;
}

.cab-nav a:focus-visible, .cab-menu-button:focus-visible {
    outline: 2px solid var(--surface);
    outline-offset: 2px;
}

.cab-user {
    opacity: 0.85;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0;
    margin-left: 4px;
}

/* name of an account registered by e-mail is its address: a long one is cut, the whole is in the hint; the menu stays in
   one line beside the brand, the name gives way first */
@media (min-width: 1161px) {
    .cab-bar {
        flex-wrap: nowrap;
    }

    .cab-brand {
        flex-shrink: 0;
    }

    .cab-nav {
        flex: 0 1 auto;
        flex-wrap: nowrap;
        min-width: 0;
    }

    .cab-nav a, .cab-logout button {
        flex-shrink: 0;
    }

    .cab-user {
        display: inline-block;
        flex: 0 1 auto;
        min-width: 48px;
        line-height: 40px;
        max-width: 220px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* a computer of a middle width: items are closer, so the admin with all items fits too */
@media (min-width: 1161px) and (max-width: 1400px) {
    .cab-nav a, .cab-user, .cab-logout button {
        padding: 0 9px;
    }
}

.cab-menu-button {
    display: none;
    margin-left: auto;
    min-height: var(--tap);
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
}

@media (max-width: 1160px) {
    .cab-menu-button {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .cab-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        margin: 0;
        padding-bottom: 8px;
    }

    .cab-nav.open {
        display: flex;
    }

    .cab-nav a, .cab-user, .cab-logout button {
        min-height: var(--tap);
        font-size: 16px;
    }

    .cab-user {
        order: -1;
        border-left: none;
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.35);
        overflow-wrap: anywhere;
    }
}

main h3 {
    margin-bottom: 15px;
}

/* modal window */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    background-color: var(--color-modal-background);
}

.modal-selector{
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    text-align: center;
    background-color: var(--color-dashboard-modal-background);
}

.form-container {
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 400px;
    background-color: var(--color-dashboard-modal-background);
}

/* the narrowest phones (320 px): the brand and the menu button stay on one line */
@media (max-width: 380px) {
    .cab-brand {
        font-size: 16px;
        gap: 8px;
    }

    .cab-menu-word {
        display: none;
    }
}

/* answers of support the user has not read yet */
.cab-badge {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    color: #ffffff;
    background-color: #c62828;
}
