/* ==========================================
   WAREHOUSES (Кладовки)
   ========================================== */

[data-tab="warehouses"] .nav-tab-icon {
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent-cyan);
}

/* ------------------------------------------
   Warehouse Card (список)
   ------------------------------------------ */

.warehouse-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.warehouse-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.warehouse-card.inactive { opacity: 0.45; }

.warehouse-card-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.warehouse-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.warehouse-card-icon svg { width: 22px; height: 22px; }

.warehouse-card-info { min-width: 0; }

.warehouse-card-name {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.warehouse-card-address {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.warehouse-card-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: 12px;
}

.warehouse-free-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  white-space: nowrap;
}

.warehouse-free-badge.none {
  background: rgba(85, 85, 102, 0.12);
  color: var(--text-muted);
}

.warehouse-card-chevron {
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ------------------------------------------
   Filter bar
   ------------------------------------------ */

.warehouse-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 32px 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
}

.warehouse-filter-search {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.warehouse-filter-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.warehouse-filter-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.warehouse-filter-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--border-glow);
}

.warehouse-filter-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.warehouse-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.warehouse-toggle input { opacity: 0; width: 0; height: 0; }

.warehouse-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  transition: all 0.3s ease;
}

.warehouse-toggle-slider::before {
  position: absolute;
  content: '';
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.warehouse-toggle input:checked + .warehouse-toggle-slider {
  background: rgba(0, 212, 255, 0.2);
  border-color: var(--accent-cyan);
}

.warehouse-toggle input:checked + .warehouse-toggle-slider::before {
  transform: translateX(18px);
  background: var(--accent-cyan);
}

/* ------------------------------------------
   Warehouse fullscreen panel
   Открывается поверх всего как модал справа
   ------------------------------------------ */

.wh-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.wh-panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Основная панель кладовки */
.wh-panel {
  position: fixed;
  top: 0;
  right: -620px;
  width: 620px;
  height: 100dvh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.wh-panel.open { right: 0; }

/* Когда открыта ячейка — панель кладовки уходит влево */
.wh-panel.shifted {
  right: 420px;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.wh-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg-card);
}

.wh-panel-header-left { min-width: 0; flex: 1; }

.wh-panel-name {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  line-height: 1.2;
}

.wh-panel-address {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.wh-panel-address svg { width: 13px; height: 13px; color: var(--accent-cyan); flex-shrink: 0; }

.wh-panel-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.wh-panel-close:hover { background: rgba(239,68,68,0.1); border-color: var(--accent-red); color: var(--accent-red); }
.wh-panel-close svg { width: 18px; height: 18px; }

.wh-stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.wh-stat-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.wh-stat-chip.free {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.25);
  color: var(--accent-green);
}

.wh-stat-chip.busy {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.2);
  color: var(--accent-red);
}

.wh-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  -webkit-overflow-scrolling: touch;
}

/* Категория */
.wh-category-label {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.wh-category-label:first-child { margin-top: 4px; }

/* Сетка ячеек */
.wh-cells-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Карточка ячейки */
.wh-cell {
  padding: 14px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--accent-green);
  background: rgba(16,185,129,0.04);
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}

.wh-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(16,185,129,0.06);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.wh-cell:hover::before { opacity: 1; }
.wh-cell:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.wh-cell:active { transform: translateY(0); }

.wh-cell.busy {
  border-color: var(--accent-red);
  background: rgba(239,68,68,0.04);
}

.wh-cell.busy::before { background: rgba(239,68,68,0.06); }

.wh-cell.reserve {
  border-color: var(--accent-orange);
  background: rgba(245,158,11,0.04);
}

.wh-cell.reserve::before { background: rgba(245,158,11,0.06); }

.wh-cell-num {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.2px;
}

.wh-cell-dims {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.wh-cell-dim { display: flex; flex-direction: column; gap: 3px; }

.wh-cell-dim-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.wh-cell-dim-lbl {
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.wh-cell-status {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.wh-cell-status.free    { color: var(--accent-green); }
.wh-cell-status.busy    { color: var(--accent-red); }
.wh-cell-status.reserve { color: var(--accent-orange); }

/* ------------------------------------------
   Cell detail side panel
   ------------------------------------------ */

.wh-cell-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100dvh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  z-index: 202;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.wh-cell-panel.open { right: 0; }

.wh-cell-panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  flex-shrink: 0;
}

.wh-cell-panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.wh-cell-panel-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.wh-cell-panel-close:hover { background: rgba(239,68,68,0.1); border-color: var(--accent-red); color: var(--accent-red); }
.wh-cell-panel-close svg { width: 16px; height: 16px; }

.wh-cell-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 32px;
}

/* Номер + статус */
.wcp-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.wcp-num {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.8px;
}

.wcp-status {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}

.wcp-status.free   { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.wcp-status.busy   { background: rgba(239,68,68,0.15);  color: var(--accent-red); }
.wcp-status.reserve{ background: rgba(245,158,11,0.15); color: var(--accent-orange); }

/* Главные размеры */
.wcp-main-dims {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  background: var(--bg-card-hover);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 14px;
  overflow: hidden;
}

.wcp-main-dim {
  flex: 1;
  padding: 16px 12px;
  text-align: center;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wcp-main-dim:last-child { border-right: none; }

.wcp-main-dim-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -1.5px;
  line-height: 1;
}

.wcp-main-dim-unit {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.wcp-main-dim-lbl {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
  font-weight: 500;
}

/* Детальные размеры */
.wcp-dims-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.wcp-dim-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.wcp-dim-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.wcp-dim-lbl {
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

/* Цены */
.wcp-prices-label {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.wcp-prices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wcp-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(245,158,11,0.04);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 10px;
}

.wcp-price-row.highlight {
  background: rgba(245,158,11,0.04);
  border-color: rgba(245,158,11,0.2);
}

.wcp-price-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wcp-price-period {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.wcp-discount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(16,185,129,0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.wcp-price-right { text-align: right; }

.wcp-price-total {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-orange);
  letter-spacing: -0.5px;
}

.wcp-price-monthly {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ------------------------------------------
   Mobile
   ------------------------------------------ */

@media (max-width: 768px) {
  .warehouse-filter-bar {
    align-items: stretch;
    flex-direction: column;
    padding: 0 16px 12px;
  }

  .warehouse-filter-search {
    max-width: none;
  }

  .warehouse-filter-toggle {
    justify-content: flex-end;
  }
  .warehouse-card { padding: 14px 16px; }

  .wh-panel { width: 100%; right: -100%; }
  .wh-panel.shifted { right: 0; }

  .wh-cell-panel { width: 100%; right: -100%; }

  .wh-cells-grid { grid-template-columns: repeat(2, 1fr); }

  .wcp-main-dims { flex-wrap: wrap; }
  .wcp-dims-row { grid-template-columns: repeat(2, 1fr); }
}

@media (hover: none) and (pointer: coarse) {
  .warehouse-card:hover { transform: none; box-shadow: none; }
  .warehouse-card:active { background: var(--bg-card-hover); }
  .wh-cell:hover { transform: none; box-shadow: none; }
  .wh-cell:active { opacity: 0.75; }
}
