:root {
  --vg-black: #0b0b0b;
  --vg-orange: #f7941d;
  --vg-orange-dark: #d97800;
  --vg-panel-dark: #151515;
  --vg-text-light: #ffffff;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--vg-black);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #e0e0e0;
}

#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

#toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--vg-black);
  border-bottom: 1px solid #2a2a2a;
  z-index: 10;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

#workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#sidebar {
  width: 300px;
  min-width: 300px;
  height: 100%;
  background: var(--vg-black);
  border-right: 1px solid #333;
  overflow-y: auto;
  padding: 24px 20px;
  z-index: 1;
}

#scene-container {
  flex: 1;
  height: 100%;
}

/* Top toolbar */
#toolbar .toolbar-btn {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: #bbbbbb;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

#toolbar .toolbar-btn:hover {
  color: var(--vg-text-light);
  background: var(--vg-panel-dark);
  border-color: var(--vg-orange);
}

#toolbar .toolbar-divider {
  width: 1px;
  height: 22px;
  background: #444;
  margin: 0 5px;
  flex-shrink: 0;
}

#toolbar .toolbar-mode-group {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

#toolbar .toolbar-mode-btn {
  height: 28px;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 700;
  color: #999999;
  background: transparent;
  border: 1px solid #444;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

#toolbar .toolbar-mode-btn:first-child {
  border-radius: 5px 0 0 5px;
}

#toolbar .toolbar-mode-btn:last-child {
  border-radius: 0 5px 5px 0;
  border-left: none;
}

#toolbar .toolbar-mode-btn.active {
  color: var(--vg-text-light);
  background: var(--vg-orange);
  border-color: var(--vg-orange-dark);
}

#sidebar h2 {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--vg-text-light);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #444;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #cccccc;
  margin-bottom: 6px;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-wrap input,
.input-wrap select {
  flex: 1;
  height: 38px;
  padding: 0 10px;
  font-size: 14px;
  border: 1px solid #444;
  border-radius: 6px;
  background: var(--vg-panel-dark);
  color: #e0e0e0;
  outline: none;
  transition: border-color 0.2s;
}

.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--vg-orange);
}

.input-wrap input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.input-wrap select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23cccccc'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.input-wrap .unit {
  font-size: 13px;
  color: #cccccc;
  min-width: 28px;
  text-align: left;
}

.input-wrap .suffix {
  font-size: 12px;
  color: #888888;
  white-space: nowrap;
}

.btn-update {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--vg-panel-dark);
  border: 1px solid #444;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-update:hover {
  background: #222;
  border-color: var(--vg-orange);
}

.btn-update:active {
  background: #111;
}

/* Wall Toggles */
.walls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.wall-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #cccccc;
  cursor: pointer;
  padding: 6px 8px;
  background: var(--vg-panel-dark);
  border: 1px solid #444;
  border-radius: 6px;
  transition: border-color 0.2s;
}

.wall-toggle:hover {
  border-color: var(--vg-orange);
}

.wall-toggle input[type="checkbox"] {
  accent-color: var(--vg-orange);
}

/* Panel Info */
.panel-info {
  margin-top: 24px;
  padding: 16px;
  background: var(--vg-panel-dark);
  border: 1px solid #444;
  border-radius: 8px;
}

.panel-info h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #cccccc;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #444;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: #cccccc;
}

.info-row .info-val {
  font-weight: 600;
  color: #e0e0e0;
}

.info-separator {
  height: 1px;
  background: #444;
  margin: 10px 0;
}

/* Project Actions */
.project-actions {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #444;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-action {
  width: 100%;
  height: 38px;
  font-size: 13px;
  font-weight: 600;
  color: #cccccc;
  background: var(--vg-panel-dark);
  border: 1px solid #444;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover {
  background: #222;
  border-color: var(--vg-orange);
  color: #fff;
}

.btn-action:active {
  background: #111;
}

.btn-action.btn-danger {
  background: #5a1a1a;
  border-color: #883333;
  color: #ff8888;
}

.btn-action.btn-danger:hover {
  background: #7a2222;
  border-color: #aa4444;
}

.btn-action.btn-danger:active {
  background: #4a1515;
}

.btn-action.btn-measure {
  background: #1a4a2a;
  border-color: #2a6a3a;
  color: #88ff88;
}

.btn-action.btn-measure:hover {
  background: #2a5a3a;
  border-color: #44cc44;
}

.btn-action.btn-measure.active {
  background: #2a6a3a;
  border-color: #44cc44;
}

