/* Общие стили */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }
  
  .container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
  }
  
  /* Заголовки */
  h1 {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    color: #333;
  }
  
  /* Кнопки */
  button {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 15px;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    background-color: #e7e7e7;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    color: #000;
  }
  
  button:hover {
    background-color: #d7d7d7;
  }
  
  /* Списки */
  ul {
    list-style: none;
    padding: 0;
  }
  
  li {
    margin: 10px 0;
    padding: 10px;
    font-size: 20px;
    font-weight: bold;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
  }
  
  li:hover {
    background-color: #f0f0f0;
  }

  /* Вместимость на кнопке ячейки */
  .cell-name {
    display: block;
    font-size: 20px;
    font-weight: bold;
  }

  .cell-capacity {
    display: block;
    font-size: 15px;
    font-weight: bold;
    color: #444;
    margin-top: 4px;
  }
  
  /* Штрих-код */
  #barcode-svg {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px auto;
    background: white;
  }
  
  /* Кнопки закрытия в верхней части */
  #close-section, #close-gates, #close-cells, #close-warehouse {
    background-color: #ff4d4d;
    color: #fff;
    border: none;
    font-size: 18px;
    padding: 10px;
    margin-bottom: 10px;
    width: auto;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  #close-section:hover, #close-gates:hover, #close-cells:hover, #close-warehouse:hover {
    background-color: #ff3333;
  }

  /* Кнопка закрытия для изображения */
  #close-item {
    background-color: #ff4d4d;
    color: #fff;
    border: none;
    font-size: 24px;
    padding: 10px 20px;
    margin: 10px auto;
    display: block;
    border-radius: 5px;
    cursor: pointer;
    width: 200px;
  }

  #close-item:hover {
    background-color: #ff3333;
  }

  /* Вместимость под штрих-кодом */
  .barcode-capacity {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    padding: 10px 0 20px;
  }

  /* Скрытый класс */
  .hidden {
    display: none !important;
  }

  /* === Сканер === */

  /* Плавающая кнопка */
  .scanner-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: #fff;
    font-size: 26px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
  }

  .scanner-fab:hover {
    background-color: #43A047;
  }

  /* Полноэкранный оверлей */
  .scanner-overlay {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .scanner-header {
    padding: 10px 15px;
    border-bottom: 1px solid #ccc;
  }

  .scanner-close-btn {
    background-color: #ff4d4d;
    color: #fff;
    border: none;
    font-size: 22px;
    padding: 8px 18px;
    border-radius: 5px;
    cursor: pointer;
    width: auto;
    margin: 0 0 10px 0;
  }

  .scanner-close-btn:hover {
    background-color: #ff3333;
  }

  .scanner-mode-tabs {
    display: flex;
    gap: 10px;
  }

  .scanner-tab {
    flex: 1;
    padding: 12px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    background-color: #e7e7e7;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    margin: 0;
  }

  .scanner-tab.active {
    background-color: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
  }

  /* Область камеры */
  .scanner-camera {
    flex: 1;
    padding: 15px;
  }

  #scanner-reader {
    width: 100%;
  }

  .scanner-error {
    color: #ff4d4d;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 20px;
  }

  /* Ручной ввод */
  .scanner-text-input {
    padding: 20px 15px;
  }

  .scanner-text-input p {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: #333;
  }

  .scanner-text-input input,
  .scanner-result input {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 22px;
    font-weight: bold;
    border: 2px solid #ccc;
    border-radius: 5px;
    margin-bottom: 10px;
    box-sizing: border-box;
  }

  .scanner-text-input input:focus,
  .scanner-result input:focus {
    border-color: #4CAF50;
    outline: none;
  }

  .scanner-action-btn {
    background-color: #4CAF50;
    color: #fff;
    border: none;
    font-size: 20px;
    font-weight: bold;
    padding: 14px;
    border-radius: 5px;
    cursor: pointer;
  }

  .scanner-action-btn:hover {
    background-color: #43A047;
  }

  /* Результат */
  .scanner-result {
    padding: 20px 15px;
  }

  .scanner-result label {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
  }

  .scanner-generate-btn {
    background-color: #2196F3;
    color: #fff;
    border: none;
    font-size: 22px;
    font-weight: bold;
    padding: 16px;
    border-radius: 5px;
    cursor: pointer;
  }

  .scanner-generate-btn:hover {
    background-color: #1976D2;
  }

  /* Штрихкод в оверлее */
  #result-barcode-svg {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 15px auto 0;
    background: white;
  }

