:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #e2e8f0;
    --sidebar-border: rgba(148, 163, 184, 0.18);
    --sidebar-hover-bg: rgba(148, 163, 184, 0.12);
    --sidebar-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 228px;
    height: 100vh;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 52%, rgba(17, 24, 39, 0.98) 100%);
    padding: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: var(--sidebar-shadow);
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 32%),
        radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.16), transparent 28%);
}

.sidebar-brand {
    padding: 0.82rem 0.7rem 0.68rem;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.sidebar-brand-shell {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.68rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(15, 23, 42, 0.28));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-brand-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0.58rem 0.72rem;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.76), rgba(30, 41, 59, 0.36)),
        rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-brand-meta {
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    align-items: center;
    text-align: center;
}

.sidebar-brand-label {
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
}

.sidebar-brand-meta strong {
    color: #f8fafc;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.2;
    width: 100%;
}

.sidebar-brand-meta small {
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.7rem;
    width: 100%;
}

.sidebar-nav {
    list-style: none;
    padding: 0.55rem 0 0.72rem;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.sidebar-nav .sidebar-link,
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.56rem;
    margin: 0.14rem 0.56rem;
    padding: 0.5rem 0.58rem;
    border-radius: 11px;
    border: 1px solid transparent;
    color: rgba(226, 232, 240, 0.8);
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.81rem;
    position: relative;
    z-index: 1;
}

.sidebar-nav .sidebar-link i,
.sidebar-nav li a i {
    width: 1.5rem;
    min-width: 1.5rem;
    height: 1.5rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: #dbeafe;
    transition: inherit;
}

.sidebar-nav .sidebar-link span,
.sidebar-nav li a span {
    flex: 1;
    min-width: 0;
}

.sidebar-nav .sidebar-link:hover,
.sidebar-nav .sidebar-link.active,
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    color: var(--sidebar-active);
    background: var(--sidebar-hover-bg);
    border-color: rgba(148, 163, 184, 0.16);
    transform: translateX(4px);
}

.sidebar-nav .sidebar-link:hover i,
.sidebar-nav .sidebar-link.active i,
.sidebar-nav li a:hover i,
.sidebar-nav li a.active i {
    background: rgba(56, 189, 248, 0.16);
    color: #f8fafc;
}

.sidebar-nav .sidebar-link.active,
.sidebar-nav li a.active {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.34), rgba(56, 189, 248, 0.18));
    border-color: rgba(125, 211, 252, 0.22);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

/* Sidebar Sektions-Labels */
.sidebar-section-label {
    padding: 0.5rem 0.6rem;
    margin: 0.58rem 0.56rem 0.18rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: rgba(226, 232, 240, 0.6);
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.sidebar-section-label:hover {
    color: rgba(248, 250, 252, 0.88);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(148, 163, 184, 0.12);
}

.sidebar-section-static {
    cursor: default;
}

.sidebar-section-static:hover {
    color: rgba(226, 232, 240, 0.6);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.sidebar-section-label span {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.sidebar-chevron {
    font-size: 0.6rem;
    transition: transform 0.25s ease;
    opacity: 0.7;
}
.sidebar-section-label.collapsed .sidebar-chevron {
    transform: rotate(-90deg);
}

/* Klappbare Sektions-Items */
.sidebar-section-items {
    overflow: visible;
    max-height: 900px;
    transition: max-height 0.3s ease;
    position: relative;
    margin: 0 0.56rem 0.22rem;
    padding: 0.16rem 0 0.1rem;
}

.sidebar-section-items::before {
    content: "";
    position: absolute;
    left: 1.05rem;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 1px;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.24), rgba(148, 163, 184, 0.04));
}

.sidebar-section-items .sidebar-link,
.sidebar-section-items li a {
    margin-left: 0.34rem;
    padding: 0.32rem 0.4rem;
    gap: 0.42rem;
    font-size: 0.72rem;
    border-radius: 9px;
}

.sidebar-section-items .sidebar-link i,
.sidebar-section-items li a i {
    width: 1.18rem;
    min-width: 1.18rem;
    height: 1.18rem;
    border-radius: 6px;
    font-size: 0.66rem;
}

.sidebar-quick-links {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    margin: 0 0.56rem 0.38rem;
}

.sidebar-favorite-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.2rem;
}

.sidebar-favorite-link {
    margin: 0 !important;
    padding: 0.32rem 0.4rem !important;
    gap: 0.42rem;
    font-size: 0.72rem;
    border-radius: 9px;
}

.sidebar-favorite-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-favorite-link i {
    width: 1.18rem !important;
    min-width: 1.18rem !important;
    height: 1.18rem !important;
    border-radius: 6px !important;
    font-size: 0.66rem;
}

.sidebar-favorite-remove {
    width: 1.2rem;
    height: 1.2rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: rgba(226, 232, 240, 0.34);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.62rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.6;
}

.sidebar-favorite-remove:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.06);
    color: rgba(248, 250, 252, 0.72);
    opacity: 1;
}

.sidebar-favorite-remove:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.sidebar-section-items.collapsed {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
}

.sidebar-placeholder {
    padding: 0.4rem 1.5rem 0.4rem 2.25rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.2);
    font-style: italic;
    pointer-events: none;
}
.sidebar-placeholder span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-footer {
    display: none;
    padding: 0.68rem;
    border-top: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    font-size: 0.8rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.legacy-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    margin: -0.35rem 0 1rem;
    padding: 0.72rem 0.9rem;
    border: 1px solid var(--border);
    background: var(--card-bg);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.legacy-topbar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}
