/* Bridge Portal — дополнения к app.css */

.hidden { display: none !important; }

.portal-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.portal-login .login-box {
  width: min(420px, 100%);
  margin-bottom: 0;
}

.login-lead {
  font-size: 13px;
  color: var(--text-muted);
  margin: -8px 0 18px;
}

.err {
  color: var(--danger);
  font-size: 12px;
  margin-top: 10px;
}

.muted-text {
  color: var(--text-muted);
  font-size: 13px;
}

.portal-modal-wide {
  width: min(820px, 100%);
}

.portal-modal-scroll {
  max-height: min(70vh, 680px);
  overflow-y: auto;
}

/* Product card */
.product-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.product-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-gallery img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.product-gallery img.main {
  width: 140px;
  height: 140px;
}

.product-sku {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.product-name {
  font-size: 18px;
  margin: 4px 0 8px;
  font-weight: 700;
}

.card-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 700;
}

.attr-table {
  width: 100%;
  font-size: 12px;
}

.attr-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.attr-table td:first-child {
  color: var(--text-muted);
  width: 38%;
  vertical-align: top;
}

.dim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dim-box {
  background: var(--accent-soft);
  border-radius: 9px;
  padding: 12px;
  font-size: 12px;
  border: 1px solid rgba(31, 122, 98, 0.12);
}

.dim-box strong {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.goods-table .col-photo {
  width: 56px;
  padding: 8px 10px;
}

.goods-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  background: #fff;
}

.goods-thumb-btn {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  line-height: 0;
}

.goods-thumb-btn:hover .goods-thumb {
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.goods-thumb-empty {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px dashed var(--border);
}

.barcodes-view {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.barcode-chip {
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.barcode-chip.primary {
  border-color: rgba(31, 122, 98, 0.35);
  font-weight: 700;
}

.barcodes-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.barcode-row input {
  flex: 1;
}

.barcode-row .btn {
  padding: 6px 10px;
  min-width: 36px;
}

.badge.muted {
  color: var(--text-muted);
  background: rgba(30, 70, 55, 0.06);
  border-color: var(--border);
}

.badge.off {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(192, 57, 43, 0.2);
}

/* Nav submenu — серийные номера под «Товары» */
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-head {
  width: 100%;
}

.nav-sub {
  margin: 0 0 4px 12px;
  padding-left: 8px;
  border-left: 2px solid rgba(31, 122, 98, 0.15);
}

.nav-sub-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  text-align: left;
}

.nav-sub-toggle:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.nav-chevron {
  font-size: 10px;
  transition: transform 0.15s ease;
}

.nav-sub.open .nav-chevron {
  transform: rotate(90deg);
}

.nav-sub-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.nav-sub-item {
  width: 100%;
  padding: 8px 10px 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  border-radius: 8px;
  text-align: left;
  line-height: 1.35;
}

.nav-sub-item:hover,
.nav-sub-item.active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.serial-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 12px;
}

.serial-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}

.serial-tab.active {
  background: var(--accent-soft);
  border-color: rgba(31, 122, 98, 0.35);
  color: var(--text);
}

textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  background: #fff;
}

@media (max-width: 900px) {
  .product-card {
    grid-template-columns: 1fr;
  }
}

.settings-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.settings-section-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.settings-section-hint {
  margin: 0 0 14px;
  font-size: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-label {
  font-size: 13px;
  font-weight: 600;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #e8e8e8;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: left 0.15s;
}

.switch.on {
  background: var(--accent-soft);
  border-color: rgba(31, 122, 98, 0.35);
}

.switch.on::after {
  left: 21px;
  background: var(--accent);
}

.switch.disabled {
  opacity: 0.5;
  pointer-events: none;
}
