:root {
    --brand: #126fed;
    --brand-dark: #126fed;
    --login-brand: #126fed;
    --login-brand-dark: #126fed;
    --bs-primary: #126fed;
    --bs-primary-rgb: 18, 111, 237;
    --bs-link-color: #126fed;
    --bs-link-color-rgb: 18, 111, 237;
    --bs-link-hover-color: #126fed;
    --bs-link-hover-color-rgb: 18, 111, 237;
    --ink: #182433;
    --muted: #627386;
    --line: #D7E0EA;
    --surface: #FFFFFF;
    --page: #F4F8FB;
}

html {
    min-height: 100%;
}

body {
    min-height: 100dvh;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(18, 111, 237, 0.08), rgba(255, 255, 255, 0) 38%),
        var(--page);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
    background: var(--brand);
}

.app-main {
    min-height: calc(100dvh - 92px);
}

.navbar {
    background: var(--brand);
}

.app-navbar {
    min-height: 92px;
}

.app-navbar-inner {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.app-brand {
    align-items: center;
    display: inline-flex;
    margin: 0;
    min-width: 0;
    padding: 0.6rem 0;
}

.app-brand img {
    display: block;
    height: clamp(48px, 7vw, 66px);
    max-width: min(360px, 54vw);
    object-fit: contain;
}

.user-menu {
    flex: 0 0 auto;
}

.user-menu-toggle {
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.32);
    color: #FFFFFF;
    display: inline-flex;
    gap: 0.65rem;
    min-height: 44px;
    padding: 0.35rem 0.75rem;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus,
.user-menu-toggle.show {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.6);
    color: #FFFFFF;
}

.user-menu-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.user-menu-icon svg {
    fill: none;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 20px;
}

.user-menu-text {
    display: grid;
    line-height: 1.1;
    min-width: 0;
    text-align: left;
}

.user-menu-label {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 600;
}

