/* _common/components.css — 레이아웃 & UI 컴포넌트 */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
}

/* ── Dashboard layout ─────────────────────────── */
.dashboard-wrapper {
  max-width: 1800px;
  margin: 0 auto;
  padding: 14px;
}

.dashboard-content {
  display: flex;
  gap: var(--gap-lg);
  align-items: flex-start;
}

.dashboard-left  { flex: 2; min-width: 380px; max-width:  760px; }
.dashboard-right {
  flex: 3;
  min-width: 420px;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* ── Badge ────────────────────────────────────── */
.badge-container { text-align: center; margin-bottom: 14px; }
.test-badge {
  display: inline-block;
  padding: 4px 16px;
  border: 1px solid var(--accent);
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}
html.day .test-badge { color: #1a5ef5; border-color: #1a5ef5; }

/* ── Controls bar ─────────────────────────────── */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  align-items: center;
  margin-bottom: 10px;
}

button, select {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--border-2);
  background: #1a1c2a;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}
button:hover  { background: #222537; }
button.active { background: #1a3a6a; border-color: var(--accent); color: var(--accent); }

.ctrl-divider { width: 1px; height: 24px; background: var(--border-2); }
#serialStatus { font-size: 11px; color: var(--text-muted); font-family: monospace; }

html.day button,
html.day select        { background: #fff; border-color: #c8cbdc; color: #1a1d2e; }
html.day button:hover  { background: #e8eaf4; color: #000; }
html.day button.active { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; }
html.day #serialStatus { color: #555; }

/* ── Heatmap section ──────────────────────────── */
.heatmap-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--bg);
  display: flex;
  align-items: stretch;
}
#canvas1 { display: block; flex: 1; min-width: 0; }
html.day .heatmap-section { border-color: #c8cbdc; background: #f4f5fb; }

/* ── Info bar ─────────────────────────────────── */
.info-bar {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
  padding: 4px 0 6px;
}
html.day .info-bar { color: #444; }

/* ── Settings controls ────────────────────────── */
.settings-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.settings-controls label { font-size: 11px; color: var(--text-label); }

.btn-silver {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid #333;
  background: #1e2130;
  color: #888;
  font-size: 12px;
  cursor: pointer;
}
.btn-silver:hover { background: #252838; color: var(--text-primary); }
.btn-silver.on    { background: #1a3a6a; border-color: #4a9eff66; color: var(--accent); }

html.day .settings-controls { background: #f4f5fb; border-color: #c8cbdc; }
html.day .btn-silver        { background: #f4f5fb; border-color: #c8cbdc; color: #1a1d2e; }
html.day .btn-silver:hover  { background: #e4e6f2; color: #000; }
html.day .btn-silver.on     { background: #dbeafe; border-color: #3b82f666; color: #1d4ed8; }

/* ── Line graph section ───────────────────────── */
.linegraph-section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--pad-md);
  max-width: 860px;
  width: 100%;
}
.linegraph-title {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.linegraph-grid { display: grid; grid-template-columns: 1fr; gap: var(--gap-md); }
.linegraph-item {
  background: var(--bg-item);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
}
.linegraph-item h4 {
  margin: 0 0 2px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}
.linegraph-item canvas { display: block; width: 100%; }

html.day .linegraph-section { background: #fff; border-color: #c8cbdc; }
html.day .linegraph-title   { color: #444; border-color: #c8cbdc; }
html.day .linegraph-item    { background: #f4f5fb; border-color: #c8cbdc; }
html.day .linegraph-item h4 { color: #333; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 1100px) {
  .dashboard-content { flex-direction: column; }
  .dashboard-left, .dashboard-right { min-width: unset; max-width: 100%; }
  .linegraph-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .linegraph-grid { grid-template-columns: 1fr; }
}
.heatmap-note { font-size: 11px; color: var(--c-muted); margin: 16px 0 6px; line-height: 1.5; }
