:root {
    /* employee-portal-concept --background: 210 20% 98% */
    --tc-layout-bg: hsl(210, 20%, 98%);
    --tc-content-bg: hsl(210, 20%, 98%);
    --tc-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --tc-sidebar-bg: #0f233a;
    --tc-sidebar-border: #1f3752;
    --tc-sidebar-text: #d2dbe8;
    --tc-sidebar-muted: #8ea1b7;
    --tc-sidebar-accent: #1a3656;
    --tc-sidebar-active: #d4a93a;
}

.tc-layout-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    background: var(--tc-layout-bg);
    font-family: var(--tc-font-sans);
}

.tc-layout-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tc-layout-content {
    flex: 1;
    min-width: 0;
    min-height: 0;
    background: var(--tc-content-bg);
    overflow-x: auto;
}

/* ERP top bar — align padding with .tp-wrapper (2rem), tokens match Taxpayers toolbar */
.tc-app-header {
    box-sizing: border-box;
    min-height: 4.5rem;
    padding: 0.75rem 2rem;
    background: hsl(0, 0%, 100%);
    border-bottom: 1px solid hsl(210, 20%, 91%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.tc-app-header__nav-toggle {
    display: none;
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 0.5rem 0 0;
    padding: 0;
    border: 1px solid hsl(210, 20%, 91%);
    border-radius: 0.375rem;
    background: hsl(0, 0%, 100%);
    align-items: center;
    justify-content: center;
    color: hsl(210, 30%, 22%);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tc-app-header__nav-toggle:hover {
    background: hsl(210, 20%, 98%);
    border-color: hsl(210, 20%, 88%);
}

.tc-app-header__titles {
    flex: 1;
    min-width: 0;
}

/* Concept: large bold title + muted subtitle */
.tc-app-header__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: hsl(210, 30%, 15%);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.tc-app-header__subtitle {
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    font-weight: 400;
    color: hsl(210, 10%, 50%);
    line-height: 1.4;
}

.tc-app-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Same shell as tp-search-input-concept: white field, light border, ~6px radius */
.tc-app-header__search {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    box-sizing: border-box;
    background: hsl(0, 0%, 100%);
    border: 1px solid hsl(210, 20%, 91%);
    border-radius: 0.375rem;
}

.tc-app-header__search-icon {
    display: inline-flex;
    color: hsl(210, 10%, 50%);
    line-height: 0;
    flex-shrink: 0;
}

.tc-app-header__search input {
    border: 0;
    outline: none;
    background: transparent;
    width: min(13rem, 28vw);
    min-width: 6.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: hsl(210, 30%, 15%);
}

.tc-app-header__search input::placeholder {
    color: hsl(210, 10%, 50%);
}

.tc-app-header__search:focus-within {
    border-color: hsla(209, 75%, 17%, 0.45);
    box-shadow: 0 0 0 2px hsla(209, 75%, 17%, 0.1);
}

.tc-app-header__icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border: 1px solid hsl(210, 20%, 91%);
    border-radius: 0.375rem;
    background: hsl(0, 0%, 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: hsl(210, 10%, 45%);
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tc-app-header__icon-btn:hover {
    background: hsl(210, 20%, 98%);
    border-color: hsl(210, 20%, 88%);
}

.tc-app-header__dot {
    position: absolute;
    right: 0.45rem;
    top: 0.45rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #eab308;
    box-shadow: 0 0 0 2px #fff;
}

/* Concept: vertical rule before profile block */
.tc-app-header__profile-cluster {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.125rem;
    position: relative;
}

.tc-app-header__actions-divider {
    width: 1px;
    height: 1.75rem;
    background: hsl(210, 20%, 91%);
    flex-shrink: 0;
}

.tc-app-header__profile-wrap {
    position: relative;
    z-index: 1;
}

.tc-app-header__profile-cluster.is-open .tc-app-header__profile-wrap {
    z-index: 100;
}

.tc-app-header__menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
}

.tc-app-header__profile-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 13.5rem;
    padding: 0.375rem 0;
    margin: 0;
    background: hsl(0, 0%, 100%);
    border: 1px solid hsl(210, 20%, 91%);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px hsla(210, 30%, 15%, 0.12), 0 4px 12px hsla(210, 30%, 15%, 0.06);
    z-index: 50;
}

.tc-app-header__menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(209, 30%, 22%);
    text-align: left;
    transition: background 0.12s ease;
}

.tc-app-header__menu-item:hover {
    background: hsl(210, 20%, 97%);
}

.tc-app-header__menu-icon {
    font-size: 1.125rem !important;
    width: 1.25rem;
    color: hsl(210, 15%, 40%) !important;
    flex-shrink: 0;
}

.tc-app-header__menu-item--danger,
.tc-app-header__menu-item--danger .tc-app-header__menu-icon {
    color: hsl(0, 65%, 45%) !important;
}

.tc-app-header__menu-item--danger:hover {
    background: hsl(0, 75%, 98%);
}

.tc-app-header__menu-separator {
    height: 1px;
    margin: 0.375rem 0;
    background: hsl(210, 20%, 93%);
}

.tc-app-header__profile {
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
    padding: 0.25rem 0.125rem 0.25rem 0.25rem;
    margin: 0;
    position: relative;
    z-index: 60;
    border-radius: 0.5rem;
    font-family: inherit;
    transition: background 0.15s ease;
}

.tc-app-header__profile:hover {
    background: hsl(210, 20%, 98%);
}

/* Concept: deep navy circle, white bold initials */
.tc-app-header__avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: hsl(215, 45%, 11%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.tc-app-header__profile-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0.0625rem;
    margin-right: 0.375rem;
    line-height: 1.15;
}

.tc-app-header__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(220, 25%, 11%);
    letter-spacing: -0.01em;
    line-height: 1.2;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Concept: muted light blue-gray, slightly smaller */
.tc-app-header__role {
    font-size: 0.8125rem;
    font-weight: 400;
    color: hsl(215, 18%, 58%);
    line-height: 1.2;
}

.tc-app-header__chevron {
    display: inline-flex;
    line-height: 0;
    flex-shrink: 0;
    align-self: center;
    color: hsl(215, 12%, 72%);
    font-size: 1.125rem;
    font-weight: 300;
    transition: transform 0.2s ease;
}

.tc-app-header__profile-cluster.is-open .tc-app-header__chevron {
    transform: rotate(180deg);
}

.tc-app-header__login {
    font-size: 0.85rem;
}

.tc-sidebar {
    width: 260px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background: var(--tc-sidebar-bg);
    border-right: 1px solid var(--tc-sidebar-border);
    transition: width 0.2s ease;
    z-index: 20;
}

.tc-sidebar.is-collapsed {
    width: 72px;
}

.tc-sidebar.is-collapsed .tc-sidebar__brand-text {
    display: none;
}

.tc-sidebar.is-collapsed .tc-sidebar__item-label {
    display: none;
}

.tc-sidebar.is-collapsed .tc-sidebar__collapse-label {
    display: none;
}

.tc-sidebar.is-collapsed .tc-sidebar__item-link {
    justify-content: center;
}

.tc-sidebar__brand {
    height: 64px;
    border-bottom: 1px solid var(--tc-sidebar-border);
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.tc-sidebar__brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    width: 100%;
}

.tc-sidebar__logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--tc-sidebar-active);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.tc-sidebar__brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tc-sidebar__brand-title {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.tc-sidebar__brand-subtitle {
    color: var(--tc-sidebar-muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

.tc-sidebar__nav {
    flex: 1;
    padding: 10px 10px 8px;
    overflow-y: auto;
}

.tc-sidebar__section {
    margin-bottom: 8px;
}

.tc-sidebar__section-button {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--tc-sidebar-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}

.tc-sidebar__section-button:hover,
.tc-sidebar__section-button.is-expanded {
    color: var(--tc-sidebar-text);
}

.tc-sidebar__section-divider {
    height: 1px;
    margin: 10px 6px;
    background: var(--tc-sidebar-border);
}

.tc-sidebar__items {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tc-sidebar__item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--tc-sidebar-muted);
    text-decoration: none;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.84rem;
    font-weight: 500;
    position: relative;
}

.tc-sidebar__item-link:hover {
    color: var(--tc-sidebar-text);
    background: rgba(26, 54, 86, 0.7);
}

.tc-sidebar__item-link.is-active {
    color: #fff;
    background: var(--tc-sidebar-accent);
}

.tc-sidebar__item-link.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--tc-sidebar-active);
}

