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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a2e;
    background: #f5f6fa;
    min-height: 100vh;
}

/* Navigation */
nav {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

nav .logo { font-weight: 600; color: #1a1a2e; }

nav .nav-links { display: flex; gap: 2px; }

nav a {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: background .15s, color .15s;
}
nav a:hover  { background: #f1f5f9; color: #1a1a2e; }
nav a.active { background: #eff6ff; color: #2563eb; }

nav .user-info { color: #64748b; font-size: 13px; display: flex; align-items: center; gap: 12px; }
nav .user-info a { color: #94a3b8; padding: 0; background: none; font-weight: 400; }
nav .user-info a:hover { color: #64748b; background: none; }

/* Layout */
main { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* Cards */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.card h2 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a2e;
}

/* Formulare */
.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 12px;
}

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.grow { flex: 1; min-width: 140px; }
.form-group.small { width: 130px; }

label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .03em;
}

input[type=text], input[type=email], input[type=password],
input[type=date], input[type=number], select, textarea {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a2e;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* Buttons */
.btn {
    padding: 7px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background .15s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.5;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #f1f5f9; color: #374151; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: none; border: 1px solid #dde1e7; border-radius: 4px; color: #94a3b8; font-size: 15px; cursor: pointer; width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-danger:hover { border-color: #ef4444; color: #ef4444; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 0 8px 10px 0;
    border-bottom: 1px solid #e2e8f0;
}
td {
    padding: 9px 8px 9px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }
.td-right { text-align: right; padding-right: 0; }
.td-actions { text-align: right; white-space: nowrap; padding-right: 0; vertical-align: middle; }
.td-actions form { display: inline-flex; }
.text-muted { color: #94a3b8; }
.text-strong { font-weight: 600; color: #1a1a2e; }
.text-right { text-align: right; }

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 13px;
}
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid #e2e8f0; margin-bottom: 20px; }
.tab {
    padding: 8px 16px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
    transition: color .15s;
}
.tab:hover  { color: #1a1a2e; }
.tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.tab-panel  { display: none; }
.tab-panel.active { display: block; }

/* Heute-Zusammenfassung */
.summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 14px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}
.summary-total { font-weight: 700; font-size: 16px; color: #2563eb; }

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f6fa;
}
.login-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 36px 32px;
    width: 100%;
    max-width: 360px;
}
.login-box h1 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.login-box .sub { color: #64748b; margin-bottom: 24px; font-size: 13px; }
.login-box .form-group { margin-bottom: 14px; }

/* Auswertung Druckkopf */
.print-header { display: none; }

/* Gruppen-Header in Auswertung */
.group-customer {
    background: #1e293b;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}
.group-project {
    background: #f8fafc;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    font-weight: 500;
    border-left: 3px solid #3b82f6;
    border-bottom: 1px solid #e2e8f0;
}
.group-task-header {
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
}
.group-entries table { margin: 0; }
.group-entries td { padding-left: 16px; }
.group-wrap { border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; margin-bottom: 20px; }

/* Gesamtsumme */
.total-bar {
    background: #1e293b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 15px;
    margin-top: 8px;
}

/* Stats-Karten */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
}
.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.1;
}
.stat-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Übersicht-Karte im Filterergebnis */
.summary-stats {
    display: flex;
    gap: 0;
}
.summary-stat {
    flex: 1;
    padding: 4px 20px 4px 0;
    border-right: 1px solid #e2e8f0;
    margin-right: 20px;
}
.summary-stat:last-child {
    border-right: none;
    margin-right: 0;
}
.summary-stat--wide {
    flex: 2;
}

/* Diagramme */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.chart-card h3 {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 14px;
}

/* Print */
@media print {
    nav, .no-print { display: none !important; }
    body { background: #fff; font-size: 12px; }
    main { padding: 0; max-width: 100%; }
    .card { border: none; padding: 0; }
    .print-header { display: block; margin-bottom: 20px; }
    .print-header h1 { font-size: 18px; }
    .group-customer { background: #000 !important; color: #fff !important; -webkit-print-color-adjust: exact; }
    .total-bar { background: #000 !important; color: #fff !important; -webkit-print-color-adjust: exact; }
}
