/* BASIC RESET & LAYOUT -------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --app-bg: #f4f7fb;
    --text-color: #1f2933;
    --surface-color: #ffffff;
    --border-color: #d0d7e2;
    --border-subtle: #cbd2e1;
    --muted-text: #627d98;
    --accent: #3b82f6;
    --accent-soft: #e8f1ff;
    --accent-strong: #0f2f87;
    --menu-bg: #ffffff;
    --menu-hover-bg: #eef3fa;
    --menu-active-bg: #e8f1ff;
    --menu-line-color: #e2e8f0;
    --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 4px 10px rgba(15, 23, 42, 0.25);
}



html[data-theme="dark"],
:root[data-theme="dark"] {
    --app-bg: #020617;
    --text-color: #e5e7eb;
    --surface-color: #020617;
    --border-color: #1f2937;
    --border-subtle: #374151;
    --muted-text: #9ca3af;
    --menu-bg: #020617;
    --menu-hover-bg: #111827;
    --menu-active-bg: #1f2937;
    --menu-line-color: #374151;
    --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.7);
    --shadow-strong: 0 8px 20px rgba(0, 0, 0, 0.8);
}

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--app-bg);
    color: var(--text-color);
}

body {
    line-height: 1.5;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* CONTAINER & HEADER ---------------------------------------------------- */

.app-header {
    padding: 0.75rem 1.5rem 1.25rem;
    background: linear-gradient(90deg, #1f2937, #111827);
    color: #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
    padding: 2rem 1rem 3rem;
}

.welcome-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.app-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.app-logo {
    width: clamp(240px, 28vw, 380px);
    height: auto;
    display: none;
    margin: 0;
}

.logo-light {
    display: block;
}

html[data-theme="dark"] .logo-light {
    display: none;
}

html[data-theme="dark"] .logo-dark {
    display: block;
}

html[data-theme="light"] .logo-dark {
    display: none;
}

html[data-theme="light"] .logo-light {
    display: block;
}

.welcome-tagline {
    margin: 0;
    font-size: clamp(1.1rem, 1.8vw, 1.7rem);
    font-style: italic;
    color: var(--text-color);
}

.welcome-meta {
    max-width: 900px;
    font-size: 1rem;
    line-height: 1.6;
}

.welcome-note {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
}

.strong {
    font-weight: 700;
}

.top-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: center;
}

.top-menu-item {
    padding: 0.3rem 0.9rem;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    color: #e5e7eb;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.top-menu-item:hover {
    background: rgba(148, 163, 184, 0.2);
}

.top-menu-item.active {
    background: rgba(37, 99, 235, 0.25);
    border-color: rgba(59, 130, 246, 0.9);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.icon-button {
    border-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.6);
    color: #e5e7eb;
    width: 32px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
}

.icon-button:hover {
    background: rgba(30, 64, 175, 0.9);
}

.icon-button.hamburger {
    font-size: 1rem;
}

.app-subtitle {
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
    opacity: 0.8;
}

.container {
    max-width: 1200px;
    margin: 1.5rem auto 3rem;
    padding: 0 1rem;
}

.component-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.component-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* GRID SYSTEM ----------------------------------------------------------- */

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

[class^="col-"] {
    padding: 0.5rem;
    min-height: 1px;
}

.col-1  { width: 8.3333%; }
.col-2  { width: 16.6667%; }
.col-3  { width: 25%; }
.col-4  { width: 33.3333%; }
.col-5  { width: 41.6667%; }
.col-6  { width: 50%; }
.col-7  { width: 58.3333%; }
.col-8  { width: 66.6667%; }
.col-9  { width: 75%; }
.col-10 { width: 83.3333%; }
.col-11 { width: 91.6667%; }
.col-12 { width: 100%; }

@media (max-width: 768px) {
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        width: 100%;
    }
}

.demo-grid .grid-box {
    background: #e6efff;
    border-radius: 4px;
    text-align: center;
    padding: 0.5rem;
    border: 1px dashed #9fb3c8;
    color: #102a43;
}

