/*
    Shared authenticated shell styles derived from redesign_ui/mockup_dashboard_revised.html.

    Scope for step 2.1:
    - define the redesign shell classes and exact visual treatment
    - style the existing shared session-expiry modal by targeting #myModal
    - do not wire layouts to these classes yet
*/

body.wn-shell-body {
    font-family: var(--font-body);
    background: var(--gray-50);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.wn-shell-header {
    background: linear-gradient(180deg, var(--wb-950) 0%, var(--wb-850) 100%);
    padding: 0 clamp(28px, 3vw, 56px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--shell-header-height);
    position: relative;
    z-index: 20;
}

.wn-shell-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--gold-500) 20%,
            var(--gold-400) 50%,
            var(--gold-500) 80%,
            transparent 100%);
}

.wn-shell-header-left,
.wn-shell-header-right {
    display: flex;
    align-items: center;
    z-index: 1;
}

.wn-shell-header-left {
    gap: 16px;
}

.wn-shell-header-right {
    gap: 20px;
    min-width: 0;
}

.wn-header-brand {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    text-decoration: none;
}

.wn-header-brand:hover,
.wn-header-brand:focus {
    text-decoration: none;
}

.wn-header-tagline {
    display: block;
    max-width: 100%;
    font-size: 15.5px;
    color: var(--gold-400);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 500;
    opacity: 0.9;
    white-space: nowrap;
}

.wn-home-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-button);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
}

.wn-home-btn:hover,
.wn-home-btn:focus {
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

.wn-home-btn svg {
    width: 19px;
    height: 19px;
    color: rgba(255, 255, 255, 0.65);
}

.wn-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 4px 7px 4px 13px;
    border-radius: var(--radius-button);
    background: transparent;
    transition: color 0.2s ease;
}

.wn-user-pill:hover,
.wn-user-pill:focus {
    background: transparent;
    text-decoration: none;
}

.wn-user-pill-name {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--white);
    min-width: 0;
}

.wn-user-pill-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--wb-950);
}

.wn-user-menu {
    position: relative;
    margin: 0;
    display: flex;
    align-items: center;
}

.wn-user-menu > summary {
    list-style: none;
    outline: none;
}

.wn-user-menu > summary::-webkit-details-marker {
    display: none;
}

.wn-user-menu[open] > .wn-user-pill {
    background: transparent;
}

.wn-user-menu-list {
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    min-width: 152px;
    margin: 0;
    padding: 3px;
    list-style: none;
    background: var(--white);
    border: 1px solid rgba(3, 40, 77, 0.08);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(3, 40, 77, 0.18);
    display: none;
    z-index: 40;
}

.wn-user-menu[open] > .wn-user-menu-list {
    display: block;
}

.wn-user-menu-list::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: var(--white);
    border-top: 1px solid rgba(3, 40, 77, 0.08);
    border-left: 1px solid rgba(3, 40, 77, 0.08);
    transform: rotate(45deg);
}

.wn-user-menu-list li + li {
    margin-top: 2px;
}

.wn-user-menu-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 9px;
    border-radius: 8px;
    color: var(--wb-900);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.wn-user-menu-link:hover,
.wn-user-menu-link:focus {
    background: rgba(0, 112, 192, 0.08);
    color: var(--wb-900);
    text-decoration: none;
}

.wn-bank-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 0;
}

