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

body {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#root {
  width: 100%;
  height: 100%;
}

.app {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Canvas — занимает всё доступное пространство */
.canvas-container {
  flex: 1;
  height: 100%;
  position: relative;
  z-index: 1;
}

.canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Панель расчетов — поверх canvas слева */
.calculation-panel {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 280px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

/* Правое меню — фиксированная ширина */
.controls {
  width: 350px;
  min-width: 350px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  padding: 20px;
  z-index: 10;
  position: relative;
}

.calculation-header {
  padding: 12px 16px;
  background: #f8f8f8;
  border-bottom: 1px solid #e0e0e0;
  border-radius: 8px 8px 0 0;
}

.calculation-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.calculation-content {
  padding: 16px;
}

.calculate-button {
  width: 100%;
  padding: 12px;
  background: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.calculate-button:hover:not(:disabled) {
  background: #45a049;
}

.calculate-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.price-result {
  margin-top: 16px;
}

.total-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f0f8f0;
  border-radius: 6px;
}

.total-price span {
  font-size: 14px;
  color: #666;
}

.total-price strong {
  font-size: 20px;
  color: #2e7d32;
}

.toggle-details {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  color: #666;
}

.toggle-details:hover {
  background: #f5f5f5;
}

.price-details {
  margin-top: 12px;
}

.details-section {
  margin-bottom: 12px;
}

.details-section h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: #555;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: #666;
}

.detail-total {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  margin-top: 4px;
  border-top: 1px solid #eee;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* ===== ПРАВОЕ МЕНЮ (CONTROLS) ===== */
.controls {
  position: absolute;
  right: 0;
  top: 0;
  width: 350px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  padding: 20px;
  z-index: 10;
}

.controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

.controls-header h3 {
  font-size: 18px;
  color: #333;
}

.section {
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.section-header {
  width: 100%;
  padding: 15px;
  background: #f8f9fa;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  transition: background 0.3s;
}

.section-header:hover {
  background: #e9ecef;
}

.arrow {
  font-size: 12px;
}

.section-content {
  padding: 15px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 15px;
}

.control-group label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.menu-button {
  padding: 10px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.3s;
}

.menu-button:hover {
  background: #5a67d8;
}

.menu-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.expand-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  font-size: 14px;
  z-index: 10;
}

/* ===== ГЛОБАЛЬНОЕ МЕНЮ ===== */
.global-menu {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.global-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.global-section h4 {
  margin: 0;
  font-size: 13px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wall-dimensions {
  display: flex;
  gap: 10px;
}

.dimension-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dimension-field label {
  font-size: 11px;
  color: #888;
}

.dimension-field input {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

.rebuild-buttons {
  display: flex;
  gap: 10px;
}

.rebuild-button {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.color-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatches {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: all 0.2s;
}

.color-swatch.active {
  border-color: #000;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.countertop-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.countertop-toggle {
  width: 100%;
  padding: 10px;
  font-size: 13px;
  cursor: pointer;
}

/* ===== МЕНЮ МОДУЛЕЙ ===== */
.module-menu {
  margin-bottom: 15px;
}

.module-category-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.category-tab {
  flex: 1;
  padding: 8px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.category-tab.active {
  background: #667eea;
  color: white;
}

.module-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.module-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

.module-item:hover {
  background: #e9ecef;
}

.module-item.selected {
  background: #e3f2fd;
  border-color: #90caf9;
}

.module-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.module-icon {
  font-size: 20px;
}

.module-name {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.module-width {
  font-size: 12px;
  color: #666;
}

.module-add-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.add-label {
  font-size: 14px;
  color: #333;
}

/* ===== СВОЙСТВА МОДУЛЯ ===== */
.width-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.width-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.width-label {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #666;
}

.width-btn {
  padding: 8px 12px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.3s;
}

.width-btn:hover {
  background: #e0e0e0;
}

.expand-left, .expand-right {
  background: #e8f5e9;
  border-color: #4caf50;
}

.shrink-left, .shrink-right {
  background: #fff3e0;
  border-color: #ff9800;
}

.snap-left, .snap-right {
  background: #e3f2fd;
  border-color: #2196f3;
  flex: 1;
}

.compact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 12px;
  color: #666;
}

.toggle-open-button {
  padding: 10px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.drawer-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-btn {
  padding: 10px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.drawer-btn.active {
  background: #667eea;
  color: white;
}

.gaps-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
}

.gap-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #333;
}

/* ===== СПИСОК МОДУЛЕЙ ===== */
.cabinet-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cabinet-item {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.3s;
}

.cabinet-item.selected {
  background: #e3f2fd;
  border: 1px solid #90caf9;
}* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}

/* ===== СТИЛИ ДЛЯ СТРАНИЦЫ МЕНЕДЖЕРА (/manager) ===== */

.manager-page {
  min-height: 100vh;
  background: #f5f5f5;
  overflow-y: auto;
}

.manager-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: #2c3e50;
  color: #fff;
}

.manager-page-header h1 {
  margin: 0;
  font-size: 24px;
}

.manager-back {
  padding: 8px 16px;
  background: #34495e;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.manager-back:hover {
  background: #3d566e;
}

.manager-page-content {
  display: flex;
  height: calc(100vh - 80px);
}

/* Сайдбар со списком заказов */
.manager-sidebar {
  width: 350px;
  min-width: 350px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  padding: 20px;
  overflow-y: auto;
}

.manager-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.manager-filters select {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

.manager-refresh {
  padding: 8px 12px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.manager-refresh:hover {
  background: #2980b9;
}

.manager-error {
  padding: 10px;
  background: #ffebee;
  border-radius: 4px;
  color: #c62828;
  font-size: 13px;
  margin-bottom: 12px;
}

.manager-loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

.manager-orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manager-empty {
  text-align: center;
  padding: 40px;
  color: #999;
}

.manager-order-item {
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.manager-order-item:hover {
  border-color: #3498db;
  background: #f8f9fa;
}

.manager-order-item.selected {
  border-color: #3498db;
  background: #e3f2fd;
}

.manager-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.manager-order-number {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.manager-order-status {
  padding: 4px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.manager-order-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
}

/* Основная область с деталями */
.manager-main {
  flex: 1;
  padding: 20px 40px;
  overflow-y: auto;
}

.manager-no-selection {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-size: 18px;
}

.manager-order-details-header {
  margin-bottom: 20px;
}

.manager-order-details-header h2 {
  margin: 0;
  font-size: 22px;
  color: #333;
}

.manager-order-details-content {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
}

.manager-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.manager-detail-row select {
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

.manager-config {
  margin-top: 20px;
}

.manager-config h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #555;
}

.manager-table {
  width: 100%;
  border-collapse: collapse;
}

.manager-table th,
.manager-table td {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  text-align: left;
  font-size: 13px;
}

.manager-table th {
  background: #f5f5f5;
  font-weight: 600;
}

.manager-details-actions {
  margin-top: 20px;
}

.manager-download-pdf {
  width: 100%;
  padding: 12px;
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.manager-download-pdf:hover {
  background: #229954;
}

/* Страница "Доступ запрещен" */
.manager-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  background: #f5f5f5;
}

.manager-denied h1 {
  font-size: 36px;
  color: #c62828;
  margin-bottom: 16px;
}

.manager-denied p {
  font-size: 16px;
  color: #666;
  margin-bottom: 24px;
}

.manager-denied button {
  padding: 12px 24px;
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

.manager-denied button:hover {
  background: #34495e;
}