/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* =========================================================
   ROOT VARIABLES
========================================================= */

:root {

    /* =====================================================
       COLORS
    ===================================================== */

    /* Primary */
    --color-primary: #14248A;
    --color-primary-dark: #132079;

    /* Text */
    --color-text: #333333;
    --color-text-light: #f4f3f2;

    /* Background */
    --color-bg: #f5f5f5;

    /* White / Black */
    --color-white: #ffffff;
    --color-black: #000000;

    /* Gray */
    --color-gray-100: #f9fafb;
    --color-gray-200: #f3f4f6;
    --color-gray-300: #e5e7eb;
    --color-gray-400: #d1d5db;
    --color-gray-500: #cccccc;
    --color-gray-600: #6b7280;
    --color-gray-700: #374151;
    --color-gray-800: #222222;

    /* Green */
    --color-green-text: #166534;
    --color-green-bg: #DCFCE7;
    --color-green-border: #86EFAC;
    --color-green-active: #22c55e;

    /* Red */
    --color-red-text: #991B1B;
    --color-red-bg: #FEE2E2;
    --color-red-border: #FCA5A5;
    --color-red-inactive: #ef4444;

    /* Yellow */
    --color-yellow-text: #854d0e;
    --color-yellow-bg: #FEF3C7;
    --color-yellow-border: #FCD34D;
    --color-yellow-active: #facc15;

    /* Table */
    --color-table-header-bg: #dbe4ff;
    --color-table-header-text: #1e2a5e;

    --color-table-row-light: #ffffff;
    --color-table-row-dark: #f3f6ff;

    --color-table-row-text: #1f2937;
    --color-table-row-text-light: #6b7280;

    --color-table-hover: #e7edff;
    --color-table-border: #d6dcf5;
    --color-table-link: #14248A;

    /* Switch */
    --color-switch-bg-on: #22c55e;
    --color-switch-bg-off: #d1d5db;
    --color-switch-table-bg: #cfd7f3;
    --color-switch-slider: #ffffff;

    /* Overlay */
    --color-overlay-light: rgba(255,255,255,0.08);

    /* Focus */
    --color-focus-ring: rgba(20,36,138,0.12);
    --color-focus-ring-light: rgba(20,36,138,0.10);

    /* =====================================================
       LAYOUT
    ===================================================== */

    --container-width: 1200px;
    
    --header-height: 70px;
    --nav-height: 60px;

    --btn-icon-size: 38px;

    --switch-width: 52px;
    --switch-height: 28px;
    --switch-slider-size: 22px;

    --table-cell-padding: 14px 16px;
    --input-padding: 0 14px;

    --nav-item-indent: 56px;

    /* =====================================================
       SPACING
    ===================================================== */

    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 60px;
    --space-3xl: 80px;

    /* =====================================================
       TYPOGRAPHY
    ===================================================== */

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;

    /* =====================================================
       RADIUS
    ===================================================== */

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-round: 999px;

    /* =====================================================
       SHADOWS
    ===================================================== */

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 6px 18px rgba(0,0,0,0.10);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.14);
    --shadow-xl: 0 20px 48px rgba(0,0,0,0.18);
}


/* =========================================================
   BASE
========================================================= */

body {
    font-family: Arial, sans-serif;

    background: var(--color-bg);
    color: var(--color-text);

    line-height: 1.6;
}

main {
    min-height: 70vh;

    margin-top: var(--space-xl);
    margin-bottom: var(--space-xl);
}


/* =========================================================
   TYPOGRAPHY
========================================================= */

h1,
h2,
h3 {
    color: var(--color-primary);

    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: var(--text-2xl);

    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);

    padding-left: var(--space-md);

    letter-spacing: 1px;

    position: relative;
}

h2 {
    font-size: var(--text-xl);

    margin-top: var(--space-lg);

    padding-left: var(--space-md);

    position: relative;
}

h3 {
    font-size: var(--text-lg);

    margin-top: var(--space-lg);

    padding-left: var(--space-md);

    position: relative;
}


/* =========================================================
   HELPERS
========================================================= */

.border {
    border-left: 4px solid var(--color-primary);
    padding-left: var(--space-sm);
}

