/*
 * Author: Behnam <b.farnaghi@gmail.com>
 * AI-assisted implementation; manually reviewed and verified by the developer.
 */
.language-switcher {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    border: 1px solid rgba(86, 105, 133, .28);
    border-radius: 6px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 4px 18px rgba(8, 25, 49, .12);
    color: #24344e;
    font: 700 12px/1.2 system-ui, sans-serif;
}
.language-switcher select {
    max-width: 112px;
    border: 0;
    outline: 0;
    color: inherit;
    background: transparent;
    font: inherit;
}
[dir="rtl"] .language-switcher { right: auto; left: 14px; }
[dir="rtl"] input,
[dir="rtl"] textarea { text-align: right; }
@media (max-width: 720px) {
    .language-switcher { bottom: 76px; }
}
.money-value { display:inline-block; direction:ltr; unicode-bidi:isolate; }
.money-value-irt-fa { display:inline-flex; flex-direction:row; align-items:baseline; gap:.22em; direction:ltr; unicode-bidi:isolate; }
.money-value-irt-fa .money-sign,.money-value-irt-fa .money-number { direction:ltr; unicode-bidi:isolate; }
.money-value-irt-fa .money-currency { direction:rtl; unicode-bidi:isolate; }

/* Shared authenticated navigation for non-dashboard pages.
 * Keep this visually identical to the dashboard sidebar. */
body.has-global-sidebar { padding-left: 244px; }
.global-app-sidebar {
    --sidebar-navy: #071a3a;
    --sidebar-active: #12376a;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    display: flex;
    width: 244px;
    flex-direction: column;
    padding: 28px 18px 20px;
    box-sizing: border-box;
    color: #f6fbff;
    background: var(--sidebar-navy);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-y: auto;
}
.global-app-sidebar[data-theme="forest"] { --sidebar-navy: #142c25; --sidebar-active: #285848; }
.global-app-sidebar[data-theme="graphite"] { --sidebar-navy: #242b31; --sidebar-active: #3d4a52; }
.global-app-sidebar[data-theme="purple"] { --sidebar-navy: #2b2033; --sidebar-active: #4d3859; }
.global-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0 8px 36px;
    color: inherit;
    font-size: 18px;
    font-weight: 750;
    text-decoration: none;
}
.global-sidebar-brand img {
    display: block;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 7px;
    object-fit: contain;
}
.global-primary-nav { display: grid; gap: 6px; }
.global-nav-item {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    gap: 13px;
    padding: 0 13px;
    box-sizing: border-box;
    border: 0;
    border-radius: 6px;
    color: #a9bbd2;
    background: transparent;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    font-size: 15px;
}
.global-nav-item span { width: 19px; color: #cbdcf2; font-size: 20px; text-align: center; }
.global-nav-item:hover, .global-nav-item:focus-visible { color: #fff; background: var(--sidebar-active); }
.global-sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding: 17px 5px 0;
    border-top: 1px solid #183b69;
}
.global-user-chip { display: flex; min-width: 0; align-items: center; gap: 10px; }
.global-user-chip > span:last-child { display: grid; min-width: 0; }
.global-user-chip strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; }
.global-user-chip small { color: #90a5bf; font-size: 11px; }
.global-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #07306b;
    background: #dceaff;
    font-weight: 800;
}
.global-sidebar-footer form { display: contents; }
.global-sidebar-icon-button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #cbdcf2;
    background: transparent;
    cursor: pointer;
    font: inherit;
}
.global-sidebar-icon-button:hover { color: #fff; background: rgba(255, 255, 255, .10); }
[dir="rtl"] body.has-global-sidebar { padding-left: 0; padding-right: 244px; }
[dir="rtl"] .global-app-sidebar { left: auto; right: 0; }
[dir="rtl"] .global-nav-item { text-align: right; }
@media (max-width: 900px) {
    body.has-global-sidebar, [dir="rtl"] body.has-global-sidebar { padding-left: 0; padding-right: 0; }
    .global-app-sidebar { display: none; }
}

/* Authenticated pages already carry the Darith identity in the shared sidebar. */
body.has-global-sidebar .credits-brand,
body.has-global-sidebar .tools-brand,
body.has-global-sidebar .split-brand,
body.has-global-sidebar .tutorial-brand,
body.has-global-sidebar .billing-brand,
body.has-global-sidebar .mission-brand,
body.has-global-sidebar .reports-brand,
body.has-global-sidebar .group-brand,
body.has-global-sidebar .account-brand { display: none; }
