/* SEIDOS sidebar port — scoped to body so the classic look is untouched. */

body {
    /* Radius/spacing aliases for sidebar component CSS */
    --radius-sm: var(--rad-2);
    /* 4 px */
    --radius: var(--rad-3);
    /* 6 px */
    --radius-lg: var(--rad-5);
    /* 10 px */

    background: var(--bg);
}

/* Dark tokens for SEIDOS users — activated by the topbar theme toggle
   writing html[data-theme="dark"]. Non-opted users keep their classic
   Bootstrap look (we don't darken page content here). */
html[data-theme="dark"] body {
    --bg: #0D1014;
    --surface: #15191F;
    --surface-2: #1A1F26;
    --surface-3: #232931;
    --border: #2A313B;
    --border-strong: #3A4250;
    --text: #ECEAE5;
    --text-2: #A8A49B;
    --text-3: #6E6A60;
    --text-disabled: #4A463F;

    --accent: oklch(0.72 0.13 250);
    --accent-hover: oklch(0.78 0.13 250);
    --accent-soft: oklch(0.28 0.08 250);
    --accent-text: oklch(0.82 0.12 250);
}

/* Sidebar+content layout — replaces Bootstrap .row/.col flex grid. */

/* Neutralize the legacy .card wrapper directly inside #work-vertrag. */
body #work-vertrag>.card {
    border-radius: 0;
    box-shadow: none;
    color: inherit;
    flex: 1 1 auto;
    min-width: 0;
}

body #main {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

body #navigation.sidebar-host {
    flex: 0 0 auto;
    padding: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

body #content {
    flex: 1 1 0;
    min-width: 0;
    overflow-x: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

body .sidebar {
    font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    font-size: var(--font-sm);
    line-height: 1.45;
    color: var(--text);
    width: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 220ms cubic-bezier(.4, 0, .2, 1);
    -webkit-font-smoothing: antialiased;
}

body[data-collapsed="true"] .sidebar {
    width: var(--sidebar-w-collapsed);
}

body .sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--g2);
    height: 56px;
    padding: 0 var(--p4);
    border-bottom: 1px solid var(--border);
}

body .sidebar-brand a {
    display: inline-flex;
    align-items: center;
    gap: var(--g2);
    text-decoration: none;
    color: inherit;
}

body .sidebar-brand img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex: 0 0 28px;
}

body .sidebar-brand .brand-text {
    font-weight: 700;
    font-size: var(--font-md);
    letter-spacing: 0.04em;
    color: var(--text);
    white-space: nowrap;
}

body[data-collapsed="true"] .brand-text {
    display: none;
}

body .sidebar-nav {
    flex: 1;
    padding: var(--p3) var(--p2);
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
}

body .nav-section-label {
    font-size: var(--font-xs);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: var(--p3) var(--p2) calc(2px + var(--p1));
}

body[data-collapsed="true"] .nav-section-label {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--g2);
    padding: calc(2px + var(--p1)) var(--p2);
    border-radius: var(--radius);
    color: var(--text-2);
    text-decoration: none;
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    position: relative;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
    list-style: none;
}

.nav-item:hover {
    background: var(--surface-3);
    color: var(--text);
}

.nav-item:hover .nav-icon {
    color: var(--accent);
}

.nav-item[data-active="true"] {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border);
}

.nav-item[data-active="true"] .nav-icon {
    color: var(--accent);
}

.body .nav-item[data-active="true"]::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

body .nav-item .nav-icon {
    flex: 0 0 16px;
    width: 16px;
    text-align: center;
    font-size: 14px;
}

body .nav-item .nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
}

body .nav-item .nav-chev {
    color: var(--text-3);
    transition: transform 160ms;
    margin-left: auto;
}

body[data-collapsed="true"] .nav-label,
body[data-collapsed="true"] .nav-chev {
    display: none;
}

body[data-collapsed="true"] .nav-item {
    justify-content: center;
    padding: var(--p2);
}

/* <details> open marker rotates the chevron. */
body details.nav-group[open]>summary .nav-chev {
    transform: rotate(90deg);
}

body details.nav-group>summary {
    list-style: none;
    cursor: pointer;
}

body details.nav-group>summary::-webkit-details-marker {
    display: none;
}

body .nav-sub {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 2px 0 4px 22px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
    list-style: none;
}

body[data-collapsed="true"] .nav-sub {
    display: none;
}

body .nav-sub .nav-item {
    font-size: var(--font-s);
    font-weight: 400;
    padding: var(--p1) var(--p2);
}

body .sidebar-footer {
    padding: var(--p2);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--p1);
}

body .collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--g2);
    padding: calc(2px + var(--p1)) var(--p2);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-2);
    font-size: var(--font-s);
    font-family: inherit;
    cursor: pointer;
    transition: all 120ms;
}

body .collapse-btn:hover {
    background: var(--surface-3);
    color: var(--text);
}

body .collapse-btn .chev {
    display: inline-block;
    transition: transform 220ms;
}

body[data-collapsed="true"] .collapse-btn .chev {
    transform: rotate(180deg);
}

body[data-collapsed="true"] .collapse-btn span.label {
    display: none;
}

body .sidebar-copy {
    font-size: var(--font-xs);
    color: var(--text-3);
    text-align: center;
    padding: var(--p1) 0 var(--p2);
}

body[data-collapsed="true"] .sidebar-copy {
    display: none;
}

/* Cancel the m-5 margin on body for the sidebar's viewport calc. */
body {
    margin: 0 !important;
}

body>.container,
body>.container-fluid {
    margin-top: 1.5rem;
}
