:root {
    --erp-nav-bg: #ffffff;
    --erp-nav-ink: #111827;
    --erp-nav-muted: #64748b;
    --erp-nav-line: #e5e7eb;
    --erp-nav-soft: #f8fafc;
    --erp-nav-raised: #ffffff;
    --erp-nav-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.erp-sidebar {
    width: 292px;
    min-width: 292px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--erp-nav-bg);
    border-right: 1px solid var(--erp-nav-line);
    color: var(--erp-nav-ink);
    position: sticky;
    top: 0;
    z-index: 30;
    transition: width 180ms ease, min-width 180ms ease, transform 220ms ease;
}

.erp-sidebar__brand {
    padding: 14px;
    border-bottom: 1px solid var(--erp-nav-line);
}

.erp-sidebar__brand-link {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    padding: 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-800, #1d4ed8) 94%, #111827), var(--theme-900, #111827));
    box-shadow: 0 12px 28px color-mix(in srgb, var(--theme-800, #1d4ed8) 28%, transparent);
}

.erp-sidebar__brand-link:hover,
.erp-sidebar__brand-link:focus {
    color: #ffffff;
    text-decoration: none;
    outline: none;
}

.erp-sidebar__brand-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
}

.erp-sidebar__brand-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.2;
}

.erp-sidebar__brand-text span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-sidebar__brand-text small {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 600;
}

.erp-sidebar__search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--erp-nav-line);
}

.erp-sidebar__search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 9px 10px;
    border: 1px solid var(--erp-nav-line);
    border-radius: 12px;
    background: var(--erp-nav-soft);
    color: var(--erp-nav-muted);
}

.erp-sidebar__search-box svg {
    width: 16px;
    height: 16px;
}

.erp-sidebar__search-box input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--erp-nav-ink);
    font-size: 13px;
    font-weight: 500;
}

.erp-sidebar__clear,
.erp-sidebar__command {
    border: 0;
    background: transparent;
    color: var(--erp-nav-muted);
}

.erp-sidebar__clear {
    width: 22px;
    height: 22px;
    padding: 2px;
}

