.language-switch {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--green);
    border-radius: 9px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.profile-language {
    width: 100%;
    margin: 3px 0;
    text-align: center;
}
.app-shell[dir='ltr'] {
    grid-template-columns: 270px 1fr;
}
.app-shell[dir='ltr'] .sidebar {
    grid-column: 1;
}
.app-shell[dir='ltr'] main {
    grid-column: 2;
}
.app-shell[dir='ltr'] .nav-item {
    text-align: left;
}
.app-shell[dir='ltr'] .nav-item.active {
    box-shadow: inset 3px 0 var(--brand-gold);
}
.app-shell[dir='ltr'] .profile-menu {
    right: auto;
    left: 0;
}
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 270px;
    background: var(--canvas);
    direction: ltr;
}

.app-shell[dir='rtl'] .sidebar {
    direction: rtl;
}
.app-shell[dir='rtl'] main {
    direction: rtl;
}

.app-shell[dir='ltr'] .sidebar {
    direction: ltr;
}
.app-shell[dir='ltr'] main {
    direction: ltr;
}

.sidebar {
    grid-column: 2;
    grid-row: 1;
    background: var(--surface);
    color: whitesmoke;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
}

.mobile-nav-trigger {
    display: none;
}
.mobile-nav-close {
    display: none;
}
.mobile-nav-backdrop {
    display: none;
}

.topbar__intro {
    min-width: 0;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 8px 28px;
    border-bottom: 1px solid #ffffff18;
}

.brand__mark {
    width: 42px;
    height: 42px;
    background: var(--surface-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-weight: 800;
    font-size: 22px;
}

.brand strong {
    display: block;
}
.brand span {
    display: block;
}

.brand strong {
    font-size: 13px;
    font-weight: bold;
}

.brand span {
    color: #b8cabe;
    font-size: 10px;
    font-weight: bold;
    margin-top: 3px;
}
.sidebar nav {
    display: grid;
    gap: 7px;
    margin-top: 26px;
}

.nav-item {
    border: 0;
    color: var(--text);
    background: transparent;
    padding: 13px 14px;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    align-items: center;
    text-align: right;
    font-size: 8px;
    text-decoration: none;
    cursor: pointer;
}

.nav-item span {
    flex: 1;
    font-size: 9px;
    font-weight: bold;
}
.nav-item b {
    background: var(--surface);
    color: var(--text);
    border-radius: 20px;
    min-width: 25px;
    padding: 2px 7px;
    text-align: center;
}

.nav-item.active {
    background: var(--surface-soft);
    color: var(--primary);
    box-shadow: inset -3px 0 var(--brand-gold);
}

.sidebar__profile {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar__profile div:nth-child(2) {
    flex: 1;
}

.sidebar__profile strong {
    display: block;
}
.sidebar__profile span {
    display: block;
}

.sidebar__profile strong {
    font-size: 12px;
}

.sidebar__profile span {
    font-size: 9px;
    color: var(--muted);
    margin-top: 4px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 700;
}

main {
    grid-column: 1;
    grid-row: 1;
    padding: 26px 34px 40px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar p {
    color: var(--muted);
    font-size: 11px;
    margin: 0 0 5px;
}

.topbar h1 {
    margin: 0;
    font-size: 21px;
}

.topbar__actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.icon-button {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    width: 42px;
    height: 42px;
    border-radius: 11px;
}

.icon-button i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--surface);
    position: absolute;
    top: 7px;
    right: 8px;
}

.primary-button {
    border-radius: 10px;
    padding: 11px 18px;
    font-size: 12px;
    font-weight: 600;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 28px 0 20px;
}

.metrics article {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 4px 14px #102a1f08;
}

.metrics span {
    display: block;
}
.metrics strong {
    display: block;
}
.metrics small {
    display: block;
}

.metrics span {
    color: var(--muted);
    font-size: 11px;
}

.metrics strong {
    font-size: 29px;
    margin: 8px 0 5px;
}

.metrics em {
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
}

.metrics small {
    color: #8b948e;
    font-size: 9px;
}

.metrics .warning {
    color: #bb6a25;
}

.metrics .success {
    color: #288158;
}

.workspace-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 22px;
    box-shadow: var(--shadow-card);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    font-size: 17px;
}

.section-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.search {
    width: 280px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: #fafcfb;
    border-radius: 10px;
    padding: 0 12px;
    color: #829087;
}

.search input {
    border: 0;
    outline: 0;
    background: transparent;
    height: 40px;
    width: 100%;
    font-size: 11px;
}

.grid-wrap {
    width: 100%;
    --ag-font-family: var(--font-ui);
    --ag-font-size: 11px;
    --ag-header-background-color: #f6f8f7;
    --ag-header-text-color: #536159;
    --ag-border-color: #e5ebe7;
    --ag-row-border-color: #edf1ee;
    --ag-wrapper-border-radius: 10px;
}

.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    line-height: 1.6;
}

.status--pending {
    background: #fff4dc;
    color: #9a6818;
}

.status--approved {
    background: #e2f5ea;
    color: #25704a;
}

.status--returned {
    background: #fde8e5;
    color: #a74d42;
}

@media (max-width: 1050px) {
    .metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-shell {
        grid-template-columns: 1fr 225px;
    }

    .sidebar {
        width: 225px;
    }
}

