@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #0d0d0d; --panel-bg: #161616; --text-main: #f0f0f0; --text-muted: #888888;
    --accent: #33ffaa; --accent-dim: rgba(51, 255, 170, 0.15); --border: #2a2a2a;
    --grid-color: rgba(255, 255, 255, 0.03); --danger: #ff4d4d; --warning-bg: rgba(255, 77, 77, 0.08);
    --canje-color: #ffd700;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; user-select: none; }
input, select, button { user-select: auto; }
body { background-color: var(--bg-color); color: var(--text-main); display: flex; height: 100vh; overflow: hidden; }

::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background-color: #444; border-radius: 4px; }

.sidebar { width: 440px; min-width: 440px; background-color: var(--panel-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; z-index: 10; }
.sidebar-content { flex: 1; }

.header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 15px; }
.header img { width: 40px; height: 40px; border-radius: 8px; }
.header h1 { font-size: 1.4rem; font-weight: 700; color: var(--accent); text-transform: uppercase; line-height: 1; }
.author-link { font-size: 0.7rem; color: #666; text-decoration: none; transition: color 0.2s; display: block; margin-top: 4px; }
.author-link:hover { color: var(--accent); }

.section { padding: 15px 20px; border-bottom: 1px solid var(--border); }
.section h2 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 15px; text-transform: uppercase; font-weight: 600; }

.control-group { margin-bottom: 12px; }
.control-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.85rem; }
.label-wrap { display: flex; align-items: center; gap: 8px; }

.tooltip-icon {
    display: inline-flex; justify-content: center; align-items: center; width: 14px; height: 14px; background: #333; color: #ccc;
    border-radius: 50%; font-size: 10px; font-weight: bold; cursor: help; position: relative;
}
.tooltip-icon:hover::after {
    content: attr(data-tooltip); position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 10px; border-radius: 4px; font-size: 0.75rem; width: 220px; text-align: center; box-shadow: 0 4px 10px rgba(0,0,0,0.5); border: 1px solid var(--border); z-index: 100; pointer-events: none; line-height: 1.4;
}

.slider-input-group { display: flex; align-items: center; gap: 10px; }
input[type="range"] { flex: 1; -webkit-appearance: none; background: var(--border); height: 4px; border-radius: 2px; outline: none; position: relative; }
input[type="range"]::-webkit-slider-runnable-track { width: 100%; height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--border) var(--track-start, 0%), var(--accent-dim) var(--track-start, 0%), var(--accent-dim) var(--track-end, 0%), var(--border) var(--track-end, 0%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--accent); border-radius: 50%; cursor: pointer; transition: transform 0.1s; margin-top: -5px; }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

