/* ═══════════════════════════════════════════════════════
   TIMECODE REGISTRATION — Blackmagic PYXIS 6K
   Main Stylesheet
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg-base:        #0a0c0f;
  --bg-panel:       #10141a;
  --bg-card:        #161b24;
  --bg-input:       #0d1017;
  --bg-hover:       #1e2535;
  --border:         #222b3a;
  --border-bright:  #2e3d54;

  --text-primary:   #e8edf5;
  --text-secondary: #7a8ba0;
  --text-muted:     #3d4f62;

  --accent:         #e8282d;
  --accent-dark:    #b01f23;
  --accent-glow:    rgba(232,40,45,0.25);
  --green:          #28e869;
  --green-dark:     #1ab050;
  --yellow:         #e8b828;
  --blue:           #2872e8;
  --blue-glow:      rgba(40,114,232,0.3);
  --orange:         #e87c28;

  --tc-font:        'Share Tech Mono', monospace;
  --ui-font:        'Inter', sans-serif;

  --panel-w:        300px;
  --panel-monitor:  280px;
  --topbar-h:       58px;
  --radius:         8px;
  --radius-lg:      14px;

  --shadow:         0 4px 20px rgba(0,0,0,0.5);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.4);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--ui-font);
  font-size: 13px;
  display: flex;
  flex-direction: column;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a5070; }
input, select, textarea, button { font-family: var(--ui-font); }
button { cursor: pointer; border: none; outline: none; }
input, select, textarea { outline: none; border: none; }

/* ═══════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}
.topbar-left { display: flex; align-items: center; gap: 16px; flex: 1; }
.topbar-center { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }

.logo-mark { display: flex; align-items: center; gap: 8px; }
.logo-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: 0 0 12px var(--accent-glow);
}
.logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
}
.logo-text .accent { color: var(--accent); }

.project-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px 4px 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.project-badge i { color: var(--text-muted); font-size: 11px; }

.timecode-main {
  font-family: var(--tc-font);
  font-size: 26px;
  color: #fff;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255,255,255,0.15);
  line-height: 1;
}
.tc-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-pill {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.status-dot.disconnected { background: var(--text-muted); }
.status-dot.connecting { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); animation: pulse 1s infinite; }
.status-dot.connected { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.recording { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 0.5s infinite; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Icon Buttons ── */
.btn-icon {
  width: 32px; height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: all 0.2s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-bright); }

/* ═══════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--topbar-h));
}

/* ═══════════════════════════════════════════════════════
   PANELS (Left & Right)
   ═══════════════════════════════════════════════════════ */
.panel {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
}
.panel-monitor { border-right: none; border-left: 1px solid var(--border); width: var(--panel-monitor); }
.panel-config { width: var(--panel-w); }

.panel-header {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* ── Config Sections ── */
.config-section {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.section-title i { color: var(--accent); font-size: 9px; }

.cfg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.cfg-label {
  width: 90px;
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.cfg-select, .cfg-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 5px 8px;
  font-size: 12px;
  transition: border-color 0.2s;
}
.cfg-select:hover, .cfg-input:hover { border-color: var(--border-bright); }
.cfg-select:focus, .cfg-input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-glow); }
.cfg-select option { background: var(--bg-card); }

.input-group { display: flex; flex: 1; gap: 4px; align-items: center; }
.input-group .cfg-input { flex: 1; }

