:root {
    --portal-navy: #020617;
    --portal-navy-soft: #0f172a;
    --portal-blue: #009977;
    --portal-blue-dark: #007a60;
    --portal-cyan: #ffc107;
    --portal-ink: #020617;
    --portal-muted: #64748b;
    --portal-line: #e2e8f0;
    --portal-surface: #ffffff;
    --portal-background: #f8fafc;
    --sidebar-width: 256px;
    --sidebar-collapsed-width: 82px;
    --header-height: 72px;
    --shadow-soft: 0 14px 40px rgba(2, 6, 23, .07);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    color: var(--portal-ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.eyebrow {
    color: var(--portal-blue);
    display: inline-block;
    font-size: .69rem;
    font-weight: 750;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.eyebrow-light {
    color: rgba(255, 255, 255, .62);
}

.brand {
    align-items: center;
    display: inline-flex;
}

.brand-logo-frame {
    background: #fff;
    border-radius: 9px;
    display: block;
    overflow: hidden;
    padding: .5rem .7rem;
    transition: width .24s ease, padding .24s ease;
}

.brand-logo {
    display: block;
    height: auto;
    max-width: none;
    width: 150px;
}

/* Login */
@property --login-glow-x {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 92%;
}

@property --login-glow-y {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 8%;
}

@keyframes login-gradient-drift {
    0% {
        --login-glow-x: 92%;
        --login-glow-y: 8%;
    }

    45% {
        --login-glow-x: 72%;
        --login-glow-y: 28%;
    }

    75% {
        --login-glow-x: 86%;
        --login-glow-y: 58%;
    }

    100% {
        --login-glow-x: 94%;
        --login-glow-y: 18%;
    }
}

.login-page {
    background: var(--portal-background);
    margin: 0;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(420px, 1.06fr) minmax(420px, .94fr);
    min-height: 100vh;
    overflow-x: hidden;
}

.login-brand-panel {
    --login-glow-x: 92%;
    --login-glow-y: 8%;
    animation: login-gradient-drift 18s ease-in-out infinite alternate;
    background:
        radial-gradient(circle at var(--login-glow-x) var(--login-glow-y), #009977 0, rgba(0, 153, 119, .72) 14%, rgba(0, 153, 119, .24) 36%, transparent 60%),
        linear-gradient(145deg, #020617 0%, #0f172a 52%, #064e3b 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 5.5rem);
    position: relative;
}

.login-brand-panel::before,
.login-brand-panel::after {
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 50%;
    content: "";
    height: 42rem;
    position: absolute;
    right: -19rem;
    top: 18%;
    width: 42rem;
}

.login-brand-panel > .brand .brand-logo {
    width: 168px;
}

.login-brand-panel::after {
    height: 29rem;
    right: -12rem;
    top: 28%;
    width: 29rem;
}

.login-brand-copy {
    margin: auto 0;
    max-width: 660px;
    position: relative;
    z-index: 1;
}

.login-brand-copy h1 {
    font-size: clamp(2.6rem, 4.7vw, 5rem);
    font-weight: 680;
    letter-spacing: -.055em;
    line-height: 1.03;
    margin: 1.25rem 0 1.6rem;
}

.login-brand-copy p {
    color: rgba(255, 255, 255, .63);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.75;
    max-width: 35rem;
}

.login-brand-footer {
    align-items: center;
    color: rgba(255, 255, 255, .55);
    display: flex;
    font-size: .75rem;
    gap: .65rem;
    letter-spacing: .04em;
    position: relative;
    z-index: 1;
}

.pulse-dot,
.connection-dot {
    background: #14bc97;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(20, 188, 151, .11);
    display: inline-block;
    height: 7px;
    width: 7px;
}

.login-form-panel {
    align-items: center;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-width: 0;
    padding: 3rem clamp(2rem, 6vw, 7rem);
    position: relative;
}

.login-form-wrap {
    max-width: 420px;
    min-width: 0;
    width: 100%;
}

.login-mobile-brand {
    align-items: center;
    display: none;
    margin-bottom: 3rem;
}

.login-mobile-brand .brand-logo-frame {
    padding: 0;
}

.login-mobile-brand .brand-logo {
    width: 165px;
}

.login-form-wrap h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -.035em;
    margin: .5rem 0 .55rem;
}

.login-form-wrap > div > p {
    color: var(--portal-muted);
    margin: 0;
}

.login-form .form-label {
    color: #334057;
    font-size: .79rem;
    font-weight: 650;
    margin-bottom: .5rem;
}

.login-form .form-control {
    background-color: #fbfcfe;
    border: 1px solid #dbe1eb;
    border-radius: 10px;
    box-shadow: none;
    color: var(--portal-ink);
    font-size: .94rem;
    min-height: 52px;
    padding: .8rem 1rem;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.login-form .form-control:focus {
    background: #fff;
    border-color: #009977;
    box-shadow: 0 0 0 4px rgba(0, 153, 119, .11);
}

.form-hint {
    color: #9aa3b4;
    font-size: .69rem;
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 3.2rem;
}

.password-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: #8490a3;
    display: flex;
    height: 44px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 5px;
    top: 4px;
    width: 44px;
}

.password-toggle svg {
    height: 19px;
    width: 19px;
}

.password-toggle .eye-closed,
.password-toggle.showing .eye-open {
    display: none;
}

.password-toggle.showing .eye-closed {
    display: block;
}

.btn-portal {
    align-items: center;
    background: var(--portal-blue);
    border: 0;
    border-radius: 10px;
    box-shadow: 0 9px 24px rgba(0, 153, 119, .2);
    color: #fff;
    display: flex;
    font-size: .88rem;
    font-weight: 680;
    justify-content: space-between;
    min-height: 52px;
    padding: .8rem 1.1rem  .8rem 1.25rem;
}

.btn-portal:hover,
.btn-portal:focus-visible {
    background: var(--portal-blue-dark);
    color: #fff;
}

.btn-portal span {
    font-size: 1.2rem;
    font-weight: 400;
}

.portal-alert {
    align-items: flex-start;
    background: #fff5f4;
    border: 1px solid #f8d3cf;
    border-radius: 10px;
    color: #a33b33;
    display: flex;
    font-size: .82rem;
    gap: .65rem;
    padding: .8rem 1rem;
}

.portal-alert svg {
    flex: 0 0 auto;
    height: 18px;
    margin-top: 1px;
    width: 18px;
}

.login-help {
    color: #929cad;
    font-size: .74rem;
    margin: 1.7rem 0 0;
    text-align: center;
}

.login-form-panel footer {
    bottom: 2rem;
    color: #a3abba;
    font-size: .68rem;
    left: 0;
    position: absolute;
    text-align: center;
    width: 100%;
}

/* Application shell */
.portal-page {
    background: var(--portal-background);
    margin: 0;
}

.portal-sidebar {
    background:
        radial-gradient(circle at 140% 10%, rgba(0, 153, 119, .82) 0, rgba(0, 153, 119, .48) 18%, rgba(0, 153, 119, .16) 42%, transparent 68%),
        linear-gradient(165deg, #020617 0%, #0f172a 50%, #064e3b 100%);
    bottom: 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    left: 0;
    position: fixed;
    top: 0;
    transition: width .24s ease, transform .24s ease;
    width: var(--sidebar-width);
    z-index: 1040;
}

.sidebar-header {
    align-items: center;
    display: flex;
    flex: 0 0 var(--header-height);
    padding: 0 1.2rem;
}

.sidebar-navigation {
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1rem .8rem;
    scrollbar-width: thin;
}

.navigation-group + .navigation-group {
    margin-top: 1.3rem;
}

.navigation-heading {
    color: rgba(255, 255, 255, .5);
    display: block;
    font-size: .58rem;
    font-weight: 750;
    letter-spacing: .14em;
    margin: 0 .75rem .5rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.navigation-link {
    align-items: center;
    border-radius: 9px;
    color: rgba(255, 255, 255, .72);
    display: flex;
    font-size: .78rem;
    font-weight: 560;
    gap: .75rem;
    height: 42px;
    margin-bottom: 2px;
    padding: 0 .75rem;
    position: relative;
    transition: color .15s, background .15s;
    white-space: nowrap;
}

.navigation-link:not(.disabled):hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.navigation-link.active {
    background: linear-gradient(90deg, rgba(0, 153, 119, .22), rgba(255, 193, 7, .08));
    color: #fff;
}

.navigation-link.active::before {
    background: var(--portal-cyan);
    border-radius: 0 4px 4px 0;
    content: "";
    height: 21px;
    left: -.8rem;
    position: absolute;
    width: 3px;
}

.navigation-link.disabled {
    cursor: default;
    opacity: .62;
}

.navigation-icon {
    align-items: center;
    display: flex;
    flex: 0 0 21px;
    justify-content: center;
}

.navigation-icon svg {
    height: 18px;
    width: 18px;
}

.navigation-soon {
    background: rgba(255, 255, 255, .07);
    border-radius: 4px;
    color: rgba(255, 255, 255, .5);
    font-size: .5rem;
    font-weight: 700;
    letter-spacing: .04em;
    margin-left: auto;
    padding: .16rem .3rem;
    text-transform: uppercase;
}

.sidebar-footer {
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, .07);
    display: flex;
    flex: 0 0 74px;
    gap: .75rem;
    margin: 0 .9rem;
    padding: 0 .7rem;
    white-space: nowrap;
}

.sidebar-footer-copy {
    display: flex;
    flex-direction: column;
}

.sidebar-footer-copy strong {
    font-size: .68rem;
    font-weight: 600;
}

.sidebar-footer-copy small {
    color: rgba(255, 255, 255, .52);
    font-size: .58rem;
    margin-top: .16rem;
}

.portal-frame {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left .24s ease;
}

.portal-header {
    align-items: center;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--portal-line);
    display: flex;
    height: var(--header-height);
    justify-content: space-between;
    padding: 0 clamp(1.15rem, 3vw, 2.5rem);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.icon-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #6f7b8f;
    display: flex;
    height: 38px;
    justify-content: center;
    padding: 0;
    transition: background .15s, color .15s;
    width: 38px;
}

.icon-button:hover {
    background: #f0f3f8;
    color: var(--portal-ink);
}

.icon-button svg {
    height: 19px;
    width: 19px;
}

.menu-button {
    display: none;
}

.header-context {
    align-items: center;
    color: #98a1b1;
    display: flex;
    font-size: .72rem;
    gap: .45rem;
}

.header-context svg {
    height: 11px;
    width: 11px;
}

.header-context strong {
    color: #5c687b;
    font-weight: 600;
}

.header-actions,
.user-summary {
    align-items: center;
    display: flex;
}

.header-actions {
    gap: 1rem;
}

.user-summary {
    gap: .65rem;
}

.user-avatar {
    align-items: center;
    background: linear-gradient(145deg, #e5f6f2, #fff6d9);
    border: 1px solid #cce9e2;
    border-radius: 10px;
    color: #007a60;
    display: flex;
    font-size: .75rem;
    font-weight: 750;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.user-copy {
    display: flex;
    flex-direction: column;
    max-width: 200px;
}

.user-copy strong {
    font-size: .7rem;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-copy small {
    color: #99a2b1;
    font-size: .58rem;
    margin-top: .1rem;
}

.logout-button {
    border-left: 1px solid var(--portal-line);
    border-radius: 0;
    margin-left: .15rem;
    padding-left: 1rem;
    width: 52px;
}

.portal-main {
    margin: 0 auto;
    max-width: 1580px;
    padding: clamp(1.6rem, 3vw, 3rem);
}

.page-heading {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-heading h1 {
    font-size: clamp(1.7rem, 2.4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -.04em;
    margin: .35rem 0 .35rem;
}

.page-heading p {
    color: var(--portal-muted);
    font-size: .84rem;
    margin: 0;
}

.welcome-panel {
    align-items: center;
    background:
        radial-gradient(circle at 92% 8%, #009977 0, rgba(0, 153, 119, .72) 14%, rgba(0, 153, 119, .24) 36%, transparent 60%),
        linear-gradient(145deg, #020617 0%, #0f172a 52%, #064e3b 100%);
    border-radius: 15px;
    box-shadow: 0 18px 36px rgba(13, 25, 48, .12);
    color: #fff;
    display: flex;
    justify-content: space-between;
    min-height: 180px;
    overflow: hidden;
    padding: clamp(1.7rem, 4vw, 3rem);
    position: relative;
}

.welcome-panel > div:first-child {
    flex: 1 1 auto;
    max-width: 690px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.welcome-panel .eyebrow {
    color: #ffc107;
}

.welcome-panel h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.15rem);
    font-weight: 650;
    letter-spacing: -.035em;
}

.welcome-panel p {
    color: rgba(255, 255, 255, .72);
    font-size: .85rem;
    line-height: 1.65;
}

.content-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-line);
    border-radius: 13px;
    box-shadow: var(--shadow-soft);
    min-height: 340px;
    overflow: hidden;
}

.content-card-header {
    align-items: center;
    border-bottom: 1px solid #edf0f5;
    display: flex;
    justify-content: space-between;
    min-height: 82px;
    padding: 1.25rem 1.5rem;
}

.content-card-header h3 {
    font-size: 1rem;
    font-weight: 680;
    margin: .25rem 0 0;
}

.status-pill {
    border-radius: 99px;
    font-size: .62rem;
    font-weight: 650;
    padding: .38rem .65rem;
}

.status-pill-neutral {
    background: #f1f3f7;
    color: #818b9c;
}

.empty-state {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 255px;
    padding: 2rem;
    text-align: center;
}

.empty-state-icon {
    align-items: center;
    background: linear-gradient(145deg, #f0f3ff, #ebfaf7);
    border-radius: 13px;
    color: #5875d2;
    display: flex;
    height: 54px;
    justify-content: center;
    margin-bottom: 1rem;
    transform: rotate(-3deg);
    width: 54px;
}

.empty-state-icon svg {
    height: 25px;
    transform: rotate(3deg);
    width: 25px;
}

.empty-state h4 {
    font-size: .91rem;
    font-weight: 670;
    margin: 0 0 .45rem;
}

.empty-state p {
    color: var(--portal-muted);
    font-size: .75rem;
    line-height: 1.65;
    margin: 0;
    max-width: 390px;
}

.status-list {
    list-style: none;
    margin: 0;
    padding: .5rem 1.5rem;
}

.status-list li {
    align-items: center;
    border-bottom: 1px solid #edf0f5;
    display: grid;
    gap: .8rem;
    grid-template-columns: auto 1fr auto;
    min-height: 78px;
}

.status-list li:last-child {
    border-bottom: 0;
}

.status-indicator {
    background: #c7ced9;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(140, 150, 166, .09);
    height: 7px;
    width: 7px;
}

.status-indicator-success {
    background: #36bf8a;
    box-shadow: 0 0 0 4px rgba(54, 191, 138, .1);
}

.status-list div {
    display: flex;
    flex-direction: column;
}

.status-list strong {
    font-size: .76rem;
    font-weight: 650;
}

.status-list small {
    color: #929cad;
    font-size: .66rem;
    margin-top: .22rem;
}

.status-label {
    color: #279568;
    font-size: .61rem;
    font-weight: 650;
}

.status-label-muted {
    color: #98a1b0;
}

.sidebar-overlay {
    display: none;
}

.sidebar-collapsed .portal-sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .portal-frame {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}

.sidebar-collapsed .navigation-heading,
.sidebar-collapsed .navigation-label,
.sidebar-collapsed .navigation-soon,
.sidebar-collapsed .sidebar-footer-copy {
    display: none;
}

.sidebar-collapsed .brand-logo-frame {
    padding: .35rem;
    width: 50px;
}

.sidebar-collapsed .brand-logo {
    width: 150px;
}

.sidebar-collapsed .navigation-link {
    justify-content: center;
    padding: 0;
}

.sidebar-collapsed .navigation-link.active::before {
    left: -.8rem;
}

.sidebar-collapsed .sidebar-footer {
    justify-content: center;
}

.sidebar-collapsed .menu-button {
    display: flex;
}

@media (max-width: 991.98px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        padding: 3rem 1.5rem 5rem;
    }

    .login-mobile-brand {
        display: flex;
    }

    .portal-sidebar,
    .sidebar-collapsed .portal-sidebar {
        box-shadow: 15px 0 45px rgba(5, 13, 29, .28);
        transform: translateX(-105%);
        width: min(82vw, 280px);
    }

    .portal-frame,
    .sidebar-collapsed .portal-frame {
        margin-left: 0;
    }

    .menu-button,
    .sidebar-collapsed .menu-button {
        display: flex;
    }

    .sidebar-mobile-open .portal-sidebar {
        transform: translateX(0);
    }

    .sidebar-mobile-open .sidebar-overlay {
        background: rgba(7, 14, 27, .46);
        bottom: 0;
        display: block;
        left: 0;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 1035;
    }

    .header-context {
        display: none;
    }

    .portal-header {
        justify-content: space-between;
    }

}

@media (max-width: 575.98px) {
    .login-shell,
    .login-form-panel {
        max-width: 100vw;
        width: 100vw;
    }

    .login-form-panel {
        justify-content: flex-start;
        padding-top: 2.2rem;
    }

    .login-form-wrap,
    .login-form {
        max-width: calc(100vw - 3rem);
        min-width: 0;
        width: calc(100vw - 3rem);
    }

    .login-mobile-brand {
        margin-bottom: 4rem;
    }

    .portal-header {
        padding: 0 1rem;
    }

    .user-copy {
        display: none;
    }

    .header-actions {
        gap: .4rem;
    }

    .logout-button {
        margin-left: 0;
        padding-left: .5rem;
        width: 42px;
    }

    .portal-main {
        padding: 1.4rem 1rem 2rem;
    }

    .page-heading {
        margin-bottom: 1.4rem;
    }

    .page-heading p {
        font-size: .76rem;
        line-height: 1.55;
    }

    .welcome-panel {
        min-height: 210px;
        padding: 1.6rem;
    }

    .welcome-panel > div:first-child {
        max-width: 100%;
        padding-right: .5rem;
    }

    .welcome-panel h2,
    .welcome-panel p {
        overflow-wrap: anywhere;
    }

    .content-card-header,
    .status-list {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .content-card-header {
        align-items: flex-start;
        gap: 1rem;
    }

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

    .content-card-header .status-pill {
        display: none;
    }

    .status-list li {
        grid-template-columns: auto 1fr;
    }

    .status-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-brand-panel {
        animation: none;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
