* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f2f5; color: #1a1a1a; min-height: 100vh; }

header {
  background: #04724D; color: white; padding: 0 32px;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: stretch; min-height: 62px;
}
header h1 { font-size: 1.1rem; font-weight: 600; align-self: center; }
.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.user-label { font-size: 0.78rem; color: rgba(255,255,255,0.5); }
.btn-logout { background: rgba(255,255,255,0.1); color: white; border: none; border-radius: 6px; padding: 5px 12px; font-size: 0.78rem; cursor: pointer; font-family: inherit; }
.btn-logout:hover { background: rgba(255,255,255,0.2); }

nav { display: flex; align-self: stretch; }
.nav-btn {
  padding: 0 22px; border: none; border-radius: 0;
  font-size: 0.88rem; font-weight: 600; letter-spacing: 0.02em; cursor: pointer;
  background: transparent; color: rgba(255,255,255,0.5);
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s, background .15s; font-family: inherit;
}
.nav-btn:hover { color: white; background: rgba(255,255,255,0.07); }
.nav-btn.active { color: white; border-bottom-color: #FC6919; background: rgba(255,255,255,0.08); }

main { max-width: 1440px; margin: 28px auto; padding: 0 28px; }
.view { display: none; }
.view.active { display: block; }

.card { background: white; border-radius: 10px; padding: 26px 30px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); margin-bottom: 24px; }
.card-title { font-size: 1.2rem; font-weight: 700; color: #333; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-header .card-title { margin-bottom: 0; }

.fg { display: grid; gap: 14px; }
.fg-2 { grid-template-columns: 1fr 1fr; }
.fg-3 { grid-template-columns: 1fr 1fr 1fr; }
.fg-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.c1 { grid-column: span 1; }
.c2 { grid-column: span 2; }
.c3 { grid-column: span 3; }
.c4 { grid-column: span 4; }

label { display: block; font-size: 0.875rem; font-weight: 600; color: #555; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
input, select, textarea {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid #e0e0e0; border-radius: 7px;
  font-size: 0.95rem; color: #1a1a1a; background: #fafafa;
  transition: border-color .15s; outline: none; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: #04724D; background: white; }
textarea { resize: vertical; min-height: 76px; }

.btn-row { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }
button { padding: 8px 18px; border-radius: 7px; border: none; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: opacity .15s; font-family: inherit; }
button:hover { opacity: 0.8; }
.btn-primary   { background: #FC6919; color: white; }
.btn-secondary { background: #e8ecf0; color: #555; }
.btn-export    { background: #04724D; color: white; font-size: 0.78rem; padding: 6px 13px; }
.btn-danger    { background: #c0392b; color: white; font-size: 0.75rem; padding: 4px 9px; }
.btn-edit      { background: #e8ecf0; color: #333; font-size: 0.75rem; padding: 4px 9px; }

.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filter-bar input  { max-width: 230px; }
.filter-bar select { max-width: 180px; }

.count-badge { background: #e8ecf0; color: #555; border-radius: 20px; padding: 2px 9px; font-size: 0.75rem; font-weight: 700; }
.badge { border-radius: 20px; padding: 2px 9px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; display: inline-block; }
.badge-status-offen      { background: #dbeafe; color: #1e40af; }
.badge-status-genehmigt  { background: #d1fae5; color: #065f46; }
.badge-status-ausgezahlt { background: #a7f3d0; color: #064e3b; }
.badge-status-storniert  { background: #fee2e2; color: #991b1b; }
.badge-isfp-ja   { background: #d1fae5; color: #065f46; }
.badge-isfp-nein { background: #fee2e2; color: #991b1b; }
.badge-partner   { background: #e0e7ff; color: #3730a3; }
.badge-massnahme { background: #fef3c7; color: #92400e; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; padding: 9px 13px; font-size: 0.75rem; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid #eee; white-space: nowrap; }
td { padding: 10px 13px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }
.actions { display: flex; gap: 5px; white-space: nowrap; }
.muted { color: #aaa; font-size: 0.78rem; }
.notizen-preview { font-size: 0.75rem; color: #888; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { text-align: center; padding: 40px 20px; color: #ccc; font-size: 0.85rem; }
.empty-state .icon { font-size: 1.8rem; margin-bottom: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { background: white; border-radius: 10px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.stat-label { font-size: 0.68rem; font-weight: 700; color: #aaa; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.stat-value { font-size: 2rem; font-weight: 800; color: #04724D; line-height: 1; }
.stat-sub   { font-size: 0.76rem; color: #ccc; margin-top: 4px; }

.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.chart-row .card { margin-bottom: 0; }

.prog-wrap { display: flex; align-items: center; gap: 7px; }
.prog-bar  { flex: 1; height: 5px; background: #eee; border-radius: 3px; min-width: 40px; }
.prog-fill { height: 100%; background: #FC6919; border-radius: 3px; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: 12px; padding: 26px; width: 100%; max-width: 640px; box-shadow: 0 8px 32px rgba(0,0,0,0.18); max-height: 92vh; overflow-y: auto; }
.modal h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 18px; }

/* Login */
.login-overlay { position: fixed; inset: 0; background: #f0f2f5; z-index: 200; display: flex; align-items: center; justify-content: center; }
.login-box { background: white; border-radius: 14px; padding: 36px 32px; width: 340px; box-shadow: 0 4px 24px rgba(0,0,0,0.12); }
.login-box h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; color: #04724D; }
.login-box p  { font-size: 0.82rem; color: #aaa; margin-bottom: 22px; }
.login-box label { margin-top: 12px; }
.login-error { background: #fee2e2; color: #991b1b; border-radius: 7px; padding: 8px 12px; font-size: 0.82rem; margin-bottom: 10px; display: none; }

.toast { position: fixed; bottom: 22px; right: 22px; background: #04724D; color: white; padding: 9px 16px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; opacity: 0; transform: translateY(8px); transition: all .2s; pointer-events: none; z-index: 300; }
.toast.show { opacity: 1; transform: translateY(0); }

mark { background: #fef08a; border-radius: 2px; padding: 0 1px; }