.btn-icon-sm {
  width: 26px; height: 26px; min-width: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  transition: all 0.2s;
}
.btn-icon-sm:hover { background: var(--bg-hover); color: var(--text-primary); }
.apply-btn { background: var(--green-dark); border-color: var(--green); color: #fff; }
.apply-btn:hover { background: var(--green); }

/* Scan Box */
.scan-box { padding: 0; }
.scan-interface-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

.btn-scan {
  width: 100%;
  background: linear-gradient(135deg, #1a2235 0%, #0d1520 100%);
  border: 1px solid var(--blue);
  color: var(--blue);
  border-radius: var(--radius);
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all 0.2s;
  margin-bottom: 10px;
}
.btn-scan:hover { background: rgba(40,114,232,0.15); box-shadow: 0 0 14px var(--blue-glow); }
.btn-scan.scanning { animation: scanPulse 1s infinite; }
@keyframes scanPulse { 0%,100%{box-shadow:0 0 6px var(--blue-glow)} 50%{box-shadow:0 0 20px var(--blue-glow)} }

.scan-results {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 70px;
  max-height: 140px;
  overflow-y: auto;
}
.scan-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 70px;
  color: var(--text-muted);
  gap: 4px;
  font-size: 11px;
  text-align: center;
}
.scan-placeholder i { font-size: 18px; margin-bottom: 2px; }

.scan-camera-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.scan-camera-item:hover { background: var(--bg-hover); }
.scan-camera-item:last-child { border-bottom: none; }
.sci-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; box-shadow: 0 0 6px var(--green); }
.sci-dot.weak { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.sci-name { font-size: 11px; font-weight: 600; flex: 1; }
.sci-ip { font-size: 10px; color: var(--text-muted); font-family: var(--tc-font); }
.sci-select { font-size: 10px; color: var(--blue); font-weight: 600; }

/* Connection Actions */
.cfg-actions { display: flex; gap: 8px; margin: 10px 0 8px; }
.btn-primary {
  flex: 1; padding: 7px 12px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 4px 18px var(--accent-glow); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger {
  flex: 1; padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.2s;
}
.btn-danger:hover:not(:disabled) { background: var(--accent-glow); }
.btn-danger:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-secondary {
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-bright); }
.btn-sm { padding: 5px 10px; font-size: 11px; }

/* Connection Log */
.connection-log {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  max-height: 80px;
  overflow-y: auto;
  font-family: var(--tc-font);
  font-size: 10px;
}
.log-entry { padding: 1px 0; color: var(--text-muted); }
.log-entry.info { color: var(--blue); }
.log-entry.success { color: var(--green); }
.log-entry.error { color: var(--accent); }
.log-entry.warning { color: var(--yellow); }
.log-time { color: var(--text-muted); margin-right: 6px; }

/* Toggle Switch */
.toggle-switch { position: relative; width: 36px; height: 20px; display: inline-block; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: 0.3s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 2px; top: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: 0.3s;
}
input:checked + .slider { background: rgba(40,232,105,0.2); border-color: var(--green); }
input:checked + .slider::before { transform: translateX(16px) translateY(-50%); background: var(--green); }

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* ── Status Cards Row ── */
.cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  flex-shrink: 0;
}
.status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s;
}
.status-card:hover { border-color: var(--border-bright); }
.sc-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.camera-icon { background: rgba(40,114,232,0.15); color: var(--blue); }
.rec-icon { background: rgba(232,40,45,0.15); color: var(--accent); }
.clip-icon { background: rgba(232,184,40,0.15); color: var(--yellow); }
.media-icon { background: rgba(40,232,105,0.15); color: var(--green); }
.sc-body { flex: 1; min-width: 0; }
.sc-title { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.sc-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  padding: 3px 7px;
  border-radius: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.sc-badge.online { background: rgba(40,232,105,0.1); border-color: var(--green); color: var(--green); }
.sc-badge.recording { background: rgba(232,40,45,0.1); border-color: var(--accent); color: var(--accent); }
/* .rec-badge — placeholder for recording-state badge overrides */

/* ── Timecode Panel ── */
.tc-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}
.tc-panel-left { display: flex; flex-direction: column; gap: 12px; }
.tc-panel-right { flex: 1; display: flex; flex-direction: column; gap: 10px; }

.tc-display-wrapper {
  display: flex; flex-direction: column; gap: 4px;
}
.tc-display-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.tc-display {
  font-family: var(--tc-font);
  font-size: 42px;
  color: #fff;
  letter-spacing: 6px;
  line-height: 1;
  text-shadow: 0 0 30px rgba(255,255,255,0.08);
  white-space: nowrap;
}
.tc-display.tc-medium { font-size: 28px; letter-spacing: 4px; }
.tc-display.tc-small { font-size: 20px; letter-spacing: 4px; color: var(--yellow); }
.tc-secondary .tc-display { font-size: 18px; letter-spacing: 4px; color: var(--text-secondary); }