.wn-bank-chip-logo {
    height: 42px;
    padding: 4px 10px;
    background: var(--white);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.wn-bank-chip-logo img {
    max-height: 100%;
    max-width: 100px;
    object-fit: contain;
}

.wn-bank-chip-name {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
    max-width: 100%;
}

.wn-nav-band {
    background: var(--wb-700);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding-top: 1px;
    padding-bottom: 1px;
    box-shadow: 0 1px 4px rgba(0, 26, 51, 0.2);
    position: relative;
    z-index: 10;
}

.wn-nav-band-inner {
    width: 100%;
    max-width: 1440px;
    padding: 0 42px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wn-nav-menu {
    position: relative;
}

.wn-nav-list,
.wn-nav-submenu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wn-nav-list {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.wn-nav-item,
.wn-nav-subitem {
    position: relative;
}

.wn-nav-link {
    padding: 2px 22px;
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease, background 0.2s ease;
    letter-spacing: 0.15px;
}

.wn-nav-list > .wn-nav-item > .wn-nav-link {
    white-space: nowrap;
}

.wn-nav-link:hover,
.wn-nav-link:focus {
    color: var(--white);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.wn-nav-link.is-active {
    color: var(--gold-400);
    font-weight: 600;
}

.wn-nav-link.is-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--gold-500);
    border-radius: 2px 2px 0 0;
}

.wn-nav-submenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 340px;
    min-width: 340px;
    padding: 8px;
    background: var(--white);
    border: 1px solid rgba(3, 40, 77, 0.08);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(3, 40, 77, 0.18);
    display: none;
    z-index: 30;
}

.wn-nav-submenu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.wn-nav-subitem > .wn-nav-submenu {
    top: -8px;
    left: calc(100% - 8px);
}

.wn-nav-subitem > .wn-nav-submenu::before {
    top: 0;
    bottom: 0;
    left: -10px;
    right: auto;
    width: 10px;
    height: auto;
}

.wn-nav-item:hover > .wn-nav-submenu,
.wn-nav-item:focus-within > .wn-nav-submenu,
.wn-nav-subitem:hover > .wn-nav-submenu,
.wn-nav-subitem:focus-within > .wn-nav-submenu {
    display: block;
}

.wn-nav-submenu .wn-nav-link {
    width: 100%;
    min-height: 0;
    padding: 6px 36px 6px 14px;
    border-radius: 8px;
    justify-content: flex-start;
    color: var(--wb-900);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
}

.wn-nav-submenu .wn-nav-link:hover,
.wn-nav-submenu .wn-nav-link:focus {
    color: var(--wb-900);
    background: var(--wb-50);
}

.wn-nav-item.has-children > .wn-nav-link,
.wn-nav-subitem.has-children > .wn-nav-link {
    padding-right: 18px;
}

.wn-shell-card {
    background: var(--white);
    border-radius: var(--radius-card);
    box-shadow: 0 1px 3px rgba(0, 26, 51, 0.06), 0 6px 20px rgba(0, 26, 51, 0.04);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wn-shell-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 26, 51, 0.08), 0 12px 36px rgba(0, 26, 51, 0.06);
}

.wn-shell-card-header {
    padding: 16px 20px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wn-shell-card-icon {
    width: 28px;
    height: 28px;
    background: var(--wb-50);
    border: 1px solid var(--wb-100);
    border-radius: var(--radius-input);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wn-shell-card-icon svg {
    width: 13px;
    height: 13px;
    color: var(--wb-600);
}

.wn-shell-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--wb-900);
}

.wn-shell-card-body {
    padding: 0 20px 20px;
}

#myModal.modal {
    background: rgba(0, 26, 51, 0.36);
}

#myModal .modal-dialog {
    margin-top: 12vh;
}

#myModal .modal-content {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-card);
    box-shadow: 0 10px 40px rgba(0, 26, 51, 0.18);
    overflow: hidden;
}

#myModal .modal-header {
    background: linear-gradient(180deg, var(--wb-950) 0%, var(--wb-850) 100%);
    border-bottom: none;
    padding: 16px 18px 14px;
    position: relative;
}

#myModal .modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--gold-500) 20%,
            var(--gold-400) 50%,
            var(--gold-500) 80%,
            transparent 100%);
}

#myModal .modal-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--white);
}

#myModal .modal-body {
    background: var(--white);
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.55;
    padding: 18px;
}

