/* ══════════════════════════════════════════════
   BAFA-Manager – Stylesheet
   Farbgebung: Blau/Weiß
   © 2026 Datenschutz-Nordhessen
   ══════════════════════════════════════════════ */

:root {
    --blue-dark: #1B3A5C;
    --blue-med: #2C5F8A;
    --blue-light: #3A7BBF;
    --blue-pale: #E8F0FA;
    --blue-header: #D0E1F4;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f0f4f8;
    --gray-200: #e2e8f0;
    --gray-300: #ccd5e0;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #1e293b;
    --red: #dc2626;
    --red-light: #fef2f2;
    --green: #16a34a;
    --green-light: #f0fdf4;
    --orange: #ea580c;
    --orange-light: #fff7ed;
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; background: var(--gray-100); color: var(--gray-700); font-size: 14px; line-height: 1.5; }
a { color: var(--blue-light); text-decoration: none; }
a:hover { color: var(--blue-dark); }

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

/* ── Sidebar ── */
.sidebar { width: var(--sidebar-width); background: var(--blue-dark); color: var(--white); position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100; }
.sidebar-header { padding: 20px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); position: relative; }
.logo { font-size: 28px; }
.logo-title { display: block; font-size: 16px; font-weight: 700; color: var(--white); }
.logo-sub { display: block; font-size: 11px; color: rgba(255,255,255,0.5); }
.nav-menu { list-style: none; padding: 8px 0; }
.nav-menu li a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: rgba(255,255,255,0.7); font-size: 13px; transition: all 0.15s; }
.nav-menu li a:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.nav-menu li.active a { background: rgba(255,255,255,0.12); color: var(--white); font-weight: 600; border-left: 3px solid var(--blue-light); }
.nav-icon { font-size: 16px; width: 22px; text-align: center; }
.nav-divider { border-top: 1px solid rgba(255,255,255,0.08); margin: 8px 0; }
.nav-logout { color: rgba(255,255,255,0.5) !important; }

/* ── Main ── */
.main-content { flex: 1; margin-left: var(--sidebar-width); }
.top-bar { height: var(--topbar-height); background: var(--white); border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 50; }
.page-title { font-size: 18px; font-weight: 600; color: var(--blue-dark); }
.user-info { font-size: 13px; color: var(--gray-500); }
.content-area { padding: 24px; }

/* ── Cards ── */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-200); }
.card-header h2 { font-size: 16px; color: var(--blue-dark); font-weight: 600; }

