:root {
    --primary: #4f46e5;       /* Indigo */
    --primary-dark: #3730a3;
    --accent: #06b6d4;        /* Cyan */
    --bg-body: #f3f4f6;       
    --surface: #ffffff;
    --text-main: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
    overflow: hidden; 
}

.background-decor {
    position: fixed; top: 0; left: 0; width: 100%; height: 300px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    z-index: -1; clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
}

.app-wrapper {
    width: 100%; max-width: 1600px;
    display: flex; flex-direction: column; gap: 15px; height: 95vh;
}

/* Header */
header { text-align: center; color: white; margin-bottom: 5px; flex-shrink: 0; }
.logo-area { display: flex; justify-content: center; align-items: center; gap: 15px; }
.logo-icon { font-size: 1.8rem; opacity: 0.9; }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -1px; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.subtitle { font-size: 0.9rem; font-weight: 300; opacity: 0.9; }

/* Layout */
.main-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    flex-grow: 1;
    overflow: hidden;
}
@media (max-width: 950px) { .main-grid { grid-template-columns: 1fr; overflow-y: auto; } }

/* --- PANEL IZQUIERDO --- */
.panel {
    background: var(--surface); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,0.5);
}

.config-panel {
    overflow-y: auto; 
    padding-right: 10px;
    display: flex; flex-direction: column; gap: 15px;
}
.config-panel::-webkit-scrollbar { width: 5px; }
.config-panel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.panel-header h2 {
    font-size: 0.85rem; color: var(--primary); margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px; font-weight: 700; text-transform: uppercase;
}
.separator { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }

.hidden { display: none !important; }
.status-text { font-size: 0.75rem; color: var(--text-light); font-style: italic; margin-top: 5px; }

/* Inputs */
.input-group { margin-bottom: 10px; }
.row-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-light); margin-bottom: 4px; }

input[type="number"], input[type="text"], select {
    width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
    font-family: inherit; font-size: 0.85rem; background-color: #f9fafb;
}
input:focus, select:focus { outline: none; border-color: var(--primary); background: white; }

.file-input { font-size: 0.75rem; padding: 4px; }
input[type="file"]::file-selector-button {
    margin-right: 8px; border: none; background: var(--primary); padding: 4px 8px; border-radius: 4px;
    color: #fff; cursor: pointer; font-size: 0.75rem;
}

/* Select */
.select-wrapper { position: relative; }
.select-wrapper i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-light); font-size: 0.7rem; }
select { appearance: none; cursor: pointer; }

/* Color Input */
.color-input.full-width { width: 100%; height: 32px; padding: 2px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; }

/* Switch Toggle */
.toggle-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.switch { position: relative; display: inline-block; width: 34px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(14px); }

/* Checkbox Group */
.checkbox-group { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 5px; }
.checkbox-group label { display: flex; align-items: center; gap: 5px; font-weight: 500; cursor: pointer; }

/* Info Box */
.info-box {
    background: #eff6ff; border: 1px solid #bfdbfe; padding: 10px; border-radius: 8px;
    text-align: center; color: #1e40af; font-size: 0.8rem; margin-top: auto;
}
.info-box i { font-size: 1.2rem; margin-bottom: 5px; display: block; }

/* --- PANEL DERECHO --- */
.right-column { display: flex; flex-direction: column; gap: 15px; overflow: hidden; }

/* Canvas Panel */
.canvas-panel {
    flex-grow: 1; position: relative; background: white; padding: 0;
    display: flex; flex-direction: column; overflow: hidden;
}

#plot { width: 100%; height: 100%; }

.empty-message {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; color: var(--text-light); pointer-events: none;
}
.empty-message i { font-size: 4rem; margin-bottom: 10px; opacity: 0.2; }

/* Botones Exportar */
.actions-container { display: flex; gap: 15px; justify-content: flex-end; }
.btn-secondary {
    background: white; border: 1px solid var(--border); color: var(--text-main); padding: 10px 16px; border-radius: 8px;
    font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 8px;
}
.btn-secondary:hover { background: var(--bg-body); border-color: var(--primary); color: var(--primary); }

footer { text-align: center; color: var(--text-light); font-size: 0.75rem; margin-top: auto; flex-shrink: 0; }