/* ===== CSS (responsif) ===== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: #f0f2f5; padding: 20px; }
.app-container {
    max-width: 2000px; margin: 0 auto;
    display: grid; gap: 20px;
    grid-template-areas: "header header header" "sidebar main right" "footer footer footer";
    grid-template-columns: 320px 1fr 500px;
    grid-template-rows: auto 1fr auto;
}
.header { grid-area: header; background: white; padding: 20px 25px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.header h1 { font-size: 1.6rem; font-weight: 600; color: #1e293b; }
.header .badge { background: #e2e8f0; color: #334155; padding: 6px 14px; border-radius: 40px; font-size: 0.85rem; }
.sidebar { grid-area: sidebar; background: white; border-radius: 20px; padding: 20px; box-shadow: 0 6px 14px rgba(0,0,0,0.03); display: flex; flex-direction: column; gap: 20px; max-height: calc(100vh - 100px); overflow-y: auto; }
.sidebar .card { background: #f8fafc; border-radius: 14px; padding: 16px; }
.card-title { font-weight: 600; color: #0f172a; margin-bottom: 15px; font-size: 1rem; display: flex; gap: 6px; }
.upload-area { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 20px; text-align: center; color: #475569; transition: 0.2s; cursor: pointer; }
.upload-area:hover { border-color: #3b82f6; background: #eff6ff; }
.upload-area input { display: none; }
.info-well { background: white; border-radius: 12px; padding: 12px; font-size: 0.9rem; }
.info-well p { margin: 6px 0; color: #1e293b; }
.param-control { display: flex; flex-direction: column; gap: 10px; }
.param-item { display: flex; justify-content: space-between; align-items: center; }
.param-item label { color: #334155; font-weight: 500; }
.param-item input, .param-item select { width: 100px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 8px; }
.summary-box { background: #e6f0ff; border-radius: 14px; padding: 16px; margin-top: 10px; }
.main { grid-area: main; background: white; border-radius: 20px; padding: 20px; box-shadow: 0 6px 14px rgba(0,0,0,0.03); display: flex; flex-direction: column; gap: 15px; }
.log-viewer { width: 100%; height: 550px; background: white; border-radius: 16px; border: 1px solid #e9eef2; }
.right { grid-area: right; background: white; border-radius: 20px; padding: 20px; box-shadow: 0 6px 14px rgba(0,0,0,0.03); display: flex; flex-direction: column; gap: 20px; overflow-y: auto; max-height: calc(100vh - 100px); }
.right-section { background: #f8fafc; border-radius: 14px; padding: 16px; }
.matrix-container, .histogram-container, .additional-plots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.matrix-plot, .histogram-plot, .additional-plot { width: 110%; height: 250px; background: white; border-radius: 8px; border: 1px solid #e2e8f0; }
.footer { grid-area: footer; background: white; border-radius: 20px; padding: 20px 25px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.zone-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.zone-table th { text-align: left; background: #f1f5f9; padding: 10px 12px; color: #0f172a; }
.zone-table td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; }
.badge-zone { background: #22c55e20; color: #15803d; padding: 4px 8px; border-radius: 20px; }
.status-message { padding: 8px 12px; border-radius: 8px; background: #f8fafc; color: #334155; font-size: 0.9rem; }
.status-message.error { background: #fee2e2; color: #b91c1c; }
.btn { background: #3b82f6; color: white; border: none; border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 0.9rem; }
.btn:hover { background: #2563eb; }
.btn-secondary { background: #64748b; }
.flex-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media screen and (max-width: 1024px) {
    .app-container { grid-template-areas: "header" "sidebar" "main" "right" "footer"; grid-template-columns: 1fr; }
    .log-viewer { height: 450px; }
}