/* =============================================
   Time Tracking App - Stylesheet
   ============================================= */

/* Bootstrap Icons – Groessen */
.nav-icon .bi       { font-size: 16px; vertical-align: middle; }
.sidebar-header .bi { font-size: 16px; vertical-align: middle; }
.btn .bi            { font-size: 14px; vertical-align: middle; }
.btn-logout .bi     { font-size: 14px; vertical-align: middle; }
.badge .bi          { font-size: 11px; }
.alert .bi          { font-size: 15px; flex-shrink: 0; }
.login-logo .bi     { font-size: 48px; color: var(--primary); }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-w: 240px;
    --header-h: 60px;

    --intern-color: #F0BC3D;
    --fae-color: #2E8B8C;
    --presales-color: #F97316;
    --billable-color: #57B846;
    --urlaub-color: #7B5EA7;
    --notfall-color: #E8603C;
    --unknown-color: #94a3b8;
    --bg-secondary: #f1f5f9;
    --border-color: #e2e8f0;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

/* ---- Login ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
}

.login-box {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--primary);
    margin-top: 8px;
}

.login-logo .icon {
    font-size: 48px;
}

/* ---- Layout ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    background: #1e293b;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid #334155;
}

.sidebar-header h2 {
    font-size: 16px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-header span {
    font-size: 12px;
    color: #94a3b8;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-section {
    padding: 8px 16px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #94a3b8;
    text-decoration: none;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    border: none;
    background: none;
    width: 100%;
    font-size: 14px;
}

.nav-item:hover {
    background: #334155;
    color: #e2e8f0;
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
}

.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }

/* ---- Horizontale Tabs ---- */
.tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}
.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 4px 4px 0 0;
    transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text); background: var(--bg); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Burger-Menü in Sidebar ---- */
.nav-burger-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 2px 8px;
    border-radius: 8px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.nav-burger-toggle:hover { background: #334155; color: #e2e8f0; }
.nav-burger-toggle .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-burger-toggle .burger-chevron { margin-left: auto; font-size: 12px; transition: transform 0.2s; }
.nav-burger-toggle.open .burger-chevron { transform: rotate(180deg); }

.nav-burger-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.nav-burger-items.open { max-height: 600px; }
.nav-burger-item { padding-left: 28px !important; }

/* Admin-Modus: Burger-Toggle ausblenden, Items direkt anzeigen, kein Extra-Einzug */
.admin-nav .nav-burger-toggle { display: none !important; }
.admin-nav .nav-burger-items { max-height: none !important; overflow: visible !important; transition: none !important; }
.admin-nav .nav-burger-item { padding-left: 12px !important; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #334155;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.user-details { flex: 1; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: #64748b; }

.btn-logout {
    width: 100%;
    padding: 8px;
    background: #334155;
    color: #94a3b8;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}
.btn-logout:hover { background: #dc2626; color: #fff; }

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--header-h);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.topbar h1 { font-size: 18px; font-weight: 600; flex: 1; }

.page-content {
    padding: 24px;
    flex: 1;
}

/* ---- Cards ---- */
.card {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- KPI Cards ---- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.kpi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.kpi-value { font-size: 22px; font-weight: 700; color: var(--text); }
.kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.kpi-card.intern    { border-left: 4px solid var(--intern-color); }
.kpi-card.fae       { border-left: 4px solid var(--fae-color); }
.kpi-card.presales  { border-left: 4px solid var(--presales-color); }
.kpi-card.billable  { border-left: 4px solid var(--billable-color); }
.kpi-card.urlaub    { border-left: 4px solid var(--urlaub-color); }
.kpi-card.notfall   { border-left: 4px solid var(--notfall-color); }
.kpi-card.rejected  { border-left: 4px solid var(--danger); }
.kpi-card.rejected.kpi-alert {
    background: #fff0f0;
    border-left: 4px solid var(--danger);
    box-shadow: 0 0 0 2px var(--danger), 0 2px 8px rgba(239,68,68,.25);
    animation: rejected-pulse 2s ease-in-out infinite;
}
.kpi-card.rejected.kpi-alert .kpi-value { color: var(--danger); }
@keyframes rejected-pulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--danger), 0 2px 8px rgba(239,68,68,.25); }
    50%       { box-shadow: 0 0 0 4px var(--danger), 0 4px 16px rgba(239,68,68,.40); }
}
.kpi-card.notfall.kpi-alert {
    background: #fff3f0;
    border-left: 4px solid var(--notfall-color);
    box-shadow: 0 0 0 2px var(--notfall-color), 0 2px 8px rgba(232,96,60,.25);
    animation: notfall-pulse 2s ease-in-out infinite;
}
.kpi-card.notfall.kpi-alert .kpi-value { color: var(--notfall-color); }
@keyframes notfall-pulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--notfall-color), 0 2px 8px rgba(232,96,60,.25); }
    50%       { box-shadow: 0 0 0 4px var(--notfall-color), 0 4px 16px rgba(232,96,60,.40); }
}
.kpi-card.total { border-left: 4px solid var(--primary); }

