.oe-nav-heading {
    display: block;
    margin: 18px 14px 7px;
    font-size: 11px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 900;
    color: rgba(255,255,255,.48);
}

.oe-sidebar-nav a + .oe-nav-heading {
    margin-top: 20px;
}

.oe-companies-page {
    display: grid;
    gap: 18px;
}

.oe-companies-head,
.oe-company-search,
.oe-company-card,
.oe-company-stats {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(15,23,42,.06);
}

[data-theme="dark"] .oe-companies-head,
[data-theme="dark"] .oe-company-search,
[data-theme="dark"] .oe-company-card,
[data-theme="dark"] .oe-company-stats {
    background: rgba(15,23,42,.72);
    border-color: rgba(255,255,255,.08);
}

.oe-companies-head {
    padding: 22px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
}

.oe-companies-head h1 {
    margin: 6px 0 8px;
    font-size: clamp(28px, 3vw, 42px);
}

.oe-companies-head p {
    margin: 0;
    color: #64748b;
    max-width: 900px;
}

.oe-companies-actions,
.oe-company-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.oe-company-stats {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 10px;
}

.oe-company-stat {
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 16px;
    padding: 14px;
    background: rgba(248,250,252,.92);
}

[data-theme="dark"] .oe-company-stat {
    background: rgba(2,6,23,.42);
    border-color: rgba(255,255,255,.08);
}

.oe-company-stat span {
    display: block;
    font-size: 12px;
    color: #64748b;
    font-weight: 800;
}

.oe-company-stat strong {
    display: block;
    font-size: 26px;
    margin-top: 4px;
}

.oe-company-stat.is-active {
    border-color: rgba(196,18,18,.45);
    box-shadow: inset 0 0 0 1px rgba(196,18,18,.25);
}

.oe-company-search {
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 220px auto auto;
    gap: 12px;
    align-items: end;
}

.oe-company-search label {
    display: block;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 6px;
}

.oe-company-search input,
.oe-company-search select {
    width: 100%;
    border: 1px solid rgba(15,23,42,.14);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
    color: #0f172a;
    font-weight: 700;
}

[data-theme="dark"] .oe-company-search input,
[data-theme="dark"] .oe-company-search select {
    background: rgba(2,6,23,.65);
    color: #e5e7eb;
    border-color: rgba(255,255,255,.12);
}

.oe-company-result-info {
    color: #64748b;
    font-size: 13px;
    padding: 0 4px;
}

.oe-company-list {
    display: grid;
    gap: 12px;
}

.oe-company-card {
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.oe-company-main {
    min-width: 0;
}

.oe-company-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.oe-company-title-row h2 {
    margin: 0;
    font-size: 18px;
}

.oe-company-meta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
}

.oe-company-meta span {
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 999px;
    padding: 5px 9px;
    background: rgba(248,250,252,.85);
}

[data-theme="dark"] .oe-company-meta span {
    background: rgba(2,6,23,.45);
    border-color: rgba(255,255,255,.08);
}

.oe-company-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 900;
    background: #e2e8f0;
    color: #0f172a;
}

.oe-company-badge.customer {
    background: rgba(34,197,94,.14);
    color: #166534;
}

.oe-company-badge.supplier {
    background: rgba(59,130,246,.14);
    color: #1d4ed8;
}

.oe-company-badge.lead {
    background: rgba(245,158,11,.18);
    color: #92400e;
}

.oe-company-badge.test {
    background: rgba(196,18,18,.12);
    color: #991b1b;
}

.oe-company-badge.muted {
    background: rgba(100,116,139,.12);
    color: #475569;
}

.oe-empty {
    border: 1px dashed rgba(15,23,42,.18);
    border-radius: 18px;
    padding: 20px;
    color: #64748b;
    background: rgba(255,255,255,.72);
}

@media (max-width: 1100px) {
    .oe-company-stats {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .oe-company-search {
        grid-template-columns: 1fr;
    }

    .oe-companies-head,
    .oe-company-card {
        flex-direction: column;
        align-items: stretch;
    }
}

/* OE FIX: interne Sidebar bei vielen Menügruppen scrollbar machen */
.oe-sidebar {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.oe-sidebar-brand {
    flex: 0 0 auto;
}

.oe-sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 18px;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}

.oe-sidebar-footer {
    flex: 0 0 auto;
    margin-top: 12px;
}

.oe-sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.oe-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.22);
    border-radius: 999px;
}

.oe-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

/* Mobile Menü ebenfalls scrollbar, falls die interne Navigation zu lang wird */
.oe-mobile-app-menu {
    max-height: calc(100vh - 82px);
    max-height: calc(100dvh - 82px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* OE FIX: Sidebar kompakter, ohne sichtbare Scrollbar */
.oe-sidebar {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden !important;
}

.oe-sidebar-brand {
    padding: 10px 12px !important;
    margin-bottom: 4px !important;
    min-height: auto !important;
    gap: 8px !important;
}

.oe-sidebar-brand img {
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    object-fit: contain !important;
}

.oe-sidebar-brand strong {
    font-size: 14px !important;
    line-height: 1.05 !important;
}

.oe-sidebar-brand small {
    font-size: 11px !important;
    line-height: 1.05 !important;
}

.oe-sidebar-nav {
    overflow: hidden !important;
    padding-top: 2px !important;
    padding-bottom: 4px !important;
}

.oe-sidebar-nav a {
    min-height: auto !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    margin-top: 1px !important;
    margin-bottom: 1px !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
}

.oe-nav-heading {
    margin: 10px 14px 4px !important;
    font-size: 9.5px !important;
    line-height: 1 !important;
    letter-spacing: .075em !important;
}

.oe-sidebar-nav a + .oe-nav-heading {
    margin-top: 12px !important;
}

.oe-sidebar-footer {
    margin-top: 4px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    font-size: 12px !important;
}

.oe-sidebar-footer span,
.oe-sidebar-footer a {
    font-size: 12px !important;
    line-height: 1.15 !important;
}

/* Falls der vorherige Scroll-Fix aktiv war: Scrollbars unsichtbar halten */
.oe-sidebar-nav::-webkit-scrollbar {
    display: none !important;
}

.oe-sidebar-nav {
    scrollbar-width: none !important;
}

/* Mobile bleibt scrollbar, weil dort sonst Inhalte auf kleinen Displays abgeschnitten würden */
.oe-mobile-app-menu {
    overflow-y: auto !important;
}