.border-left {
    border-left: 4px solid var(--color-primary);
    padding-left: var(--space-sm);
}

.border-right {
    border-right: 4px solid var(--color-primary);
    padding-right: var(--space-sm);
}

.border-top {
    border-top: 4px solid var(--color-primary);
    padding-top: var(--space-sm);
}

.border-bottom {
    border-bottom: 4px solid var(--color-primary);
    padding-bottom: var(--space-sm);
}

.uppercase {
    text-transform: uppercase;
}


/* =========================================================
   CONTAINER
========================================================= */

.container {
    max-width: min(var(--container-width), 92%);
    margin-inline: auto;
}


/* =========================================================
   HEADER
========================================================= */

.header {
    background: var(--color-primary);
    color: var(--color-text-light);

    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;

    height: var(--header-height);
}

.logo {
    font-size: 24px;
    color: var(--color-white);
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: var(--space-sm);

    min-height: 42px;

    padding: 0 24px;
    margin: var(--space-lg);

    border: 1px solid transparent;
    border-radius: var(--radius-md);

    cursor: pointer;

    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1;

    transition: all 0.2s ease;

    appearance: none;
    -webkit-appearance: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--color-primary);

    color: var(--color-white);

    border-color: var(--color-primary-dark);
}

.btn-primary:hover {
    background: var(--color-white);

    color: var(--color-primary);

    border-color: var(--color-primary);
}

.btn-green {
    background: var(--color-green-bg);

    color: var(--color-green-text);

    border-color: var(--color-green-border);
}

.btn-red {
    background: var(--color-red-bg);

    color: var(--color-red-text);

    border-color: var(--color-red-border);
}

.btn-yellow {
    background: var(--color-yellow-bg);

    color: var(--color-yellow-text);

    border-color: var(--color-yellow-border);
}


.btn-green:hover,
.btn-red:hover,
.btn-yellow:hover  {
    opacity: 0.9;
}

/* =========================================================
   INPUTS
========================================================= */

textarea {
    width: 100%;
    min-height: 240px !important;
    padding: 10px;
    border: 1px solid var(--primary-backgroud-border);
    border-radius: 6px;
    background-color: var(--primary-content-backgroud-color);
    color: var(--primary-text-color);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea::placeholder {
    color: var(--placeholder);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-header-color);
    box-shadow: 0 0 0 3px rgba(20, 36, 138, 0.15);
}

textarea:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.input {
    flex: 1;

    min-width: 120px;
    min-height: 42px;

    padding: 0 14px;

    background: var(--color-white);
    color: var(--color-text);

    border: 1px solid var(--color-table-border);
    border-radius: var(--radius-md);

    font-size: var(--text-base);
    line-height: 1;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;

    appearance: none;
    -webkit-appearance: none;
}

.input::placeholder {
    color: var(--color-table-row-text-light);
}

.input:hover {
    border-color: var(--color-primary);
}

.input:focus {
    outline: none;

    border-color: var(--color-primary);

    box-shadow:
        0 0 0 3px var(--color-focus-ring);

    background: var(--color-white);
}

.input:disabled {
    opacity: 0.6;

    cursor: not-allowed;

    background: var(--color-gray-200);
}

.input-sm {
    min-height: 34px;

    padding: 0 10px;

    font-size: var(--text-sm);
}

.input-lg {
    min-height: 50px;

    padding: 0 18px;

    font-size: var(--text-lg);
}

/* =========================================================
   ICON BUTTONS
========================================================= */

.icon-btn {
    width: var(--btn-icon-size);
    height: var(--btn-icon-size);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: var(--radius-md);

    cursor: pointer;

    text-decoration: none;

    font-size: var(--text-base);

    transition: 0.2s ease;

    box-shadow: var(--shadow-xs);
}

.icon-btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.icon-btn-red {
    background: var(--color-red-bg);
    color: var(--color-red-text);
}

.icon-btn-primary:hover,
.icon-btn-red:hover {
    opacity: 0.9;

    box-shadow: var(--shadow-sm);
}


/* =========================================================
   SWITCH
========================================================= */