@media (min-width: 761px) and (max-width: 900px) {
    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .topbar__intro {
        width: 100%;
    }
    .topbar__intro > div {
        width: 100%;
    }

    .topbar h1 {
        font-size: 20px;
        line-height: 1.55;
    }

    .topbar__actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .app-shell[dir='rtl'] .topbar__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        display: flex;
        position: fixed;
        z-index: 120;
        top: 0;
        bottom: 0;
        width: min(82vw, 300px);
        min-height: 100dvh;
        box-sizing: border-box;
        transition: transform 0.22s ease;
        box-shadow: 0 0 0 transparent;
        overflow-y: auto;
    }

    .app-shell[dir='rtl'] .sidebar {
        right: 0;
        left: auto;
        transform: translateX(105%);
    }

    .app-shell[dir='ltr'] .sidebar {
        left: 0;
        right: auto;
        transform: translateX(-105%);
    }

    .app-shell.mobile-nav-open .sidebar {
        transform: translateX(0);
        box-shadow: none;
    }

    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 110;
        border: 0;
        background: #071a1275;
    }

    .mobile-nav-open .mobile-nav-backdrop {
        display: block;
    }

    .mobile-nav-close {
        z-index: 5;
        display: grid;
        place-items: center;
        position: absolute;
        top: 12px;
        width: 38px;
        height: 38px;
        border: 1px solid #ffffff2b;
        border-radius: 10px;
        background: #ffffff12;
        color: #fff;
        cursor: pointer;
    }

    .app-shell[dir='rtl'] .mobile-nav-close {
        left: 12px;
    }

    .app-shell[dir='ltr'] .mobile-nav-close {
        right: 12px;
    }

    .mobile-nav-trigger {
        display: grid;
        place-items: center;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
        color: var(--green);
        cursor: pointer;
    }

    .topbar__intro {
        display: flex;
        align-items: flex-start;
        gap: 11px;
    }

    .topbar__intro > div {
        min-width: 0;
    }

    .metrics {
        grid-template-columns: 1fr 1fr;
    }

    main {
        padding: 20px 14px;
    }

    .topbar {
        align-items: flex-start;
    }

    .topbar h1 {
        font-size: 16px;
    }

    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .search {
        width: 100%;
    }
}

.sidebar__profile {
    border: 0;
    border-top: 1px solid var(--line);
    padding: 18px 0 0;
    background: transparent;
    color: var(--text);
    text-align: right;
}

.profile-area {
    margin-top: auto;
    position: relative;
    min-width: 0;
}

.profile-area .sidebar__profile {
    margin-top: 0;
    width: 100%;
    cursor: pointer;
}

.avatar-image {
    object-fit: cover;
    border: 2px solid var(--line);
}

.chevron-open {
    transform: rotate(180deg);
}

.profile-menu {
    position: absolute;
    right: 0;
    bottom: 66px;
    width: 100%;
    box-sizing: border-box;
    background: white;
    color: #183b2d;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 18px 45px #071a1245;
    z-index: 20;
}

.profile-menu__heading {
    display: flex;
    gap: 9px;
    align-items: center;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--line);
}

.profile-menu__heading div {
    display: grid;
}

.profile-menu__heading span {
    color: var(--muted);
    font-size: 9px;
}
.profile-menu p {
    color: var(--muted);
    font-size: 9px;
}

.profile-menu p {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-menu .profile-roles {
    background: #f2f6f4;
    padding: 8px;
    border-radius: 7px;
}

.upload-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    background: white;
    padding: 10px 7px;
    font-size: 10px;
    cursor: pointer;
}
.logout-button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    background: white;
    padding: 10px 7px;
    font-size: 10px;
    cursor: pointer;
}
.profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    background: white;
    padding: 10px 7px;
    font-size: 10px;
    cursor: pointer;
}

.upload-avatar input {
    display: none;
}

.logout-button {
    color: #ad4137;
    border-top: 1px solid var(--line);
    margin-top: 3px;
}

.profile-link {
    color: var(--green);
    border-bottom: 1px solid var(--line);
}

.profile-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    gap: 28px;
    align-items: center;
}

.profile-photo {
    display: grid;
    gap: 10px;
    justify-items: center;
}

.profile-photo > img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    background: #e9f3ed;
    color: var(--green);
    padding: 10px;
    box-sizing: border-box;
}
.profile-photo > svg {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    background: #e9f3ed;
    color: var(--green);
    padding: 10px;
    box-sizing: border-box;
}

.profile-photo label {
    display: flex;
    gap: 6px;
    align-items: center;
    color: var(--green);
    font-size: 10px;
    cursor: pointer;
}

.profile-photo input {
    display: none;
}

.profile-data h3 {
    font-size: 22px;
    margin: 0 0 12px;
}

.profile-data p {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
}

.back-link {
    border: 0;
    background: none;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 5px;
    width: max-content;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
}

.form-grid input {
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 0 11px;
}

.verify-button {
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
}

.employee-match {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eaf5ee;
    color: var(--green);
    border-radius: 10px;
    padding: 13px;
}

.employee-match div {
    display: grid;
}

.employee-match span {
    color: var(--muted);
    font-size: 9px;
}

.success-card {
    text-align: center;
    justify-items: center;
    max-width: 520px;
}

.success-card > svg {
    color: var(--green);
}

.success-card > strong {
    direction: ltr;
    background: #eef4f1;
    padding: 10px 18px;
    border-radius: 9px;
    font-size: 18px;
}

@media (max-width: 650px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}
