/* ============================================================
   AUFGABENPORTAL – Corporate Design
   Corporate Design des Mandanten
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --orange:      #F5A623;
    --schwarz:     #1a1a1a;
    --hintergrund: #f0efed;
    --grau-mid:    #d8d5d0;
    --grau-hell:   #f7f6f4;
    --weiss:       #ffffff;
    --border:      #cccccc;
    --gruen:       #2e7d32;
    --rot:         #c62828;
    --blau:        #1565c0;
    --gelb:        #f9a825;
    --lila:        #6a1b9a;

    /* Radius-System (UI-Fix-02) */
    --radius-sm:   4px;
    --radius-md:   6px;
    --radius-lg:   8px;

    /* Status-Farben */
    --status-open:        #1565c0;
    --status-in-progress: #f9a825;
    --status-done:        #2e7d32;
    --status-archived:    #888;

    /* Priorität-Farben */
    --prio-high:   #c62828;
    --prio-medium: #f9a825;
    --prio-low:    #2e7d32;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--hintergrund);
    color: var(--schwarz);
    font-size: 14px;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

/* ── HEADER ── */
.portal-header {
    background: var(--schwarz);
    color: var(--weiss);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 200;
}

.portal-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--weiss);
}

.logo-dot {
    width: 10px;
    height: 10px;
    background: var(--orange);
    border-radius: 50%;
    flex-shrink: 0;
}

.logo-tenant {
    color: var(--orange);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right a {
    color: var(--grau-mid);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s;
}

.header-right a:hover { color: var(--orange); }

/* Glocke */
.notif-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--grau-mid);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.notif-btn:hover { color: var(--orange); }

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--rot);
    color: var(--weiss);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User-Avatar im Header */
.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--orange);
    color: var(--schwarz);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.header-avatar:hover { border-color: var(--orange); }
.header-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ── NAVIGATION ── */
.portal-nav {
    background: var(--weiss);
    border-bottom: 2px solid var(--grau-mid);
    display: flex;
    align-items: center;
    padding: 0 32px;
    overflow-x: auto;
    scrollbar-width: none;
}

.portal-nav::-webkit-scrollbar { display: none; }

.portal-nav a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 14px 18px;
    text-decoration: none;
    color: var(--schwarz);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.2s;
}

.portal-nav a:hover { color: var(--orange); border-bottom-color: var(--orange); }
.portal-nav a.aktiv { color: var(--orange); border-bottom-color: var(--orange); }
.portal-nav a i { font-size: 16px; }

/* ── MAIN CONTENT ── */
.portal-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 32px;
}

/* ── PAGE TITLE ── */
.page-title {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i { color: var(--orange); font-size: 22px; }

/* ── FLEX UTILITIES ── */
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.flex-gap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ── CARDS ── */
.card {
    background: var(--weiss);
    border: 2px solid var(--grau-mid);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--grau-mid);
}

.card-title i { color: var(--orange); }

/* ── KACHELN / STAT-KARTEN ── */
.kacheln-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.kachel {
    background: var(--weiss);
    border: 2px solid var(--grau-mid);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-decoration: none;
    color: var(--schwarz);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    cursor: default;
}

.kachel.clickable { cursor: pointer; }
.kachel.clickable:hover {
    border-color: var(--orange);
    color: var(--orange);
    transform: translateY(-2px);
}

.kachel i { font-size: 28px; }
.kachel .kachel-label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: #555; }
.kachel .kachel-wert  { font-size: 32px; font-weight: 700; color: var(--orange); line-height: 1; }
.kachel .kachel-sub   { font-size: 12px; color: #666; }

.kachel.kachel-rot    .kachel-wert { color: var(--rot); }
.kachel.kachel-gruen  .kachel-wert { color: var(--gruen); }
.kachel.kachel-blau   .kachel-wert { color: var(--blau); }
.kachel.kachel-gelb   .kachel-wert { color: var(--gelb); }

.kachel-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--rot);
    color: var(--weiss);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── TABELLE ── */
