:root {
    --portal-navy: #17233b;
    --portal-navy-dark: #10192b;
    --portal-blue: #376fa8;
    --portal-blue-light: #edf4fb;

    --portal-bg: #f4f6f8;
    --portal-card: #ffffff;

    --portal-text: #202733;
    --portal-muted: #667085;

    --portal-border: #dfe3e8;

    --portal-green: #2f855a;
    --portal-red: #c53030;

    --portal-radius: 9px;
}


/*
|--------------------------------------------------------------------------
| Base
|--------------------------------------------------------------------------
*/

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    background: var(--portal-bg);
    color: var(--portal-text);
}

a {
    color: var(--portal-blue);
}

.portal-page {
    width: min(
        1400px,
        calc(100% - 40px)
    );
    margin: 0 auto;
    padding: 30px 0 60px;
}


/*
|--------------------------------------------------------------------------
| Header
|--------------------------------------------------------------------------
*/

.portal-header {
    position: relative;
    z-index: 1000;

    background:
        var(--portal-navy);

    color: #fff;

    border-bottom:
        1px solid
        rgba(255,255,255,.08);
}

.portal-header-inner {
    width: min(
        1500px,
        calc(100% - 40px)
    );

    min-height: 68px;

    margin: 0 auto;

    display: grid;

    grid-template-columns:
        auto
        1fr
        auto;

    align-items: center;

    gap: 28px;
}


/*
|--------------------------------------------------------------------------
| Logo
|--------------------------------------------------------------------------
*/

.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;

    text-decoration: none;
    color: #fff;
}

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

.portal-brand-mark {
    width: 29px;
    height: 29px;

    display: flex;
    align-items: flex-end;
    gap: 3px;

    padding: 5px;

    border-radius: 7px;

    background:
        rgba(255,255,255,.1);
}

.portal-brand-mark span {
    display: block;

    width: 5px;

    border-radius:
        2px 2px 0 0;

    background: #7eb3e5;
}

.portal-brand-mark span:nth-child(1) {
    height: 8px;
}

.portal-brand-mark span:nth-child(2) {
    height: 13px;
}

.portal-brand-mark span:nth-child(3) {
    height: 18px;
}

.portal-brand-text {
    display: flex;
    align-items: baseline;

    font-size: 19px;
    letter-spacing: -.3px;
}

.portal-brand-text strong {
    font-weight: 800;
}

.portal-brand-text span {
    font-weight: 400;
}


/*
|--------------------------------------------------------------------------
| Navigation
|--------------------------------------------------------------------------
*/

.portal-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 6px;
}

.portal-nav-link {
    padding: 9px 12px;

    border-radius: 6px;

    color:
        rgba(255,255,255,.78);

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    transition:
        background .15s ease,
        color .15s ease;
}

.portal-nav-link:hover {
    color: #fff;

    background:
        rgba(255,255,255,.08);
}

.portal-nav-link.active {
    color: #fff;

    background:
        rgba(255,255,255,.13);
}


/*
|--------------------------------------------------------------------------
| User menu
|--------------------------------------------------------------------------
*/

.portal-user-menu {
    position: relative;
}

.portal-user-trigger {
    display: flex;
    align-items: center;
    gap: 5px;

    padding: 9px 10px;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #fff;

    cursor: pointer;

    font: inherit;
    font-size: 13px;
}

.portal-user-trigger:hover {
    background:
        rgba(255,255,255,.08);
}

.portal-user-label {
    color:
        rgba(255,255,255,.62);
}

.portal-user-chevron {
    margin-left: 3px;

    font-size: 11px;

    transition:
        transform .15s ease;
}

.portal-user-trigger[
    aria-expanded="true"
]
.portal-user-chevron {
    transform:
        rotate(180deg);
}

.portal-user-dropdown {
    position: absolute;

    top: calc(100% + 9px);
    right: 0;

    width: 220px;

    padding: 7px;

    background: #fff;

    border:
        1px solid
        var(--portal-border);

    border-radius: 8px;

    box-shadow:
        0 12px 30px
        rgba(0,0,0,.13);
}

.portal-user-dropdown a {
    display: block;

    padding: 10px 11px;

    border-radius: 6px;

    color: var(--portal-text);

    text-decoration: none;

    font-size: 14px;
}

.portal-user-dropdown a:hover {
    background:
        #f3f5f7;
}

.portal-dropdown-divider {
    height: 1px;

    margin: 6px 4px;

    background:
        var(--portal-border);
}

.portal-user-dropdown
.portal-logout-link {
    color: var(--portal-red);
}


/*
|--------------------------------------------------------------------------
| Common page styles
|--------------------------------------------------------------------------
*/

.portal-page-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}

.portal-page-header h1 {
    margin: 0 0 5px;

    font-size: 28px;
}

.portal-page-header p {
    margin: 0;

    color:
        var(--portal-muted);
}

.portal-card {
    background:
        var(--portal-card);

    border:
        1px solid
        var(--portal-border);

    border-radius:
        var(--portal-radius);

    padding: 22px;
}