.tc-meta-row { display: flex; gap: 8px; }
.tc-meta-item {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-weight: 500;
}

.scene-take-row { display: flex; align-items: center; gap: 8px; }
.scene-take-input {
  width: 60px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 6px 8px;
  font-size: 18px;
  font-family: var(--tc-font);
  text-align: center;
  transition: border-color 0.2s;
}
.scene-take-input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-glow); }
.st-sep { font-size: 24px; color: var(--text-muted); }

.tc-controls { display: flex; gap: 8px; margin-top: auto; }
.btn-tc-ctrl {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.2s;
}
.btn-mark {
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  color: var(--yellow);
}
.btn-mark:hover { background: rgba(232,184,40,0.1); border-color: var(--yellow); }
.btn-register {
  flex: 1;
  padding: 8px 20px;
  font-size: 13px;
  letter-spacing: 1px;
}

/* ── In/Out Bar ── */
.inout-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.inout-item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.inout-label { font-size: 10px; font-weight: 700; color: var(--yellow); letter-spacing: 1px; }
.inout-tc { font-family: var(--tc-font); font-size: 13px; color: var(--text-primary); min-width: 90px; }
.inout-ruler { flex: 1; }
.ruler-track {
  height: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.ruler-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--accent));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}
.ml-auto { margin-left: auto; }

/* ── Params Grid ── */
.params-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  flex-shrink: 0;
}
.param-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.2s;
}
.param-card:hover { border-color: var(--border-bright); }
.param-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.param-label i { color: var(--blue); font-size: 9px; }
.param-value {
  font-family: var(--tc-font);
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 400;
}

/* ── Log Panel ── */
.log-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  flex: 1;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.log-panel-header {
  display: flex; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.2);
}
.log-actions { display: flex; gap: 6px; margin-left: auto; }

