/* ==========================================================================
   IHK-Prüfungsrechner – Responsive Basis-Styling
   Keine externen Abhängigkeiten (kein Bootstrap, keine CDN-Schriftarten)
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Sicherstellen dass [hidden] immer greift, auch wenn display per CSS gesetzt ist */
[hidden] { display: none !important; }

/* --- Design Tokens --- */
:root {
  --color-primary: #1a56db;
  --color-primary-dark: #1547c0;
  --color-primary-light: #eff3ff;
  --color-nav: #475569;
  --color-nav-dark: #334155;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-text-subtle: #94a3b8;
  --color-success: #059669;
  --color-danger: #dc2626;
  --color-warning: #d97706;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
}

html {
    font-size: 16px;
    line-height: 1.5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }

p { margin-bottom: 0.75rem; }

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Container --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* --- Navigation --- */
.main-nav {
    background-color: var(--color-nav);
    color: #fff;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.nav-brand:hover {
    text-decoration: none;
    opacity: 0.9;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.nav-user {
    color: #94a3b8;
    font-size: 0.875rem;
}

.nav-form {
    display: inline;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
    opacity: 0.9;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.btn-danger {
    background-color: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-outline {
    background-color: transparent;
    color: #fff;
    border-color: #64748b;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #94a3b8;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: #374151;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

input[type="number"] {
    width: 80px;
    max-width: 100%;
    text-align: center;
}

/* --- Alerts --- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

thead {
    background-color: #f8fafc;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    vertical-align: middle;
}

th {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

th a {
    color: #374151;
    text-decoration: none;
}

th a:hover {
    color: #2563eb;
}

tbody tr:hover {
    background-color: #f9fafb;
}

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

/* --- Cards --- */
.card {
    background-color: var(--color-surface);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.card h2, .card h3 {
    margin-bottom: 1rem;
}

/* --- Login Page --- */
.login-page {
    background-color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.login-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form .btn {
    margin-top: 0.5rem;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-success {
    background-color: #ecfdf5;
    color: #065f46;
}

.badge-danger {
    background-color: #fef2f2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fffbeb;
    color: #92400e;
}

.badge-info {
    background-color: #eff6ff;
    color: #1e40af;
}

/* --- Score Entry Sections --- */
.score-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.score-section h3 {
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #e5e7eb;
    font-size: 1rem;
}

.score-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.4rem;
}

.score-field {
    display: flex;
    flex-direction: column;
}

.score-field label {
    font-size: 0.72rem;
    color: #6b7280;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-field input {
    width: 100%;
    text-align: center;
    padding: 0.3rem 0.4rem;
    font-size: 0.85rem;
}

.score-result {
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.score-result .result-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
}

.score-result .result-grade {
    font-size: 0.8rem;
    color: #6b7280;
}

/* --- Mode Toggle --- */
.mode-toggle {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.mode-toggle button {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.mode-toggle button.active {
    background-color: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.mode-toggle button:hover:not(.active) {
    background-color: #f3f4f6;
}

/* --- MEPR Toggle --- */
.mepr-toggle {
    margin-top: 0.75rem;
}

.mepr-toggle summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: #6b7280;
    user-select: none;
}

.mepr-toggle summary:hover {
    color: #374151;
}

.mepr-fields {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 6px;
}

/* --- Pass Rules --- */
.pass-rules {
    list-style: none;
    padding: 0;
}

.pass-rules li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pass-rules .rule-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.pass-rules .rule-pass {
    background-color: #ecfdf5;
    color: #065f46;
}

.pass-rules .rule-fail {
    background-color: #fef2f2;
    color: #991b1b;
}

.pass-rules .rule-pending {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* --- Footer --- */
.main-footer {
    margin-top: auto;
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none; }
.overflow-x-auto { overflow-x: auto; }
.text-muted { color: #6b7280; }
.text-subtle { color: #9ca3af; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.8rem; }
.inline-form { display: inline; }

/* --- Sortable Table Headers --- */
th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    background-color: #f1f5f9;
}

th.sortable::after {
    content: ' \2195';
    font-size: 0.7rem;
    color: #9ca3af;
}

/* --- Toast Notifications --- */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #fff;
    background-color: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-error {
    background-color: #dc2626;
}

.toast-success {
    background-color: #059669;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }

    .score-fields {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .form-row {
        flex-direction: column;
    }

    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.15rem; }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem 0.75rem;
    }

    .score-section {
        padding: 1rem;
    }

    .login-card {
        padding: 1.5rem;
    }

    .score-fields {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Weighted Results Table --- */
.weighted-table {
    margin: 1rem 0;
    font-size: 0.875rem;
}

.weighted-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.weighted-table td:nth-child(2),
.weighted-table td:nth-child(3),
.weighted-table td:nth-child(4),
.weighted-table td:nth-child(5),
.weighted-table th:nth-child(2),
.weighted-table th:nth-child(3),
.weighted-table th:nth-child(4),
.weighted-table th:nth-child(5) {
    text-align: center;
}

/* --- MEPR Hints --- */
.mepr-hint {
    display: none;
    margin-top: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.mepr-hint-possible {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.mepr-hint-impossible {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* --- MEPR Overview in Gesamtergebnis --- */
.mepr-overview {
    display: none;
    padding: 1rem;
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
}

.mepr-overview h4 {
    margin-bottom: 0.5rem;
    color: #92400e;
}

.mepr-overview-list {
    list-style: none;
    padding: 0;
}

.mepr-overview-list li {
    padding: 0.4rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid #fde68a;
}

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

.mepr-overview-impossible {
    color: #991b1b;
}

.mepr-overview-possible {
    color: #92400e;
}

.mepr-overview-passed {
    color: #065f46;
    font-weight: 500;
    margin: 0;
}

/* --- MEPR Status Messages --- */
.mepr-status {
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.mepr-status-passed {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.mepr-status-possible {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.mepr-status-impossible {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.mepr-status-info {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

/* --- Examiner Table (Einzelbewertung 3 Prüfer) --- */
.examiner-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    box-shadow: none;
}

.examiner-table th,
.examiner-table td {
    padding: 0.5rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.85rem;
    white-space: nowrap;
}

.examiner-table th:first-child,
.examiner-table td:first-child {
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
}

.examiner-table thead th {
    background-color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

.examiner-table input[type="number"] {
    width: 100%;
    min-width: 80px;
    text-align: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
}

.examiner-table .avg-cell {
    font-weight: 700;
    color: #1e293b;
    background-color: #f0f9ff;
}

.avg-input {
    width: 100%;
    min-width: 80px;
    text-align: center;
    font-weight: 700;
    border: 1px solid #93c5fd;
    background: #f0f9ff;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.avg-input.avg-overridden {
    background-color: #fef3c7;
    border-color: #f59e0b;
}

.avg-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

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

.examiner-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Responsive: stack examiner table on small screens */
@media (max-width: 600px) {
    .examiner-table th:not(:first-child),
    .examiner-table td:not(:first-child) {
        padding: 0.4rem;
    }

    .examiner-table input[type="number"] {
        width: 55px;
        font-size: 0.8rem;
    }
}

/* --- Tabs --- */
.tab-nav {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 0.75rem;
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.6rem 0.75rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: #1e293b;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.tab-content {
    display: none;
}

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

@media (max-width: 600px) {
    .tab-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.72rem;
    }
}

/* --- Tab Group Labels & Separators --- */
.tab-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.5rem 0.4rem 0.5rem 0;
    align-self: center;
}

.tab-separator {
    width: 1px;
    background-color: #d1d5db;
    margin: 0.3rem 0.5rem;
    align-self: stretch;
}

/* --- Badge Neutral --- */
.badge-neutral {
    background-color: #f3f4f6;
    color: #374151;
}

/* Badge im Seitentitel */
.badge-header {
    font-size: 0.7rem;
    vertical-align: middle;
}

/* --- Button Secondary (heller Outline für Content-Bereich) --- */
.btn-secondary {
    background-color: transparent;
    color: #374151;
    border-color: #d1d5db;
}

.btn-secondary:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    opacity: 1;
}

.btn-secondary:disabled,
.btn-secondary[disabled],
.btn-secondary.btn-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* --- Card Row (flex-Variante für User-Cards etc.) --- */
.card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 600px) {
    .card-row {
        flex-direction: column;
    }
}

/* --- Form Actions (inline Button-/Input-Reihen) --- */
.form-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.form-actions-sm {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* --- Select Small --- */
.select-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    width: auto;
}

/* --- Sub-section (umrandeter Bereich innerhalb einer Card) --- */
.sub-section {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    padding: 0 1rem 1rem 1rem;
}

.sub-section h3 {
    margin: 0 -1rem 1rem -1rem;
    padding: 0.65rem 1rem;
    background-color: #f1f5f9;
    border-bottom: 1px solid #d1d5db;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.sub-section h4 {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
}

/* --- Plain List (ohne Bullet-Points) --- */
.list-plain {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0;
}

.list-plain li {
    font-size: 0.875rem;
}

/* --- Dropdown-Komponente --- */
.dropdown {
    display: inline-block;
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 0.25rem 0;
    min-width: 120px;
}

.dropdown-menu.dropdown-menu-left {
    right: auto;
    left: 0;
}

.dropdown-menu.dropdown-menu-up {
    top: auto;
    bottom: 100%;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.35rem 0.75rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.8rem;
    white-space: nowrap;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    line-height: 1.4;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
    text-decoration: none;
}

/* --- Upload-Zone --- */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
}

.upload-zone.drag-over {
    border-color: #2563eb;
    background-color: #eff6ff;
}

/* --- Prüfling Inline-Edit --- */
.candidate-edit-form {
    display: none;
    gap: 0.25rem;
    align-items: center;
}

.candidate-edit-form.active {
    display: flex;
}

.cand-edit-form {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

.cand-popup-form {
    display: none;
    position: fixed;
    align-items: center;
    gap: 0.25rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    white-space: nowrap;
}

.btn-edit-inline {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: #6b7280;
    padding: 0 0.2rem;
    line-height: 1;
}

.btn-edit-inline:hover {
    color: #374151;
}

.btn-cancel-inline {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: #dc2626;
    padding: 0 0.2rem;
    line-height: 1;
}

.input-number-xs {
    width: 80px;
    padding: 0.2rem 0.3rem;
    font-size: 0.8rem;
}

.input-nr-inline {
    width: 75px;
    border: 1px solid transparent;
    background: transparent;
    padding: 0.1rem 0.2rem;
    font-size: inherit;
    color: inherit;
    border-radius: 4px;
}
.input-nr-inline:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}
.input-nr-inline:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.input-name-xs {
    width: 150px;
    padding: 0.2rem 0.3rem;
    font-size: 0.8rem;
}

/* --- Passwort-Input in Benutzerverwaltung --- */
.input-pw-sm {
    width: 140px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* --- Gewichtungstabelle (Ergebnis-Tab) --- */
.table-section-header {
    background-color: #f1f5f9;
    font-weight: 600;
}

.table-section-sub {
    background-color: #f1f5f9;
    font-weight: 600;
    border-top: 1px solid #94a3b8;
}

.table-subtotal {
    font-weight: 600;
    border-top: 1px solid #94a3b8;
}

.table-grand-total {
    font-weight: 700;
    border-top: 2px solid #1e293b;
    background-color: #f0f9ff;
}

.table-row-muted {
    color: #6b7280;
    font-size: 0.85rem;
}

.td-indent-1 {
    padding-left: 1.5rem !important;
}

.td-indent-2 {
    padding-left: 3rem !important;
}

/* Score-Section mit Highlight-Rahmen (Gesamtergebnis) */
.score-section-highlight {
    border-left: 4px solid #2563eb;
}

/* --- Benutzerverwaltung Cards --- */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}
.user-grid .card { margin-bottom: 0; }

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.user-card-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}
.user-card-name {
    font-size: 1rem;
}
.user-card-badges {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.user-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.user-card-actions .form-actions-sm {
    flex-wrap: nowrap;
}
.input-pw-sm {
    min-width: 0;
    flex: 1;
}

/* Kompakte Tabellenzelle für Formular-Aktionen */
.td-action {
    white-space: nowrap;
}

/* Prüflingsliste */
.candidate-table            { min-width: 900px; }
.candidate-table .col-nr    { width: 90px;  white-space: nowrap; position: relative; }
.candidate-table .col-name  { min-width: 180px; position: relative; }
.candidate-table .col-ua    { min-width: 200px; }
.candidate-table .col-result{ width: 130px; white-space: nowrap; }
.candidate-table .col-status{ width: 140px; white-space: nowrap; }
.candidate-table .col-actions{ white-space: nowrap; }

.candidate-table .cand-display {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.action-btns {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
}

/* Sub-section table (ohne eigene Box-Shadow, Teil eines übergeordneten Bereichs) */
.sub-section table {
    box-shadow: none;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-bottom: 0;
}

.sub-section table th {
    background-color: #f8fafc;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

.sub-section table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Kein doppelter Abstand zwischen aufeinanderfolgenden Sub-Sektionen */
.sub-section + .sub-section {
    margin-top: 0;
}

/* Responsive: Admin-Tabellen auf schmalen Screens scrollbar */
@media (max-width: 768px) {
    .overflow-x-auto table {
        min-width: 600px;
    }
}

@media (max-width: 600px) {
    .input-pw-sm {
        width: 100%;
    }
}

/* ===== Ausschuss-Übersicht ===== */
.committee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.committee-grid .card {
    margin-bottom: 0;
}
.committee-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.4rem;
}
.committee-card-header h2 {
    margin-bottom: 0;
    font-size: 1.05rem;
}
.committee-meta {
    margin-top: 0.5rem;
    color: #94a3b8;
}

/* ===== Unterausschuss-Layout ===== */
.sc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.sc-col h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e2e8f0;
}

/* Details/Summary als aufklappbarer Toggle */
details.mt-1, details.mt-2 { margin-top: 0.75rem; }
.details-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #2563eb;
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 0.2rem 0;
}
.details-toggle::-webkit-details-marker { display: none; }
.details-toggle::before {
    content: '＋';
    font-size: 0.8rem;
}
details[open] .details-toggle::before {
    content: '－';
}
.details-body {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

@media (max-width: 700px) {
    .sc-grid { grid-template-columns: 1fr; }
}

/* Session context navigation */
.session-nav {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0;
}
.session-nav a {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 4px 4px 0 0;
    transition: color 0.15s, border-color 0.15s;
}
.session-nav a:hover {
    color: var(--color-text);
    text-decoration: none;
}
.session-nav a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* Session list grid */
.session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}
.session-grid .card { margin-bottom: 0; }
.session-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.session-card-header h2 { margin-bottom: 0; font-size: 1.1rem; }
.session-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* Config sum display */
.config-sum-display {
    font-weight: 700;
    padding-top: 0.5rem;
    display: block;
}

/* --- Niederschrift der Abschlussprüfung --- */
.niederschrift-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin: 0.5rem 0 0.25rem;
    min-width: 700px;
}
.niederschrift-table td {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--color-border);
    vertical-align: middle;
    line-height: 1.4;
}
.niederschrift-table .ns-header td {
    background: var(--color-nav);
    color: #fff;
    font-size: 0.8rem;
}
.niederschrift-table .ns-gap td {
    border-top: 3px solid var(--color-border-strong);
}
.niederschrift-table .ns-subtotal td {
    background: #f1f5f9;
    border-top: 2px solid var(--color-border-strong);
}
.niederschrift-table .ns-grand-total td {
    background: var(--color-primary-light);
    border-top: 2px solid var(--color-primary);
    font-size: 0.9rem;
}
.niederschrift-table .ns-row-muted td {
    background: #fafafa;
    color: var(--color-text-muted);
    font-size: 0.82rem;
}
.niederschrift-table .ns-projekt-label td {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    border-bottom: none;
    padding-top: 0.6rem;
    font-style: italic;
}
.niederschrift-table .ns-bereich {
    word-break: break-word;
}
.niederschrift-table .ns-indent {
    padding-left: 1.75rem;
}
.niederschrift-table .ns-center {
    text-align: center;
}
.niederschrift-table .ns-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.niederschrift-table .ns-emph {
    background: #f0f4ff;
}
.niederschrift-table .ns-col-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
}
.niederschrift-table .ns-op {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}
.niederschrift-table .ns-formula-text {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}
.niederschrift-table .ns-blank:empty::before {
    content: '____';
    color: var(--color-text-subtle);
    font-weight: 300;
    letter-spacing: 0.05em;
}
.ns-footnote {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}