.portal-button {
    display: inline-block;

    padding: 10px 15px;

    border: 0;
    border-radius: 7px;

    background:
        var(--portal-navy);

    color: #fff;

    text-decoration: none;

    font: inherit;
    font-weight: 700;

    cursor: pointer;
}

.portal-button:hover {
    background:
        var(--portal-navy-dark);

    color: #fff;
}

.portal-button-secondary {
    background:
        #e8edf4;

    color:
        var(--portal-text);
}

.portal-muted {
    color:
        var(--portal-muted);
}


/*
|--------------------------------------------------------------------------
| Homepage
|--------------------------------------------------------------------------
*/

.portal-home-hero {
    margin-bottom: 30px;
}

.portal-home-hero h1 {
    margin: 0 0 8px;

    font-size: 32px;
}

.portal-home-hero p {
    margin: 0;

    color:
        var(--portal-muted);

    font-size: 16px;
}

.portal-tool-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );

    gap: 18px;
}

.portal-tool-card {
    display: flex;
    flex-direction: column;

    min-height: 190px;

    padding: 22px;

    background: #fff;

    border:
        1px solid
        var(--portal-border);

    border-radius:
        var(--portal-radius);
}

.portal-tool-card h2 {
    margin: 0 0 8px;

    font-size: 19px;
}

.portal-tool-card p {
    margin: 0 0 20px;

    color:
        var(--portal-muted);

    line-height: 1.5;
}

.portal-tool-card
.portal-button {
    margin-top: auto;
    align-self: flex-start;
}

.portal-section-title {
    margin:
        36px 0 15px;

    font-size: 18px;
}


/*
|--------------------------------------------------------------------------
| Forms
|--------------------------------------------------------------------------
*/

.portal-form {
    max-width: 720px;
}

.portal-field {
    display: grid;
    gap: 6px;

    margin-bottom: 18px;
}

.portal-field label {
    font-size: 14px;
    font-weight: 700;
}

.portal-field input,
.portal-field select,
.portal-field textarea {
    width: 100%;

    padding: 10px 11px;

    border:
        1px solid
        #cfd5dc;

    border-radius: 7px;

    background: #fff;

    color:
        var(--portal-text);

    font: inherit;
}

.portal-field-help {
    color:
        var(--portal-muted);

    font-size: 12px;
}

.portal-success,
.portal-error {
    padding: 11px 13px;

    margin-bottom: 20px;

    border-radius: 7px;
}

.portal-success {
    background: #ecfdf3;

    border:
        1px solid
        #bbf7d0;

    color: #166534;
}

.portal-error {
    background: #fef2f2;

    border:
        1px solid
        #fecaca;

    color: #991b1b;
}


/*
|--------------------------------------------------------------------------
| Footer
|--------------------------------------------------------------------------
*/

.portal-footer {
    padding:
        22px 20px 35px;

    color:
        var(--portal-muted);

    font-size: 12px;

    text-align: center;
}

.portal-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
}


/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 900px) {

    .portal-header-inner {
        grid-template-columns:
            auto auto;

        min-height: 64px;
    }

    .portal-navigation {
        grid-column: 1 / -1;

        justify-content:
            flex-start;

        order: 3;

        padding-bottom: 10px;

        overflow-x: auto;
    }

    .portal-user-menu {
        justify-self: end;
    }

    .portal-user-label {
        display: none;
    }

}


@media (max-width: 600px) {

    .portal-header-inner,
    .portal-page {
        width:
            calc(100% - 24px);
    }

    .portal-page-header {
        display: block;
    }

}


* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

.container {
    width: min(900px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0 60px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 5px;
}

.muted {
    color: #6b7280;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
    font-size: 14px;
}

input,
select {
    padding: 9px 11px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font: inherit;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
}

.full {
    grid-column: 1 / -1;
}

.permissions {
    margin-top: 25px;
}

.permissions h2 {
    margin-bottom: 5px;
}

.permission-list {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.permission-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
}

.permission-item input {
    width: auto;
    min-height: auto;
    margin-top: 3px;
}

.permission-item label {
    display: block;
    font-weight: 400;
}

.permission-name {
    display: block;
    font-weight: 700;
    margin-bottom: 3px;
}

.permission-description {
    color: #6b7280;
    font-size: 13px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row input {
    width: auto;
    min-height: auto;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 0px;
}

button,
.button {
    padding: 10px 15px;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
}

button {
    background: #111827;
    color: #fff;
}

.button {
    background: #e5e7eb;
    color: #111827;
}

.error {
    padding: 11px 13px;
    margin-bottom: 20px;
    border-radius: 7px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.password-note {
    color: #6b7280;
    font-size: 12px;
    font-weight: 400;
}

@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Community checkbox list */

.community-checkboxes {
    display: block;
}

.community-checkbox {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: start;
    gap: 9px;

    padding: 6px 8px;

    font-size: 13px;
    line-height: 1.3;
}

.community-checkbox input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-height: 0 !important;

    margin: 1px 0 0 0;
    padding: 0;

    flex: none;
}

.community-checkbox span {
    display: block;
    min-width: 0;
}

.community-checkbox:hover {
    background: #f5f7f9;
}