/* =========================================================
   TABLES-MODALS.CSS — таблицы (товары/заказы/сводка) и модальные окна.
   ========================================================= */

/* =========================================================
   ТАБЛИЦЫ
   ========================================================= */
.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.product-table, .order-table, .summary-detail-table {
  font-size: 13px;
}

.product-table th, .order-table th, .summary-detail-table th {
  text-align: left;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.product-table td, .order-table td, .summary-detail-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bg);
  color: var(--text);
  vertical-align: middle;
}

.product-table tbody tr:last-child td,
.order-table tbody tr:last-child td,
.summary-detail-table tbody tr:last-child td { border-bottom: none; }

.product-table tbody tr:hover, .order-table tbody tr:hover { background: var(--surface-hover); }

.margin-col-header { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.margin-col-header .lock-btn { min-width:auto; height: 20px; padding:0 6px; font-size: 10px; }

.margin-locked-cell { color: var(--text-faint); letter-spacing: 2px; }
.positive { color: var(--success); font-weight: 600; }
.negative { color: var(--danger); font-weight: 600; }

.editable, .editable-category {
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease;
}
.editable:hover, .editable-category:hover {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-soft-strong);
}

.table-heading {
  padding: 12px 14px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.access-notice {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 13.5px;
}

/* Идентификатор пользователя, скрытый до подтверждения */
.uid-mask {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 1px;
}
.uid-reveal-btn {
  margin-left: 8px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
}
.uid-reveal-btn:hover { border-color: var(--accent); color: var(--accent); }
.uid-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
}

/* =========================================================
   МОДАЛЬНЫЕ ОКНА
   ========================================================= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 30, 0.42);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal[style*="block"] { display: flex !important; }

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 92%;
  max-width: 460px;
  max-height: 86vh;
  overflow-y: auto;
  animation: modal-in 0.14s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15.5px; }

.modal-header .close {
  cursor: pointer;
  color: var(--text-faint);
  font-size: 20px;
  line-height: 1;
}
.modal-header .close:hover { color: var(--text); }

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-body input[type="text"],
.modal-body input[type="number"],
.modal-body input[type="password"],
.modal-body input[type="email"],
.modal-body select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  width: 100%;
}
.modal-body input:focus, .modal-body select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-row-label {
  width: 62px;
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}
.price-row-hint {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Список дополнительных поставщиков с ценой закупки в модалке товара
   (см. renderSupplierPricesRows() в products.js) */
.supplier-prices-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}
.supplier-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.supplier-price-row input[type="text"] { flex: 1.4; }
.supplier-price-row input[type="number"] { flex: 1; }