.legacy-topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
    flex: 0 0 auto;
}
.legacy-topbar-meta { min-width: 0; text-align: right; }
.legacy-topbar-name {
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text);
}
.legacy-topbar-role {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.legacy-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.legacy-topbar-actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.44rem 0.62rem;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}
.legacy-topbar-actions a:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #eff6ff;
}
.legacy-topbar-actions a.danger { color: #dc2626; }
.legacy-topbar-actions a.danger:hover {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
}

.sidebar-footer-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.62rem;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(15, 23, 42, 0.22));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer-company {
    min-height: 1.5rem;
}

.sidebar-footer-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.24rem 0.48rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #dbeafe;
    font-size: 0.64rem;
    font-weight: 600;
}

.sidebar-footer-chip-crown {
    background: rgba(124, 58, 237, 0.16);
    color: #ede9fe;
}

.sidebar-footer-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-footer-avatar {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(30, 64, 175, 0.2));
    color: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar-footer-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-footer-profile {
    color: #f8fafc;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer-user-meta small {
    color: rgba(226, 232, 240, 0.62);
    font-size: 0.62rem;
}

.sidebar-footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.sidebar-footer-actions a,
.sidebar-footer-legal a {
    text-decoration: none;
}

.sidebar-footer-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.62rem;
    padding: 0.24rem 0.34rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(226, 232, 240, 0.88);
    font-weight: 600;
    font-size: 0.68rem;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sidebar-footer-actions a:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(148, 163, 184, 0.16);
    transform: translateY(-1px);
}

.sidebar-footer-legal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: rgba(226, 232, 240, 0.5);
    font-size: 0.58rem;
}

.sidebar-footer-legal a {
    color: rgba(226, 232, 240, 0.68);
}

/* Main Content */
.main-content {
    margin-left: 228px;
    padding: 2rem;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.page-meta-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 2rem;
    margin-top: -0.35rem;
    margin-bottom: 0.95rem;
    padding-right: 0.15rem;
    position: relative;
    z-index: 60;
}

.page-favorite-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.76);
    color: var(--text-muted);
    font-size: 0.82rem;
    position: relative;
    z-index: 61;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.page-favorite-toggle span {
    display: none;
}

.page-favorite-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(56, 189, 248, 0.28);
    color: var(--text);
}

.page-favorite-toggle.active {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.28);
    color: var(--primary);
}

