/* Shared navigation only. Entry screens and the Calculator worksheet retain their own layout. */
.department-sidebar {
    --dept-ink: #173f34;
    --dept-line: #c3d2c9;
    --dept-sage: #e4eee7;
    --dept-text: #f1f7f1;
    font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}
.workspace-sidebar.department-sidebar:not(.workspace-sidebar--calculator) {
    padding: 14px 12px 12px;
    color: var(--dept-text);
    background: linear-gradient(167deg, #153c32 0%, #14392f 50%, #112e28 100%);
    border-inline-end: 1px solid #265143;
}
.department-sidebar [hidden] { display: none !important; }
.department-sidebar .dept-brand {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 0 4px 13px;
    margin: 0 0 10px;
    border-bottom: 1px solid #446353;
}
.workspace-sidebar.department-sidebar .dept-brand img { width: 108px; height: 38px; border-radius: 6px; padding: 3px 7px; }
.workspace-sidebar.department-sidebar .dept-brand > span { color: #e0ede2; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.dept-search { position: relative; margin-bottom: 8px; --ui-control-pad: 4px 8px 4px 32px; --ui-control-height: 36px; }
.department-sidebar .dept-search input {
    width: 100%; min-width: 0; height: 36px;
    border: 1px solid #7a9988; border-radius: 7px; padding: 4px 6px 4px 32px;
    color: #16392e; background: #f4f8f3; font-weight: 500; line-height: 1.3; font-family: inherit; font-size: 14px;
}
.department-sidebar .dept-search input::placeholder { color: #4e665a; opacity: 1; }
.department-sidebar .dept-search > .workspace-icon { position: absolute; left: 10px; top: 10px; height: 16px; width: 16px; color: #52705f; pointer-events: none; }
.dept-sr-only { position: absolute; height: 1px; width: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.department-sidebar .dept-row {
    width: 100%; display: flex; align-items: center; gap: 9px; text-align: left;
    min-height: 37px; margin: 0; padding: 4px 7px; border: 1px solid transparent; border-radius: 7px;
    cursor: pointer; background: transparent; color: #f0f6f0; text-decoration: none;
    font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
}
.department-sidebar .dept-nav .dept-row:hover, .department-sidebar .dept-nav .dept-row[aria-expanded="true"] {
    background: #315648; border-color: #638271; color: white;
}
.department-sidebar .dept-row.is-current { box-shadow: inset 3px 0 #e4ab77; background: #2b4f42; }
.department-sidebar .dept-row > .workspace-icon { color: #c7dacc; width: 18px; height: 18px; }
.department-sidebar .dept-choice > .workspace-icon:last-child { margin-inline-start: auto; width: 13px; height: 13px; color: #c0d3c4; }
.department-sidebar .dept-count { margin-inline-start: auto; min-width: 24px; padding: 1px 5px; text-align: center; border: 1px solid #72927e; border-radius: 5px; color: #d8e9da; font-size: 12px; font-variant-numeric: tabular-nums; }
.department-sidebar .dept-label { margin: 8px 3px 5px; padding: 10px 4px 0; border-top: 1px solid #456354; color: #c5d9cb; background: none; font-weight: 700; line-height: 1.3; font-family: inherit; font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
.department-sidebar .dept-symbol {
    display: inline-grid; place-items: center; flex: none; width: 25px; height: 25px; border-radius: 6px;
    background: #dae8db; color: #285343;
}
.department-sidebar .dept-symbol .workspace-icon { width: 16px; height: 16px; color: inherit; }
.department-sidebar .dept-symbol--calculator { background: #ebddc8; color: #755227; }
.department-sidebar .dept-symbol--purchasing, .department-sidebar .dept-symbol--dispatch { background: #d6e6ef; color: #345973; }
.department-sidebar .dept-symbol--contacts { background: #ebe1ef; color: #654874; }
.department-sidebar .dept-symbol--production { background: #f2ddc9; color: #81512c; }
.department-sidebar .dept-account { margin-top: auto; padding: 9px 4px 0; flex: none; }
.department-sidebar .dept-account strong { font-size: 13px; color: #eef6ef; }
.department-sidebar .dept-account > div > span { font-size: 11px; color: #c1d7c4; }
.department-sidebar .dept-account .workspace-avatar { width: 29px; height: 29px; border-radius: 7px; }
.department-sidebar .dept-directory {
    box-sizing: border-box; color: var(--dept-ink); background: #fbfdfb; border: 1px solid #91ad9d;
    border-radius: 11px; padding: 0; text-align: left; font: 14px/1.35 Inter, "Helvetica Neue", Arial, sans-serif;
}
.department-sidebar[data-enhanced] .dept-directory {
    position: fixed; z-index: 120; inset: 12px auto auto calc(var(--dept-panel-left, 218px) + 8px); margin: 0;
    width: min(850px, calc(100vw - var(--dept-panel-left, 218px) - 20px));
    max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain;
    box-shadow: 0 12px 38px rgb(18 49 37 / 24%), 0 2px 6px rgb(18 49 37 / 12%);
}
.department-sidebar[data-enhanced] .dept-directory.dept-single { width: min(365px, calc(100vw - var(--dept-panel-left, 218px) - 20px)); }
.department-sidebar .dept-panel-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; background: #214b3e; color: white; border: none; border-bottom: 2px solid #c79e70; }
.department-sidebar .dept-panel-head h2 { margin: 0; padding: 0; border: 0; background: none; color: #fff; font: 700 19px/1.24 Inter, "Helvetica Neue", Arial, sans-serif; letter-spacing: -.02em; }
.department-sidebar .dept-result-count { color: #dbe9dd; font-size: 12px; }
.department-sidebar .dept-close { display: grid; place-items: center; width: 32px; min-width: 32px; height: 32px; border: 1px solid #93b0a0; border-radius: 6px; background: transparent; cursor: pointer; padding: 0; }
.department-sidebar .dept-close .workspace-icon { width: 16px; height: 16px; color: white; }
.department-sidebar .dept-panel-head .dept-close:hover { background: #38634f; border-color: #d6e7da; }
.department-sidebar .dept-grid { padding: 11px; }
.department-sidebar[data-enhanced] .dept-grid { columns: 3; column-gap: 12px; }
.department-sidebar .dept-directory.dept-single .dept-grid { columns: 1; }
.department-sidebar .dept-group { display: inline-block; vertical-align: top; width: 100%; break-inside: avoid; margin: 0 0 8px; padding: 0; background: #fff; border: 1px solid var(--dept-line); border-radius: 6px; overflow: hidden; }
.department-sidebar .dept-group h3 { display: flex; align-items: center; gap: 7px; margin: 0; border: 0; border-bottom: 1px solid var(--dept-line); padding: 5px 9px; background: var(--dept-sage); color: #244d3c; font: 700 14px/1.25 Inter, "Helvetica Neue", Arial, sans-serif; }
.department-sidebar .dept-group h3 .dept-symbol { width: 19px; height: 19px; }
.department-sidebar .dept-group h3 .workspace-icon { width: 15px; height: 15px; }
.department-sidebar .dept-group ul, .department-sidebar .dept-group li { list-style: none; margin: 0; padding: 0; }
.department-sidebar .dept-group li + li { border-top: 1px solid #e3ebe5; }
.department-sidebar .dept-module {
    display: block; min-height: 29px; padding: 5px 10px; color: #203d31; background: white;
    font: 500 14px/1.37 Inter, "Helvetica Neue", Arial, sans-serif; text-decoration: none; white-space: normal; overflow-wrap: anywhere;
}
.department-sidebar .dept-module:hover, .department-sidebar .dept-module:focus-visible { background: #ebf4ed; color: #154631; }
.department-sidebar .dept-module:focus-visible { outline: 2px solid #40765d !important; outline-offset: -2px; }
.department-sidebar .dept-module.current { background: #f8efe4; box-shadow: inset 3px 0 #b76c3c; color: #704324; font-weight: 700; }
.department-sidebar .dept-selected .dept-group h3 { display: none; }
.department-sidebar .dept-group:last-child { margin-bottom: 0; }
.department-sidebar .dept-empty { margin: 0 14px 14px; color: #3d5749; }
.department-sidebar .dept-row:focus-visible, .department-sidebar .dept-close:focus-visible { outline: 2px solid #f4c08f; outline-offset: -2px; }
@media (max-height: 650px) {
    .workspace-sidebar.department-sidebar:not(.workspace-sidebar--calculator) { padding-block: 9px; }
    .department-sidebar .dept-brand { margin-bottom: 6px; padding-bottom: 7px; }
    .department-sidebar .dept-row { min-height: 31px; padding-block: 2px; }
    .department-sidebar .dept-label { margin-top: 3px; padding-top: 6px; }
    .department-sidebar .dept-account { padding-top: 5px; }
}
@media (max-width: 990px) { .department-sidebar[data-enhanced] .dept-grid { columns: 2; } }
@media (max-width: 700px) {
    .department-sidebar[data-enhanced] .dept-directory, .department-sidebar[data-enhanced] .dept-directory.dept-single {
        inset: 8px 8px auto; width: auto; max-height: calc(100dvh - 16px);
    }
    .department-sidebar .dept-row { font-size: 13px; gap: 6px; padding-inline: 4px; }
}
@media (max-width: 460px) { .department-sidebar[data-enhanced] .dept-grid { columns: 1; } }
@media print { .department-sidebar, .dept-directory { display: none !important; } }
