:root {
  --ft: 'Assistant', sans-serif;
  --bg: #f6f6f7;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: rgba(17, 24, 39, 0.10);
  --shadow: 0 10px 30px rgba(0,0,0,0.06);
  --primary: #111827;
  --primary-2: #111827;
  --green: #22c55e;
  --green-bg: #dcfce7;
  --red: #ef4444;
  --red-bg: #fee2e2;
  --chip: #f3f4f6;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--ft);
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }
button, input, select, textarea { font-family: inherit; }

.app { min-height: 100%; display: grid; grid-template-rows: auto 1fr; }

.topbar {
  height: 56px;
  padding: 0 18px;
  background: #111;
  color: #fff;
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  align-items: center;
  gap: 14px;
}

.crumb { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.crumb__icon { opacity: 0.95; }
.crumb__text { font-size: 13px; }

.topsearch {
  height: 34px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
}

.topsearch i { opacity: 0.9; }
.topsearch input {
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  width: 100%;
  font-size: 13px;
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.10);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.topbar__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: rgba(255,255,255,0.10);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
}

.icon-btn:hover { background: rgba(255,255,255,0.16); }

.dot {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #ec4899;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
}

.account { font-size: 12px; font-weight: 700; opacity: 0.9; }

.main {
  padding: 18px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.page-actions { display: inline-flex; align-items: center; gap: 10px; }

.btn {
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: #111;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn:hover { box-shadow: 0 10px 18px rgba(0,0,0,0.06); }

.btn--primary {
  background: #111;
  color: #fff;
  border-color: rgba(255,255,255,0.1);
}

.btn--primary:hover { background: #000; }

.tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 10px;
}

.tab {
  border: 0;
  background: transparent;
  font-weight: 800;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
  padding: 8px 4px;
}

.tab.is-active { color: #111; }

.tab--plus {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(0,0,0,0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.pad { padding: 14px; }

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.table-tools__right { display: inline-flex; gap: 8px; }

.table-tools .icon-btn {
  background: rgba(0,0,0,0.06);
  color: #111;
}

.table-tools .icon-btn:hover { background: rgba(0,0,0,0.10); }

.chip {
  height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--chip);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.chip.is-on { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.25); }

.muted { color: var(--muted); font-size: 12px; font-weight: 600; }

.table-wrap { overflow: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th, .table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.table th { color: #6b7280; font-weight: 900; font-size: 11px; }

.col-check { width: 34px; }
.col-product { width: 520px; }
.col-status { width: 140px; }
.col-inv { width: 160px; }
.col-cat { width: 240px; }
.col-ch { width: 90px; text-align: right; }

.row-product {
  display: flex;
  align-items: center;
  gap: 10px;
}

.thumb {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  overflow: hidden;
  flex: 0 0 34px;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pname {
  font-weight: 800;
  cursor: pointer;
  white-space: normal;
  line-height: 1.2;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.badge--green { background: var(--green-bg); color: #166534; }
.badge--gray { background: rgba(0,0,0,0.06); color: #374151; }
.badge--red { background: var(--red-bg); color: #991b1b; }

.inv-red { color: #b91c1c; font-weight: 900; }
.inv-ok { color: #111827; font-weight: 800; }

.table-empty {
  padding: 26px;
  display: grid;
  place-items: center;
  gap: 12px;
}

.table-empty__text { font-weight: 900; }

.table-loading { padding: 12px; }
.row-skel {
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(90deg,#f0f0f0,#fafafa,#f0f0f0);
  background-size: 200% 100%;
  animation: sk 1.15s infinite linear;
  margin-bottom: 10px;
}
@keyframes sk { 0%{background-position:0% 0} 100%{background-position:200% 0} }

.learn {
  display: grid;
  place-items: center;
  padding: 16px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.menu { position: relative; }
.menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.10);
  overflow: hidden;
  z-index: 120;
}

.menu__item {
  width: 100%;
  border: 0;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.menu__item:hover { background: rgba(0,0,0,0.05); }
.menu__item.danger { color: #b91c1c; }

.editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.editor-crumb { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; }
.editor-actions { display: inline-flex; align-items: center; gap: 10px; }

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
}

.card-title { font-weight: 900; font-size: 12px; margin-bottom: 10px; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field__label { font-weight: 900; font-size: 11px; color: #6b7280; }

input[type="text"],
input[type="number"],
.select,
.textarea {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0 12px;
  outline: none;
  font-size: 13px;
}

.textarea { height: auto; padding: 10px 12px; resize: vertical; }

.row { display: flex; gap: 10px; align-items: center; }
.row--between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.toggle { display: inline-flex; align-items: center; cursor: pointer; }
.toggle input { display: none; }
.toggle__ui {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.06);
  position: relative;
}
.toggle__ui::after {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: 0.15s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.toggle input:checked + .toggle__ui { background: rgba(34,197,94,0.20); border-color: rgba(34,197,94,0.35); }
.toggle input:checked + .toggle__ui::after { left: 24px; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.media-item {
  position: relative;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  overflow: hidden;
  aspect-ratio: 1/1;
}

.media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.media-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 0;
  background: rgba(0,0,0,0.75);
  color: #fff;
  cursor: pointer;
}

.media-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

.media-url-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.media-url-section .input {
  flex: 1;
  min-width: 0;
}

.media-url-section .btn {
  white-space: nowrap;
}

.media-add {
  width: 84px;
  height: 84px;
  border-radius: 14px;
  border: 2px dashed rgba(0,0,0,0.14);
  background: transparent;
  cursor: pointer;
  color: #6b7280;
}

.media-add:hover { background: rgba(0,0,0,0.03); }

.link { color: #2563eb; font-weight: 800; font-size: 12px; text-decoration: none; }
.link:hover { text-decoration: underline; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.cat-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cat-name { font-weight: 900; }

.banner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.banner-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.banner-img {
  width: 100%;
  height: 180px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  overflow: hidden;
}

.banner-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 80;
}

.overlay[hidden] { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0,0,0,0.92);
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.25);
  opacity: 0;
  transition: 0.18s ease;
  z-index: 120;
  pointer-events: none;
  font-weight: 800;
  font-size: 12px;
}

.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 120;
}

.modal[hidden] { display: none !important; }

.modal__panel {
  width: min(520px, calc(100vw - 28px));
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 26px 70px rgba(0,0,0,0.20);
  padding: 14px;
}

.modal__title { font-weight: 900; margin-bottom: 8px; }
.modal__body { color: #374151; font-weight: 600; font-size: 13px; line-height: 1.6; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 200px 1fr 220px; }
  .account { display: none; }
  .editor-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  .topbar { grid-template-columns: 1fr; height: auto; padding: 12px; gap: 10px; }
  .topbar__right { justify-content: flex-start; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-actions { flex-wrap: wrap; }
  .media-grid { grid-template-columns: repeat(3, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .banner-grid { grid-template-columns: 1fr; }
}