@media (max-width: 1199px) {
    .wn-shell-header {
        padding-left: 24px;
        padding-right: 24px;
    }

    .wn-nav-band-inner {
        padding: 0 24px;
    }

    .wn-nav-link {
        padding-top: 5px;
        padding-bottom: 5px;
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media (max-width: 1279px) and (min-width: 901px) {
    .wn-nav-band {
        min-height: 0;
        padding-top: 2px;
        padding-bottom: 2px;
    }

    .wn-nav-band-inner {
        padding: 6px 20px;
        justify-content: flex-start;
    }

    .wn-nav-menu {
        width: 100%;
    }

    .wn-nav-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .wn-nav-link {
        min-height: 32px;
        padding: 3px 12px;
        font-size: 14px;
        border-radius: 8px;
    }
}

@media (max-width: 1599px) and (min-width: 1280px) {
    .wn-nav-band {
        min-height: 50px;
        padding-top: 1px;
        padding-bottom: 1px;
    }

    .wn-nav-link {
        min-height: 33px;
        padding-top: 1px;
        padding-bottom: 1px;
    }

    .wn-nav-submenu .wn-nav-link {
        padding-top: 5px;
        padding-bottom: 5px;
    }
}

@media (max-width: 900px) {
    .wn-shell-header {
        height: auto;
        padding-top: 14px;
        padding-bottom: 14px;
        align-items: flex-start;
        gap: 12px;
        flex-wrap: wrap;
    }

    .wn-shell-header-left,
    .wn-shell-header-right {
        width: 100%;
    }

    .wn-shell-header-right {
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
    }

    .wn-user-pill-name {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wn-bank-chip {
        padding-left: 12px;
    }

    .wn-bank-chip-logo {
        height: 38px;
        padding: 4px 8px;
    }

    .wn-bank-chip-logo img {
        max-width: 84px;
    }

    .wn-nav-band {
        min-height: 0;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .wn-nav-band-inner {
        padding: 8px 24px;
        justify-content: flex-start;
    }

    .wn-nav-menu {
        width: 100%;
    }

    .wn-nav-list {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px 6px;
    }

    .wn-nav-link {
        min-height: 40px;
        padding: 6px 14px;
        border-radius: 8px;
    }
}

@media (max-width: 640px) {
    .wn-shell-header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .wn-shell-header-left {
        gap: 10px;
    }

    .wn-header-tagline {
        font-size: 12px;
        letter-spacing: 1px;
        white-space: normal;
    }

    .wn-bank-chip-name {
        display: none;
    }

    .wn-user-pill {
        padding-left: 10px;
    }

    .wn-user-pill-name {
        max-width: 104px;
    }

    .wn-user-pill-avatar {
        width: 28px;
        height: 28px;
    }

    .wn-bank-chip {
        margin-left: auto;
        border-left: none;
        padding-left: 0;
    }

    .wn-bank-chip-logo {
        height: 32px;
        padding: 3px 6px;
    }

    .wn-bank-chip-logo img {
        max-width: 72px;
    }

    .wn-nav-band-inner {
        padding-left: 16px;
        padding-right: 16px;
    }

    .wn-nav-list {
        gap: 4px;
    }

    .wn-nav-link {
        font-size: 11px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .wn-nav-submenu {
        width: 260px;
        min-width: 260px;
        left: 0;
    }

    .wn-nav-subitem > .wn-nav-submenu {
        left: 0;
        top: calc(100% + 6px);
    }
}

@media (min-width: 1920px) {
    .wn-shell-header {
        padding-left: clamp(36px, 3.6vw, 72px);
        padding-right: clamp(36px, 3.6vw, 72px);
        height: calc(var(--shell-header-height) + 8px);
    }

    .wn-shell-header-left {
        gap: 18px;
    }

    .wn-shell-header-right {
        gap: 24px;
    }

    .wn-user-pill-name {
        font-size: 18px;
    }

    .wn-user-menu-link {
        font-size: 14.5px;
    }

    .wn-header-tagline {
        font-size: 18px;
    }

    .wn-home-btn {
        width: 46px;
        height: 46px;
    }

    .wn-home-btn svg {
        width: 22px;
        height: 22px;
    }

    .wn-user-pill {
        gap: 13px;
        padding: 6px 8px 6px 16px;
    }

    .wn-user-pill-avatar {
        width: 36px;
        height: 36px;
        font-size: 12.5px;
    }

    .wn-nav-link {
        font-size: 18px;
        padding-top: 8px;
        padding-bottom: 8px;
        padding-left: 24px;
        padding-right: 24px;
    }

    .wn-nav-submenu .wn-nav-link {
        font-size: 16.5px;
    }

    .wn-bank-chip {
        padding-left: 24px;
    }

    .wn-bank-chip-logo {
        height: 50px;
        padding: 5px 12px;
    }

    .wn-bank-chip-logo img {
        max-width: 112px;
    }

    .wn-bank-chip-name {
        font-size: 9.5px;
    }

    .wn-nav-list {
        gap: 10px;
    }
}

#myModal .modal-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 0 18px 18px;
}

#myModal .btn {
    border-radius: var(--radius-button);
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 16px;
}

#myModal .btn-danger {
    background: var(--wb-600);
    border-color: var(--wb-600);
}

#myModal .btn-danger:hover,
#myModal .btn-danger:focus {
    background: var(--wb-700);
    border-color: var(--wb-700);
}
