* {
    box-sizing: border-box;
}

html {
    min-width: 0;
}

body {
    margin: 0;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #f4f6f8;
    color: #1e293b;

    overflow-x: hidden;
}

a {
    color: inherit;
}

img,
svg {
    max-width: 100%;
}


/* ==========================================================
   PORTAL SHELL
   ========================================================== */

.portal-shell {
    min-height: 100vh;
    min-width: 0;
}


/* ==========================================================
   HEADER
   ========================================================== */

.portal-header {
    min-height: 78px;

    padding:
        16px
        32px;

    background: #111827;
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    min-width: 0;
}


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

    gap: 14px;

    min-width: 0;
}


.portal-brand-icon {
    width: 44px;
    height: 44px;

    flex:
        0
        0
        44px;

    border-radius: 10px;

    background: #ffffff;
    color: #111827;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;
}


.portal-brand > div:last-child {
    min-width: 0;
}


.portal-brand strong {
    display: block;

    font-size: 15px;
    letter-spacing: 0.05em;

    overflow-wrap: anywhere;
}


.portal-brand span {
    display: block;

    margin-top: 3px;

    font-size: 11px;

    color: #cbd5e1;

    letter-spacing: 0.12em;

    overflow-wrap: anywhere;
}


.portal-user {
    display: flex;
    align-items: center;

    gap: 15px;

    min-width: 0;
}


.portal-user > span {
    display: block;

    max-width: 420px;

    font-size: 14px;

    overflow-wrap: anywhere;
    word-break: break-word;
}


.portal-user form {
    flex:
        0
        0
        auto;

    margin: 0;
}


/* ==========================================================
   NAVIGATION
   ========================================================== */

.portal-nav {
    background: #ffffff;

    border-bottom:
        1px
        solid
        #dfe5ec;

    padding:
        0
        32px;

    display: flex;

    gap: 4px;

    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: thin;
}


.portal-nav a {
    flex:
        0
        0
        auto;

    padding:
        16px
        18px;

    text-decoration: none;

    color: #526174;

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

    border-bottom:
        3px
        solid
        transparent;

    white-space: nowrap;

    transition:
        color
        0.15s
        ease,
        border-color
        0.15s
        ease,
        background-color
        0.15s
        ease;
}


.portal-nav a:hover {
    color: #111827;

    background:
        #f8fafc;
}


.portal-nav a.active {
    color: #111827;

    border-bottom-color:
        #111827;
}


/* ==========================================================
   CONTENT
   ========================================================== */

.portal-content {
    width:
        min(
            1200px,
            calc(
                100%
                -
                40px
            )
        );

    margin:
        0
        auto;

    padding:
        36px
        0
        60px
        0;

    min-width: 0;
}


/* ==========================================================
   COMMON TYPOGRAPHY
   ========================================================== */

.eyebrow {
    margin:
        0
        0
        8px
        0;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.12em;

    color: #64748b;
}


h1,
h2,
h3,
h4,
p,
span,
strong,
a {
    overflow-wrap: anywhere;
}


h1,
h2,
h3,
h4 {
    max-width: 100%;
}


/* ==========================================================
   AUTHENTICATION
   ========================================================== */

.auth-page {
    min-height:
        calc(
            100vh
            -
            150px
        );

    display: flex;
    align-items: center;
    justify-content: center;
}


.auth-card {
    width:
        min(
            470px,
            100%
        );

    background: #ffffff;

    border:
        1px
        solid
        #dde3ea;

    border-radius: 16px;

    padding: 34px;

    box-shadow:
        0
        12px
        35px
        rgba(
            15,
            23,
            42,
            0.08
        );

    min-width: 0;
}


.auth-heading {
    min-width: 0;
}


.auth-heading h1 {
    margin:
        0
        0
        10px
        0;

    font-size: 30px;

    line-height: 1.15;
}


.auth-heading p {
    margin: 0;

    color: #64748b;

    line-height: 1.6;
}