/* ── Stat Cards (Dashboard) ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; border-left: 4px solid var(--blue-light); }
.stat-card .stat-label { font-size: 12px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--blue-dark); }
.stat-card .stat-sub { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.stat-card.green { border-left-color: var(--green); }
.stat-card.orange { border-left-color: var(--orange); }
.stat-card.red { border-left-color: var(--red); }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead { background: var(--blue-pale); }
.data-table th { text-align: left; padding: 10px 12px; font-weight: 600; color: var(--blue-dark); font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; border-bottom: 2px solid var(--blue-header); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-200); vertical-align: top; }
.data-table tbody tr:hover { background: var(--gray-50); }

/* ── Status Badges ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-vorbereitung { background: var(--gray-200); color: var(--gray-700); }
.badge-angebot_vertrag { background: #dbeafe; color: #1d4ed8; }
.badge-antragstellung { background: #e0e7ff; color: #4338ca; }
.badge-bewilligung { background: #fef3c7; color: #b45309; }
.badge-beratung_laeuft { background: #d1fae5; color: #065f46; }
.badge-dokumente_rechnung { background: #cffafe; color: #0e7490; }
.badge-verwendungsnachweis { background: #fae8ff; color: #7e22ce; }
.badge-pruefung_auszahlung { background: #fff7ed; color: #c2410c; }
.badge-abgeschlossen { background: #dcfce7; color: #15803d; }
.badge-abgelehnt { background: #fee2e2; color: #b91c1c; }
.badge-storniert { background: var(--gray-200); color: var(--gray-500); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; text-decoration: none; }
.btn-primary { background: var(--blue-dark); color: var(--white); }
.btn-primary:hover { background: var(--blue-med); color: var(--white); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-success { background: var(--green); color: var(--white); }
.btn-success:hover { background: #15803d; color: var(--white); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #b91c1c; color: var(--white); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; color: var(--blue-dark); }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--gray-300); border-radius: 6px; font-size: 14px; font-family: inherit; transition: border-color 0.15s; background: var(--white); }
.form-control:focus { border-color: var(--blue-light); outline: none; box-shadow: 0 0 0 3px rgba(58,123,191,0.12); }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: var(--green-light); border: 1px solid #bbf7d0; color: #166534; }
.alert-error { background: var(--red-light); border: 1px solid #fecaca; color: #991b1b; }
.alert-warning { background: var(--orange-light); border: 1px solid #fed7aa; color: #9a3412; }
.alert-info { background: var(--blue-pale); border: 1px solid var(--blue-header); color: var(--blue-dark); }

/* ── Checkliste ── */
.checklist-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--gray-200); }
.checklist-item:last-child { border-bottom: none; }
.checklist-cb { width: 20px; height: 20px; accent-color: var(--blue-light); margin-top: 2px; cursor: pointer; }
.checklist-text { flex: 1; }
.checklist-task { font-weight: 600; font-size: 13px; color: var(--gray-900); }
.checklist-detail { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.checklist-who { font-size: 11px; padding: 2px 8px; background: var(--blue-pale); border-radius: 10px; color: var(--blue-med); white-space: nowrap; }
.checklist-item.done .checklist-task { text-decoration: line-through; color: var(--gray-500); }

/* ── Dokument-Kategorien ── */
.doc-cat { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--blue-pale); color: var(--blue-dark); }

/* ── Login ── */
.login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-med) 100%); }
.login-card { background: var(--white); border-radius: 12px; box-shadow: var(--shadow-md); padding: 40px; width: 100%; max-width: 400px; text-align: center; }
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-card h1 { color: var(--blue-dark); font-size: 22px; margin-bottom: 4px; }
.login-sub { color: var(--gray-500); font-size: 13px; margin-bottom: 24px; }
.login-card label { text-align: left; display: block; font-weight: 600; font-size: 13px; color: var(--blue-dark); margin-bottom: 6px; }
.login-card input { width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300); border-radius: 6px; font-size: 14px; margin-bottom: 16px; }
.login-card input:focus { border-color: var(--blue-light); outline: none; box-shadow: 0 0 0 3px rgba(58,123,191,0.15); }
.login-footer { margin-top: 24px; font-size: 11px; color: var(--gray-500); }

/* ── Hamburger Menu Button ── */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 10px; margin-right: 8px; flex-shrink: 0; -webkit-tap-highlight-color: rgba(0,0,0,0.1); touch-action: manipulation; text-decoration: none; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--blue-dark); margin: 5px 0; border-radius: 2px; pointer-events: none; }
.top-bar-left { display: flex; align-items: center; }

/* ── Sidebar Overlay ── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 90; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sidebar-overlay.active { display: block; }

/* ── Sidebar Close (Mobile) ── */
.sidebar-close { display: none; position: absolute; top: 12px; right: 12px; background: none; border: none; color: rgba(255,255,255,0.7); font-size: 22px; cursor: pointer; line-height: 1; padding: 8px; -webkit-tap-highlight-color: rgba(255,255,255,0.2); touch-action: manipulation; text-decoration: none; }
.sidebar-close:hover { color: var(--white); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; z-index: 110; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .top-bar { padding: 0 16px; }
    .content-area { padding: 16px; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 6px; }
    .card { padding: 16px; }
    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; justify-content: center; }
}

/* ── Print ── */
@media print {
    .sidebar, .top-bar { display: none; }
    .main-content { margin-left: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
