* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Open Sans', sans-serif; background: #f5f6fa; color: #333; }

/* --- Login --- */
.login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1A3460; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; text-align: center; width: 360px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.login-box h1 { color: #1A3460; font-size: 24px; margin-bottom: 4px; }
.login-box p { color: #666; margin-bottom: 24px; font-size: 14px; }
.login-box input { width: 100%; padding: 12px; border: 2px solid #ddd; border-radius: 8px; font-size: 15px; margin-bottom: 16px; }
.login-box input:focus { border-color: #3565A9; outline: none; }
.login-box button { width: 100%; padding: 12px; background: #1A3460; color: #fff; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: 600; }
.login-box button:hover { background: #3565A9; }
.error { color: #e53e3e; margin-top: 12px; font-size: 13px; }

/* --- Navigation --- */
.topnav { display: flex; align-items: center; background: #1A3460; color: #fff; padding: 0 24px; height: 56px; position: sticky; top: 0; z-index: 100; }
.nav-brand { font-weight: 700; font-size: 16px; margin-right: 32px; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link { color: rgba(255,255,255,0.7); text-decoration: none; padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 600; transition: all 0.2s; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.15); }
.btn-logout { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-logout:hover { background: rgba(255,255,255,0.1); }

/* --- Content --- */
.content { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* --- Dashboard --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.stat-card .stat-value { font-size: 32px; font-weight: 700; color: #1A3460; }
.stat-card .stat-label { font-size: 13px; color: #888; margin-top: 4px; }

.section-title { font-size: 18px; font-weight: 700; color: #1A3460; margin: 24px 0 12px; }

/* --- Listings Table --- */
.filters-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters-bar select, .filters-bar input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; background: #fff; }
.filters-bar select:focus, .filters-bar input:focus { border-color: #3565A9; outline: none; }
.filters-bar label { font-size: 13px; display: flex; align-items: center; gap: 4px; }

.listings-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.listings-table th { background: #1A3460; color: #fff; padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }
.listings-table th:hover { background: #3565A9; }
.listings-table td { padding: 10px 16px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.listings-table tr:hover { background: #f8f9ff; cursor: pointer; }
.listings-table tr.privat { background: #fffbeb; }

.score-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-weight: 700; font-size: 13px; color: #fff; }
.score-high { background: #38a169; }
.score-mid { background: #dd6b20; }
.score-low { background: #a0aec0; }

.status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.status-neu { background: #ebf4ff; color: #3565A9; }
.status-interessant { background: #f0fff4; color: #38a169; }
.status-kontaktiert { background: #fffbeb; color: #dd6b20; }
.status-abgelehnt { background: #fff5f5; color: #e53e3e; }
.status-gekauft { background: #f0fff4; color: #276749; font-weight: 700; }

.portal-badge { font-size: 11px; color: #666; background: #f0f0f0; padding: 2px 6px; border-radius: 4px; }
.privat-badge { font-size: 11px; color: #d69e2e; background: #fffbeb; padding: 2px 6px; border-radius: 4px; font-weight: 600; }

/* --- Detail --- */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.detail-header h2 { font-size: 20px; color: #1A3460; }
.back-link { color: #3565A9; text-decoration: none; font-size: 14px; }
.back-link:hover { text-decoration: underline; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.detail-card { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.detail-card h3 { font-size: 14px; color: #1A3460; margin-bottom: 12px; font-weight: 700; }

.detail-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f5f5f5; font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: #888; }
.detail-value { font-weight: 600; }

.status-buttons { display: flex; gap: 8px; margin: 16px 0; }
.status-btn { padding: 8px 16px; border: 2px solid; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; background: #fff; transition: all 0.2s; }
.status-btn:hover { transform: translateY(-1px); }
.status-btn.active { color: #fff; }
.status-btn[data-status="interessant"] { border-color: #38a169; color: #38a169; }
.status-btn[data-status="interessant"].active { background: #38a169; }
.status-btn[data-status="kontaktiert"] { border-color: #dd6b20; color: #dd6b20; }
.status-btn[data-status="kontaktiert"].active { background: #dd6b20; }
.status-btn[data-status="abgelehnt"] { border-color: #e53e3e; color: #e53e3e; }
.status-btn[data-status="abgelehnt"].active { background: #e53e3e; }
.status-btn[data-status="gekauft"] { border-color: #276749; color: #276749; }
.status-btn[data-status="gekauft"].active { background: #276749; }

textarea.notizen { width: 100%; min-height: 80px; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; font-size: 13px; resize: vertical; }
textarea.notizen:focus { border-color: #3565A9; outline: none; }
.btn-save { background: #3565A9; color: #fff; border: none; padding: 8px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; margin-top: 8px; }
.btn-save:hover { background: #1A3460; }

.inserat-link { display: inline-block; background: #3565A9; color: #fff; padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px; margin-top: 12px; }
.inserat-link:hover { background: #1A3460; }

/* --- Suchprofile --- */
.profil-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.profil-card { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.profil-card h3 { color: #1A3460; margin-bottom: 8px; }
.profil-meta { font-size: 13px; color: #666; line-height: 1.8; }
.profil-toggle { margin-top: 12px; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 24px; transition: 0.3s; }
.toggle-slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s; }
.toggle-switch input:checked + .toggle-slider { background: #38a169; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.pagination button { padding: 6px 14px; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; }
.pagination button.active { background: #1A3460; color: #fff; border-color: #1A3460; }
.pagination button:hover:not(.active) { background: #f0f0f0; }

/* --- ZVG Termin Badges --- */
.zvg-termin-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.termin-urgent { background: #fff5f5; color: #e53e3e; }
.termin-soon { background: #fffbeb; color: #dd6b20; }
.termin-later { background: #ebf4ff; color: #3565A9; }
.termin-past { background: #f0f0f0; color: #999; text-decoration: line-through; }

.status-recherchiert { background: #e9d8fd; color: #6b46c1; }
.status-teilgenommen { background: #bee3f8; color: #2b6cb0; }

.status-btn[data-status="recherchiert"] { border-color: #6b46c1; color: #6b46c1; }
.status-btn[data-status="recherchiert"].active { background: #6b46c1; }
.status-btn[data-status="teilgenommen"] { border-color: #2b6cb0; color: #2b6cb0; }
.status-btn[data-status="teilgenommen"].active { background: #2b6cb0; }

/* --- Scoring Breakdown --- */
.scoring-breakdown { padding: 4px 0; }
.scoring-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.scoring-label { width: 80px; color: #666; flex-shrink: 0; }
.scoring-bar-bg { flex: 1; height: 16px; background: #f0f0f0; border-radius: 8px; overflow: hidden; }
.scoring-bar-fill { height: 100%; border-radius: 8px; transition: width 0.3s; min-width: 2px; }
.scoring-pts { width: 50px; text-align: right; font-weight: 600; color: #333; flex-shrink: 0; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filters-bar { flex-direction: column; }
  .nav-links { display: none; }
}
