.dashboard-page .dashboard-module-nav {
    position: sticky;
    /* Fully below sticky .app-header (15px + header height + gap). Measured in header-menu.js. */
    top: var(--app-header-offset, calc(15px + 80px + 12px));
    z-index: 20;
    isolation: isolate;
    padding: 10px 8px 12px;
    margin: -4px -8px 1rem;
    border-radius: 16px;
    background: var(--body-bg, var(--bg-base, #f4f6f8));
    border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.06));
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

/* Keep pill buttons inside the sticky stacking context (never paint over the header). */
.dashboard-page .dashboard-module-nav > .btn {
    position: relative;
    z-index: 0;
}

html.theme-dark .dashboard-page .dashboard-module-nav {
    background: var(--body-bg, var(--bg-base, #0d1117));
    border-color: var(--border-subtle);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.dashboard-stats-grid > [class*='col-'] {
    display: flex;
}

.dashboard-stats-grid .stat-card {
    flex: 1 1 auto;
    width: 100%;
}

.dashboard-stats-grid .stat-card .card-body {
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dashboard-stats-grid .stats-kpi-card .card-body {
    min-height: 96px;
}

.dashboard-stats-grid .stat-card h3 {
    margin-bottom: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.dashboard-module-panel {
    min-height: 200px;
}

.dashboard-settings-nav {
    position: static;
    margin: 0 0 1.25rem;
    box-shadow: none;
}

.dashboard-page .money-value {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dashboard-employees-list .card-header {
    border-color: var(--border-subtle, rgba(0, 0, 0, 0.08)) !important;
}

.dashboard-employees-list .card-body.border-top {
    border-color: var(--border-subtle, rgba(0, 0, 0, 0.08)) !important;
}

.dashboard-employees-list .employee-card-toggle {
    color: inherit;
}

.dashboard-employees-list .employee-card-toggle:hover,
.dashboard-employees-list .employee-card-toggle:focus,
.dashboard-employees-list .employee-card-toggle:focus-visible {
    color: inherit;
    box-shadow: none;
}

.dashboard-employees-list .employee-collapse-icon {
    font-size: 0.85rem;
    opacity: 0.65;
    transition: transform 0.2s ease;
}

.employee-access-panel {
    background: rgba(var(--bs-success-rgb), 0.04);
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

html.theme-dark .employee-access-panel {
    background: rgba(255, 255, 255, 0.03);
}

#ranksSection .rank-editor-card:last-child {
    margin-bottom: 0;
}

.dashboard-employees-list .employee-card-toggle[aria-expanded="true"] .employee-collapse-icon {
    transform: rotate(180deg);
}

.employee-category-list {
    display: grid;
    gap: 0.35rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background: var(--bg-surface, transparent);
}

.showcase-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
}

.showcase-style-tile {
    margin: 0;
    cursor: pointer;
}

.showcase-style-tile__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.showcase-style-tile__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 118px;
    padding: 16px 12px;
    border-radius: 16px;
    border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
    background: var(--surface-bg, #f8f9fa);
    color: var(--text-primary, inherit);
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.showcase-style-tile__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(25, 135, 84, 0.12);
    color: #198754;
    font-size: 1.2rem;
}

.showcase-style-tile__label {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.35;
}

.showcase-style-tile__input:checked + .showcase-style-tile__card {
    border-color: rgba(25, 135, 84, 0.55);
    background: rgba(25, 135, 84, 0.08);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.14);
}

.showcase-style-tile:hover .showcase-style-tile__card {
    transform: translateY(-1px);
    border-color: rgba(25, 135, 84, 0.35);
}

.showcase-options-panel {
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed var(--border-subtle, rgba(0, 0, 0, 0.12));
    background: var(--body-bg, #fff);
}

html.theme-dark .showcase-style-tile__card {
    background: var(--surface-bg);
    border-color: var(--border-subtle);
}

html.theme-dark .showcase-style-tile__icon {
    background: rgba(63, 185, 80, 0.16);
    color: #3fb950;
}

html.theme-dark .showcase-style-tile__input:checked + .showcase-style-tile__card {
    border-color: rgba(63, 185, 80, 0.55);
    background: rgba(63, 185, 80, 0.1);
    box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.16);
}

html.theme-dark .showcase-options-panel {
    background: var(--card-bg);
    border-color: var(--border-subtle);
}

.manual-picker-product-list {
    display: grid;
    gap: 0.5rem;
    max-height: 360px;
    overflow-y: auto;
}

.manual-picker-product-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
    border-radius: 0.65rem;
    cursor: pointer;
}

.weight-units-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .weight-units-settings {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.weight-unit-tile {
    display: block;
    margin: 0;
    cursor: pointer;
}

.weight-unit-tile__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.weight-unit-tile__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 88px;
    padding: 0.75rem;
    border-radius: 14px;
    border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
    background: var(--bg-surface, #f8fafc);
    color: var(--text-primary, #0f172a);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.weight-unit-tile__input:checked + .weight-unit-tile__card {
    border-color: color-mix(in srgb, var(--primary-color, #1d4ed8) 45%, transparent);
    background: color-mix(in srgb, var(--primary-color, #1d4ed8) 8%, var(--bg-card, #fff));
    box-shadow: var(--shadow-card-hover, 0 4px 14px rgba(15, 23, 42, 0.08));
}

.weight-unit-tile__code {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
}