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

/* Login */
.login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.login-box { background: #fff; padding: 2.5rem; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.1); width: 100%; max-width: 380px; text-align: center; }
.login-box h1 { font-size: 1.6rem; color: #2d3748; margin-bottom: 0.2rem; }
.login-box .subtitle { color: #718096; margin-bottom: 1.5rem; font-size: 0.95rem; }
.form-group { margin-bottom: 1rem; }
.form-group input { width: 100%; padding: 0.75rem 1rem; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 1rem; transition: border-color 0.2s; }
.form-group input:focus { outline: none; border-color: #4299e1; }
button, .btn-primary { padding: 0.6rem 1.2rem; background: #4299e1; color: #fff; border: none; border-radius: 8px; font-size: 0.9rem; cursor: pointer; transition: background 0.2s; }
button:hover, .btn-primary:hover { background: #3182ce; }
.btn-secondary { background: #e2e8f0; color: #4a5568; }
.btn-secondary:hover { background: #cbd5e0; }
.error { background: #fed7d7; color: #c53030; padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }

/* Dashboard */
.dashboard { max-width: 1400px; margin: 0 auto; padding: 1rem; }
header { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 0; border-bottom: 2px solid #e2e8f0; margin-bottom: 1rem; }
header h1 { font-size: 1.3rem; color: #2d3748; }
.btn-logout { color: #e53e3e; text-decoration: none; font-size: 0.85rem; padding: 0.4rem 0.8rem; border: 1px solid #e53e3e; border-radius: 6px; }
.btn-logout:hover { background: #e53e3e; color: #fff; }

/* Stats */
.stats-bar { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.stat-item { background: #fff; padding: 1rem 1.5rem; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,0.06); flex: 1; min-width: 140px; text-align: center; }
.stat-num { display: block; font-size: 1.6rem; font-weight: 700; color: #4299e1; }
.stat-label { font-size: 0.75rem; color: #718096; text-transform: uppercase; letter-spacing: 0.5px; }

/* Filters */
.filter-bar { background: #fff; padding: 1rem 1.5rem; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,0.06); margin-bottom: 1rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-group label { font-size: 0.75rem; color: #718096; text-transform: uppercase; font-weight: 600; }
.filter-group input, .filter-group select { padding: 0.45rem 0.6rem; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.85rem; }
.small-input { width: 90px; }
.range-inputs { display: flex; gap: 0.3rem; align-items: center; }
.range-inputs input { width: 100px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.checkbox-group label { font-size: 0.8rem; background: #edf2f7; padding: 0.25rem 0.6rem; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.checkbox-group label.active { background: #4299e1; color: #fff; }
.checkbox-label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem !important; cursor: pointer; }
.filter-actions { margin-top: 0.8rem; display: flex; gap: 0.5rem; }

/* Listings Grid */
.listings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.loading { grid-column: 1/-1; text-align: center; padding: 3rem; color: #718096; }

/* Listing Card */
.listing-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,0.06); overflow: hidden; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; position: relative; }
.listing-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.card-img { width: 100%; height: 180px; object-fit: cover; background: #e2e8f0; display: block; }
.card-img-placeholder { width: 100%; height: 180px; background: #e2e8f0; display: flex; align-items: center; justify-content: center; color: #a0aec0; font-size: 2rem; }
.card-body { padding: 0.8rem; }
.card-address { font-weight: 600; font-size: 0.9rem; color: #2d3748; margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-area { display: inline-block; font-size: 0.7rem; background: #edf2f7; color: #4a5568; padding: 0.15rem 0.5rem; border-radius: 3px; margin-bottom: 0.4rem; }
.card-price { font-size: 1.1rem; font-weight: 700; color: #48bb78; }
.card-price-dkk { font-size: 0.75rem; color: #a0aec0; }
.card-details { display: flex; gap: 0.6rem; font-size: 0.8rem; color: #718096; margin-top: 0.4rem; flex-wrap: wrap; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid #f0f0f0; }
.card-days { font-size: 0.75rem; color: #a0aec0; }
.card-changes { font-size: 0.75rem; color: #e53e3e; }
.card-actions { display: flex; gap: 0.5rem; align-items: center; }
.btn-fav { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 0.2rem; color: #cbd5e0; transition: color 0.2s; }
.btn-fav.active { color: #ecc94b; }
.btn-fav:hover { color: #d69e2e; }
.btn-link { background: none; border: none; font-size: 0.8rem; cursor: pointer; color: #4299e1; padding: 0.2rem; text-decoration: none; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal-content { background: #fff; border-radius: 12px; max-width: 700px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; padding: 2rem; }
.modal-close { position: absolute; top: 0.8rem; right: 1rem; background: none; border: none; font-size: 1.8rem; cursor: pointer; color: #a0aec0; padding: 0; line-height: 1; }
.modal-close:hover { color: #2d3748; }
.modal-img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 8px; margin-bottom: 1rem; }
.modal-address { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.3rem; }
.modal-area { font-size: 0.85rem; color: #718096; margin-bottom: 1rem; }
.modal-price { font-size: 1.5rem; font-weight: 700; color: #48bb78; margin-bottom: 1rem; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1.5rem; }
.modal-grid .label { font-size: 0.75rem; color: #a0aec0; text-transform: uppercase; }
.modal-grid .value { font-size: 0.95rem; font-weight: 600; }
.modal-section { margin-bottom: 1.5rem; }
.modal-section h3 { font-size: 0.9rem; color: #718096; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.chart-container { height: 200px; margin-bottom: 1rem; }
.note-area { width: 100%; min-height: 80px; padding: 0.6rem; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.9rem; resize: vertical; }
.rating-stars { display: flex; gap: 0.3rem; margin: 0.5rem 0; }
.rating-stars span { font-size: 1.4rem; cursor: pointer; color: #e2e8f0; transition: color 0.15s; }
.rating-stars span.active { color: #ecc94b; }
.rating-stars span:hover { color: #d69e2e; }
.modal-links { display: flex; gap: 0.8rem; margin-top: 1rem; }
.modal-links a { color: #4299e1; text-decoration: none; font-size: 0.9rem; }
.modal-links a:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 1024px) {
    .listings-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .listings-grid { grid-template-columns: 1fr; }
    .stats-bar { flex-direction: column; }
    .filter-row { flex-direction: column; }
    .range-inputs input { width: 80px; }
    header h1 { font-size: 1.1rem; }
    .modal-content { padding: 1.2rem; }
    .modal-grid { grid-template-columns: 1fr; }
}
