:root {
    --siko-fehler: #dc3545;
    --siko-warnung: #fd7e14;
    --siko-ok: #198754;
    --siko-ausstehend: #0d6efd;
    --siko-sidebar-bg: #1f2937;
    --siko-sidebar-hover: #374151;
}

html, body { height: 100%; }
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Layout */
.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.app-sidebar {
    background-color: var(--siko-sidebar-bg);
    color: #e5e7eb;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.app-sidebar .brand {
    padding: 0 1.25rem 1rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: white;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-bottom: 1px solid #374151;
    margin-bottom: .75rem;
}

.app-sidebar .active-va {
    padding: .5rem 1.25rem;
    font-size: .8rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.app-sidebar .active-va-name {
    font-size: .95rem;
    color: #f3f4f6;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    margin-top: .15rem;
}

.app-sidebar .sidebar-group {
    padding: 1rem 1.25rem 0.35rem;
    color: #6b7280;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.app-sidebar nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem 1.25rem;
    color: #d1d5db;
    text-decoration: none;
    font-size: .94rem;
    border-left: 3px solid transparent;
}
.app-sidebar nav a:hover {
    background-color: var(--siko-sidebar-hover);
    color: white;
}
.app-sidebar nav a.active {
    background-color: var(--siko-sidebar-hover);
    color: white;
    border-left-color: #60a5fa;
}
.app-sidebar nav a i {
    width: 1.1rem;
    text-align: center;
}

.app-main { display: flex; flex-direction: column; min-width: 0; }

.app-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.app-header .ampel {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.app-header .ampel-ok { background-color: var(--siko-ok); }
.app-header .ampel-warnung { background-color: var(--siko-warnung); }
.app-header .ampel-fehler { background-color: var(--siko-fehler); }
.app-header .ampel-ausstehend { background-color: var(--siko-ausstehend); }

.app-content {
    padding: 1.5rem;
    flex: 1;
}

.page-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.page-title h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

/* Tables */
.table-sticky thead th {
    position: sticky;
    top: 56px;
    background: white;
    z-index: 5;
    border-bottom: 2px solid #dee2e6;
}
.table-hover tbody tr:hover { background-color: #f1f5f9; }

/* Fundstellen badges */
.fundstelle {
    display: inline-block;
    background-color: #eef2ff;
    color: #3730a3;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: .78rem;
    margin: 1px 3px 1px 0;
    white-space: nowrap;
}
.fundstelle-input {
    min-width: 220px;
}

/* Inline edit */
.inline-edit {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    padding: 2px 4px;
    border-radius: 3px;
}
.inline-edit:hover { background-color: #fef9c3; border-bottom-color: #a16207; }
.inline-edit.editing { background-color: #fffbeb; }
.inline-edit input {
    width: 100%;
    border: 1px solid #d1d5db;
    padding: 2px 4px;
    font-size: inherit;
    font-family: inherit;
}

/* Dashboard cards */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    height: 100%;
}
.stat-card .stat-label { color: #6b7280; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 600; margin-top: .25rem; }
.stat-card .stat-sub { font-size: .85rem; color: #6b7280; margin-top: .25rem; }

.status-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    margin-right: .35rem;
}

/* Activity */
.activity-item {
    display: flex; gap: .75rem; padding: .65rem 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: .92rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-item time {
    color: #6b7280; font-size: .8rem; white-space: nowrap;
    flex-shrink: 0; width: 120px;
}

/* Toast-Position */
.toast-container {
    position: fixed; top: 72px; right: 1rem; z-index: 1080;
}

/* Narrow screens */
@media (max-width: 768px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar { position: static; height: auto; }
    .table-sticky thead th { position: static; }
}