/* TABS (für Showcase & allgemeine Tabs) --------------------------------- */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    overflow-x: auto;
}

.tabs-left {
    justify-content: flex-start;
}

.tabs-center {
    justify-content: center;
}

.tabs-right {
    justify-content: flex-end;
}

.tab-button {
    background: #e5e7eb;
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 0.35rem 0.8rem;
    margin-right: 0.3rem;
    color: #111827;
    cursor: pointer;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.tab-button.active {
    background: var(--surface-color);
    color: var(--text-color);
}

html[data-theme="dark"] .tab-button {
    background: #111827;
    color: #e5e7eb;
}

html[data-theme="dark"] .tab-button.active {
    background: #020617;
}

.tab-button:focus {
    outline: 2px solid #6fa8dc;
    outline-offset: 1px;
}

.tab-content {
    display: none;
    border: 1px solid var(--border-color);
    border-radius: 0 6px 6px 6px;
    padding: 0.75rem;
    background: var(--surface-color);
}

.tab-content.active {
    display: block;
}

/* ACCORDION ------------------------------------------------------------- */

.accordion {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: #f8fafc;
}

html[data-theme="dark"] .accordion {
    background: #020617;
}

.accordion-item + .accordion-item {
    border-top: 1px solid var(--border-color);
}

.accordion-header {
    width: 100%;
    background: #e1effe;
    border: none;
    color: #102a43;
    padding: 0.6rem 0.9rem;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
}

html[data-theme="dark"] .accordion-header {
    background: #111827;
    color: #e5e7eb;
}

.accordion-header::after {
    content: "▸";
    float: right;
    opacity: 0.7;
}

.accordion-header.active::after {
    content: "▾";
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    background: var(--surface-color);
    transition: max-height 0.2s ease-out, padding 0.2s ease-out;
    padding: 0 0.9rem;
}

.accordion-body.open {
    padding-top: 0.5rem;
    padding-bottom: 0.8rem;
}

/* FORMS ----------------------------------------------------------------- */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

.form-group label {
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.input,
textarea,
select {
    background: var(--surface-color);
    border: 1px solid var(--border-subtle);
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    color: var(--text-color);
    font-size: 0.9rem;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #6fa8dc;
    box-shadow: 0 0 0 2px rgba(111, 168, 220, 0.35);
}

/* FIELDSET / LEGEND ----------------------------------------------------- */

.fieldset {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1rem 1rem 0.9rem;
    margin: 0.5rem 0 1rem;
    position: relative;
    background: #fdfdff;
}

html[data-theme="dark"] .fieldset {
    background: #020617;
}

/* Basiseinstellungen für alle Legends */
.fieldset legend {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334e68;
}

/* VARIANTE 1: CLASSIC --------------------------------------------------- */

.fieldset.classic {
    background: var(--surface-color);
}

.fieldset.classic legend {
    position: static;
    transform: none;
    padding: 0 0.25rem;
    border: none;
    border-radius: 0;
    background: transparent;
}

/* VARIANTE 2: MODERN ---------------------------------------------------- */

.fieldset.modern {
    background: #fdfdff;
}

.fieldset.modern legend {
    padding: 0 0.6rem;
    background: #f4f7fb;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* VARIANTE 3: MATERIAL -------------------------------------------------- */

.fieldset.material {
    padding-top: 1.3rem;
}

.fieldset.material legend {
    position: absolute;
    top: 0;
    left: 1rem;
    transform: translateY(-50%);
    padding: 0 0.4rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #f4f7fb;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

/* VARIANTE 4: BADGE ----------------------------------------------------- */

.fieldset.badge {
    border-color: #2f7ed8;
    background: #f5f9ff;
}

.fieldset.badge legend {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.15rem 0.75rem;
    font-size: 0.8rem;
    background: #2f7ed8;
    color: #ffffff;
    border-radius: 999px;
    border: none;
    box-shadow: 0 1px 3px rgba(47, 126, 216, 0.35);
}


/* Validation / Statusfarben -------------------------------------------- */

.red {
    border-color: #d64545 !important;
    background-color: #ffe3e3 !important;
}

.green {
    border-color: #2f9e44 !important;
    background-color: #e6fcf5 !important;
}

.input-error {
    color: #9b1c1c;
}

.input-success {
    color: #0b7285;
}

/* Checkboxen & Radios --------------------------------------------------- */

.checkbox,
.radio {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #334e68;
}

.checkbox input,
.radio input {
    accent-color: #6fa8dc;
}

/* BUTTONS --------------------------------------------------------------- */

.button-row {
    margin-bottom: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    background: #edf2ff;
    color: #102a43;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.btn.small {
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Farbvarianten – 90er-inspirierte Palette ----------------------------- */

.btn.blue {
    background: #cfe2ff;
    border-color: #9ec5fe;
    color: #084298;
}

.btn.blue:hover {
    background: #b6d4fe;
}

.btn.red {
    background: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.btn.red:hover {
    background: #f1b0b7;
}

.btn.green {
    background: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.btn.green:hover {
    background: #badbcc;
}

.btn.orange {
    background: #ffe5b4;
    border-color: #ffd28c;
    color: #8a4b08;
}

.btn.orange:hover {
    background: #ffd28c;
}

/* Buttonbar ------------------------------------------------------------- */

.buttonbar {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem;
    border-radius: 4px;
    background: #f5f7fb;
    border: 1px solid #ccd5e0;
}

html[data-theme="dark"] .buttonbar {
    background: #020617;
    border-color: #374151;
}

.hint {
    font-size: 0.8rem;
    color: var(--muted-text);
}

/* ICONS (font-awesome-like via Unicode) -------------------------------- */

.icon {
    display: inline-block;
    font-style: normal;
}

.icon-pencil::before,
.icon-edit::before {
    content: "✏";
}

.icon-delete::before {
    content: "✖";
}

.icon-add::before {
    content: "＋";
}

.icon-open::before {
    content: "⤴";
}

.icon-new::before {
    content: "★";
}

/* LISTEN ---------------------------------------------------------------- */

.list {
    margin: 0.5rem 0;
    padding-left: 1.3rem;
}

.list.bullets {
    list-style: disc;
}

.list.checkmarks {
    list-style: none;
    padding-left: 0;
}

.list.checkmarks li {
    padding-left: 1.3rem;
    position: relative;
}

.list.checkmarks li.ok::before {
    content: "✔";
    color: #2f9e44;
    position: absolute;
    left: 0;
}

.list.checkmarks li.fail::before {
    content: "✖";
    color: #d64545;
    position: absolute;
    left: 0;
}

/* ====================================================================== */
/* HORIZONTAL MENU (Demo)                                                 */
/* ====================================================================== */

.menu.horizontal {
    background: #f3f4f6;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.5rem;
    margin-bottom: 0.75rem;
}

html[data-theme="dark"] .menu.horizontal {
    background: #020617;
}

.menu.horizontal > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.25rem;
}

.menu.horizontal > ul > li {
    position: relative;
}

.menu.horizontal .menu-item {
    padding: 0.35rem 0.7rem;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #111827;
}

html[data-theme="dark"] .menu.horizontal .menu-item {
    color: #e5e7eb;
}

.menu.horizontal .menu-item:hover {
    background: #e5e7eb;
}

html[data-theme="dark"] .menu.horizontal .menu-item:hover {
    background: #111827;
}

.menu.horizontal .submenu {
    position: absolute;
    left: 0;
    top: calc(100% + 2px);
    background: var(--surface-color);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    min-width: 160px;
    padding: 0.25rem 0;
    list-style: none;
    margin: 0;
    box-shadow: var(--shadow-soft);
    display: none;
    z-index: 50;
}

.menu.horizontal li.open > .submenu {
    display: block;
}

.menu.horizontal .submenu .menu-item {
    width: 100%;
    justify-content: flex-start;
    border-radius: 0;
    border: none;
}

/* ====================================================================== */
/* VERTICAL MENU (Hierarchy, indentation, arrows, active states)          */
/* ====================================================================== */

.menu.vertical {
    width: 100%;
    max-width: 260px;
    background: var(--menu-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.25rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

/* Reset list layout */
.menu.vertical ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.menu.vertical ul li {
    position: relative;
}

/* BASE MENU ITEM STYLE -------------------------------------------------- */

.menu.vertical .menu-item {
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.75rem 0.45rem 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    gap: 0.5rem;

    font-size: 0.9rem;
    color: #1a2a3a;

    transition: background 0.15s, color 0.15s;
}

html[data-theme="dark"] .menu.vertical .menu-item {
    color: #e5e7eb;
}

.menu.vertical .menu-item:hover {
    background: var(--menu-hover-bg);
}

/* SUBMENU INDENTATION + HIERARCHY LINES -------------------------------- */

.menu.vertical ul ul {
    padding-left: 1.25rem;
    margin-top: 0.25rem;
    border-left: 1px solid var(--menu-line-color);
}

.menu.vertical ul ul ul {
    padding-left: 1.25rem;
    border-left: 1px solid var(--menu-line-color);
}

.menu.vertical ul ul ul ul {
    padding-left: 1.25rem;
    border-left: 1px solid var(--menu-line-color);
}

/* BULLETS / DOUBLE ARROWS FOR ITEMS WITHOUT SUBMENU -------------------- */

.menu.vertical ul li::before {
    content: "";
}

/* Show »» only if the LI does NOT contain a submenu */
.menu.vertical ul li:not(:has(.submenu))::before {
    content: "»»";
    position: absolute;
    left: 0.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #6b7d96;
    opacity: 0.8;
}

/* SUBMENU COLLAPSE / EXPAND BEHAVIOR ----------------------------------- */

.menu.vertical .submenu {
    display: none;
    margin-top: 0.25rem;
}

.menu.vertical li.open > .submenu {
    display: block;
}

/* ARROWS ONLY IF SUBMENU EXISTS ---------------------------------------- */

.menu.vertical li > .menu-item:after {
    content: "";
}

/* Arrow for items WITH submenu */
.menu.vertical li:has(.submenu) > .menu-item:after {
    content: "▸";
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.45;
}

/* Arrow changes when opened */
.menu.vertical li.open:has(.submenu) > .menu-item:after {
    content: "▾";
}

/* ACTIVE ITEM STYLING -------------------------------------------------- */

.menu.vertical li.active > .menu-item {
    background: var(--menu-active-bg);
    color: var(--accent-strong);
    font-weight: 600;
}

/* Blue left bar for active item */
.menu.vertical li.active > .menu-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

/* ACTIVE PATH (parents of the active item) ------------------------------ */

.menu.vertical li.active-path > .menu-item {
    background: #f3f7ff;
    color: #1a2a3a;
    font-weight: 500;
}

html[data-theme="dark"] .menu.vertical li.active-path > .menu-item {
    background: #020617;
    color: #e5e7eb;
}

/* Responsive Menü für kleine Screens ----------------------------------- */

@media (max-width: 900px) {
    .top-menu {
        display: none;
    }
}

@media (max-width: 768px) {
    .menu.vertical {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease-out;
        z-index: 210;
        border-radius: 0 6px 6px 0;
    }

    .menu.vertical.is-open-mobile {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease-out;
        z-index: 200;
    }

    .sidebar-backdrop.visible {
        opacity: 1;
        pointer-events: auto;
        max-width: 250px;
    }
}

/* BREADCRUMBS ----------------------------------------------------------- */

.breadcrumbs {
    margin-top: 1rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    color: var(--muted-text);
}

.breadcrumbs a {
    color: #0066cc;
}

/* TABLES ---------------------------------------------------------------- */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.table th,
.table td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.table thead {
    background: #e5e7eb;
}

.table.narrow th,
.table.narrow td {
    padding: 0.25rem 0.5rem;
}

.table.wide th,
.table.wide td {
    padding: 0.6rem 0.9rem;
}

.table.striped tbody tr:nth-child(odd) {
    background: #f7fafc;
}

.table.striped tbody tr:nth-child(even) {
    background: var(--surface-color);
}

html[data-theme="dark"] .table thead {
    background: #111827;
}

html[data-theme="dark"] .table.striped tbody tr:nth-child(odd) {
    background: #020617;
}

html[data-theme="dark"] .table.striped tbody tr:nth-child(even) {
    background: #020617;
}

.table.sortable th {
    cursor: pointer;
    background: #e1effe;
}

html[data-theme="dark"] .table.sortable th {
    background: #111827;
}

.table.sortable th.sort-asc::after {
    content: " ▲";
    font-size: 0.75em;
}

.table.sortable th.sort-desc::after {
    content: " ▼";
    font-size: 0.75em;
}

/* PAGINATION ------------------------------------------------------------ */

.pagination {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.page-btn {
    min-width: 2rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
}

.page-btn:hover {
    background: #e1effe;
}

html[data-theme="dark"] .page-btn:hover {
    background: #111827;
}

.page-btn.active {
    background: #2f7ed8;
    color: #ffffff;
    border-color: #2f7ed8;
}

/* TOOLTIP --------------------------------------------------------------- */

.tooltip {
    position: relative;
    border-bottom: 1px dotted #6fa8dc;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 120%;
    background: #102a43;
    color: #ffffff;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
}

/* TYPOGRAFIE / CODE ----------------------------------------------------- */

h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--text-color);
}

.inline-link {
    color: #0066cc;
}

pre {
    background: #0b1120;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    overflow-x: auto;
    border: 1px solid #111827;
    color: #e5e7eb;
}

code {
    font-family: "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    color: #e5e7eb;
}

/* einfache Syntax-Farbgebung */

.code.js    { color: #d7ffaf; }
.code.php   { color: #ffd7af; }
.code.html  { color: #afffd7; }
.code.css   { color: #afffff; }
.code.c,
.code.cpp   { color: #ffd7ff; }
.code.python{ color: #ffffaf; }

/* SLIDESHOW ------------------------------------------------------------- */

.slideshow {
    position: relative;
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #d7dee8;
    background: var(--surface-color);
}

.slideshow .slides img {
    width: 100%;
    height: auto;
    display: none;
    border-radius: inherit;
}

.slideshow .slides img.active {
    display: block;
}

.slideshow .prev,
.slideshow .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;

    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);

    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.slideshow .prev:hover,
.slideshow .next:hover {
    opacity: 1;
    box-shadow: 0 0 4px rgba(15, 23, 42, 0.25);
}

.slideshow .prev {
    left: 8px;
}

.slideshow .next {
    right: 8px;
}

@media (max-width: 600px) {
    .slideshow .prev { left: 4px; }
    .slideshow .next { right: 4px; }
}


/* TOASTS / MELDUNGEN ---------------------------------------------------- */

.toast-container {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 200;
}

.toast {
    min-width: 220px;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.3);
}

.toast-success {
    background: #2f9e44;
    border: 1px solid #38d9a9;
}

.toast-error {
    background: #d64545;
    border: 1px solid #ff8787;
}

.toast button {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
}

/* SPINNER --------------------------------------------------------------- */

.spinner {
    margin-top: 1rem;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: #6fa8dc;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.spinner.visible {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* MODAL ----------------------------------------------------------------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 150;
}

.modal-overlay.visible {
    display: flex;
}

.modal {
    background: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-width: 280px;
    max-width: 480px;
    box-shadow: var(--shadow-strong);
    position: relative;
}

.modal-header,
.modal-footer {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    border-bottom: none;
}

.modal-body {
    padding: 0.75rem;
}

/* DRAG HANDLE ----------------------------------------------------------- */

.drag-handle {
    cursor: move;
}

/* KBD ------------------------------------------------------------------- */

kbd {
    background: #e5e7eb;
    color: #111827;
    border-radius: 3px;
    padding: 0 0.25rem;
    font-size: 0.75rem;
    border: 1px solid #9ca3af;
}

/* ACTIVE TABLE ----------------------------------------------------------- */

.active-table-container {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
    padding: 0.5rem;
}

.active-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.active-table-toolbar-left,
.active-table-toolbar-right {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.active-table-summary {
    font-size: 0.8rem;
    color: var(--muted-text);
}

.table-row-selectable tbody tr {
    cursor: pointer;
}

.table-row-selectable tbody tr.row-selected {
    background: var(--accent-soft);
}

html[data-theme="dark"] .table-row-selectable tbody tr.row-selected {
    background: #111827;
}

.table-cell-editable {
    position: relative;
}

.table-cell-editable input {
    width: 100%;
    border-radius: 3px;
    border: 1px solid var(--border-subtle);
    padding: 0.15rem 0.25rem;
    font-size: 0.85rem;
    background: var(--surface-color);
    color: var(--text-color);
}

/* Advanced Search Modal -------------------------------------------------- */

.active-table-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 220;
}

.active-table-search-overlay.visible {
    display: flex;
}

.active-table-search-modal {
    background: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-width: 320px;
    max-width: 520px;
    max-height: 80vh;
    overflow: auto;
    box-shadow: var(--shadow-strong);
    position: relative;
}

.active-table-search-header {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
}

.active-table-search-body {
    padding: 0.75rem;
}

.active-table-search-footer {
    padding: 0.5rem 0.75rem 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

.active-table-search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.75rem;
}

.active-table-search-grid label {
    font-size: 0.8rem;
    color: var(--text-color);
}

.centeredX {
  display: flex;
  flex-direction: row;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
}

.centeredY {
  display: flex;
  flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 16 Farb-Klassen für Status / Validierung ------------------------------ */

.color-1  { border-color: #ef4444 !important; background-color: #fee2e2 !important; }
.color-2  { border-color: #f97316 !important; background-color: #ffedd5 !important; }
.color-3  { border-color: #eab308 !important; background-color: #fef9c3 !important; }
.color-4  { border-color: #22c55e !important; background-color: #dcfce7 !important; }
.color-5  { border-color: #14b8a6 !important; background-color: #ccfbf1 !important; }
.color-6  { border-color: #0ea5e9 !important; background-color: #e0f2fe !important; }
.color-7  { border-color: #6366f1 !important; background-color: #e0e7ff !important; }
.color-8  { border-color: #a855f7 !important; background-color: #f3e8ff !important; }
.color-9  { border-color: #ec4899 !important; background-color: #fce7f3 !important; }
.color-10 { border-color: #6b7280 !important; background-color: #e5e7eb !important; }
.color-11 { border-color: #4b5563 !important; background-color: #e5e7eb !important; }
.color-12 { border-color: #0f172a !important; background-color: #e5e7eb !important; }
.color-13 { border-color: #15803d !important; background-color: #bbf7d0 !important; }
.color-14 { border-color: #4338ca !important; background-color: #e0e7ff !important; }
.color-15 { border-color: #be123c !important; background-color: #ffe4e6 !important; }
.color-16 { border-color: #6d28d9 !important; background-color: #ede9fe !important; }

/* ACTIVE TABLE EXCEL-STYLE OVERRIDES ------------------------------------ */

.active-table-container .table {
    border-collapse: collapse;
    font-size: 0.85rem;
}

.active-table-container .table th,
.active-table-container .table td {
    padding: 0 4px;
    border: 1px solid #e5e7eb;
}

html[data-theme="dark"] .active-table-container .table th,
html[data-theme="dark"] .active-table-container .table td {
    border-color: #1f2937;
}

.active-table-container .table thead {
    background: #f3f4f6;
}

html[data-theme="dark"] .active-table-container .table thead {
    background: #111827;
}

.active-table-container .table tbody tr:hover {
    background: #f9fafb;
}

html[data-theme="dark"] .active-table-container .table tbody tr:hover {
    background: #020617;
}

/* MENU FILTER ----------------------------------------------------------- */

.menu-filter {
    margin-bottom: 0.5rem;
}

.menu-filter-input {
    width: 100%;
}

/* ActiveTable Search Table Layout -------------------------------------- */

.active-table-search-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.active-table-search-table th,
.active-table-search-table td {
    padding: 0.25rem 0.4rem;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
}

.active-table-search-table th {
    font-weight: 600;
}

/* ====================================================================== */
/* GENERAL TREE MENU (Windows-like menubar + nested flyouts)              */
/* Classes: .item and .child-item only for tree structure                 */
/* ====================================================================== */

.general-menubar {
    background: #f3f4f6;
    border-bottom: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem; /* slightly taller than base font size */
}

.general-menubar__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.general-menubar__left {
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

.general-menubar__nav {
    flex: 1;
    min-width: 0;
}

.general-menu {
    list-style: none;
    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: nowrap;
}

.general-menu > .item {
    position: relative;
}

.general-menu a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;

    font-size: 0.9rem;
    color: #111827;
    text-decoration: none;

    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    border: 1px solid transparent;

    user-select: none;
}

.general-menu a:hover,
.general-menu .item.open > a,
.general-menu .item:focus-within > a {
    background: #e5e7eb;
    border-color: #cbd5e1;
}

/*.general-menu > .item.login {
    margin-left: auto;
}*/

.general-menu > .item.align-right {
    margin-left: auto;
}


/* Submenus (child-item = UL) */
.child-item {
    list-style: none;
    margin: 0;
    padding: 0.25rem;

    position: absolute;
    left: 0;
    top: calc(100% + 2px);

    min-width: 190px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-soft);
    z-index: 500;

    display: none;
}

/* Show on hover (desktop) or .open (touch/keyboard) */
.item:hover > .child-item,
.item.open > .child-item,
.item:focus-within > .child-item {
    display: block;
}

.child-item > .item {
    position: relative;
}

.child-item > .item > a {
    width: 100%;
    justify-content: flex-start;
    border-radius: 4px;
    padding: 0.32rem 0.55rem;
}

/* Flyout for deeper levels */
.child-item .child-item {
    left: calc(100% + 2px);
    top: -0.15rem;
}

/* Right arrow hint if an item has a submenu */
.item:has(> .child-item) > a::after {
    content: "▸";
    margin-left: auto;
    opacity: 0.6;
    font-size: 0.85em;
}

/* For root items, show down arrow */
.general-menu > .item:has(> .child-item) > a::after {
    content: "▾";
}

/* Divider helper (optional) */
.item.divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.25rem 0.35rem;
}

/* Dark theme support */
html[data-theme="dark"] .general-menubar {
    background: #020617;
    border-bottom-color: #1f2937;
}

html[data-theme="dark"] .general-menubar__left,
html[data-theme="dark"] .general-menu a {
    color: #e5e7eb;
}

html[data-theme="dark"] .general-menu a:hover,
html[data-theme="dark"] .general-menu .item.open > a,
html[data-theme="dark"] .general-menu .item:focus-within > a {
    background: #111827;
    border-color: #374151;
}

@media (max-width: 520px) {
    .general-menu {
        flex-wrap: wrap;
        row-gap: 0.25rem;
    }
}

/* Documentor: bessere Lesbarkeit auf hellen Flächen */
.cb-doc-table td code,
.cb-doc-table th code,
.cb-doc-function-signature code,
.cb-doc-no-params code {
    color: #102a43;
}

/* Default-Werte / Variablen in Tabellen etwas kräftiger */
.cb-doc-table td {
    color: var(--text-color);
}

.cb-doc-table td code {
    font-weight: 600;
}

/* Muted-Text leicht dunkler auf hellem Hintergrund */
.cb-doc-muted {
    color: #52667a;
    font-style: italic;
}

/* Darkmode: dort wieder heller */
html[data-theme="dark"] .cb-doc-table td code,
html[data-theme="dark"] .cb-doc-table th code,
html[data-theme="dark"] .cb-doc-function-signature code,
html[data-theme="dark"] .cb-doc-no-params code {
    color: #dbeafe;
}

html[data-theme="dark"] .cb-doc-muted {
    color: #a3b3c7;
}