.switch {
    position: relative;

    width: var(--switch-width);
    height: var(--switch-height);

    background: var(--color-switch-bg-off);

    border: none;
    border-radius: var(--radius-round);

    cursor: pointer;

    transition: background 0.2s ease;
}

.switch.active {
    background: var(--color-switch-bg-on);
}

.switch-slider {
    position: absolute;

    top: 3px;
    left: 3px;

    width: var(--switch-slider-size);
    height: var(--switch-slider-size);

    background: var(--color-switch-slider);

    border-radius: 50%;

    box-shadow: var(--shadow-xs);

    transition: transform 0.2s ease;
}

.switch.active .switch-slider {
    transform: translateX(24px);
}


/* =========================================================
   NAVIGATION
========================================================= */

nav {
    background: var(--color-primary);

    box-shadow: var(--shadow-sm);
}

.top-menu {
    list-style: none;

    display: flex;
    align-items: center;

    max-width: var(--container-width);

    margin: 0 auto;

    padding: 0 20px;
}

.top-menu > li {
    position: relative;
}

.top-menu > li > a {
    display: flex;
    align-items: center;

    height: var(--nav-height);

    padding: 0 18px;

    color: var(--color-white);

    text-decoration: none;

    font-size: var(--text-base);
    font-weight: 500;

    transition: background 0.2s ease;
}

.top-menu > li > a:hover {
    background: var(--color-overlay-light);
}

.has-children::after {
    content: "▾";

    margin-left: var(--space-sm);

    font-size: var(--text-xs);
}


/* =========================================================
   SUBMENU
========================================================= */

.submenu {
    position: absolute;

    top: 100%;
    left: 0;

    min-width: 220px;

    background: var(--color-white);

    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-lg);

    list-style: none;

    opacity: 0;
    visibility: hidden;

    transform: translateY(8px);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s;

    z-index: 1000;
}