.btn-action.btn-accent {
  background: var(--vg-orange-dark);
  border-color: var(--vg-orange);
  color: #fff;
}

.btn-action.btn-accent:hover {
  background: var(--vg-orange);
  border-color: var(--vg-orange-dark);
}

/* Row Controls */
.row-card {
  background: var(--vg-panel-dark);
  border: 1px solid #444;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.row-card-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #cccccc;
  padding: 10px 12px;
  background: #111;
  border-bottom: 1px solid #444;
}

.row-card-body {
  padding: 12px;
}

.row-card-body .form-group {
  margin-bottom: 12px;
}

.row-card-body .form-group:last-child {
  margin-bottom: 0;
}

.helper-text {
  font-size: 10px;
  color: #888888;
  margin-top: 6px;
  font-style: italic;
}

.form-row {
  display: flex;
  gap: 8px;
}

.form-group.half {
  flex: 1;
}

.row-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #222;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.row-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--vg-orange);
  cursor: pointer;
  border: none;
}

.row-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--vg-orange);
  cursor: pointer;
  border: none;
}

.range-val {
  font-weight: 600;
  color: #e0e0e0;
}

.row-status {
  float: right;
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.row-status.invalid {
  color: #ff4444;
}

/* Client Presentation Panel */
.client-panel-inner {
  padding: 0;
}

.client-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  margin-bottom: 16px;
}

.client-summary-item {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  background: var(--vg-panel-dark);
  border-radius: 6px;
  border: 1px solid #444;
}

.client-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #aaaaaa;
  margin-bottom: 2px;
}

.client-value {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.client-camera-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.btn-camera {
  height: 34px;
  font-size: 12px;
  font-weight: 600;
  color: #cccccc;
  background: var(--vg-panel-dark);
  border: 1px solid #444;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-camera:hover {
  background: #222;
  border-color: var(--vg-orange);
  color: #fff;
}

.view-controls {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.view-controls .btn-camera {
  height: 28px;
  font-size: 11px;
  padding: 0 2px;
}

/* Presentation View — cleaner sidebar when presenting */
body.presentation-view #sidebar {
  width: 280px;
  min-width: 280px;
}

body.presentation-view #sidebar h2 {
  font-size: 14px;
  margin-bottom: 16px;
  padding-bottom: 8px;
}

body.presentation-view .client-summary-item {
  padding: 4px 6px;
}

body.presentation-view .client-value {
  font-size: 13px;
}

/* Quick Design Panel */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-bottom: 12px;
}

.quick-grid .form-group {
  margin-bottom: 8px;
}

.quick-grid .input-wrap input {
  height: 32px;
  font-size: 13px;
  padding: 0 8px;
}

.quick-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.quick-buttons .btn-action {
  flex: 1;
  font-size: 11px;
  padding: 6px 4px;
  height: 32px;
}

.row-status.valid {
  color: #44cc44;
}

/* BOM Panel */
.bom-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bom-section {
  background: var(--vg-panel-dark);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 10px 12px;
}

.bom-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #aaaaaa;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #444;
}

.bom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 13px;
}

.bom-label {
  color: #cccccc;
}

.bom-val {
  font-weight: 600;
  color: #e0e0e0;
}

.row-selection-indicator {
  padding: 6px 8px;
  margin-bottom: 8px;
  background: #111;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 12px;
  color: var(--vg-orange);
  text-align: center;
}

/* Solar Panel Editor */
.solar-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.solar-section {
  background: var(--vg-panel-dark);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px 10px;
}

.solar-section h4 {
  font-size: 11px;
  font-weight: 600;
  color: #cccccc;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.solar-row {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.solar-row label {
  flex: 1;
  font-size: 11px;
  color: #aaaaaa;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.solar-field {
  background: #0a0a0a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #e0e0e0;
  padding: 4px 6px;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}

.solar-field:focus {
  outline: none;
  border-color: var(--vg-orange);
}

select.solar-field {
  cursor: pointer;
}

.solar-check {
  margin-right: 6px;
}

.solar-section label {
  font-size: 11px;
  color: #aaaaaa;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.solar-section label input[type="number"] {
  flex: 1;
  max-width: 80px;
}

.solar-slider {
  flex: 1;
  max-width: 140px;
  accent-color: var(--vg-orange);
  cursor: pointer;
}

.slider-value {
  color: var(--vg-orange);
  font-weight: 700;
  margin-left: 6px;
  font-size: 12px;
  min-width: 36px;
  display: inline-block;
  text-align: right;
}