.auth-form {
    margin-top: 28px;

    display: flex;
    flex-direction: column;

    gap: 10px;

    min-width: 0;
}


.auth-form label {
    margin-top: 8px;

    font-size: 13px;
    font-weight: 700;
}


.auth-form input {
    width: 100%;

    min-width: 0;

    padding:
        13px
        14px;

    border:
        1px
        solid
        #cbd5e1;

    border-radius: 9px;

    font-size: 14px;

    outline: none;

    background: #ffffff;

    color: #111827;
}


.auth-form input:focus {
    border-color: #475569;

    box-shadow:
        0
        0
        0
        2px
        rgba(
            71,
            85,
            105,
            0.08
        );
}


.auth-form input[readonly] {
    background: #f8fafc;

    color: #475569;

    cursor: default;
}


/* ==========================================================
   BUTTONS
   ========================================================== */

.primary-button,
.secondary-button {
    border: none;

    border-radius: 9px;

    font-weight: 700;

    cursor: pointer;

    font-family: inherit;
}


.primary-button {
    margin-top: 16px;

    padding:
        14px
        18px;

    background: #111827;

    color: #ffffff;

    font-size: 14px;
}


.primary-button:hover {
    background: #1f2937;
}


.secondary-button {
    padding:
        9px
        13px;

    background: #e5e7eb;

    color: #111827;

    white-space: nowrap;
}


.secondary-button:hover {
    background: #d1d5db;
}


/* ==========================================================
   AUTH FOOTER
   ========================================================== */

.auth-footer {
    margin-top: 25px;

    padding-top: 20px;

    border-top:
        1px
        solid
        #e5e7eb;

    display: flex;
    flex-direction: column;

    gap: 7px;

    font-size: 13px;

    color: #64748b;

    min-width: 0;
}


.auth-footer a {
    color: #111827;

    font-weight: 700;

    width: fit-content;
}


/* ==========================================================
   ALERTS
   ========================================================== */

.alert-error {
    margin-top: 20px;

    padding:
        12px
        14px;

    background: #fef2f2;

    border:
        1px
        solid
        #fecaca;

    border-radius: 8px;

    color: #991b1b;

    font-size: 13px;

    line-height: 1.45;

    overflow-wrap: anywhere;
}


/* ==========================================================
   DASHBOARD / PAGE HEADERS
   ========================================================== */

.dashboard-header {
    background: #ffffff;

    border:
        1px
        solid
        #dde3ea;

    border-radius: 14px;

    padding: 28px;

    min-width: 0;
}


.dashboard-header > div {
    min-width: 0;
}


.dashboard-header h1 {
    margin:
        0
        0
        8px
        0;

    line-height: 1.15;
}


.dashboard-header h2 {
    margin:
        0
        0
        8px
        0;

    line-height: 1.2;
}


.dashboard-header p {
    margin: 0;

    color: #64748b;

    line-height: 1.45;

    overflow-wrap: anywhere;
}


.dashboard-header p + p {
    margin-top: 4px;
}


/* ==========================================================
   DASHBOARD GRID
   ========================================================== */

.dashboard-grid {
    margin-top: 20px;

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                min(
                    240px,
                    100%
                ),
                1fr
            )
        );

    gap: 18px;

    min-width: 0;
}


/* ==========================================================
   DASHBOARD CARDS
   ========================================================== */

.dashboard-card {
    background: #ffffff;

    border:
        1px
        solid
        #dde3ea;

    border-radius: 14px;

    padding: 24px;

    min-width: 0;

    overflow: hidden;
}


.dashboard-card > * {
    max-width: 100%;
}


.dashboard-card span {
    display: block;

    font-size: 12px;

    color: #64748b;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.07em;

    overflow-wrap: anywhere;
}


.dashboard-card strong {
    display: block;

    margin-top: 12px;

    font-size: 23px;

    line-height: 1.25;

    overflow-wrap: anywhere;
    word-break: break-word;
}


.dashboard-card p {
    margin:
        12px
        0
        0
        0;

    color: #64748b;

    line-height: 1.5;

    font-size: 14px;

    overflow-wrap: anywhere;
    word-break: break-word;
}