/* ---- Charts Grid ---- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
.charts-grid .col-span-2 { grid-column: span 2; }

.chart-container { position: relative; height: 280px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-label.required::after { content: ' *'; color: var(--danger); }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control.error { border-color: var(--danger); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 2px solid var(--border);
}
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tr:hover td { background: #f8fafc; }
tr:last-child td { border-bottom: none; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-intern    { background: #fef9e7; color: var(--intern-color); }
.badge-fae       { background: #e0f4f4; color: var(--fae-color); }
.badge-presales  { background: #fff3e8; color: var(--presales-color); }
.badge-billable  { background: #eafbea; color: var(--billable-color); }
.badge-urlaub    { background: #ede9f8; color: var(--urlaub-color); }
.badge-notfall   { background: #fdecea; color: var(--notfall-color); }
.badge-unknown  { background: #f1f5f9; color: var(--unknown-color); }
.badge-admin     { background: #fef3c7; color: #92400e; }
.badge-developer { background: #f0fdf4; color: #166534; }
.badge-mitarbeiter { background: #e0f2fe; color: #075985; }
.badge-backoffice  { background: #ede9fe; color: #5b21b6; }
.badge-active { background: #dcfce7; color: var(--success); }
.badge-inactive { background: #fee2e2; color: var(--danger); }

/* ---- Alerts (inline, z. B. auf Login-Seite) ---- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ---- Toast-Container (fixed, unten rechts) ---- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: toast-in 0.2s ease;
    max-width: 340px;
    word-break: break-word;
}
.toast-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.toast-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.toast-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.toast-out     { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(8px); } }

/* ---- Filters ---- */
.filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 12px; font-weight: 500; color: var(--text-muted); }

/* ---- Topbar-Filter (Dashboard-Kopfzeile) ---- */
.topbar .filters { margin-bottom: 0; gap: 8px; flex-wrap: nowrap; align-items: flex-end; }
.topbar .filter-label { font-size: 11px; white-space: nowrap; }
.topbar .form-control { height: 30px; font-size: 12px; padding: 2px 8px; }
.topbar .filters .btn { height: 30px; padding: 0 10px; font-size: 13px; align-self: flex-end; }

/* ---- Kachel-interne Filter (z.B. Überstunden) ---- */
.card-title .filters { align-items: flex-end; }
.card-title .filter-label { font-size: 11px; }
.card-title .form-control { height: 30px; font-size: 13px; padding: 2px 6px; }
.card-title .btn-sm { height: 30px; align-self: flex-end; }

/* ---- Dashboard Drag-and-Drop ---- */
.dash-section {
    position: relative;
    margin-bottom: 20px;
    transition: opacity 0.15s;
}
.dash-section.dragging {
    opacity: 0.35;
}
.dash-section.drop-above {
    border-top: 3px solid var(--primary);
    padding-top: 4px;
}
.dash-section.drop-below {
    border-bottom: 3px solid var(--primary);
    padding-bottom: 4px;
}
.dash-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    cursor: grab;
    color: var(--text-muted);
    font-size: 20px;
    opacity: 0.25;
    transition: opacity 0.2s;
    user-select: none;
    border-radius: 4px;
    margin-bottom: 6px;
}
.dash-handle:hover {
    opacity: 0.7;
    background: var(--bg-secondary);
}
.dash-handle:active {
    cursor: grabbing;
    opacity: 1;
}

