﻿:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #66788a;
  --brand: #0d5b8f;
  --accent: #f6a609;
  --line: #d9e1e8;
  --ok: #157f3b;
  --danger: #bd1e1e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #eef6ff 0%, var(--bg) 45%);
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-secondary {
  background: #e8f1f8;
  color: var(--brand);
}

.btn-danger {
  background: #ffe3e3;
  color: var(--danger);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 25px rgba(2, 26, 43, 0.04);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #e8ebef;
  color: #27313c;
}

.tab-btn.active {
  background: var(--brand);
  color: #fff;
}

.grid-2 {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.list {
  display: grid;
  gap: 8px;
  width: 100%;
}

.list > * {
  width: 100%;
  min-width: 0;
}

.product-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.product-card img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  background: #eef2f5;
}

.image-paste-zone {
  width: 100%;
  border: 1px dashed transparent;
  border-radius: 10px;
  padding: 4px;
  background: #f7fafc;
}

.image-paste-zone.active {
  border-color: var(--brand);
  background: #edf6ff;
}

.product-meta {
  font-size: 12px;
  color: var(--muted);
}

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

.row > * {
  min-width: 0;
  max-width: 100%;
}

#selected-zone,
#family-select,
#subcategory-select {
  flex: 1 1 240px;
  max-width: 100%;
}

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

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.kpi {
  font-size: 12px;
  color: var(--muted);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #ebf8ee;
  color: var(--ok);
}

.summary-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f2f5f8;
  display: block;
}

.zone-cover-wrap {
  margin: 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f2f5f8;
  overflow: hidden;
}

.zone-cover {
  width: 100%;
  max-height: 220px;
  display: block;
  object-fit: cover;
  object-position: center;
}

.category-row {
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fbfdff;
  flex-wrap: nowrap;
}

.category-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 30, 0.46);
  display: grid;
  place-items: center;
  z-index: 999;
  padding: 16px;
  overflow: auto;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 20px 40px rgba(4, 20, 33, 0.25);
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.category-manager-list {
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.icon-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 920px) {
  .container {
    padding: 12px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .table th,
  .table td {
    white-space: nowrap;
    font-size: 12px;
    padding: 6px;
  }

  .summary-thumb {
    width: 34px;
    height: 34px;
  }

  #selected-zone,
  #family-select,
  #subcategory-select,
  #open-zone-edit-modal,
  #open-zone-create-modal {
    flex: 1 1 100%;
    width: 100%;
  }
}