.table-wrapper { overflow: auto; flex: 1; }
.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.tc-table thead th {
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.tc-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.tc-table tbody tr:hover { background: var(--bg-hover); }
.tc-table td {
  padding: 7px 10px;
  color: var(--text-primary);
  white-space: nowrap;
  font-family: var(--tc-font);
  font-size: 11px;
}
.tc-table td.td-plain { font-family: var(--ui-font); font-size: 11px; }
.table-empty-row td {
  text-align: center; padding: 30px;
  color: var(--text-muted);
  font-family: var(--ui-font);
  font-size: 12px;
}
.table-empty-row i { font-size: 20px; margin-right: 8px; opacity: 0.5; }
.tc-badge { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.tc-badge.good { background: rgba(40,232,105,0.1); color: var(--green); }
.tc-badge.rec { background: rgba(232,40,45,0.1); color: var(--accent); }
.btn-row-action {
  background: none; border: none; color: var(--text-muted);
  font-size: 11px; cursor: pointer; padding: 2px 4px;
  border-radius: 4px; transition: color 0.15s;
}
.btn-row-action:hover { color: var(--accent); }
.note-input {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--ui-font);
  font-size: 11px;
  width: 120px;
  cursor: text;
}
.note-input:focus { outline: 1px solid var(--border-bright); border-radius: 3px; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════
   RIGHT PANEL — MONITOR
   ═══════════════════════════════════════════════════════ */
.panel-monitor { padding-bottom: 10px; }

.video-preview {
  margin: 10px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.video-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a0f18 0%, #060a10 100%);
}
.video-placeholder {
  display: flex; flex-direction: column; align-items: center;
  color: var(--text-muted); gap: 6px; text-align: center;
}
.video-placeholder i { font-size: 28px; margin-bottom: 4px; }
.video-placeholder p { font-size: 12px; font-weight: 500; }
.video-placeholder span { font-size: 10px; color: var(--text-muted); }
.video-tc-overlay {
  position: absolute; bottom: 6px; left: 6px;
  background: rgba(0,0,0,0.65);
  padding: 3px 8px; border-radius: 4px;
  font-family: var(--tc-font); font-size: 12px; color: #fff;
  backdrop-filter: blur(4px);
}

/* Quick Controls */
.quick-controls {
  margin: 0 10px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}
.qc-title {
  font-size: 10px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.qc-transport {
  display: flex; gap: 8px; justify-content: center;
  margin-bottom: 10px;
}
.btn-transport {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.btn-transport:hover { border-color: var(--border-bright); color: var(--text-primary); background: var(--bg-hover); }
#btnRecord { border-color: var(--accent); color: var(--accent); }
#btnRecord:hover { background: rgba(232,40,45,0.15); box-shadow: 0 0 12px var(--accent-glow); }
#btnRecord.active { background: var(--accent); color: #fff; box-shadow: 0 0 16px var(--accent-glow); animation: pulse 0.5s infinite; }
.btn-play { border-color: var(--green); color: var(--green); }
.btn-play:hover { background: rgba(40,232,105,0.1); }
.qc-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.qc-row .cfg-label { width: 50px; font-size: 10px; }
.qc-row .cfg-select, .qc-row .cfg-input { font-size: 11px; padding: 4px 6px; }

/* Scope */
.scope-panel {
  margin: 0 10px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.scope-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.scope-tab {
  flex: 1; padding: 6px; font-size: 10px; font-weight: 600;
  background: transparent; color: var(--text-muted);
  letter-spacing: 0.5px; border: none;
  cursor: pointer; transition: all 0.15s;
  border-right: 1px solid var(--border);
}
.scope-tab:last-child { border-right: none; }
.scope-tab.active { color: var(--text-primary); background: var(--bg-hover); }
.scope-tab:hover { color: var(--text-primary); }
.scope-canvas { display: block; width: 100%; background: #050810; }

/* Media Info */
.media-info {
  margin: 0 10px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}
.mi-title {
  font-size: 10px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.mi-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.mi-label { font-size: 10px; color: var(--text-secondary); width: 60px; flex-shrink: 0; }
.mi-bar-wrap {
  flex: 1; height: 5px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px; overflow: hidden;
}
.mi-bar { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.5s; }
.mi-bar.warn { background: var(--yellow); }
.mi-bar.crit { background: var(--accent); }
.mi-pct { font-size: 10px; color: var(--text-muted); width: 28px; text-align: right; font-family: var(--tc-font); }
.mi-value { font-family: var(--tc-font); font-size: 11px; color: var(--text-primary); }

/* Notes */
.notes-panel {
  margin: 0 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}
.notes-area {
  width: 100%; resize: none;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 7px 8px;
  font-size: 11px;
  line-height: 1.5;
  height: 70px;
  margin-top: 6px;
  transition: border-color 0.2s;
}
.notes-area:focus { border-color: var(--blue); }

/* ═══════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-backdrop.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 320px;
  box-shadow: var(--shadow);
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-backdrop.active .modal { transform: scale(1); }
.modal-wide { min-width: 520px; }
.modal-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary);
}
.modal .cfg-input { width: 100%; margin-bottom: 14px; padding: 8px 12px; font-size: 13px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-actions .btn-primary, .modal-actions .btn-secondary { flex: none; padding: 8px 20px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-section-title {
  font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px;
}

/* ═══════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 2000;
  pointer-events: none;
}
.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px;
  min-width: 220px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow);
  pointer-events: all;
  transform: translateX(120%);
  transition: transform 0.3s ease;
}
.toast.show { transform: translateX(0); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--accent); }
.toast.warning { border-color: var(--yellow); }
.toast-icon { font-size: 14px; }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--accent); }
.toast.warning .toast-icon { color: var(--yellow); }
.toast.info .toast-icon { color: var(--blue); }

/* ── Flash animation for TC register ── */
@keyframes tcFlash {
  0% { background: var(--accent); }
  50% { background: rgba(232,40,45,0.2); }
  100% { background: var(--bg-card); }
}
.tc-flash { animation: tcFlash 0.4s ease; }

/* ── Responsive tweaks ── */
@media (max-width: 1400px) {
  .params-grid { grid-template-columns: repeat(4, 1fr); }
  :root { --panel-monitor: 240px; }
}
@media (max-width: 1200px) {
  .cards-row { grid-template-columns: repeat(2, 1fr); }
  :root { --panel-w: 260px; }
}
