:root {
    --primary: #0f172a; --secondary: #475569; --accent: #2563eb;
    --bg-light: #f8fafc; --text-dark: #1e293b; --text-muted: #64748b;
    --border-color: #e2e8f0; --success: #059669; --danger: #dc2626;
    --warning: #f59e0b;
}

body { margin: 0; padding: 0; font-family: 'Inter', sans-serif; display: flex; flex-direction: column; height: 100vh; background-color: var(--bg-light); color: var(--text-dark); overflow: hidden;}

#navbar { background: white; height: 75px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); z-index: 1000; position: relative; border-bottom: 1px solid var(--border-color);}
.logo { font-size: 1.6rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 12px; letter-spacing: -0.5px;}
.logo i { color: var(--accent); font-size: 1.8rem;}

.top-controls { display: flex; gap: 15px; align-items: center; flex: 1; justify-content: center; max-width: 900px; margin: 0 auto; width: 100%; }

/* SØGEFELT */
.search-box { display: flex; flex: 2; position: relative; border-radius: 8px; min-width: 450px; background: white; box-shadow: 0 2px 15px rgba(0,0,0,0.06); border: 1px solid var(--border-color); transition: all 0.2s;}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15); }
.search-icon { padding: 0 15px; display: flex; align-items: center; color: var(--text-muted); font-size: 1.1rem;}
.search-box input { width: 100%; padding: 16px 15px 16px 0; border: none; border-radius: 0 8px 8px 0; font-size: 1.1rem; outline: none; background: transparent; font-family: 'Inter', sans-serif; color: var(--primary); font-weight: 500;}

.autocomplete-items { position: absolute; border: 1px solid var(--border-color); z-index: 1000; top: 110%; left: 0; right: 0; background-color: #fff; max-height: 300px; overflow-y: auto; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); display: none;}
.autocomplete-items.active { display: block; }
.autocomplete-items div { padding: 14px 20px; cursor: pointer; border-bottom: 1px solid var(--border-color); font-size: 1rem; color: var(--primary); display: flex; align-items: center; gap: 12px; font-weight: 500;}
.autocomplete-items div:hover { background-color: var(--bg-light); color: var(--accent); }

.stats-badge { background: #f1f5f9; padding: 10px 18px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; color: var(--secondary); border: 1px solid var(--border-color);}

/* DASHBOARD LAYOUT */
#main-container { display: flex; height: calc(100vh - 75px); background: var(--bg-light); padding: 20px; box-sizing: border-box; gap: 20px; }

#left-panel { flex: 0 0 25%; display: flex; flex-direction: column; gap: 20px; min-width: 320px; }

#map { flex: 1; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 4px 15px rgba(0,0,0,0.03); background: #e2e8f0; z-index: 1; }

#streetview-panorama { flex: 1; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 4px 15px rgba(0,0,0,0.03); background: #e2e8f0; position: relative; overflow: hidden; }
.streetview-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); flex-direction: column; text-align: center; padding: 20px; font-weight: 500;}

#right-panel { flex: 1; background: white; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 4px 20px rgba(0,0,0,0.04); overflow-y: auto; padding: 40px; position: relative;}