.user-menu-name {
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 700;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu .dropdown-menu {
    min-width: 220px;
}

.user-menu .dropdown-item {
    border: 0;
    background: transparent;
    text-align: left;
    width: 100%;
}

.brand-mark,
.brand-large {
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark span,
.brand-large span {
    color: #126fed;
}

.brand-large {
    color: var(--brand);
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1;
    margin-bottom: 1rem;
}

.auth-stack {
    width: min(100%, 440px);
}

.auth-stack.wide {
    width: min(100%, 560px);
}

.auth-logo-strip,
.auth-logos {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.auth-logo-card {
    align-items: center;
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex: 1 1 0;
    justify-content: center;
    min-height: 86px;
    padding: 0.9rem 1rem;
}

.auth-logo-card-dark {
    background: #050A10;
    border-color: #050A10;
}

.auth-logo-card img {
    display: block;
    max-height: 58px;
    max-width: 100%;
    object-fit: contain;
}

.auth-logo-card-dark img {
    max-height: 48px;
}

.auth-shell {
    display: grid;
    min-height: calc(100dvh - 2rem);
    place-items: center;
    width: 100%;
}

.app-main-auth {
    min-height: 100dvh;
}

.auth-container {
    display: grid;
    min-height: 100dvh;
    padding-bottom: 1rem;
    padding-top: 1rem;
    place-items: center;
}

.app-main-auth .auth-shell {
    min-height: 0;
}

.auth-panel {
    width: min(100%, 440px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    box-shadow: 0 18px 40px rgba(24, 36, 51, 0.08);
}

.auth-panel.wide {
    width: min(100%, 560px);
}

.auth-panel h1,
.dashboard-header h1,
.form-header h1 {
    margin: 0 0 1.5rem;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--ink);
}

.auth-form {
    margin-top: 1.5rem;
}

.app-main-auth {
    background:
        linear-gradient(145deg, rgba(18, 111, 237, 0.14), rgba(255, 255, 255, 0) 34%),
        linear-gradient(315deg, rgba(18, 111, 237, 0.09), rgba(255, 255, 255, 0) 42%),
        #F6F9FD;
}

.auth-container {
    max-width: none;
    padding: clamp(1rem, 3vw, 2rem);
}

.auth-shell {
    min-height: calc(100dvh - clamp(2rem, 6vw, 4rem));
}

.app-main-auth .auth-shell {
    min-height: calc(100dvh - clamp(2rem, 6vw, 4rem));
}

.auth-experience {
    background: #FFFFFF;
    border: 1px solid rgba(18, 111, 237, 0.12);
    border-radius: 8px;
    box-shadow: 0 26px 70px rgba(13, 41, 81, 0.16);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    min-height: 680px;
    overflow: hidden;
    width: min(100%, 1120px);
}

.auth-brand-panel {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 34%),
        linear-gradient(145deg, #126fed 0%, #0D58CC 58%, #082D83 100%);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    overflow: hidden;
    padding: 3rem;
    position: relative;
}

.auth-brand-panel::before {
    background:
        repeating-linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.13) 0,
            rgba(255, 255, 255, 0.13) 1px,
            transparent 1px,
            transparent 72px
        );
    content: "";
    inset: -30%;
    opacity: 0.48;
    position: absolute;
    transform: rotate(-8deg);
}

.auth-brand-panel::after {
    background: linear-gradient(90deg, rgba(237, 42, 37, 0), rgba(237, 42, 37, 0.82));
    bottom: 0;
    content: "";
    height: 5px;
    left: 0;
    position: absolute;
    right: 0;
}

.auth-brand-logos,
.auth-brand-copy {
    position: relative;
    z-index: 1;
}

.auth-brand-logos {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-width: 0;
    width: min(340px, 82%);
}

.auth-qc-logo {
    display: block;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    width: 100%;
}

.auth-logo-divider {
    display: none;
}

.auth-home-logo {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    display: inline-flex;
    flex: 0 0 auto;
    height: auto;
    justify-content: flex-start;
    width: 100%;
}

.auth-home-logo img {
    display: block;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    width: 100%;
}

.auth-brand-copy {
    max-width: 560px;
}

.auth-kicker,
.auth-eyebrow {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
}

.auth-kicker {
    color: rgba(255, 255, 255, 0.76);
}

.auth-brand-copy h1 {
    font-size: 3.25rem;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.02;
    margin: 0 0 1.25rem;
    max-width: 620px;
}

.auth-brand-copy p:not(.auth-kicker) {
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.05rem;
    line-height: 1.65;
    margin: 0;
    max-width: 510px;
}

.auth-form-panel {
    align-self: center;
    padding: 3rem;
    width: 100%;
}

.auth-form-panel-wide {
    padding-right: 2.5rem;
}

.auth-form-header {
    margin-bottom: 2rem;
}

.auth-eyebrow {
    color: var(--brand);
}

.auth-form-header h2 {
    color: #101828;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0 0 0.75rem;
}

.auth-form-header p:not(.auth-eyebrow) {
    color: var(--muted);
    line-height: 1.55;
    margin: 0;
}

.auth-form .form-label {
    color: #26364A;
    font-size: 0.9rem;
    font-weight: 750;
    margin-bottom: 0.55rem;
}

.auth-form .form-control {
    background: #F8FBFF;
    border: 1px solid #CCDAEC;
    border-radius: 8px;
    color: var(--ink);
    min-height: 54px;
    padding-left: 1rem;
    padding-right: 1rem;
}

.auth-form .form-control:hover {
    border-color: rgba(18, 111, 237, 0.48);
}

.auth-form .btn {
    border-radius: 8px;
    font-weight: 800;
    min-height: 54px;
}

.btn-primary {
    --bs-btn-bg: #126fed;
    --bs-btn-border-color: #126fed;
    --bs-btn-hover-bg: #0D5ED4;
    --bs-btn-hover-border-color: #0D5ED4;
    --bs-btn-active-bg: #0A4FAF;
    --bs-btn-active-border-color: #0A4FAF;
    box-shadow: 0 12px 26px rgba(18, 111, 237, 0.26);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
}

.form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(18, 111, 237, 0.15);
}

.dashboard-header,
.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-surface,
.form-surface {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 14px 34px rgba(24, 36, 51, 0.06);
}

table.dataTable thead th {
    color: var(--ink);
}

.dt-paging .pagination {
    gap: 0.25rem;
}

.dt-paging .page-link,
.dt-paging-button {
    align-items: center;
    border-color: var(--line);
    border-radius: 6px;
    color: var(--brand);
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    min-height: 36px;
    min-width: 36px;
}

.dt-paging .page-item.active .page-link,
.dt-paging-button.current {
    background: var(--brand);
    border-color: var(--brand);
    color: #FFFFFF;
}

.dt-paging .page-link:hover,
.dt-paging-button:hover {
    background: rgba(18, 111, 237, 0.08);
    border-color: var(--brand);
    color: var(--brand-dark);
}

.form-section-title {
    border-bottom: 1px solid var(--line);
    color: var(--brand);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0.5rem 0 0;
    padding-bottom: 0.5rem;
}

.required-marker {
    color: #C62828;
    font-weight: 800;
}

.form-alert {
    border-radius: 8px;
    border: 1px solid;
    padding: 0.95rem 1rem;
}

.form-alert strong {
    display: block;
    font-size: 0.98rem;
    margin-bottom: 0.35rem;
}

.form-alert ul {
    margin-bottom: 0;
    padding-left: 1.1rem;
}

.form-alert-error {
    background: #FFF5F5;
    border-color: #F1B8B8;
    color: #8A1F1F;
}

.address-toggle-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.address-toggle-button[aria-expanded="true"] {
    background: var(--brand);
    border-color: var(--brand);
    color: #FFFFFF;
}

.address-default-text {
    color: var(--muted);
    font-size: 0.9rem;
}

.address-collapse-inner {
    border-left: 3px solid var(--line);
    margin-left: 0;
    padding-left: 0.75rem;
}

@media (max-width: 575.98px) {
    .app-navbar-inner {
        align-items: stretch;
        flex-direction: column;
        gap: 0.5rem;
        padding-bottom: 0.75rem;
        padding-top: 0.75rem;
    }

    .app-brand img {
        height: 54px;
        max-width: 100%;
    }

    .auth-logo-strip {
        gap: 0.5rem;
    }

    .auth-logo-card {
        min-height: 76px;
        padding: 0.75rem;
    }

    .auth-logo-card img {
        max-height: 52px;
    }

    .auth-logo-card-dark img {
        max-height: 42px;
    }

    .user-menu,
    .user-menu-toggle {
        width: 100%;
    }

    .user-menu-toggle {
        justify-content: flex-start;
    }

    .user-menu-name {
        max-width: calc(100vw - 130px);
    }

    .dashboard-header,
    .form-header {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-header .btn,
    .form-header .btn {
        width: 100%;
    }
}

@media (max-width: 991.98px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-experience {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .auth-brand-panel {
        gap: 4rem;
        min-height: 360px;
        padding: 2rem;
    }

    .auth-brand-copy h1 {
        font-size: 2.35rem;
    }

    .auth-form-panel,
    .auth-form-panel-wide {
        padding: 2rem;
    }
}

@media (max-width: 575.98px) {
    .auth-shell {
        min-height: calc(100dvh - 2rem);
    }

    .auth-brand-panel {
        gap: 2.5rem;
        min-height: 300px;
        padding: 1.25rem;
    }

    .auth-brand-logos {
        gap: 0.65rem;
        width: min(100%, 320px);
    }

    .auth-qc-logo {
        max-width: 100%;
    }

    .auth-home-logo {
        width: 100%;
    }

    .auth-home-logo img {
        max-width: 100%;
    }

    .auth-brand-copy h1 {
        font-size: 1.9rem;
    }

    .auth-brand-copy p:not(.auth-kicker) {
        font-size: 0.96rem;
    }

    .auth-form-panel,
    .auth-form-panel-wide {
        padding: 1.25rem;
    }

    .auth-form-header {
        margin-bottom: 1.35rem;
    }

    .auth-form-header h2 {
        font-size: 1.65rem;
    }
}

@media (max-height: 620px) {
    .auth-container {
        align-items: start;
    }

    .auth-panel {
        padding: 1rem;
    }

    .brand-large {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    .auth-panel h1 {
        font-size: 1.45rem;
        margin-bottom: 1rem;
    }

    .auth-form {
        margin-top: 1rem;
    }
}