.page-favorite-toggle:disabled {
    opacity: 0.7;
    cursor: wait;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body { padding: 1.25rem; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Dashboard Module Cards */
.dash-module-card > div:hover,
.card-body a[style*="text-decoration:none"] > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.table tr:hover { background: #f8fafc; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--primary), #8a9bb5 20%),
        color-mix(in srgb, var(--primary-dark), #6b7d96 18%));
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.04);
    border: 1px solid color-mix(in srgb, var(--primary), transparent 78%);
    letter-spacing: 0.01em;
}
.btn-primary:hover {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--primary), #8a9bb5 8%),
        color-mix(in srgb, var(--primary-dark), #6b7d96 6%));
    box-shadow: 0 3px 8px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.btn-success {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--success), #8a9bb5 20%),
        color-mix(in srgb, var(--success), #6b7d96 28%));
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.04);
    border: 1px solid color-mix(in srgb, var(--success), transparent 78%);
}
.btn-success:hover {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--success), #8a9bb5 8%),
        color-mix(in srgb, var(--success), #6b7d96 10%));
    box-shadow: 0 3px 8px rgba(0,0,0,0.14);
    transform: translateY(-1px);
}
.btn-warning {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--warning), #8a9bb5 20%),
        color-mix(in srgb, var(--warning), #6b7d96 28%));
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.04);
    border: 1px solid color-mix(in srgb, var(--warning), transparent 78%);
}
.btn-warning:hover {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--warning), #8a9bb5 8%),
        color-mix(in srgb, var(--warning), #6b7d96 10%));
    box-shadow: 0 3px 8px rgba(0,0,0,0.14);
    transform: translateY(-1px);
}
.btn-danger {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--danger), #8a9bb5 20%),
        color-mix(in srgb, var(--danger), #6b7d96 28%));
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.04);
    border: 1px solid color-mix(in srgb, var(--danger), transparent 78%);
}
.btn-danger:hover {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--danger), #8a9bb5 8%),
        color-mix(in srgb, var(--danger), #6b7d96 10%));
    box-shadow: 0 3px 8px rgba(0,0,0,0.14);
    transform: translateY(-1px);
}
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.btn-modern-outline {
    background: transparent;
    border: 1.5px solid var(--btn-accent, var(--primary));
    color: var(--btn-accent, var(--primary));
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
}
.btn-modern-outline:hover {
    background: color-mix(in srgb, var(--btn-accent, var(--primary)), transparent 90%);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--btn-accent, var(--primary)), transparent 75%);
    transform: translateY(-1px);
}
.btn-modern-outline:active {
    transform: translateY(0);
    background: color-mix(in srgb, var(--btn-accent, var(--primary)), transparent 85%);
}
.btn-sm.btn-modern-outline {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

select.form-control { appearance: auto; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-early { background: #fef3c7; color: #92400e; }
.badge-late { background: #e0e7ff; color: #3730a3; }

/* Modal */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-backdrop.show { display: flex; }

.modal {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

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

.modal-header h3 { margin: 0; font-size: 1.1rem; }

.modal-body { padding: 1.25rem; }

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Flash Messages */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

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

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

.login-card h1 {
    text-align: center;
    margin: 0 0 0.25rem;
    font-size: 1.8rem;
    color: var(--primary);
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 256px; }
    .sidebar-brand { padding: 0.8rem 0.6rem; }
    .sidebar-brand-shell { padding: 0.55rem; border-radius: 18px; }
    .sidebar-brand-logo-wrap { min-height: 56px; padding: 0.55rem; }
    .sidebar-brand-meta,
    .sidebar-footer { display: none; }
    .sidebar-nav li a span,
    .sidebar-nav .sidebar-link span,
    .sidebar-section-label { display: flex; }
    .sidebar-placeholder { display: none; }
    .sidebar-quick-links { margin: 0 0 0.35rem; }
    .sidebar-favorite-row { grid-template-columns: 1fr; }
    .sidebar-favorite-remove { display: none; }
    .sidebar-favorite-link { padding: 0.36rem !important; }
    .sidebar-section-items { max-height: 900px !important; overflow: visible; margin: 0; padding: 0.25rem 0; }
    .sidebar-section-items::before { display: none; }
    .sidebar-chevron { display: none; }
    .sidebar-nav li a, .sidebar-nav .sidebar-link { justify-content: center; padding: 0.54rem; margin: 0.16rem 0.5rem; }
    .sidebar-nav li a i, .sidebar-nav .sidebar-link i { margin: 0; }
    .sidebar-section-items .sidebar-link, .sidebar-section-items li a { padding: 0.36rem; }
    .main-content { margin-left: 256px; padding: 1rem; }
    .legacy-topbar { align-items: stretch; flex-direction: column; }
    .legacy-topbar-user { justify-content: space-between; }
    .legacy-topbar-actions a { flex: 1; justify-content: center; }
    .page-meta-bar { margin-top: -0.15rem; margin-bottom: 0.8rem; padding-right: 0; }
    .page-favorite-toggle { width: 2rem; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; }
    .stat-card { padding: 0.75rem; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .page-header > div { width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card .stat-value { font-size: 1.2rem; }
    .stat-card .stat-label { font-size: 0.75rem; }
}

/* ===================== DISPOSITION TABLE ===================== */
.dispo-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 900px;
}

.dispo-table th {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 1;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0.35rem 0.6rem;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.dispo-table td {
    padding: 0.12rem 0.6rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    white-space: nowrap;
}

.dispo-table .editable {
    cursor: text;
    min-width: 60px;
    border-radius: 4px;
    transition: background 0.15s;
}

.dispo-table .editable:hover {
    background: #eef2ff;
}

.dispo-table .editable:empty::after {
    content: '–';
    color: var(--text-muted);
    opacity: 0.4;
}

.inline-edit-input {
    width: 100%;
    border: 2px solid var(--primary);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

select.inline-edit-input {
    appearance: auto;
    cursor: pointer;
    min-width: 140px;
}

/* Tour-Nummer als übergreifender Bereich (rowspan) */
.tour-number-cell {
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border-right: 3px solid var(--primary);
    vertical-align: middle;
    text-align: center;
    min-width: 70px;
    position: relative;
}

.tour-number-label {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    writing-mode: horizontal-tb;
    white-space: nowrap;
    color: #fff;
}

.th-tour-number {
    min-width: 70px;
    text-align: center;
}

/* Drag & Drop */
.drag-handle {
    cursor: grab;
    width: 30px;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
}

.drag-handle:active { cursor: grabbing; }

.dispo-row {
    transition: background 0.15s, opacity 0.15s;
}

.dispo-row.dragging {
    opacity: 0.3;
    background: #dbeafe;
}

.dispo-row.drag-over {
    border-top: 3px solid var(--primary);
}

.dispo-tour {
    transition: box-shadow 0.2s;
}

.dispo-tour:has(.drag-over),
.dispo-tour:has(.dispo-body:empty) {
    box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(26,115,232,0.15);
}

/* Empty drop zone */
.dispo-body:empty::after {
    content: 'Zeilen hierher ziehen';
    display: block;
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.dispo-body {
    min-height: 40px;
}

/* ===================== ROW COLOR CATEGORIES ===================== */
.row-sonder td:not(.tour-number-cell):not(.drag-handle)        { background: #fef3c7 !important; }
.row-turnschwimm td:not(.tour-number-cell):not(.drag-handle)   { background: #dbeafe !important; }
.row-schule td:not(.tour-number-cell):not(.drag-handle)        { background: #dcfce7 !important; }
.row-verstärker td:not(.tour-number-cell):not(.drag-handle),
.row-verstaerker td:not(.tour-number-cell):not(.drag-handle)   { background: #fce7f3 !important; }
.row-reserve td:not(.tour-number-cell):not(.drag-handle)       { background: #e0e7ff !important; }
.row-pause td:not(.tour-number-cell):not(.drag-handle)         { background: #f3e8ff !important; }
.row-transfer td:not(.tour-number-cell):not(.drag-handle)      { background: #ccfbf1 !important; }

/* Durchgestrichen-Markierung (unabhängig von Hintergrundfarbe) */
.row-strike td:not(.tour-number-cell):not(.drag-handle) {
    text-decoration: line-through !important;
    text-decoration-thickness: 2px;
    text-decoration-color: #dc2626;
    color: var(--text-muted) !important;
    opacity: 0.75;
}

.row-sonder td:not(.tour-number-cell):not(.drag-handle):not(:last-child),
.row-turnschwimm td:not(.tour-number-cell):not(.drag-handle):not(:last-child),
.row-schule td:not(.tour-number-cell):not(.drag-handle):not(:last-child),
.row-verstärker td:not(.tour-number-cell):not(.drag-handle):not(:last-child),
.row-verstaerker td:not(.tour-number-cell):not(.drag-handle):not(:last-child),
.row-reserve td:not(.tour-number-cell):not(.drag-handle):not(:last-child),
.row-pause td:not(.tour-number-cell):not(.drag-handle):not(:last-child),
.row-transfer td:not(.tour-number-cell):not(.drag-handle):not(:last-child) {
    color: var(--text-muted) !important;
}

/* Spezialzeilen Pause / Transfer */
.row-pause td,
.row-transfer td {
    padding-top: 0.15rem !important;
    padding-bottom: 0.15rem !important;
    font-size: 0.8rem;
    line-height: 1.2;
}
.row-pause .special-label,
.row-transfer .special-label {
    font-weight: 600;
    font-style: italic;
    text-align: center;
}

/* Farblegende */
.color-legend {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.dot-sonder      { background: #fef3c7; border: 1px solid #f59e0b; }
.dot-turnschwimm  { background: #dbeafe; border: 1px solid #3b82f6; }
.dot-schule       { background: #dcfce7; border: 1px solid #22c55e; }
.dot-verstaerker  { background: #fce7f3; border: 1px solid #ec4899; }
.dot-reserve      { background: #e0e7ff; border: 1px solid #6366f1; }
.dot-pause        { background: #f3e8ff; border: 1px solid #c084fc; }
.dot-transfer     { background: #ccfbf1; border: 1px solid #2dd4bf; }
.dot-strike       { background: #fff; border: 1px solid #dc2626; position: relative; }
.dot-strike::after { content: ''; position: absolute; left: 1px; right: 1px; top: 50%; height: 2px; background: #dc2626; transform: translateY(-50%) rotate(-12deg); }

/* Rechtsklick Kontextmenü */
.color-context-menu {
    display: none;
    position: absolute;
    z-index: 3000;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 180px;
    overflow: hidden;
}

.color-menu-title {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.color-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.1s;
}

.color-menu-item:hover {
    background: var(--bg);
}

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    flex-shrink: 0;
}

.dot-none {
    background: #fff;
    border: 2px dashed var(--border);
}

/* Ausgeschnittene Zeile (Zwischenablage) */
.dispo-row.row-clipboard-cut {
    opacity: 0.5;
    outline: 2px dashed #f87171;
    outline-offset: -2px;
    background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(248,113,113,0.06) 8px, rgba(248,113,113,0.06) 16px);
}
.dispo-row.row-clipboard-cut td {
    text-decoration: line-through;
    text-decoration-color: rgba(220,38,38,0.4);
}

.color-menu-item kbd {
    margin-left: auto;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary, var(--bg));
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===================== UNDO TOAST ===================== */
.undo-toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--sidebar-bg);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 3000;
    transition: bottom 0.3s ease;
}

.undo-toast.show {
    bottom: 24px;
}

.undo-btn {
    background: rgba(255,255,255,0.15) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,0.3) !important;
    font-weight: 600;
}

.undo-btn:hover {
    background: rgba(255,255,255,0.25) !important;
}

/* ===================== FILTER BAR ===================== */
.filter-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.filter-select {
    width: auto !important;
    min-width: 180px;
    padding: 0.35rem 0.6rem !important;
    font-size: 0.85rem !important;
}

/* ===================== SHIFT TABS ===================== */
.shift-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.shift-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.shift-tab:hover { background: var(--bg); }
.shift-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.shift-tab-early.active { background: #f59e0b; border-color: #f59e0b; }
.shift-tab-late.active { background: #6366f1; border-color: #6366f1; }
.shift-tab-night.active { background: #1e293b; border-color: #1e293b; }

.shift-count {
    background: rgba(255,255,255,0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.75rem;
}

.shift-tab:not(.active) .shift-count {
    background: var(--bg);
    color: var(--text-muted);
}

/* Schicht-Sektionen */
.shift-section {
    margin-bottom: 1.5rem;
}

.shift-section-title {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shift-section-early .shift-section-title { border-bottom-color: #f59e0b; color: #92400e; }
.shift-section-late .shift-section-title { border-bottom-color: #6366f1; color: #3730a3; }
.shift-section-night .shift-section-title { border-bottom-color: #1e293b; color: #1e293b; }

.shift-section-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: auto;
}

/* Nacht-Badge */
.badge-night { background: #1e293b; color: #e2e8f0; }

/* ===================== URLAUBSPLAN ===================== */
.stat-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    text-align: center;
    min-width: 100px;
}
.stat-card .stat-num { font-size: 1.5rem; font-weight: 700; color: var(--primary, #1a73e8); }
.stat-card .stat-lbl { font-size: 0.8rem; color: var(--text-muted, #64748b); }

.badge-vac-urlaub { background: #dbeafe; color: #1e40af; }
.badge-vac-krank { background: #fee2e2; color: #991b1b; }
.badge-vac-sonder { background: #fef3c7; color: #92400e; }
.badge-vac-frei { background: #dcfce7; color: #166534; }
.badge-vac-termin { background: #ede9fe; color: #5b21b6; }
.badge-vac-arzt { background: #fce7f3; color: #9d174d; }
.badge-vac-fortbildung { background: #cffafe; color: #155e75; }
.badge-vac-dienstreise { background: #e0e7ff; color: #3730a3; }
.badge-vac-mutterschutz { background: #ffe4e6; color: #9f1239; }
.badge-vac-elternzeit { background: #fef9c3; color: #854d0e; }
.badge-vac-unbezahlt { background: #f3f4f6; color: #374151; }
.badge-vac-sonstiges { background: #e2e8f0; color: #1e293b; }

.status-select {
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
    cursor: pointer;
    background: #fff;
}
.status-beantragt { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.status-genehmigt { background: #dcfce7; color: #166534; border-color: #22c55e; }
.status-abgelehnt { background: #fee2e2; color: #991b1b; border-color: #ef4444; }

.vac-row-abgelehnt td { opacity: 0.5; text-decoration: line-through; }

/* ===================== TAGESTYP BADGES ===================== */
.badge-daytype-schultag { background: #dbeafe; color: #1e40af; }
.badge-daytype-schule_mo_fr { background: #e0f2fe; color: #075985; }
.badge-daytype-ferien { background: #dcfce7; color: #166534; }
.badge-daytype-schule_montag,
.badge-daytype-schule_dienstag,
.badge-daytype-schule_mittwoch,
.badge-daytype-schule_donnerstag,
.badge-daytype-schule_freitag { background: #e0f2fe; color: #075985; }
.badge-daytype-ferien_montag,
.badge-daytype-ferien_dienstag,
.badge-daytype-ferien_mittwoch,
.badge-daytype-ferien_donnerstag,
.badge-daytype-ferien_freitag { background: #dcfce7; color: #166534; }
.badge-daytype-samstag { background: #fef3c7; color: #92400e; }
.badge-daytype-sonntag { background: #fce7f3; color: #9d174d; }
.badge-daytype-montag { background: #e0e7ff; color: #3730a3; }
.badge-daytype-dienstag { background: #ccfbf1; color: #115e59; }
.badge-daytype-mittwoch { background: #fef9c3; color: #854d0e; }
.badge-daytype-donnerstag { background: #ede9fe; color: #5b21b6; }
.badge-daytype-freitag { background: #ffe4e6; color: #9f1239; }
.badge-daytype-sondertag { background: #fef2f2; color: #991b1b; }

/* ===================== SORTIERBARE SPALTEN ===================== */
.sortable-th:hover { background: #e2e8f0; }

/* ===================== SIDEBAR LOGO ===================== */
.sidebar-logo {
    max-width: 100%;
    max-height: 52px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.22));
}

.sidebar-word-logo {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    color: #f1f5f9;
    font-size: 1.85rem;
    font-weight: 850;
    letter-spacing: -0.035em;
    line-height: 1;
    text-decoration: none;
    filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.35));
}

.sidebar-word-logo span { color: #7dd3fc; }

/* ===================== SETTINGS PAGE ===================== */
.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.settings-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.settings-tab:hover { background: var(--bg); }
.settings-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.settings-panel { display: none; }
.settings-panel.active { display: block; }

/* Farbschema-Auswahl */
.color-scheme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.scheme-option {
    cursor: pointer;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    transition: all 0.2s;
}

.scheme-option:hover { border-color: var(--primary); }
.scheme-option.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,0.2); }
.scheme-option input[type="radio"] { display: none; }

.scheme-preview {
    display: flex;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

.scheme-sidebar { width: 30%; }
.scheme-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0.5rem; }
.scheme-accent { width: 60%; height: 12px; border-radius: 4px; }

.scheme-label { font-size: 0.8rem; font-weight: 500; color: var(--text); }

/* Logo-Vorschau */
.logo-preview-box {
    width: 120px;
    height: 70px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ===================== FAHRZEUG-ZEITLEISTE ===================== */
.vehicle-timeline-card {
    border-left: 4px solid var(--primary, #1a73e8);
}
.vehicle-timeline-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.timeline-toolbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.timeline-filter-group {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}
.timeline-icon-btn {
    width: 28px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.timeline-icon-btn.active {
    background: var(--primary, #1a73e8);
    border-color: var(--primary, #1a73e8);
    color: #fff;
}
.timeline-container {
    position: relative;
    min-height: 40px;
}
.timeline-header {
    display: flex;
    position: relative;
    height: 18px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    margin-bottom: 2px;
    font-size: 0.6rem;
    color: var(--text-muted, #94a3b8);
    user-select: none;
}
.timeline-hour-mark {
    position: absolute;
    top: 0;
    text-align: center;
    border-left: 1px solid var(--border, #e2e8f0);
    height: 100%;
    line-height: 18px;
    padding-left: 2px;
}
.timeline-row {
    display: flex;
    align-items: center;
    height: 20px;
    margin-bottom: 1px;
    position: relative;
}
.timeline-row-standby .timeline-bar-area {
    background: color-mix(in srgb, var(--success, #16a34a), transparent 92%);
}
.timeline-row-workshop .timeline-label {
    color: #991b1b;
}
.timeline-row-workshop .timeline-label i,
.timeline-row-blocked .timeline-label i {
    color: #dc2626 !important;
}
.timeline-row-blocked .timeline-label {
    color: #991b1b;
}
.timeline-row-workshop .timeline-bar-area,
.timeline-row-blocked .timeline-bar-area {
    background: color-mix(in srgb, #dc2626, transparent 92%);
}
.timeline-label {
    width: 90px;
    min-width: 90px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 0.3rem;
}
.timeline-bar-area {
    flex: 1;
    position: relative;
    height: 100%;
    background: var(--card-bg, #f8fafc);
    border-radius: 4px;
    min-width: 0;
}
.timeline-block {
    position: absolute;
    top: 1px;
    height: 18px;
    border-radius: 3px;
    font-size: 0.6rem;
    line-height: 18px;
    padding: 0 4px;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    min-width: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: opacity 0.15s;
}
.timeline-block:hover {
    opacity: 0.85;
    z-index: 2;
}
.timeline-standby-chip {
    position: absolute;
    left: 0.35rem;
    top: 2px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.4rem;
    border: 1px solid color-mix(in srgb, var(--success, #16a34a), transparent 55%);
    border-radius: 3px;
    background: color-mix(in srgb, var(--success, #16a34a), transparent 86%);
    color: #15803d;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 16px;
    pointer-events: none;
}
.timeline-status-chip {
    position: absolute;
    right: 0.35rem;
    top: 2px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.4rem;
    border-radius: 3px;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 16px;
    pointer-events: none;
    z-index: 3;
}
.timeline-workshop-chip {
    border: 1px solid color-mix(in srgb, #dc2626, transparent 48%);
    background: color-mix(in srgb, #dc2626, transparent 86%);
    color: #991b1b;
}
.timeline-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4444;
    z-index: 5;
    pointer-events: none;
}
.timeline-now-label {
    position: absolute;
    top: -18px;
    font-size: 0.65rem;
    color: #ef4444;
    font-weight: 700;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* ===================== DISPOSITION STICKY LAYOUT ===================== */
.dispo-sticky-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg, #f1f5f9);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border, #e2e8f0);
    margin: -2rem -2rem 0 -2rem;
    padding: 1.5rem 2rem 0.75rem 2rem;
}
.dispo-scroll-area {
    padding-top: 1rem;
}

/* ===================== KOMPAKTMODUS ===================== */
.compact-mode .shift-section-title {
    display: none;
}
.compact-mode .dispo-tour > .card-header {
    display: none;
}
.compact-mode .dispo-tour {
    margin-bottom: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--border, #e2e8f0);
    box-shadow: none;
}
.compact-mode .dispo-tour .card-body {
    border-radius: 0;
    padding: 0 !important;
}
.compact-mode .shift-section {
    margin-bottom: 0;
}
/* Alle thead ausblenden, nur der erste wird per JS-Klasse eingeblendet */
.compact-mode .dispo-table thead {
    display: none;
}
.compact-mode .compact-first-thead thead {
    display: table-header-group;
}
/* Tour-Nummer-Spalte im Kompaktmodus kompakt darstellen */
.compact-mode .tour-number-cell {
    background: var(--bg-secondary, #f8fafc) !important;
    color: var(--text-primary, #1e293b) !important;
    font-weight: 700;
    font-size: 0.75rem;
    text-align: center;
    padding: 0.1rem 0.2rem !important;
    border-right: 1px solid var(--border, #e2e8f0);
}
.compact-mode .tour-number-cell .tour-number-label {
    writing-mode: horizontal-tb;
    font-size: 0.75rem;
    color: var(--text-primary, #1e293b) !important;
}
/* Tour-Nummer-Header im Kompaktmodus passend stylen */
.compact-mode .th-tour-number {
    background: var(--bg-secondary, #f8fafc) !important;
    color: var(--text-primary, #1e293b) !important;
    font-weight: 700;
    font-size: 0.7rem;
    text-align: center;
    padding: 0.1rem 0.2rem !important;
    border-right: 1px solid var(--border, #e2e8f0);
}
/* Drag-Handle bleibt im Tabellen-Flow, damit rowspan-Spalten nicht nach links rutschen. */
.compact-mode .drag-handle,
.compact-mode .dispo-table thead th:first-child {
    padding: 0 0.15rem !important;
    margin: 0 !important;
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    overflow: hidden;
    font-size: 0.65rem;
    line-height: 1;
    opacity: 0.25;
}
/* Feste Spaltenbreiten damit alle Tabellen identisch ausgerichtet sind */
.compact-mode .dispo-table {
    table-layout: fixed;
    min-width: 0;
    width: 100%;
}
.compact-mode .dispo-table col:nth-child(1) { width: 18px; visibility: visible; }
.compact-mode .dispo-table col.col-tour-number { width: 54px; }
.compact-mode .dispo-table col.col-employee   { width: 14%; }
.compact-mode .dispo-table col.col-vehicle     { width: 11%; }
.compact-mode .dispo-table col.col-run         { width: 7%; }
.compact-mode .dispo-table col.col-line        { width: 5%; }
.compact-mode .dispo-table col.col-departure   { width: 5%; }
.compact-mode .dispo-table col.col-arrival     { width: 5%; }
.compact-mode .dispo-table col.col-trip        { width: 8%; }
.compact-mode .dispo-table col.col-start-stop  { width: 19%; }
.compact-mode .dispo-table col.col-end-stop    { width: 19%; }
.compact-mode .dispo-table col.col-total       { width: 0; visibility: collapse; }
.compact-mode .dispo-table col.col-actions     { width: 4%; }
.compact-mode .dispo-table th:nth-child(12),
.compact-mode .dispo-table td[data-field="total_time"],
.compact-mode .depot-travel-info,
.compact-mode .worktime-info {
    display: none !important;
}
/* Kompakt-Tour-Label: nicht mehr benoetigt, Tour-Nummer-Spalte bleibt sichtbar */
.compact-tour-label {
    display: none;
}
/* Trennlinie zwischen Touren im Kompaktmodus */
.compact-mode .dispo-body tr:last-child td {
    border-bottom: 1px solid var(--border, #e2e8f0);
}
/* Zellen im Kompaktmodus: Überlauf abschneiden */
.compact-mode .dispo-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .dispo-sticky-header {
        margin: -1rem -1rem 0 -1rem;
        padding: 1rem 1rem 0.5rem 1rem;
    }
}

/* ===== Employee Photo Styles ===== */
.employee-photo-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border, #e2e8f0);
}
.employee-photo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #94a3b8);
    font-size: 1rem;
    border: 2px solid var(--border, #e2e8f0);
}
.employee-photo-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border, #e2e8f0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.employee-photo-placeholder-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg, #f1f5f9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #94a3b8);
    font-size: 2.5rem;
    border: 3px solid var(--border, #e2e8f0);
}

/* ═══════════════════════════════════════════════
   Sonderfahrten – Kalender & Styles
   ═══════════════════════════════════════════════ */
.reminder-row { background: rgba(245, 158, 11, 0.06) !important; }
.row-cancelled td { opacity: 0.5; text-decoration: line-through; }
.status-badge { transition: all 0.2s; }
.status-badge:hover { filter: brightness(0.9); transform: scale(1.05); }

/* Kalenderansicht */
.special-calendar { width: 100%; }
.cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
}
.cal-day-name { padding: 0.5rem 0.25rem; }
.cal-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.cal-cell {
    min-height: 90px;
    border: 1px solid var(--border);
    padding: 0.25rem;
    font-size: 0.8rem;
    position: relative;
    background: var(--bg-card);
}
.cal-cell.cal-empty { background: var(--bg); opacity: 0.5; }
.cal-cell.cal-today { background: rgba(59, 130, 246, 0.06); }
.cal-cell.cal-today .cal-date { color: var(--primary); font-weight: 700; }
.cal-cell.cal-has-trips { border-color: var(--primary); }
.cal-date {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
    color: var(--text);
}
.cal-event {
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    margin-bottom: 0.15rem;
    font-size: 0.7rem;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: transform 0.15s;
}
.cal-event:hover { transform: scale(1.03); }
.cal-status-geplant { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; border-left: 3px solid #3b82f6; }
.cal-status-bestaetigt { background: rgba(34, 197, 94, 0.15); color: #15803d; border-left: 3px solid #22c55e; }
.cal-status-abgeschlossen { background: rgba(107, 114, 128, 0.15); color: #374151; border-left: 3px solid #6b7280; }
.cal-status-storniert { background: rgba(239, 68, 68, 0.12); color: #991b1b; border-left: 3px solid #ef4444; }

/* Statistik-Karten (Sonderfahrten) */
.stats-row .stat-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    min-width: 100px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
}
.stats-row .stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}
.stats-row .stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Sidebar Badge */
.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.15rem !important;
    width: 1.15rem !important;
    min-width: 1.15rem !important;
    max-width: 1.15rem !important;
    height: 1.15rem !important;
    min-height: 1.15rem !important;
    max-height: 1.15rem !important;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--sidebar-badge-start, #38bdf8), var(--sidebar-badge-end, #2563eb));
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    margin-left: auto;
    line-height: 1;
    letter-spacing: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 6px 14px var(--sidebar-badge-shadow, rgba(37, 99, 235, 0.26));
    overflow: hidden;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.sidebar-badge-vacation {
    --sidebar-badge-start: #f59e0b;
    --sidebar-badge-end: #ea580c;
    --sidebar-badge-shadow: rgba(245, 158, 11, 0.3);
}

.sidebar-badge-chat {
    --sidebar-badge-start: #22c55e;
    --sidebar-badge-end: #16a34a;
    --sidebar-badge-shadow: rgba(34, 197, 94, 0.28);
}

.sidebar-badge-email {
    --sidebar-badge-start: #38bdf8;
    --sidebar-badge-end: #2563eb;
    --sidebar-badge-shadow: rgba(56, 189, 248, 0.28);
}

/* Vacation request cards */
.vac-request-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    margin-bottom: 0.75rem;
    transition: box-shadow .15s;
}
.vac-request-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.vac-request-card .vac-info { flex: 1; }
.vac-request-card .vac-name { font-weight: 600; font-size: 0.95rem; }
.vac-request-card .vac-dates { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.vac-request-card .vac-note { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; font-style: italic; }
.vac-request-card .vac-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.vac-request-card .btn-approve { background: #22c55e; color: #fff; border: none; padding: 0.4rem 1rem; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.85rem; display: flex; align-items: center; gap: 4px; }
.vac-request-card .btn-approve:hover { background: #16a34a; }
.vac-request-card .btn-reject { background: #ef4444; color: #fff; border: none; padding: 0.4rem 1rem; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.85rem; display: flex; align-items: center; gap: 4px; }
.vac-request-card .btn-reject:hover { background: #dc2626; }

/* ── Canonical Sidebar ─────────────────────────────────
   Keep this block last. Older sidebar rules above remain for compatibility,
   but this is the single visual system used by all Flask pages. */
.sidebar {
    width: 256px !important;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 34%),
        radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.15), transparent 30%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.99) 0%, rgba(30, 41, 59, 0.98) 52%, rgba(17, 24, 39, 0.99) 100%) !important;
    border-right: 1px solid rgba(51, 65, 85, 0.68) !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28) !important;
    overflow: hidden !important;
}
.sidebar::before { display: none !important; }
.sidebar-brand {
    padding: 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
}
.sidebar-brand-shell {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.sidebar-brand-logo-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 76px !important;
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 1rem !important;
    background: rgba(255, 255, 255, 0.045) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
.sidebar-logo,
.sidebar-brand-meta,
.sidebar-footer,
.sidebar-section-static,
.sidebar-quick-links,
.sidebar-favorite-row {
    display: none !important;
}
.sidebar-word-logo {
    display: inline-flex !important;
    align-items: baseline !important;
    justify-content: center !important;
    color: #f1f5f9 !important;
    font-size: 1.85rem !important;
    font-weight: 850 !important;
    letter-spacing: -0.035em !important;
    line-height: 1 !important;
    text-decoration: none !important;
    filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.35)) !important;
}
.sidebar-word-logo span { color: #7dd3fc !important; }
.sidebar-nav {
    padding: 1rem 0.75rem !important;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent !important;
}
.sidebar-nav .sidebar-link,
.sidebar-nav li a {
    margin: 0.08rem 0 !important;
    padding: 0.62rem 0.75rem !important;
    border: 1px solid transparent !important;
    border-radius: 0.75rem !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #cbd5e1 !important;
    font-size: 0.875rem !important;
    transform: none !important;
    gap: 0.75rem !important;
}
.sidebar-nav .sidebar-link:hover,
.sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.10) !important;
    color: #fff !important;
    transform: none !important;
    border-color: transparent !important;
}
.sidebar-nav .sidebar-link.active,
.sidebar-nav li a.active {
    background: #2563eb !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24) !important;
}
.sidebar-nav .sidebar-link i,
.sidebar-nav li a i {
    width: 1.25rem !important;
    min-width: 1.25rem !important;
    height: 1.25rem !important;
    background: transparent !important;
    color: currentColor !important;
    font-size: 1rem !important;
    border-radius: 0 !important;
}
.sidebar-nav .sidebar-link span,
.sidebar-nav li a span {
    display: inline !important;
    flex: 1 !important;
    min-width: 0 !important;
    color: inherit !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
.sidebar-section-label {
    margin: 0.12rem 0 !important;
    padding: 0.62rem 0.75rem !important;
    border: 0 !important;
    border-radius: 0.75rem !important;
    background: transparent !important;
    color: #cbd5e1 !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}
.sidebar-section-label:hover {
    background: rgba(255, 255, 255, 0.10) !important;
    color: #fff !important;
}
.sidebar-section-label span {
    gap: 0.75rem !important;
    min-width: 0 !important;
}
.sidebar-section-label span i {
    width: 1.25rem !important;
    text-align: center !important;
    color: currentColor !important;
}
.sidebar-chevron {
    display: inline-block !important;
    font-size: 0.8rem !important;
    color: #94a3b8 !important;
}
.sidebar-section-items {
    margin: 0 0 0 1rem !important;
    padding: 0 0 0 0.75rem !important;
    border-left: 1px solid rgba(255, 255, 255, 0.10) !important;
}
.sidebar-section-items::before { display: none !important; }
.sidebar-section-items .sidebar-link,
.sidebar-section-items li a {
    padding: 0.52rem 0.75rem !important;
    font-size: 0.875rem !important;
    color: #94a3b8 !important;
}
.sidebar-section-items .sidebar-link:hover,
.sidebar-section-items li a:hover { color: #f1f5f9 !important; }
.sidebar-section-items .sidebar-link.active,
.sidebar-section-items li a.active {
    background: rgba(56, 189, 248, 0.15) !important;
    color: #e0f2fe !important;
    border-color: rgba(125, 211, 252, 0.20) !important;
    box-shadow: none !important;
}
.sidebar-section-items.collapsed {
    max-height: 0 !important;
    overflow: hidden !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.sidebar-badge {
    flex: 0 0 1.25rem !important;
    width: 1.25rem !important;
    min-width: 1.25rem !important;
    max-width: 1.25rem !important;
    height: 1.25rem !important;
    min-height: 1.25rem !important;
    max-height: 1.25rem !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 9999px !important;
    background: linear-gradient(135deg, var(--sidebar-badge-start, #38bdf8), var(--sidebar-badge-end, #2563eb)) !important;
    border: 1px solid rgba(255, 255, 255, 0.30) !important;
    box-shadow: 0 6px 14px var(--sidebar-badge-shadow, rgba(37, 99, 235, 0.28)) !important;
    font-size: 0.56rem !important;
    line-height: 1 !important;
    padding: 0 !important;
}
.main-content {
    margin-left: 256px !important;
    width: auto !important;
}
@media (max-width: 768px) {
    .sidebar { width: 256px !important; }
    .sidebar-nav li a span,
    .sidebar-nav .sidebar-link span,
    .sidebar-section-label { display: flex !important; }
    .sidebar-section-items.collapsed {
        max-height: 0 !important;
        overflow: hidden !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    .main-content {
        margin-left: 256px !important;
        padding: 1rem !important;
    }
}