/* ===== Theme Modes ===== */

body.theme-light {
  --vg-black: #ececec;
  --vg-panel-dark: #ffffff;
  --vg-text-light: #222222;
}

body.theme-light {
  background: #ececec;
  color: #333333;
}

body.theme-light #sidebar {
  background: #ececec;
  border-right: 1px solid #ccc;
}

body.theme-light #sidebar h2 {
  color: #222;
  border-bottom-color: #ccc;
}

body.theme-light #toolbar {
  background: #ececec;
  border-bottom-color: #ccc;
}

body.theme-light #toolbar .toolbar-btn {
  color: #555;
}

body.theme-light #toolbar .toolbar-btn:hover {
  color: #222;
  background: #ddd;
  border-color: var(--vg-orange);
}

body.theme-light #toolbar .toolbar-mode-btn {
  color: #666;
  border-color: #bbb;
}

body.theme-light #toolbar .toolbar-mode-btn.active {
  color: #fff;
  background: var(--vg-orange);
  border-color: var(--vg-orange-dark);
}

body.theme-light .input-wrap input,
body.theme-light .input-wrap select {
  background: #f5f5f5;
  color: #333;
  border-color: #ccc;
}

body.theme-light .form-group label {
  color: #555;
}

body.theme-light .solar-section {
  background: #ffffff;
  border-color: #ddd;
}

body.theme-light .solar-section h4 {
  color: #444;
}

body.theme-light .solar-field {
  background: #f5f5f5;
  color: #333;
  border-color: #ccc;
}

body.theme-light .solar-row label {
  color: #666;
}

body.theme-light .btn-action {
  color: #555;
  background: #f0f0f0;
  border-color: #ccc;
}

body.theme-light .btn-action:hover {
  background: #e0e0e0;
  border-color: var(--vg-orange);
  color: #222;
}

body.theme-light .btn-action.btn-danger {
  background: #fdd;
  border-color: #e88;
  color: #c33;
}

body.theme-light .btn-action.btn-danger:hover {
  background: #fbb;
  border-color: #d66;
}

body.theme-light .btn-action.btn-accent {
  background: var(--vg-orange-dark);
  border-color: var(--vg-orange);
  color: #fff;
}

body.theme-light .btn-update {
  background: #f0f0f0;
  color: #333;
  border-color: #ccc;
}

body.theme-light .btn-update:hover {
  background: #e0e0e0;
  border-color: var(--vg-orange);
}

body.theme-light .panel-info {
  background: #ffffff;
  border-color: #ddd;
}

body.theme-light .panel-info h3 {
  color: #444;
  border-bottom-color: #ddd;
}

body.theme-light .info-row {
  color: #555;
}

body.theme-light .info-row .info-val {
  color: #333;
}

body.theme-light .row-card {
  background: #ffffff;
  border-color: #ddd;
}

body.theme-light .row-card-header {
  color: #555;
  background: #f5f5f5;
  border-bottom-color: #ddd;
}

body.theme-light .wall-toggle {
  color: #555;
  background: #ffffff;
  border-color: #ccc;
}

body.theme-light .bom-section {
  background: #ffffff;
  border-color: #ddd;
}

body.theme-light .bom-section-title {
  color: #666;
  border-bottom-color: #ddd;
}

body.theme-light .bom-label {
  color: #555;
}

body.theme-light .bom-val {
  color: #333;
}

body.theme-light .client-summary-item {
  background: #ffffff;
  border-color: #ddd;
}

body.theme-light .client-label {
  color: #888;
}

body.theme-light .client-value {
  color: #222;
}

body.theme-light .btn-camera {
  color: #555;
  background: #f0f0f0;
  border-color: #ccc;
}

body.theme-light .btn-camera:hover {
  background: #e0e0e0;
  border-color: var(--vg-orange);
  color: #222;
}

body.theme-light #toolbar .toolbar-divider {
  background: #ccc;
}

body.theme-light .project-actions {
  border-top-color: #ccc;
}

body.theme-light .row-selection-indicator {
  background: #f5f5f5;
  border-color: #ccc;
}

body.theme-light .helper-text {
  color: #999;
}

body.theme-light .range-val {
  color: #333;
}

body.theme-light .row-slider {
  background: #ddd;
}

body.theme-light .input-wrap .unit {
  color: #666;
}

body.theme-light .input-wrap select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555555'/%3E%3C/svg%3E");
}