.dashboard-card p strong {
    display: block;

    margin-top: 6px;

    font-size: 18px;

    line-height: 1.35;
}


.dashboard-card a {
    color: #475569;

    text-decoration: underline;

    text-underline-offset: 2px;

    overflow-wrap: anywhere;
}


.dashboard-card a:hover {
    color: #111827;
}


/* ==========================================================
   LONG IDENTIFIERS / EMAILS
   ========================================================== */

.dashboard-card,
.dashboard-header,
.portal-user,
.auth-card {
    word-wrap: break-word;
}


.dashboard-card strong,
.dashboard-card p,
.dashboard-card a,
.portal-user span {
    overflow-wrap: anywhere;
}


.dashboard-card code {
    white-space: normal;

    overflow-wrap: anywhere;

    word-break: break-all;
}


/* ==========================================================
   TABLET
   ========================================================== */

@media (
    max-width: 900px
) {

    .portal-header {
        padding:
            14px
            20px;
    }

    .portal-nav {
        padding:
            0
            18px;
    }

    .portal-content {
        width:
            min(
                calc(
                    100%
                    -
                    28px
                ),
                1200px
            );

        padding-top: 24px;
    }

    .dashboard-header {
        padding: 24px;
    }

    .dashboard-card {
        padding: 22px;
    }

    .dashboard-card strong {
        font-size: 21px;
    }
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (
    max-width: 700px
) {

    .portal-header {
        min-height: auto;

        padding:
            14px
            16px;

        gap: 12px;
    }

    .portal-brand {
        gap: 10px;
    }

    .portal-brand-icon {
        width: 38px;
        height: 38px;

        flex-basis: 38px;

        border-radius: 8px;

        font-size: 13px;
    }

    .portal-brand strong {
        font-size: 12px;
    }

    .portal-brand span {
        font-size: 9px;

        letter-spacing: 0.08em;
    }

    .portal-user {
        gap: 8px;
    }

    .portal-user > span {
        display: none;
    }

    .secondary-button {
        padding:
            8px
            10px;

        font-size: 12px;
    }

    .portal-nav {
        padding:
            0
            8px;

        gap: 0;

        scroll-behavior: smooth;
    }

    .portal-nav a {
        padding:
            14px
            13px;

        font-size: 13px;
    }

    .portal-content {
        width:
            calc(
                100%
                -
                24px
            );

        padding:
            20px
            0
            40px
            0;
    }

    .auth-page {
        min-height:
            calc(
                100vh
                -
                120px
            );

        align-items: flex-start;

        padding-top: 10px;
    }

    .auth-card {
        padding: 24px;

        border-radius: 14px;
    }

    .auth-heading h1 {
        font-size: 26px;
    }

    .dashboard-header {
        padding: 22px;

        border-radius: 12px;
    }

    .dashboard-header h1 {
        font-size: 25px;
    }

    .dashboard-header h2 {
        font-size: 22px;
    }

    .dashboard-grid {
        grid-template-columns:
            1fr;

        gap: 14px;

        margin-top: 14px;
    }

    .dashboard-card {
        padding: 21px;

        border-radius: 12px;
    }

    .dashboard-card strong {
        font-size: 20px;
    }

    .dashboard-card p strong {
        font-size: 17px;
    }
}


/* ==========================================================
   SMALL MOBILE
   ========================================================== */

@media (
    max-width: 430px
) {

    .portal-header {
        padding:
            12px
            12px;
    }

    .portal-brand strong {
        font-size: 11px;
    }

    .portal-brand span {
        font-size: 8px;
    }

    .portal-content {
        width:
            calc(
                100%
                -
                18px
            );
    }

    .portal-nav a {
        padding:
            12px
            11px;

        font-size: 12px;
    }

    .auth-card {
        padding: 20px;
    }

    .dashboard-header {
        padding: 20px;
    }

    .dashboard-card {
        padding: 20px;
    }
}