.erp-sidebar__command {
    min-width: 42px;
    border-radius: 12px;
    border: 1px solid var(--erp-nav-line);
    background: var(--erp-nav-raised);
    color: var(--theme-800, #1d4ed8);
    font-size: 12px;
    font-weight: 700;
}

.erp-sidebar__meta {
    padding: 10px 14px 4px;
}

.erp-sidebar__meta-block {
    margin-bottom: 10px;
}

.erp-sidebar__meta-title {
    color: var(--erp-nav-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.erp-sidebar__mini-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.erp-sidebar__mini-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--erp-nav-soft);
    color: var(--erp-nav-ink);
    border: 1px solid var(--erp-nav-line);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.erp-sidebar__mini-item:hover {
    color: var(--item-accent, var(--theme-800, #1d4ed8));
    text-decoration: none;
}

.erp-sidebar__mini-item span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--item-accent, var(--theme-800, #1d4ed8));
    flex: 0 0 auto;
}

.erp-sidebar__nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 4px 10px 18px;
}

.erp-nav-section {
    margin-bottom: 6px;
}

.erp-nav-section__toggle {
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--erp-nav-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.erp-nav-section__toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 160ms ease;
}

.erp-nav-section__toggle[aria-expanded="false"] svg {
    transform: rotate(-90deg);
}

.erp-nav-section__panel {
    display: grid;
    gap: 4px;
}

.erp-nav-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    gap: 4px;
    align-items: center;
}

.erp-nav-item {
    min-width: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    padding: 7px 9px;
    color: var(--erp-nav-ink);
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.erp-nav-item:hover,
.erp-nav-item:focus {
    background: color-mix(in srgb, var(--item-accent, var(--theme-800, #1d4ed8)) 10%, transparent);
    color: var(--item-accent, var(--theme-800, #1d4ed8));
    text-decoration: none;
    transform: translateX(2px);
    outline: none;
}

.erp-nav-item.is-active {
    color: var(--item-accent, var(--theme-800, #1d4ed8));
    background: color-mix(in srgb, var(--item-accent, var(--theme-800, #1d4ed8)) 14%, transparent);
    box-shadow: inset 3px 0 0 var(--item-accent, var(--theme-800, #1d4ed8));
}

.erp-nav-item__icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: color-mix(in srgb, var(--item-accent, var(--theme-800, #1d4ed8)) 12%, #ffffff);
}

.erp-nav-item__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.erp-nav-item__title,
.erp-nav-item__meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-nav-item__title {
    font-size: 13px;
    font-weight: 750;
}

.erp-nav-item__meta {
    margin-top: 3px;
    color: var(--erp-nav-muted);
    font-size: 11px;
    font-weight: 600;
}

.erp-nav-item__badge {
    margin-left: auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--item-accent, var(--theme-800, #1d4ed8)) 13%, transparent);
    color: var(--item-accent, var(--theme-800, #1d4ed8));
    font-size: 10px;
    font-weight: 800;
}

.erp-nav-favorite {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    color: var(--erp-nav-muted);
    background: transparent;
    transition: background-color 150ms ease, color 150ms ease;
}

.erp-nav-favorite svg {
    width: 15px;
    height: 15px;
}

.erp-nav-favorite:hover,
.erp-nav-favorite.is-active {
    background: #fff7ed;
    color: #ea580c;
}

.erp-sidebar__empty {
    margin: 18px 10px;
    padding: 12px;
    border-radius: 12px;
    background: var(--erp-nav-soft);
    color: var(--erp-nav-muted);
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.erp-nav-icon {
    width: 28px;
    height: 28px;
    display: block;
}

.erp-nav-icon--brand {
    width: 30px;
    height: 30px;
}

.erp-nav-icon--small {
    width: 24px;
    height: 24px;
}

.erp-nav-icon--tiny {
    width: 22px;
    height: 22px;
}

.erp-nav-collapsed .erp-sidebar {
    width: 84px;
    min-width: 84px;
}

.erp-nav-collapsed .erp-sidebar__brand-text,
.erp-nav-collapsed .erp-sidebar__command,
.erp-nav-collapsed .erp-sidebar__meta,
.erp-nav-collapsed .erp-nav-section__toggle span,
.erp-nav-collapsed .erp-nav-item__content,
.erp-nav-collapsed .erp-nav-item__badge,
.erp-nav-collapsed .erp-nav-favorite {
    display: none;
}

.erp-nav-collapsed .erp-sidebar__search {
    grid-template-columns: 1fr;
}

.erp-nav-collapsed .erp-sidebar__search-box input,
.erp-nav-collapsed .erp-sidebar__clear {
    display: none;
}

.erp-nav-collapsed .erp-nav-row {
    grid-template-columns: 1fr;
}

.erp-nav-collapsed .erp-nav-item {
    justify-content: center;
}

.erp-workspace {
    min-height: calc(100vh - 80px);
    padding: 24px;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--workspace-accent, #2563eb) 14%, transparent), transparent 30rem),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.erp-workspace__hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.erp-workspace__hero-main {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.erp-workspace__icon {
    width: 74px;
    height: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: color-mix(in srgb, var(--workspace-accent, #2563eb) 10%, #ffffff);
    flex: 0 0 auto;
}

.erp-workspace__icon .erp-nav-icon {
    width: 52px;
    height: 52px;
}

.erp-workspace__eyebrow {
    margin: 0 0 5px;
    color: var(--workspace-accent, #2563eb);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.erp-workspace h1 {
    margin: 0;
    color: #111827;
    font-size: 28px;
    font-weight: 850;
    line-height: 1.15;
}

.erp-workspace__hero p:last-child {
    max-width: 760px;
    margin: 8px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.55;
}

.erp-workspace__hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.erp-workspace__pin,
.erp-workspace__report-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--workspace-accent, #2563eb) 25%, transparent);
    background: color-mix(in srgb, var(--workspace-accent, #2563eb) 9%, #ffffff);
    color: var(--workspace-accent, #2563eb);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.erp-workspace__pin:hover,
.erp-workspace__report-link:hover {
    color: #ffffff;
    background: var(--workspace-accent, #2563eb);
    text-decoration: none;
}

.erp-workspace__quick,
.erp-workspace__toolbar,
.erp-report-hub__filters {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.erp-workspace__quick-action {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.erp-workspace__quick-action:hover {
    color: var(--workspace-accent, #2563eb);
    text-decoration: none;
    transform: translateY(-1px);
}

.erp-workspace__search {
    width: min(420px, 100%);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #64748b;
}

.erp-workspace__search svg {
    width: 18px;
    height: 18px;
}

.erp-workspace__search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
}

.erp-workspace__grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 16px;
}

.erp-workspace__group {
    min-width: 0;
}

.erp-workspace__group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.erp-workspace__group-head h2 {
    margin: 0;
    color: #111827;
    font-size: 15px;
    font-weight: 850;
}

.erp-workspace__group-head span {
    min-width: 28px;
    padding: 3px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--workspace-accent, #2563eb) 10%, #ffffff);
    color: var(--workspace-accent, #2563eb);
    text-align: center;
    font-size: 11px;
    font-weight: 850;
}

.erp-workspace__cards,
.erp-report-hub__grid {
    display: grid;
    gap: 10px;
}

.erp-workspace-card,
.erp-report-card {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #111827;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.erp-workspace-card:hover,
.erp-workspace-card:focus,
.erp-report-card:hover,
.erp-report-card:focus {
    color: #111827;
    text-decoration: none;
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--workspace-accent, #2563eb) 35%, #e5e7eb);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
    outline: none;
}

.erp-workspace-card__icon,
.erp-report-card__icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: color-mix(in srgb, var(--workspace-accent, #2563eb) 10%, #ffffff);
    flex: 0 0 auto;
}

.erp-workspace-card__body,
.erp-report-card__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.erp-workspace-card__title,
.erp-report-card__title {
    color: #111827;
    font-size: 14px;
    font-weight: 850;
}

.erp-workspace-card__copy,
.erp-report-card__copy {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.erp-workspace-card__arrow,
.erp-report-card__meta {
    margin-left: auto;
    color: var(--workspace-accent, #2563eb);
    font-size: 13px;
    font-weight: 850;
    flex: 0 0 auto;
}

.erp-report-hub__filters {
    justify-content: space-between;
}

.erp-report-hub__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.erp-report-hub__chips button {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 850;
}

.erp-report-hub__chips button.is-active {
    border-color: color-mix(in srgb, var(--workspace-accent, #2563eb) 32%, #e5e7eb);
    background: color-mix(in srgb, var(--workspace-accent, #2563eb) 10%, #ffffff);
    color: var(--workspace-accent, #2563eb);
}

.erp-report-hub__grid {
    margin-top: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.erp-report-card {
    align-items: flex-start;
}

.erp-report-card__meta {
    display: inline-flex;
    gap: 6px;
}

.erp-report-hub__switcher {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.erp-report-hub__switcher a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--hub-accent, #2563eb) 10%, #ffffff);
    color: var(--hub-accent, #2563eb);
    border: 1px solid color-mix(in srgb, var(--hub-accent, #2563eb) 24%, #e5e7eb);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.erp-mobile-dock {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root {
        --erp-nav-bg: #0f172a;
        --erp-nav-ink: #e5e7eb;
        --erp-nav-muted: #94a3b8;
        --erp-nav-line: rgba(148, 163, 184, 0.22);
        --erp-nav-soft: #111827;
        --erp-nav-raised: #172033;
        --erp-nav-shadow: 0 22px 50px rgba(0, 0, 0, 0.36);
    }

    .erp-workspace {
        background:
            radial-gradient(circle at top right, color-mix(in srgb, var(--workspace-accent, #2563eb) 18%, transparent), transparent 30rem),
            linear-gradient(180deg, #0f172a 0%, #111827 100%);
    }

    .erp-workspace__hero,
    .erp-workspace__quick-action,
    .erp-workspace__search,
    .erp-workspace-card,
    .erp-report-card,
    .erp-report-hub__chips button {
        background: rgba(15, 23, 42, 0.88);
        border-color: rgba(148, 163, 184, 0.22);
    }

    .erp-workspace h1,
    .erp-workspace__group-head h2,
    .erp-workspace-card__title,
    .erp-report-card__title,
    .erp-workspace__search input,
    .erp-workspace__quick-action,
    .erp-workspace-card,
    .erp-report-card {
        color: #e5e7eb;
    }
}

body.dark .erp-sidebar,
body.dark-mode .erp-sidebar {
    --erp-nav-bg: #0f172a;
    --erp-nav-ink: #e5e7eb;
    --erp-nav-muted: #94a3b8;
    --erp-nav-line: rgba(148, 163, 184, 0.22);
    --erp-nav-soft: #111827;
    --erp-nav-raised: #172033;
}

@media (max-width: 1023px) {
    .erp-sidebar {
        display: none;
        width: min(90vw, 330px);
        min-width: min(90vw, 330px);
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        box-shadow: var(--erp-nav-shadow);
        z-index: 2147483100;
    }

    .erp-sidebar.small-view-side-active {
        display: flex !important;
    }

    .erp-sidebar.small-view-side-active ~ .erp-mobile-dock {
        display: none;
    }

    .overlay {
        z-index: 2147483050 !important;
    }

    .erp-mobile-dock {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 2147483000;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        padding: 7px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.94);
        border: 1px solid rgba(226, 232, 240, 0.94);
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
        backdrop-filter: blur(18px);
    }

    .erp-mobile-dock a,
    .erp-mobile-dock button {
        min-width: 0;
        min-height: 54px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        border: 0;
        border-radius: 14px;
        background: transparent;
        color: #475569;
        text-decoration: none;
        font-size: 10px;
        font-weight: 850;
    }

    .erp-mobile-dock a span,
    .erp-mobile-dock button span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .erp-mobile-dock a.is-active {
        color: var(--item-accent, var(--theme-800, #1d4ed8));
        background: color-mix(in srgb, var(--item-accent, var(--theme-800, #1d4ed8)) 12%, transparent);
    }

    #scrollable-container {
        padding-bottom: 82px;
    }

    .erp-workspace {
        padding: 16px;
    }

    .erp-workspace__hero {
        flex-direction: column;
        padding: 16px;
    }

    .erp-workspace__hero-main {
        align-items: flex-start;
    }

    .erp-workspace__icon {
        width: 58px;
        height: 58px;
        border-radius: 15px;
    }

    .erp-workspace__icon .erp-nav-icon {
        width: 42px;
        height: 42px;
    }

    .erp-workspace h1 {
        font-size: 22px;
    }

    .erp-workspace__grid,
    .erp-report-hub__grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .erp-mobile-dock {
        display: none !important;
    }
}