.top-menu li:hover > .submenu {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

.submenu li a {
    display: block;

    padding: 12px 16px;

    color: var(--color-text);

    text-decoration: none;

    font-size: var(--text-sm);

    transition: background 0.15s ease;
}

.submenu li a:hover {
    background: var(--color-gray-100);

    color: var(--color-primary);
}


/* =========================================================
   FOOTER
========================================================= */

.footer {
    background: var(--color-gray-800);
    color: var(--color-gray-500);

    text-align: center;

    padding: var(--space-lg) 0;

    margin-top: var(--space-xl);
}


/* =========================================================
   BOX
========================================================= */

.box {
    background: var(--color-white);

    border: 1px solid var(--color-gray-300);
    border-left: 4px solid var(--color-primary);

    border-radius: var(--radius-lg);

    padding: 20px;
    margin: 15px 0;

    box-shadow: var(--shadow-sm);
}

.LB_rot {
    color: var(--color-red-text);

    font-weight: bold;
}

hr {
    border: none;

    border-top: 1px solid var(--color-gray-500);

    margin: var(--space-2xl) 0;
}

/* =========================================================
   FILTER BAR
========================================================= */

.filter-bar {
    display: flex;
    align-items: center;

    gap: var(--space-sm);

    margin-bottom: var(--space-md);
}

/* Inputs */
.filter-bar input {
    padding: 8px 10px;

    background: var(--color-white);

    border: 1px solid var(--color-gray-400);
    border-radius: var(--radius-md);

    font-size: var(--text-sm);

    transition:
        border 0.2s ease,
        box-shadow 0.2s ease;
}

/* Fokus */
.filter-bar input:focus {
    outline: none;

    border-color: var(--color-primary);

    box-shadow:
        0 0 0 2px var(--color-focus-ring-light);
}


/* =========================================================
   TABLES
========================================================= */

.table {
    width: 100%;

    overflow: hidden;

    background: var(--color-table-row-light);

    border: 1px solid var(--color-table-border);
    border-radius: var(--radius-lg);

    border-collapse: collapse;

    box-shadow: var(--shadow-sm);
}


/* =========================================================
   TABLE HEADER
========================================================= */

.table thead {
    background: var(--color-table-header-bg);
}

.table th {
    padding: 14px 16px;

    text-align: left;

    color: var(--color-table-header-text);

    border-bottom: 1px solid var(--color-table-border);

    font-size: var(--text-xs);
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* =========================================================
   TABLE CELLS
========================================================= */

.table td {
    padding: 14px 16px;

    color: var(--color-table-row-text);

    border-bottom: 1px solid var(--color-table-border);

    vertical-align: middle;

    font-size: var(--text-base);
}


/* =========================================================
   TABLE ZEBRA
========================================================= */

.table tbody tr:nth-child(odd) {
    background: var(--color-table-row-light);
}

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


/* =========================================================
   TABLE HOVER
========================================================= */

.table tbody tr:hover {
    background: var(--color-table-hover);
}


/* =========================================================
   TABLE LAST ROW
========================================================= */

.table tbody tr:last-child td {
    border-bottom: none;
}


/* =========================================================
   TABLE FIRST COLUMN
========================================================= */

.table td:first-child {
    color: var(--color-table-row-text-light);

    white-space: nowrap;
}


/* =========================================================
   TABLE LINKS
========================================================= */

.table a {
    color: var(--color-table-link);

    text-decoration: none;

    font-weight: 500;

    transition: color 0.15s ease;
}

.table a:hover {
    text-decoration: underline;
}


/* =========================================================
   TABLE ROWS
========================================================= */

.table tbody tr {
    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.1s ease;
}


/* =========================================================
   NAVIGATION TABLE SPECIAL
========================================================= */

/* gleiche Farbe für Daten + Aktionen */
.table-navigation tbody tr.item-main,
.table-navigation tbody tr.item-actions {
    background: var(--color-table-row-light);
}

/* Zebra für komplette Blöcke */
.table-navigation tbody tr.item-main.alt,
.table-navigation tbody tr.item-actions.alt {
    background: var(--color-table-row-dark);
}

/* Hover komplett */
.table-navigation tbody tr.item-main:hover,
.table-navigation tbody tr.item-actions:hover {
    background: var(--color-table-hover);
}

/* Linie zwischen Daten + Aktionen entfernen */
.table-navigation tbody tr.item-main td {
    border-bottom: 0 !important;
}

/* Aktionszeile */
.table-navigation tbody tr.item-actions td {
    padding-top: 0;

    /* 40px Ebene + normales Padding */
    padding-left: var(--nav-item-indent);

    border-top: 0;
}

/* Actions links */
.table-navigation .table-actions {
    justify-content: flex-start;
}


/* =========================================================
   TABLE ACTIONS
========================================================= */

.table-actions {
    display: flex;
    align-items: center;

    gap: var(--space-sm);

    flex-wrap: wrap;
}


/* =========================================================
   TABLE BUTTONS
========================================================= */

.table-btn {
    width: var(--btn-icon-size);
    height: var(--btn-icon-size);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: var(--color-table-row-light);
    color: var(--color-primary);

    border: 1px solid var(--color-table-border);
    border-radius: var(--radius-md);

    cursor: pointer;

    text-decoration: none;

    font-size: var(--text-base);
    line-height: 1;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.1s ease,
        box-shadow 0.2s ease;

    box-shadow: var(--shadow-xs);

    appearance: none;
    -webkit-appearance: none;
}

/* Hover */
.table-btn:hover {
    background: var(--color-table-hover);

    border-color: var(--color-primary);

    color: var(--color-primary);

    transform: translateY(-1px);

    box-shadow: var(--shadow-sm);
}

/* Active */
.table-btn:active {
    transform: translateY(1px);
}

/* =========================================================
   TABLE SWITCH
========================================================= */

.table-switch {
    position: relative;

    width: var(--switch-width);
    height: var(--switch-height);

    min-width: var(--switch-width);
    min-height: var(--switch-height);

    display: inline-block;

    padding: 0;

    background: var(--color-switch-table-bg);

    border: 1px solid var(--color-table-border);
    border-radius: var(--radius-round);

    cursor: pointer;

    overflow: hidden;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;

    box-shadow: var(--shadow-xs);

    appearance: none;
    -webkit-appearance: none;
}

/* Aktiv */
.table-switch.active {
    background: var(--color-primary);

    border-color: var(--color-primary);
}

/* Slider */
.table-switch-slider {
    position: absolute;

    top: 2px;
    left: 2px;

    width: 22px;
    height: 22px;

    background: var(--color-switch-slider);

    border-radius: 50%;

    box-shadow: var(--shadow-xs);

    transition: transform 0.2s ease;
}

/* Aktiv -> rechts */
.table-switch.active .table-switch-slider {
    transform: translateX(24px);
}

/* Hover */
.table-switch:hover {
    border-color: var(--color-primary);
}


/* =========================================================
   TABLE FILTER
========================================================= */

.table-filter {
    display: none;

    background: var(--color-table-row-dark);
}

.table-filter input {
    width: 100%;

    padding: 8px 10px;

    background: var(--color-white);

    border: 1px solid var(--color-table-border);
    border-radius: var(--radius-sm);

    font-size: var(--text-sm);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.table-filter input:focus {
    outline: none;

    border-color: var(--color-primary);

    box-shadow:
        0 0 0 2px var(--color-focus-ring);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 768px) {

    .table {
        display: block;

        overflow-x: auto;
    }

    .table-actions {
        flex-wrap: wrap;
    }

    .top-menu {
        flex-direction: column;
        align-items: stretch;
    }

    .top-menu > li > a {
        height: auto;

        padding: 14px 18px;
    }

    .submenu {
        position: static;

        opacity: 1;
        visibility: visible;

        transform: none;

        border: none;
        border-radius: 0;

        box-shadow: none;

        display: none;
    }

    .top-menu li:hover > .submenu {
        display: block;
    }
}


/* =========================================================
   DB OVERVIEW
========================================================= */


.db-box {
    margin-bottom: var(--space-lg);

    border: 1px solid var(--color-table-border);
    border-radius: var(--radius-lg);

    overflow: hidden;

    background: var(--color-white);

    box-shadow: var(--shadow-sm);
}

.db-toggle {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 20px;

    background: var(--color-primary);
    color: var(--color-white);

    border: none;

    cursor: pointer;

    font-size: var(--text-lg);
    font-weight: 700;

    transition: background 0.2s ease;
}

.db-toggle:hover {
    background: var(--color-primary-dark);
}

.db-toggle-icon {
    font-size: 28px;

    line-height: 1;
}

.db-content {
    display: none;

    padding: var(--space-md);

    background: var(--color-table-row-light);

    overflow-x: auto;
}


.db-content .table {
    min-width: 100%;
}



/* =========================================================
   Protocol 
========================================================= */

.protocol-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.protocol-header {
    background: var(--color-white);
    border: 1px solid var(--color-table-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.protocol-top {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.protocol-member-list,
.protocol-top-right {
    background: var(--color-white);
    border: 1px solid var(--color-table-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.protocol-topic {
    background: var(--color-white);
    border: 1px solid var(--color-table-border);
    border-left: var(--space-xs) solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.protocol-topic-title {
    color: var(--color-primary);
    font-size: var(--text-lg);
    margin-bottom: var(--space-sm);
}

.protocol-section-title {
    color: var(--color-primary);
    font-size: var(--text-xl);
    margin-bottom: var(--space-xm);
}

.protocol-footer {
    background: var(--color-white);
    border: 1px solid var(--color-table-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}


/* =========================================================
   Card-Widgets 
========================================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.card-full {
    grid-column: 1 / -1;
}

.card {
    background: var(--color-white);
    border: 1px solid var(--color-table-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: var(--space-md);
    background: var(--color-table-header-bg);
    border-bottom: 1px solid var(--color-table-border);
}

.card-header h2,
.card-header h3,
.card-header h4 {
    margin: 0;
    padding: 0;
    color: var(--color-table-header-text);
}

.card-content {
    padding: var(--space-md);
}

.card-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--color-table-border);
    background: var(--color-gray-100);
}
.card-list {
    list-style: none;
}

.card-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px 0;

    border-bottom: 1px solid var(--color-table-border);
}

.card-list li:last-child {
    border-bottom: none;
}