.tc-sidebar.is-collapsed .tc-sidebar__item-link {
    justify-content: center;
    padding: 8px;
}

.tc-sidebar__footer {
    padding: 10px;
    border-top: 1px solid var(--tc-sidebar-border);
}

.tc-sidebar__collapse-btn {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--tc-sidebar-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 0.84rem;
}

.tc-sidebar__collapse-btn:hover {
    color: var(--tc-sidebar-text);
    background: rgba(26, 54, 86, 0.7);
}

/* Main shell footer — matches employee-portal-concept Login.tsx footer */
.tc-main-footer {
    margin-top: auto;
    flex-shrink: 0;
    padding: 1.5rem 2rem;
    border-top: 1px solid hsl(210, 20%, 91%);
    background: var(--tc-content-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.tc-main-footer__secure {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: hsl(210, 15%, 55%);
}

.tc-main-footer__lock {
    width: 0.75rem;
    height: 0.75rem;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tc-main-footer__copy {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: hsl(210, 15%, 40%);
}

/* ——— Staging environment banner ——— */
.tc-staging-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    padding: 0.5rem 1rem 0.625rem;
    background: hsl(38, 92%, 50%);
    border-top: 2px solid hsl(32, 95%, 38%);
    color: hsl(24, 45%, 12%);
    text-align: center;
    box-shadow: 0 -2px 8px hsla(24, 45%, 12%, 0.12);
}

.tc-staging-banner__title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.06em;
}

.tc-staging-banner__message {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.35;
    opacity: 0.92;
}

html:has(.tc-staging-banner) {
    scroll-padding-bottom: 3.5rem;
}

html:has(.tc-staging-banner) .tc-layout-main,
html:has(.tc-staging-banner) .login-background {
    padding-bottom: 3.5rem;
}

@media (max-width: 1024px) {
    .tc-sidebar {
        width: 72px;
    }
}

.tc-mobile-nav-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .tc-layout-shell.is-mobile-nav-open {
        overflow: hidden;
        touch-action: none;
    }

    .tc-mobile-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        margin: 0;
        padding: 0;
        border: 0;
        background: hsla(215, 45%, 11%, 0.45);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .tc-app-header__nav-toggle {
        display: inline-flex;
    }

    .tc-sidebar {
        width: min(280px, 86vw);
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        z-index: 45;
        box-shadow: none;
    }

    .tc-layout-shell.is-mobile-nav-open .tc-sidebar {
        transform: translateX(0);
        box-shadow: 12px 0 48px hsla(215, 45%, 11%, 0.35);
    }

    .tc-sidebar.is-collapsed .tc-sidebar__brand-text {
        display: flex !important;
    }

    .tc-sidebar.is-collapsed .tc-sidebar__item-label {
        display: inline !important;
    }

    .tc-sidebar.is-collapsed .tc-sidebar__collapse-label {
        display: inline !important;
    }

    .tc-sidebar.is-collapsed .tc-sidebar__item-link {
        justify-content: flex-start;
    }

    .tc-sidebar__footer {
        display: none;
    }

    .tc-app-header {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
        padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
        gap: 0.5rem;
    }

    .tc-app-header__title {
        font-size: 1.125rem;
    }

    .tc-app-header__subtitle {
        font-size: 0.8125rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .tc-app-header__search {
        display: none;
    }

    .tc-app-header__profile-text {
        display: none;
    }

    .tc-app-header__profile {
        padding: 0.25rem;
    }

    .tc-layout-content {
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }

    .tc-main-footer {
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    }
}

.rz-dropdown {
    width: 100%;
    border-radius: 10px;
    border-color: #e2e8f0;
    background: rgba(255, 255, 255, 0.9);
    min-height: 2.35rem;
}

.tc-form__field + .tc-form__field {
    margin-top: 0.9rem;
}

.tc-form__grid-top {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 992px) {
    .tc-form__grid-top,
    .tc-form__grid-bottom {
        grid-template-columns: 1fr;
    }

    .tc-form__grid-mid {
        grid-template-columns: 1fr;
    }
}
