:root {
    /* Company color palette */
    --primary-dark: #162336;    /* Primary dark / navbar / headers */
    --primary-mid: #4e818d;     /* Primary mid-tone / accents */
    --white: #ffffff;           /* Background / surfaces */
    --yellow: #bcb025;          /* Highlight / warnings */
    --purple: #7f3089;          /* Accent / special elements */
    --blue: #2395d2;            /* Links / info / secondary actions */
    --orange: #e84e0f;          /* Danger / errors / alerts */
    --opacity-80: 0.8;
    --opacity-60: 0.6;
    --opacity-40: 0.4;
    --opacity-20: 0.2;

    /* Derived colors for UI components */
    --main: var(--primary-dark);
    --main-600: #0f1825;        /* darker primary-dark for hover */
    --main-700: #0a1018;        /* even darker */
    --sub: var(--primary-mid);
    --sub-600: #3d6872;         /* darker primary-mid */
    --highlight: var(--orange);
    --highlight-700: #c43d0a;   /* darker orange */

    --bg: #F7F9FC;              /* app background */
    --surface: var(--white);    /* cards/surfaces */
    --text: #1F2937;            /* slate-800 */
    --muted: #6B7280;           /* slate-500 */
    --border: #E5E7EB;          /* slate-200 */
}

/* Base */
* { box-sizing: border-box; }
html { height: 100%; }
body { min-height: 100vh; display:flex; flex-direction: column; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; font-size: 0.9rem; margin: 0; color: var(--text); background: var(--bg); }
body > main { flex: 1 0 auto; display:block; }

/* Navbar */
.navbar {
    display:flex; gap:1rem; align-items:center; padding:0.75rem 1rem;
    background: linear-gradient(180deg, var(--main), var(--main-600));
    color: #fff;
}
.navbar a { color: #fff; text-decoration:none; font-weight:500; }
.navbar a:hover { text-decoration: underline; }
.navbar .spacer { flex:1; }

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-toggle {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}
.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}
.dropdown-toggle::after {
    content: " ▾";
    font-size: 0.8em;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 0.25rem;
    padding: 0.5rem 0;
    z-index: 1000;
}
.dropdown:hover .dropdown-menu {
    display: block;
}
.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}
.dropdown-menu a:hover {
    background: var(--bg);
    text-decoration: none;
}

/* Layout */
.container { max-width: 1800px; margin: 1rem auto; padding: 0 1rem; }
.footer { padding: 1rem; border-top:1px solid var(--border); color: var(--muted); text-align:center; background: var(--surface); }

/* Buttons */
.btn {
    display:inline-block; padding:0.55rem 1rem; border-radius:8px; text-decoration:none; border:1px solid transparent; cursor:pointer;
    font-weight:600; transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:focus { outline: 2px solid var(--sub); outline-offset: 1px; }
.btn-primary { background: var(--main); color:#fff; }
.btn-primary:hover { background: var(--main-600); }
.btn-secondary { background: var(--sub); color: #0f172a; border-color: rgba(0,0,0,.05); }
.btn-secondary:hover { background: var(--sub-600); }
.btn-outline-primary { background: transparent; color: var(--main); border-color: var(--main); }
.btn-outline-primary:hover { background: rgba(22, 35, 54, 0.08); }
.btn-outline-danger { background: transparent; color: var(--highlight); border-color: var(--highlight); }
.btn-outline-danger:hover { background: rgba(232, 78, 15, 0.08); color: var(--highlight-700); border-color: var(--highlight-700); }
.btn-sm { padding: 0.35rem 0.6rem; font-size: .9rem; border-radius:6px; }

/* Forms */
.form { max-width:680px; }
.form-row { display:flex; flex-direction:column; gap:0.35rem; margin-bottom:1rem; }
.form-row input, .form-row textarea, .form-control { padding:0.6rem 0.65rem; border:1px solid #d1d5db; border-radius:8px; background:#fff; color:var(--text); }
.form-row label, .form-label { font-weight:600; color:#374151; }
.form-row input:focus, .form-row textarea:focus, .form-control:focus { outline: 2px solid var(--sub); border-color: var(--main); }
.form-row input.invalid, .form-row textarea.invalid { border-color: var(--highlight); background:#FEF2F2; }
.form-actions { margin-top:1rem; }
.small { font-size: .875rem; }

/* Alerts */
.alert { padding:0.75rem 1rem; margin:0.75rem 0; border-radius:10px; border:1px solid var(--border); background: var(--surface); }
.alert.success, .alert-success { background:#ECFDF5; color:#065F46; border-color: var(--primary-mid); }
.alert.error, .alert-danger { background:#FEF2F2; color:#991B1B; border-color: var(--orange); }
.alert.warning, .alert-warning { background: rgba(188, 176, 37, 0.15); color:#78700e; border-color: var(--yellow); }
.alert.info, .alert-info { background: rgba(35, 149, 210, 0.1); color:#0c5a82; border-color: var(--blue); }

/* Cards */
.card { background: var(--surface); border:1px solid var(--border); border-radius:12px; }
.card .card-body { padding: 1rem; }
.card-title { margin: 0 0 .75rem 0; font-size:1.05rem; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 1px rgba(0,0,0,0.02); }

/* Tables */
.table-responsive { overflow:auto; max-height: 70vh; }
.table { width:100%; border-collapse: collapse; font-size: 0.85rem; }
.table th, .table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th { position: sticky; top: 0; background: var(--sub); color:#0f172a; z-index: 1; text-align:left; }
.align-middle td, .align-middle th { vertical-align: middle; }

/* Badges */
.badge { display:inline-block; padding: .25rem .5rem; border-radius:7px; font-size: .75rem; font-weight:600; }
.bg-success { background: var(--primary-mid); color: var(--white); }
.bg-danger { background: var(--orange); color: var(--white); }
.bg-warning { background: var(--yellow); color:#1a1a1a; }
.bg-info { background: var(--blue); color: var(--white); }
.bg-primary { background: var(--primary-dark); color: var(--white); }
.bg-secondary { background:#E5E7EB; color:#111827; }
.bg-purple { background: var(--purple); color: var(--white); }

/* Typography & Utilities */
.text-end { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.25rem; }
.mt-auto { margin-top: auto; }
.d-inline { display:inline; }
.d-flex { display:flex; }
.d-grid { display:grid; }
.gap-2 { gap: .5rem; }
.g-2 { gap: .5rem; }
.g-3 { gap: 1rem; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

/* Simple grid */
.row { display:flex; flex-wrap: wrap; gap: 1rem; }
.col-12 { flex: 1 0 100%; }
.col-sm-9 { flex: 1 0 75%; }
.col-sm-3 { flex: 1 0 23%; }
.col-md-8, .col-md-4 { flex: 1 0 100%; }
@media (min-width: 768px) {
    .col-md-8 { flex: 0 0 calc(66.666% - .5rem); }
    .col-md-4 { flex: 0 0 calc(33.333% - .5rem); }
}

/* Abstand oberhalb von Überschriften, wenn direkt darüber Fragen stehen */
.questionheadline {
    margin-top: 32px;
}