.table-wrap { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: var(--schwarz);
    color: var(--weiss);
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { background: #333; }
.data-table th .sort-icon { margin-left: 4px; font-size: 10px; }

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--grau-mid);
    vertical-align: middle;
}

.data-table tr:hover td { background: var(--grau-hell); }
.data-table tr.priority-high td { border-left: 4px solid var(--prio-high); }
.data-table tr.priority-medium td { border-left: 4px solid var(--prio-medium); }
.data-table tr.priority-low td { border-left: 4px solid var(--prio-low); }

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-open        { background: #e3f2fd; color: #1565c0; }
.badge-in-progress { background: #fff8e1; color: #1a1a1a; }
.badge-done        { background: #e8f5e9; color: #2e7d32; }
.badge-archived    { background: #f5f5f5; color: #757575; }
.badge-waiting     { background: #e8eaf6; color: #3949ab; }

.badge-high   { background: #ffebee; color: #c62828; }
.badge-medium { background: #fff8e1; color: #1a1a1a; }
.badge-low    { background: #e8f5e9; color: #2e7d32; }

.badge-admin       { background: #1a1a1a; color: #fff; }
.badge-gl          { background: #F5A623; color: #1a1a1a; }
.badge-projektleiter { background: #1565c0; color: #fff; }
.badge-mitarbeiter { background: #e0e0e0; color: #333333; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    color: var(--schwarz);
    background: var(--weiss);
    border: 2px solid var(--schwarz);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn:hover { border-color: var(--orange); color: var(--orange); }
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--orange);
    color: var(--schwarz);
    border-color: var(--orange);
}
.btn-primary:hover { background: #e09000; border-color: #e09000; color: var(--schwarz); }

.btn-danger {
    background: var(--rot);
    color: var(--weiss);
    border-color: var(--rot);
}
.btn-danger:hover { background: #a51c1c; border-color: #a51c1c; color: var(--weiss); }

.btn-success {
    background: var(--gruen);
    color: var(--weiss);
    border-color: var(--gruen);
}
.btn-success:hover { background: #1b5e20; border-color: #1b5e20; color: var(--weiss); }

.btn-sm  { padding: 5px 11px; font-size: 11px; }
.btn-lg  { padding: 12px 24px; font-size: 13px; }
.btn-icon { padding: 7px; min-width: 36px; min-height: 36px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── FORMULARE ── */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    color: #555;
}

.pflicht { color: var(--rot); }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--weiss);
    font-family: inherit;
    font-size: 14px;
    color: var(--schwarz);
    transition: border-color 0.2s;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--orange);
}

.form-control::placeholder { color: #bbb; }

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

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a1a1a' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

.form-hint { font-size: 12px; color: #555; font-weight: 500; margin-top: 4px; }
.form-error { font-size: 12px; color: var(--rot); margin-top: 4px; }

/* ── ALERTS ── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-left: 4px solid;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
}

.alert i { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #e8f5e9; border-color: var(--gruen); color: #1b5e20; }
.alert-danger  { background: #ffebee; border-color: var(--rot);   color: #b71c1c; }
.alert-warning { background: #fff8e1; border-color: var(--gelb);  color: #e65100; }
.alert-info    { background: #e3f2fd; border-color: var(--blau);  color: #0d47a1; }

/* ── MODALS ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px;
    overflow-y: auto;
}

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

.modal {
    background: var(--weiss);
    width: 100%;
    max-width: 560px;
    border: 2px solid var(--schwarz);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--schwarz);
    color: var(--weiss);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--weiss);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.modal-close:hover { opacity: 1; }

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--grau-mid);
    flex-shrink: 0;
}

/* ── FILTER-BAR ── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--weiss);
    border: 2px solid var(--grau-mid);
    border-radius: var(--radius-sm);
}

.filter-bar .form-control { width: auto; min-width: 140px; }
.filter-bar label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #555; }

/* ── AUFGABE PRIORITÄT STREIFEN ── */
.priority-stripe {
    display: inline-block;
    width: 4px;
    height: 100%;
    border-radius: 2px;
}

.priority-high   { color: var(--prio-high); }
.priority-medium { color: var(--prio-medium); }
.priority-low    { color: var(--prio-low); }

/* ── FORTSCHRITTSBALKEN ── */
.progress-bar {
    height: 8px;
    background: var(--grau-mid);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--orange);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-fill.done { background: var(--gruen); }

/* ── AVATAR ── */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--orange);
    color: var(--schwarz);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* ── BEREICHS-FARB-STREIFEN ── */
.section-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── LEERER ZUSTAND ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #555;
}

.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 13px; }

/* ── LOGIN PAGE ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--schwarz);
    padding: 24px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--weiss);
    padding: 40px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-logo-text {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-logo-sub {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

/* ── SETUP WIZARD ── */
.setup-step {
    display: none;
}

.setup-step.aktiv { display: block; }

.setup-progress {
    display: flex;
    gap: 0;
    margin-bottom: 32px;
}

.setup-progress-step {
    flex: 1;
    height: 4px;
    background: var(--grau-mid);
}

.setup-progress-step.done { background: var(--orange); }

/* ── DROPDOWN ── */
.dropdown { position: relative; }

.dropdown-btn {
    background: var(--weiss);
    border: 2px solid var(--schwarz);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    transition: all 0.2s;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--schwarz);
}

.dropdown-btn:hover { border-color: var(--orange); color: var(--orange); }

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--weiss);
    border: 2px solid var(--schwarz);
    border-radius: var(--radius-sm);
    min-width: 200px;
    z-index: 500;
    box-shadow: 4px 4px 0 rgba(0,0,0,.12);
}

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

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--schwarz);
    background: none;
    border: none;
    border-bottom: 1px solid var(--grau-hell);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: background 0.15s;
    text-align: left;
}

.dropdown-menu a:last-child, .dropdown-menu button:last-child { border-bottom: none; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--grau-hell); color: var(--orange); }
.dropdown-menu .dd-danger { color: var(--rot); }
.dropdown-menu .dd-danger:hover { background: #fff5f5; color: var(--rot); }

/* ── NOTIFICATION PANEL ── */
.notif-panel {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 340px;
    background: var(--weiss);
    border: 2px solid var(--schwarz);
    border-radius: var(--radius-sm);
    box-shadow: 4px 4px 0 rgba(0,0,0,.12);
    z-index: 400;
    max-height: 440px;
    overflow-y: auto;
}

.notif-panel.open { display: block; }

.notif-header {
    padding: 12px 16px;
    background: var(--schwarz);
    color: var(--weiss);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--grau-mid);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.notif-item:hover { background: var(--grau-hell); }
.notif-item.unread { background: #fff8e8; border-left: 3px solid var(--orange); }
.notif-item .notif-title { font-weight: 600; margin-bottom: 2px; }
.notif-item .notif-time  { color: #999; font-size: 11px; }

/* ── GANTT / TIMELINE ── */
.gantt-wrap { overflow-x: auto; }

/* ── PW-STÄRKE ── */
.pw-strength { height: 4px; background: var(--grau-mid); border-radius: 2px; overflow: hidden; }
.pw-strength-bar { height: 100%; width: 0; border-radius: 2px; transition: all 0.3s; }
.pw-strength-bar[data-strength="0"] { width: 0; }
.pw-strength-bar[data-strength="1"] { width: 33%; background: var(--rot); }
.pw-strength-bar[data-strength="2"] { width: 66%; background: var(--gelb); }
.pw-strength-bar[data-strength="3"] { width: 100%; background: var(--gruen); }

/* ── SPINNER ── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--grau-mid);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ── DARK MODE ── */
@media (prefers-color-scheme: dark) {
    body.auto-dark, body[data-theme="dark"], html[data-theme="dark"] {
        --hintergrund: #121212;
        --weiss:       #1e1e1e;
        --schwarz:     #f0efed;
        --grau-mid:    #444;
        --grau-hell:   #2a2a2a;
        --border:      #444;
    }
}

body[data-theme="dark"], html[data-theme="dark"] {
    --hintergrund: #121212;
    --weiss:       #1e1e1e;
    --schwarz:     #f0efed;
    --grau-mid:    #444;
    --grau-hell:   #2a2a2a;
    --border:      #444;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .portal-header { padding: 0 16px; }
    .portal-nav    { padding: 0 16px; }
    .portal-main   { padding: 14px 16px; }

    .kacheln-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

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

    .flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .card { padding: 16px; }

    .modal { max-width: 100%; margin: 0; }
    .modal-overlay { padding: 16px; }

    .filter-bar { flex-direction: column; gap: 8px; }
    .filter-bar .form-control { width: 100%; }

    .page-title { font-size: 16px; }

    .notif-panel { width: calc(100vw - 32px); right: -16px; }
}

@media (min-width: 601px) and (max-width: 900px) {
    .portal-main { padding: 20px; }
    .kacheln-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Hotfix: gelbe Badges auf dunklem Hintergrund besser lesbar */
.badge.badge-medium,
span.badge.badge-medium,
.badge.badge-in-progress,
span.badge.badge-in-progress {
    color: #1a1a1a !important;
}

/* Hotfix: Prioritaets-Zeilen duerfen Tabellen-Text nicht einfaerben */
.data-table tr.priority-high,
.data-table tr.priority-medium,
.data-table tr.priority-low {
    color: inherit !important;
}

.data-table tr.priority-high td,
.data-table tr.priority-medium td,
.data-table tr.priority-low td {
    color: inherit !important;
}

/* Fix: Aufgabenuebersicht auf Desktop-Breite besser nutzen */
@media (min-width: 901px) {
    .portal-main:has(#taskTable) {
        max-width: calc(100vw - 24px);
        padding-left: 24px;
        padding-right: 24px;
    }
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.task-list-wrap {
    width: 100%;
    max-width: 100%;
}

#taskTable {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

#taskTable th:nth-child(1),
#taskTable td:nth-child(1) { width: 36px; }

#taskTable th:nth-child(2),
#taskTable td:nth-child(2) { width: 36%; }

#taskTable th:nth-child(3),
#taskTable td:nth-child(3) { width: 13%; }

#taskTable th:nth-child(4),
#taskTable td:nth-child(4) { width: 15%; }

#taskTable th:nth-child(5),
#taskTable td:nth-child(5) { width: 11%; }

#taskTable th:nth-child(6),
#taskTable td:nth-child(6) { width: 9%; }

#taskTable th:nth-child(7),
#taskTable td:nth-child(7) { width: 10%; }

#taskTable th:nth-child(8),
#taskTable td:nth-child(8) { width: 12%; }

#taskTable th:nth-child(9),
#taskTable td:nth-child(9) {
    width: 96px;
    white-space: nowrap;
}

#taskTable td,
#taskTable th {
    overflow: hidden;
    text-overflow: ellipsis;
}

#taskTable td:nth-child(9),
#taskTable th:nth-child(9) {
    overflow: visible;
}

@media (max-width: 900px) {
    #taskTable {
        min-width: 1100px;
    }
}


/* ── v6f UX-Feinschliff ── */

/* Überfällig-Kachel: stärkere Hervorhebung */
.kachel.kachel-rot {
    border-color: #ef9a9a;
    background: #fff8f8;
}

/* Aufgabenliste: Hover-Effekt bereits vorhanden (.data-table tr:hover td)
   Zusatz: Transition für sanfteren Übergang */
.data-table tr td {
    transition: background 0.1s;
}

/* Fortschrittsbalken: auch bei 0% sichtbar (minimale Breite) */
.progress-bar .progress-fill {
    min-width: 0;
    transition: width 0.3s ease;
}

/* Status-Button: aktiver Zustand im Detail */
.btn.btn-primary {
    position: relative;
}

/* Login: Logo-Container */
.login-tenant-logo {
    text-align: center;
    margin-bottom: 20px;
}
.login-tenant-logo img {
    max-height: 64px;
    max-width: 220px;
    object-fit: contain;
}

/* Sections: Progress-Bar etwas dicker */
.sections-grid .progress-bar {
    height: 7px;
}

/* Gantt: Aktuelle Woche Spalten-Hintergrund */
.gantt-week-current {
    background: #fdfaf5 !important;
}

/* Admin-Tabs: zweite Zeile visuell getrennt */
.admin-tabs-row2 {
    border-top: 1px solid var(--grau-mid);
    padding-top: 4px;
    margin-top: -1px;
}

/* ── DARK MODE FEINSCHLIFF v7.7 ── */
/* Nur aktiv bei html[data-theme="dark"] – Hellmodus bleibt unverändert */

html[data-theme="dark"] body {
    background: #121212;
    color: #f0efed;
}

html[data-theme="dark"] .portal-header,
html[data-theme="dark"] .portal-nav {
    background: #1e1e1e;
    border-color: #3a3a3a;
}

html[data-theme="dark"] .portal-main {
    background: #121212;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .kachel,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .notif-panel {
    background: #1e1e1e;
    color: #f0efed;
    border-color: #444;
}

html[data-theme="dark"] .data-table th,
html[data-theme="dark"] table.data-table th {
    background: #2a2a2a;
    color: #f0efed;
    border-color: #444;
}

html[data-theme="dark"] .data-table td,
html[data-theme="dark"] table.data-table td {
    background: #1e1e1e;
    color: #f0efed;
    border-color: #444;
}

html[data-theme="dark"] .data-table tr:hover td {
    background: #2a2a2a;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control {
    background-color: #1e1e1e;
    color: #f0efed;
    border-color: #555;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #aaa;
}

html[data-theme="dark"] label,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .section-title {
    color: #f0efed;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] small,
html[data-theme="dark"] .muted {
    color: #aaa;
}

html[data-theme="dark"] .kachel-rot,
html[data-theme="dark"] .alert-warning,
html[data-theme="dark"] .notif-item.unread {
    background: #2a1f1f !important;
    color: #f0efed;
    border-color: #7a2e2e;
}

html[data-theme="dark"] .btn:not(.btn-primary):not(.btn-danger),
html[data-theme="dark"] .btn-sm:not(.btn-primary):not(.btn-danger) {
    color: #f0efed;
    border-color: #aaa;
}


/* ── GANTT THEME VARIABLEN v7.7 ── */
:root {
    --gantt-today-bg: #fff8e1;
    --gantt-companyholiday-bg: #fff3e0;
    --gantt-holiday-bg: #ede7f6;
    --gantt-week-bg: #fdfaf5;
    --gantt-weekend-bg: #fafafa;
    --gantt-grid-border: #f0efed;
}

html[data-theme="dark"] {
    --gantt-today-bg: #3a3015;
    --gantt-companyholiday-bg: #3a2615;
    --gantt-holiday-bg: #2b2440;
    --gantt-week-bg: #242424;
    --gantt-weekend-bg: #181818;
    --gantt-grid-border: #444;
}

/* ── GANTT DARK MODE KONTRAST v7.7 ── */
html[data-theme="dark"] {
    --gantt-grid-border: #6a6a6a;
    --gantt-week-bg: #202020;
    --gantt-weekend-bg: #151515;
    --gantt-today-bg: #403513;
    --gantt-companyholiday-bg: #3a2414;
    --gantt-holiday-bg: #30284a;
}

html[data-theme="dark"] .gantt-wrap table td,
html[data-theme="dark"] .gantt-wrap table th {
    border-color: #5a5a5a !important;
}

html[data-theme="dark"] .gantt-wrap thead th {
    color: #f0efed !important;
}


/* Aufgabenliste: Checkbox-Filter als zusammenhaengende Gruppe */
.task-filter-toggles {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.task-filter-toggles label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.task-filter-toggles .btn {
    height: 24px;
    min-height: 24px;
    padding: 2px 8px;
}

/* ── UI-Fix-03: Warn- & Rechte-Badges ── */

/* Passwort-Warn-Badge (Benutzerliste) */
.badge-pw-warn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 5px;
    white-space: nowrap;
    vertical-align: middle;
    margin-left: 4px;
    cursor: default;
}

/* Recht erlaubt – grün */
.badge-right-yes {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #2e7d32;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    white-space: nowrap;
}

/* Recht verweigert – rot */
.badge-right-no {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #c62828;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    white-space: nowrap;
}

/* Vollzugriff – dunkelgrün */
.badge-right-full {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #1b5e20;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    white-space: nowrap;
}

/* Nur lesend – blau */
.badge-right-readonly {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #1565c0;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    white-space: nowrap;
}

/* Auffälligkeit: kritisch (Kein Zugang) – roter Rahmen */
.badge-anomaly-danger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    white-space: normal;
    line-height: 1.4;
}

/* Auffälligkeit: Warnung – oranges Warn-Badge */
.badge-anomaly-warn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    white-space: normal;
    line-height: 1.4;
}

/* Kompaktes Icon-Badge für Aufgaben-Rechtematrix */
.badge-right-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.3;
    text-align: center;
}
.badge-right-icon.yes { background: #2e7d32; color: #fff; }
.badge-right-icon.no  { background: #c62828; color: #fff; }

/* ── FIX v7.9: Notification-Glocke im Darkmode lesbar machen ── */
html[data-theme="dark"] .notif-panel {
    background: #1e1e1e !important;
    color: #f0efed !important;
    border-color: #555 !important;
}

html[data-theme="dark"] .notif-header {
    background: #111 !important;
    color: #fff !important;
    border-bottom: 1px solid #444 !important;
}

html[data-theme="dark"] .notif-header span,
html[data-theme="dark"] .notif-header button {
    color: #fff !important;
}

html[data-theme="dark"] .notif-header button {
    opacity: 0.9;
}

html[data-theme="dark"] .notif-header button:hover {
    opacity: 1;
    text-decoration: underline;
}

html[data-theme="dark"] .notif-item {
    background: #1e1e1e !important;
    color: #f0efed !important;
    border-bottom-color: #3a3a3a !important;
}

html[data-theme="dark"] .notif-item:hover {
    background: #2a2a2a !important;
}

html[data-theme="dark"] .notif-item.unread {
    background: #3a2a12 !important;
    border-left-color: var(--orange) !important;
}

html[data-theme="dark"] .notif-item .notif-title {
    color: #fff !important;
    font-weight: 700 !important;
}

html[data-theme="dark"] .notif-item .notif-time {
    color: #d0d0d0 !important;
}

html[data-theme="dark"] #notifList,
html[data-theme="dark"] #notifList * {
    color: inherit;
}

html[data-theme="dark"] #notifList .empty-state,
html[data-theme="dark"] #notifList .empty-state p,
html[data-theme="dark"] #notifList [style*="color:#aaa"],
html[data-theme="dark"] #notifList [style*="color: #aaa"] {
    color: #d0d0d0 !important;
}

/* ── FIX v8.1: Notification-Glocke immer lesbar, unabhängig vom Browser-/App-Theme ── */
.notif-panel {
    background: #fffaf0 !important;
    color: #1a1a1a !important;
}

.notif-panel,
.notif-panel * {
    color: #1a1a1a !important;
}

.notif-panel .notif-header {
    background: #151515 !important;
    color: #ffffff !important;
}

.notif-panel .notif-header,
.notif-panel .notif-header *,
.notif-panel .notif-header button {
    color: #ffffff !important;
}

.notif-panel .notif-item {
    background: #fffaf0 !important;
    color: #1a1a1a !important;
}

.notif-panel .notif-item.unread {
    background: #fff4dc !important;
    border-left-color: var(--orange) !important;
}

.notif-panel .notif-item:hover {
    background: #ffe9bd !important;
}

.notif-panel .notif-title {
    color: #1a1a1a !important;
    font-weight: 800 !important;
}

.notif-panel .notif-time {
    color: #555555 !important;
}

.notif-panel .empty-state,
.notif-panel .empty-state * {
    color: #555555 !important;
}