/* ---- Settings Tabs ---- */
.settings-tab-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border, #e5e7eb);
    margin-bottom: 24px;
}
.settings-tab-nav button {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color 0.15s, border-color 0.15s;
}
.settings-tab-nav button:hover { color: var(--text, #111827); background: var(--surface-hover, #f3f4f6); }
.settings-tab-nav button.active { color: var(--primary, #3b82f6); border-bottom-color: var(--primary, #3b82f6); }

/* ---- Sync-Animation ---- */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 1s linear infinite; }
.nav-item-loading { opacity: 0.6; }

/* ---- Sync-Overlay ---- */
#sync-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
    align-items: center;
    justify-content: center;
}
#sync-overlay.active { display: flex; }
#sync-overlay-box {
    background: var(--surface, #fff);
    border-radius: 14px;
    padding: 36px 48px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.28);
    min-width: 260px;
}
#sync-overlay-box .sync-spinner {
    width: 52px;
    height: 52px;
    border: 5px solid var(--border, #e5e7eb);
    border-top-color: var(--primary, #3b82f6);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin: 0 auto 20px;
}
#sync-overlay-box p {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #111827);
}
#sync-overlay-box small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}

/* ---- Datum-Stepper ---- */
.date-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
}
.date-stepper .form-control {
    flex: 1;
    min-width: 0;
}
.date-step-btn {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Dialog-Box innerhalb .modal-overlay */
.modal-overlay > .modal {
    display: block;          /* flex-Vererbung von .modal verhindern */
    position: static;
    background: var(--card-bg);
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
}

/* Variante B: .modal als vollflächiger Wrapper */
.modal:not(.modal-overlay > .modal) {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal > .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 0;
}
.modal-content {
    position: relative;
    z-index: 1;
    background: var(--card-bg);
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    line-height: 1;
}
.btn-close:hover { color: var(--text); }

/* ---- Toolbar ---- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.toolbar-left { flex: 1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }

/* ---- Spinner ---- */
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Progress Bar ---- */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
.progress-fill.intern    { background: var(--intern-color); }
.progress-fill.fae       { background: var(--fae-color); }
.progress-fill.presales  { background: var(--presales-color); }
.progress-fill.billable  { background: var(--billable-color); }
.progress-fill.urlaub    { background: var(--urlaub-color); }
.progress-fill.notfall   { background: var(--notfall-color); }

/* ---- Utility ---- */
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: 'Consolas', monospace; }
.gap-8 { gap: 8px; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.w-100 { width: 100%; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ---- Team-Weekly-Widget ---- */
.tw-table {
    width: 100%;
    border-collapse: collapse;
}
.tw-table th,
.tw-table td {
    padding: 8px 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.tw-table thead th {
    background: var(--bg-secondary);
    font-weight: 600;
    white-space: nowrap;
}
.tw-table tbody tr:last-child td { border-bottom: none; }
.tw-table tbody tr:hover td { background: var(--bg) !important; }

.tw-col-name  { text-align: left; min-width: 150px; }
.tw-col-week  { text-align: center; min-width: 130px; }

.tw-name { font-weight: 500; }

.tw-kw    { font-size: 13px; font-weight: 700; color: var(--primary); }
.tw-range { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tw-soll  { font-size: 11px; color: var(--text-muted); }

.tw-cell { text-align: center; }
.tw-cell-hours {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}
.tw-warn { font-size: 12px; }
.tw-bar-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 4px;
    max-width: 90px;
}
.tw-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.tw-cell-pct { font-size: 11px; }

.tw-cell-low { background: #fff0f0; }

/* Filter-Button Zustände */
.tw-filter-active {
    background: var(--notfall-color) !important;
    border-color: var(--notfall-color) !important;
    color: #fff !important;
}
.tw-filter-inactive {
    background: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text-muted) !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .charts-grid { grid-template-columns: 1fr; }
    .charts-grid .col-span-2 { grid-column: span 1; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