/* TOM START-SKÆRM */
.empty-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); text-align: center; }
.empty-state i { font-size: 4.5rem; color: #e2e8f0; margin-bottom: 25px; }
.empty-state h2 { color: var(--primary); margin: 0 0 10px 0; font-size: 2rem; }
.empty-state p { font-size: 1.1rem; max-width: 500px; line-height: 1.6; }

/* DASHBOARD HEADER */
.dashboard-header { margin-bottom: 30px; border-bottom: 1px solid var(--border-color); padding-bottom: 25px; position: relative; }
.dashboard-header h1 { margin: 0 0 12px 0; font-size: 2.4rem; color: var(--primary); letter-spacing: -0.5px; }
.dashboard-meta { display: flex; gap: 15px; align-items: center; }

/* ENERGIMÆRKE */
.energylabel-wrapper { position: absolute; top: 0; right: 0; display: flex; flex-direction: column; align-items: center;}
.energy-arrow { position: relative; width: 60px; height: 36px; padding: 5px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 1.2rem; border-radius: 5px 0 0 5px; margin-bottom: 5px;}
.energy-arrow::after { content: ''; position: absolute; top: 0; right: -18px; border-top: 18px solid transparent; border-bottom: 18px solid transparent;}
.energy-subtext { font-size: 0.75rem; color: var(--text-muted); font-weight: 500;}

/* Farver for mærkerne */
.e-a2020 { background-color: #00964a;} .e-a2020::after { border-left: 18px solid #00964a;}
.e-a2015 { background-color: #4ead44;} .e-a2015::after { border-left: 18px solid #4ead44;}
.e-b { background-color: #a4ce3a;} .e-b::after { border-left: 18px solid #a4ce3a;}
.e-c { background-color: #ffde00; color: #333;} .e-c::after { border-left: 18px solid #ffde00;}
.e-d { background-color: #ffb600;} .e-d::after { border-left: 18px solid #ffb600;}
.e-e { background-color: #ff8b00;} .e-e::after { border-left: 18px solid #ff8b00;}
.e-f { background-color: #ff5700;} .e-f::after { border-left: 18px solid #ff5700;}
.e-g { background-color: #e30613;} .e-g::after { border-left: 18px solid #e30613;}

/* PROPERTY FACTS GRID */
.property-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.prop-stat { background: #f8fafc; border: 1px solid var(--border-color); padding: 18px; border-radius: 10px; display: flex; flex-direction: column; gap: 5px;}
.prop-label { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; display: flex; align-items: center; gap: 6px;}
.prop-value { font-size: 1.3rem; font-weight: 700; color: var(--primary);}

/* MULIGHEDER KORT */
.muligheder-card { background: white; border-radius: 12px; border: 1px solid var(--accent); box-shadow: 0 4px 15px rgba(37, 99, 235, 0.08); overflow: hidden; margin-bottom: 20px;}
.muligheder-header { padding: 18px 20px; background: linear-gradient(to right, #eff6ff, white); border-bottom: 1px solid #bfdbfe; display: flex; justify-content: space-between; align-items: center; }
.muligheder-header h3 { margin: 0; font-size: 1.1rem; color: var(--accent); display: flex; align-items: center; gap: 10px; }

.muligheder-liste { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.muligheder-liste li { display: flex; gap: 15px; padding: 20px; border-bottom: 1px solid var(--border-color); background: white;}
.muligheder-liste li:last-child { border-bottom: none; }
.muligheder-liste li i { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.mulighed-title { font-weight: 700; color: var(--primary); font-size: 1.05rem; margin-bottom: 4px;}
.mulighed-desc { font-size: 0.9rem; color: var(--secondary); line-height: 1.5;}

/* BYGGERET PROGESS BAR */
.pot-meter-wrapper { margin-top: 15px;}
.pot-meter-labels { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--secondary); margin-bottom: 5px; font-weight: 500;}
.pot-meter-container { height: 24px; background: #e2e8f0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-color); position: relative; box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);}
.pot-meter-bar { height: 100%; border-radius: 12px; transition: width 1.5s ease-out; background: linear-gradient(to right, var(--accent) 0%, #60a5fa 100%); }

/* Styling for overskridelse */
.pot-meter-wrapper.over { .pot-meter-bar { background: linear-gradient(to right, var(--warning) 0%, var(--danger) 100%); }}

/* BEREGNING TOGGLE */
.beregning-toggle { padding: 15px 20px; background: #f8fafc; cursor: pointer; font-weight: 600; color: var(--secondary); display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; transition: 0.2s; border-top: 1px solid var(--border-color);}
.beregning-toggle:hover { background: #f1f5f9; color: var(--primary); }
.beregning-content { display: none; padding: 15px 20px 20px 20px; background: #f8fafc; font-size: 0.9rem; border-top: 1px solid var(--border-color);}
.beregning-content.show { display: block; }
.beregning-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--secondary); }

/* LOKALPLAN TOGGLE */
.lokalplan-toggle { background: white; border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.01);}
.lokalplan-header { padding: 18px 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: white; transition: 0.2s; font-weight: 700; color: var(--primary);}
.lokalplan-header:hover { background: var(--bg-light); }
.lokalplan-header .arrow { transition: transform 0.3s; color: var(--secondary); }
.lokalplan-toggle.open .arrow { transform: rotate(180deg); }
.lokalplan-body { display: none; padding: 20px; border-top: 1px solid var(--border-color); background: var(--bg-light);}
.lokalplan-toggle.open .lokalplan-body { display: block; }

.lp-stat { margin-bottom: 15px; }
.lp-stat:last-child { margin-bottom: 0; }
.lp-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px;}
.lp-val { font-size: 1rem; color: var(--text-dark); font-weight: 500;}

.pdf-btn { display: block; width: 100%; text-align: center; background-color: var(--primary); color: white; padding: 14px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: 0.2s; box-sizing: border-box; margin-top: 15px; font-size: 0.95rem;}
.pdf-btn:hover { background-color: var(--accent); }

/* KORT ETIKETTER (Til skelmål) */
.skel-label { background: white; border: 1px solid var(--secondary); color: var(--primary); padding: 2px 6px; border-radius: 4px; font-weight: 700; font-size: 0.85rem; text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); white-space: nowrap;}
.custom-pin i { text-shadow: 0 4px 10px rgba(0,0,0,0.3); }

/* ANIMATIONER */
@keyframes polygonHighlight { 0% { fill-opacity: 0; stroke-width: 0; } 50% { fill-opacity: 0.3; stroke-width: 5; } 100% { fill-opacity: 0.15; stroke-width: 3; }}
.matrikel-polygon { animation: polygonHighlight 1.5s ease-out; }
@keyframes pinDrop { 0% { transform: translateY(-30px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; }}
.custom-pin i { animation: pinDrop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }