/* --- LAYOUT --- */
.tool-section {
    min-height: 100vh;
    padding-bottom: 4rem;
    font-family: 'Inter', sans-serif;
    background: #0a0a0a;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
}

/* --- PANELS --- */
.panel {
    background: #111;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #222;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.panel-header h2 { font-size: 1.2rem; margin: 0; letter-spacing: 2px; color: #fff; }

.status-badge {
    font-size: 0.75rem;
    background: #222;
    color: #777;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
}
.status-badge.active { background: #ef4444; color: #fff; animation: pulse 1s infinite; }

/* --- METER READOUT --- */
.meter-panel { display: flex; flex-direction: column; align-items: center; }

.readout-container {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}
.readout-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 4.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 20px rgba(255,255,255,0.1);
}
.readout-unit { color: #555; font-weight: 600; font-size: 1rem; margin-top: 5px; }

/* Stats Row */
.stats-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
    background: #1a1a1a;
    padding: 10px;
    border-radius: 8px;
}
.stat-item { text-align: center; flex: 1; }
.stat-item .label { display: block; font-size: 0.7rem; color: #555; font-weight: 700; }
.stat-item .val { font-family: 'JetBrains Mono', monospace; font-size: 1.2rem; color: #aaa; }

/* Controls */
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-bottom: 20px; }

.btn-tool {
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}
.btn-tool.start { background: #10b981; color: #fff; }
.btn-tool.start:hover { background: #059669; box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }

.btn-tool.stop { background: #27272a; color: #ef4444; }
.btn-tool.stop:hover:not(:disabled) { background: #3f3f46; }

.btn-tool.export { width: 100%; background: #222; color: #aaa; border: 1px solid #333; }
.btn-tool.export:hover:not(:disabled) { background: #333; color: #fff; border-color: #555; }
.btn-tool:disabled { opacity: 0.3; cursor: not-allowed; }

/* Calibration */
.calibration-box {
    width: 100%;
    background: #0f0f0f;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #222;
}
.calibration-box label { font-size: 0.8rem; color: #666; display: block; margin-bottom: 5px; }
.calibration-box input { width: 100%; cursor: pointer; }

/* --- VISUALIZATIONS --- */
.viz-grid { display: flex; flex-direction: column; gap: 20px; }

.viz-panel { padding: 0; min-height: 200px; display: flex; flex-direction: column; }
.panel-header-small {
    padding: 10px 15px;
    background: #161616;
    border-bottom: 1px solid #222;
}
.panel-header-small h3 { font-size: 0.75rem; color: #666; margin: 0; letter-spacing: 1px; }

#freqCanvas { width: 100%; height: 100%; background: #000; }
.chart-wrapper { padding: 10px; height: 200px; position: relative; }

/* Log */
.log-panel { max-height: 150px; overflow: hidden; display: flex; flex-direction: column; padding: 0; }
.log-header { background: #161616; padding: 5px 15px; font-size: 0.7rem; color: #555; font-weight: 700; border-bottom: 1px solid #222; }
.log-body { padding: 10px; overflow-y: auto; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: #777; }
.log-line { margin-bottom: 4px; }
.log-line.warn { color: #f59e0b; }

@keyframes pulse { 50% { opacity: 0.5; } }

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