.range-label { font-size: 0.6rem; color: #666; width: 100%; text-align: left; margin-top: 2px; display: none; }
.range-label.active { display: block; }

.touch-warning { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.8); color: #fff; padding: 10px 15px; border-radius: 8px; font-size: 0.8rem; pointer-events: none; opacity: 0; transition: opacity 0.3s; z-index: 100; text-align: center; border: 1px solid var(--accent); font-weight: bold; }

input[type="number"], input[type="text"], select {
    width: 85px; padding: 6px; background-color: #111; border: 1px solid #444; color: var(--text-main); font-family: inherit; border-radius: 4px; outline: none; font-size: 0.85rem; text-align: right; transition: border-color 0.2s;
}
select, input[type="text"] { width: 100%; text-align: left; }
input:focus, select:focus { border-color: var(--accent); }

.search-container { position: relative; margin-bottom: 5px; }
.search-results {
    position: absolute; top: 100%; left: 0; width: 100%; background: #222; border: 1px solid var(--border);
    border-top: none; border-radius: 0 0 4px 4px; max-height: 200px; overflow-y: auto; z-index: 20; display: none;
}
.search-results.active { display: block; }
.search-item { padding: 10px; font-size: 0.8rem; cursor: pointer; border-bottom: 1px solid var(--border); }
.search-item:hover { background: var(--border); color: var(--accent); }

.danger-zone { background-color: var(--warning-bg); border: 1px solid rgba(255, 77, 77, 0.4); border-radius: 6px; padding: 10px; margin-top: 10px; }
.danger-zone label { font-size: 0.85rem; color: var(--danger); font-weight: 600; display: flex; align-items: center; gap: 8px; cursor: pointer;}

.canje-zone { background-color: rgba(255, 215, 0, 0.05); border: 1px solid rgba(255, 215, 0, 0.3); border-radius: 6px; padding: 10px; margin-top: 10px; }
.canje-zone .control-header span { color: var(--canje-color); font-weight: 600; }
.canje-zone input[type="range"]::-webkit-slider-thumb { background: var(--canje-color); }

.metrics-grid { display: grid; gap: 8px; padding: 20px; background-color: #080808; border-top: 1px solid var(--border); }
.metric-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 0.8rem; }
.metric-row:last-child { border-bottom: none; }
.metric-label { color: var(--text-muted); }
.metric-val { font-weight: 600; }

.card-highlight { background-color: rgba(51, 255, 170, 0.05); border: 1px solid var(--accent); padding: 15px; border-radius: 6px; margin-top: 10px; text-align: center; cursor: pointer; transition: background 0.2s; }
.card-highlight:hover { background-color: rgba(51, 255, 170, 0.15); }
.card-highlight .metric-label { color: var(--accent); text-transform: uppercase; font-size: 0.70rem; font-weight: bold; letter-spacing: 1px; margin-bottom: 5px; }
.card-highlight .metric-val { font-size: 1.8rem; font-weight: 700; color: var(--text-main); }

.card-canje { background-color: rgba(255, 215, 0, 0.05); border: 1px solid var(--canje-color); padding: 12px; border-radius: 6px; margin-top: 10px; text-align: center; }
.card-canje .metric-label { color: var(--canje-color); text-transform: uppercase; font-size: 0.70rem; font-weight: 600; margin-bottom: 5px; }
.card-canje .metric-val { font-size: 1.2rem; font-weight: 700; }

.btn-link { width: 100%; border: 1px solid var(--border); background: transparent; padding: 10px; color: var(--text-muted); border-radius: 6px; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.2s; margin-top: 8px;}
.btn-link:hover { background: rgba(255,255,255,0.05); color: #fff; border-color: var(--accent); }

/* Range Bar v3.3 */
.valuation-range-container { margin: 30px 0; padding: 0 10px; }
.valuation-range-bar {
    height: 12px; width: 100%; border-radius: 6px; position: relative;
    background: linear-gradient(to right, var(--danger) 0%, #ffaa00 50%, var(--accent) 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); margin-top: 40px;
}
.range-marker {
    position: absolute; top: -10px; width: 14px; height: 32px; background: #fff; border: 2px solid #000;
    border-radius: 3px; transform: translateX(-50%); box-shadow: 0 4px 10px rgba(0,0,0,0.8);
    transition: left 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.marker-label {
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    white-space: nowrap; font-size: 0.65rem; font-weight: 800; color: #fff;
    background: #000; padding: 2px 6px; border-radius: 4px; margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.2);
}
.range-extremos { display: flex; justify-content: space-between; margin-top: 10px; font-size: 0.75rem; font-weight: 600; color: #888; }
.range-extremos span:first-child { color: var(--danger); text-align: left; }
.range-extremos span:last-child { color: var(--accent); text-align: right; }

/* Accordion Styles */
.collapsible-trigger {
    width: 100%; text-align: left; background: none; border: none; color: var(--accent);
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase; cursor: pointer;
    padding: 12px 20px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border); transition: background 0.2s;
}
.collapsible-trigger:hover { background: rgba(51, 255, 170, 0.03); }
.collapsible-trigger::after { content: '▼'; font-size: 14px; transition: transform 0.3s; color: rgba(51, 255, 170, 0.6); }
.collapsible-trigger.active::after { transform: rotate(180deg); color: var(--accent); }
.collapsible-content { display: none; background: #0f0f0f; }
.collapsible-content.active { display: block; }

/* Main Views */
.main-view { flex: 1; display: grid; grid-template-columns: 1fr; grid-template-rows: 2fr 1fr; gap: 20px; padding: 20px; background:radial-gradient(circle, #1a1a1a 0%, #0d0d0d 100%); }
.panel { background: var(--panel-bg); border: 1px solid var(--border); border-radius: 12px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background-image: linear-gradient(var(--grid-color) 1px, transparent 1px), linear-gradient(90deg, var(--grid-color) 1px, transparent 1px); background-size: 20px 20px; }
.panel:active { cursor: grabbing; }
.panel-title { position: absolute; top: 15px; left: 15px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); z-index: 10; pointer-events: none; background: rgba(0,0,0,0.6); padding: 4px 10px; border-radius: 4px; border: 1px solid rgba(51,255,170,0.2); }
.panel-hint { position: absolute; bottom: 15px; right: 15px; font-size: 0.65rem; color: #888; pointer-events: none; background: rgba(0,0,0,0.5); padding: 4px 8px; border-radius: 4px;}
.bottom-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.transform-container { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; transform-origin: center center; cursor: grab; }

/* 3D ISO Visuals */
.axonometric-container { perspective: 2000px; }
.isometric-world { position: relative; transform-style: preserve-3d; }
.iso-layer { position: absolute; border: 1px solid var(--accent); background: rgba(51, 255, 170, 0.08); box-shadow: inset 0 0 10px rgba(51, 255, 170, 0.1); display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 9px; font-weight: 600; transition: background 0.2s, border-width 0.1s, box-shadow 0.2s; transform-style: preserve-3d; }

.iso-layer:hover { 
    background: rgba(51, 255, 170, 0.35); 
    border-width: 2px; 
    box-shadow: 0 0 20px rgba(51, 255, 170, 0.3), inset 0 0 15px rgba(51, 255, 170, 0.2); 
    cursor: pointer;
}

.iso-balcony { position: absolute; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); }
.iso-lot { position: absolute; border: 1px dashed #666; background: rgba(0,0,0,0.4); transform-style: preserve-3d; }
.iso-measure { position: absolute; font-size:12px; font-weight:bold; color:var(--accent); background:rgba(0,0,0,0.6); padding:2px 5px; border-radius:2px; pointer-events:none;}

/* 3D Callouts v3.2 Billboarding */
.callout-box {
    position: absolute; left: 140%; background: rgba(0,0,0,0.95); border: 1px solid var(--accent);
    padding: 10px 14px; border-radius: 8px; width: 150px; box-shadow: 0 10px 25px rgba(0,0,0,0.7);
    pointer-events: none; z-index: 2000; display: flex; flex-direction: column; gap: 4px;
    opacity: 0; transition: opacity 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.leader-line {
    position: absolute; left: 100%; top: 50%; height: 1.5px; background: var(--accent);
    transform-origin: left center; opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
}
.iso-layer:hover .callout-box, .iso-layer:hover .leader-line { opacity: 1; }

.callout-name { color: var(--accent); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; border-bottom: 1px solid rgba(51,255,170,0.3); margin-bottom: 4px; padding-bottom: 4px; }
.callout-val { color: #fff; font-size: 0.75rem; display: flex; justify-content: space-between; }
.callout-val span:last-child { color: #aaa; font-weight: 600; }

/* 2D Elements */
.plan-lot { border: 1px dashed #666; position: relative; }
.plan-footprint { position: absolute; top: 0; left: 0; width: 100%; background: rgba(51, 255, 170, 0.15); border: 1px solid var(--accent); }
.plan-balcony-front, .plan-balcony-back { position: absolute; width: 100%; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); }
.floor-label-2d { position: absolute; font-size: 9px; color: var(--accent); background: rgba(0,0,0,0.8); padding: 1px 4px; border-radius: 2px; pointer-events: none; z-index: 10; white-space: nowrap;}
.side-metric-label { position: absolute; left: 105%; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 10px; color: var(--accent); background: rgba(0,0,0,0.8); padding: 4px 10px; border-radius: 4px; border: 1px solid var(--accent); pointer-events: none; z-index: 10; font-weight: 600; box-shadow: 0 4px 10px rgba(0,0,0,0.5);}

.profile-wrapper { display: flex; flex-direction: column-reverse; align-items: flex-start; border-bottom: 2px solid var(--border); position: relative;}
.prof-floor { border: 1px solid var(--accent); background: rgba(51, 255, 170, 0.12); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight:bold; color: var(--accent); margin-bottom: 1px; position: relative; transform-style: preserve-3d; }
.prof-balcony-front, .prof-balcony-back { position: absolute; top: 0; height: 100%; width: 15px; background: rgba(255, 255, 255, 0.1); border: 1px dotted rgba(255,255,255,0.3); color:transparent;}
.measure { position: absolute; color: var(--accent); font-size: 10px; font-weight: bold; background: rgba(0,0,0,0.7); padding: 2px 6px; border-radius: 3px; z-index: 5; pointer-events:none;}

/* Modals Professional v3.2 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.92); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.modal-content { background: var(--panel-bg); padding: 40px; border-radius: 20px; border: 1px solid var(--border); max-width: 650px; width: 90%; box-shadow: 0 30px 60px rgba(0,0,0,0.9); max-height: 90vh; overflow-y: auto; }
.modal-content.success { border-color: var(--accent); }
.modal-content.warning { border-color: var(--canje-color); }
.modal-content h2 { font-size: 1.6rem; margin-bottom: 20px; font-weight: 800; letter-spacing: -0.5px; color: #fff; }
.modal-body { font-size: 0.95rem; line-height: 1.7; color: #aaa; margin-bottom: 30px;}
.modal-body b, .modal-body strong { color: #fff; }

.modal-body table { width: 100%; margin-top: 20px; border-collapse: collapse; }
.modal-body table td { padding: 12px 10px; border-bottom: 1px solid #222; }
.modal-body table tr.total td { color: var(--accent); font-size: 1.1rem; border-top: 1px solid var(--accent); border-bottom: none; padding-top: 20px; font-weight: 700; }

.btn-primary { width: 100%; padding: 16px; background: var(--accent); color: #000; font-weight: 800; text-transform: uppercase; border: none; border-radius: 10px; cursor: pointer; font-size: 0.95rem; transition: all 0.2s; letter-spacing: 0.5px; }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.warn { background: var(--canje-color); }

.tip { border-bottom: 1px dashed var(--accent); cursor: help; color: #fff; position: relative; display: inline-block; }
.tip:hover::after {
    content: attr(data-tooltip); position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%);
    background: #222; color: #fff; padding: 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 400;
    width: 250px; text-align: center; border: 1px solid var(--border); z-index: 1100; pointer-events: none;
    line-height: 1.5; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.sensitivity-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; background: #080808; padding: 10px; border-radius: 8px; border: 1px solid #222; overflow: visible; }
.sensitivity-cell { padding: 12px 5px; text-align: center; font-size: 0.75rem; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-weight: 500; position: relative; overflow: visible; }
.sensitivity-cell.header { background: #1a1a1a; color: #888; text-transform: uppercase; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.5px; }
.sensitivity-cell .tip { border-bottom: 1px dotted #555; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: inherit; }
.sensitivity-cell.val { background: #111; color: #fff; }
.sensitivity-cell.positive { color: var(--accent); }
.sensitivity-cell.negative { color: var(--danger); }
.sensitivity-cell.current { border: 1px solid var(--accent); background: rgba(51, 255, 170, 0.05); }

.panel-address { position: absolute; top: 15px; right: 15px; font-size: 0.75rem; font-weight: 600; color: #fff; background: rgba(0,0,0,0.7); padding: 5px 12px; border-radius: 6px; border: 1px solid rgba(51,255,170,0.3); z-index: 10; }

/* Disclaimer UI */
.disclaimer-sidebar { padding: 15px 20px; font-size: 0.65rem; color: #555; line-height: 1.4; border-top: 1px solid var(--border); background: #0a0a0a; }

.loader {
    display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(51, 255, 170, 0.2);
    border-radius: 50%; border-top-color: var(--accent); animation: spin 0.8s linear infinite;
    margin-left: 10px; vertical-align: middle; display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading .loader { display: inline-block; }

/* PRINT STYLES v3.4 */
#report-print-area { display: none; }
@media print {
    body { background: #fff !important; color: #000 !important; height: auto !important; overflow: visible !important; display: block !important; -webkit-print-color-adjust: exact; }
    .sidebar, .main-view, .modal-overlay, .bottom-panels { display: none !important; }
    
    #report-print-area { display: block !important; padding: 20px; font-family: 'Inter', sans-serif; }
    .report-header { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 20px; }
    .report-title h1 { font-size: 20pt; font-weight: 900; margin-bottom: 2pt; color: #000; }
    .report-title p { font-size: 9pt; color: #666; }
    
    .report-section { margin-bottom: 20pt; page-break-inside: avoid; }
    .report-section h2 { font-size: 12pt; border-bottom: 1px solid #000; padding-bottom: 3pt; margin-bottom: 10pt; text-transform: uppercase; font-weight: 800; }
    
    .report-table { width: 100%; border-collapse: collapse; }
    .report-table td { padding: 6pt 4pt; border-bottom: 1px solid #eee; font-size: 10pt; color: #000; }
    .report-table td:last-child { text-align: right; font-weight: bold; }
    .total-row { background: #f0f0f0 !important; font-weight: bold; }
    .total-row td { border-top: 1.5px solid #000; font-size: 11pt !important; }

    /* Graphics in PDF */
    .report-viz-container { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin: 20px 0; min-height: 300px; }
    .print-3d-box { border: 1px solid #ccc; background: #fafafa; position: relative; overflow: hidden; height: 350px; display: flex; align-items: center; justify-content: center; }
    .print-2d-box { display: flex; flex-direction: column; gap: 10px; }
    .print-canvas-sub { border: 1px solid #eee; height: 165px; position: relative; display: flex; align-items: center; justify-content: center; background: #fff; }
    
    /* Assumptions Table (Compact) */
    .assumptions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
    .assumption-item { font-size: 8pt; border-bottom: 1px dotted #ccc; display: flex; justify-content: space-between; padding: 3pt 0; }
    .assumption-item b { color: #333; }

    .report-footer { margin-top: 30pt; border-top: 1px solid #000; padding-top: 10pt; font-size: 8pt; color: #444; text-align: justify; line-height: 1.4; }
}

/* Splash Screen Styling */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at center, #1a1a1a 0%, #0d0d0d 100%),
        linear-gradient(var(--grid-color) 1px, transparent 1px), 
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s cubic-bezier(0.77, 0, 0.175, 1), transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.splash-content {
    text-align: center;
    max-width: 800px;
    padding: 40px;
}

.splash-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 0 30px rgba(51, 255, 170, 0.2);
    opacity: 0;
    transform: scale(0.8);
    animation: logoReveal 1s 0.1s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes logoReveal {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.splash-title {
    font-size: 3.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 50px;
    line-height: 1.1;
    letter-spacing: -1.5px;
    opacity: 0;
    transform: translateY(30px);
    animation: textReveal 1s 0.2s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes textReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-primary-splash {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 20px 50px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 0 30px var(--accent-dim);
    opacity: 0;
    transform: translateY(30px);
    animation: textReveal 1s 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    position: relative;
    overflow: hidden;
}

.btn-primary-splash:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 50px var(--accent);
    transform: translateY(-3px);
}

.btn-primary-splash:active {
    transform: translateY(-1px);
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .splash-title { font-size: 2rem; margin-bottom: 30px; }
    .btn-primary-splash { padding: 15px 30px; font-size: 0.9rem; }
}

/* RESPONSIVE LAYOUT v3.8 */
@media (max-width: 1024px) {
    body {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--border);
        height: auto;
        overflow: visible; /* Let the body scroll */
    }
    .main-view {
        min-height: 800px; /* Give it some space to stack */
    }
    .card-highlight {
        position: sticky;
        bottom: 10px;
        z-index: 1000;
        box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 0 1px var(--accent);
        background-color: #111;
        backdrop-filter: blur(10px);
    }
}

@media (max-width: 768px) {
    .main-view {
        grid-template-rows: auto auto auto;
        padding: 10px;
        gap: 10px;
        min-height: auto;
    }
    .bottom-panels {
        grid-template-columns: 1fr; /* Stack planta and perfil */
    }
    .panel {
        min-height: 350px;
    }
    .modal-content {
        padding: 20px;
        width: 95%;
    }
}

/* Donut Chart */
.donut-chart-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 25px;
    padding: 20px;
    background: var(--panel-bg);
    border: 1px solid #222;
    border-radius: 10px;
}
.donut-chart-container canvas {
    flex-shrink: 0;
}
.donut-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #ccc;
}
.donut-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}
.donut-pct {
    margin-left: auto;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}


