:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg-soft: var(--tg-theme-secondary-bg-color, #f4f4f6);
  --text: var(--tg-theme-text-color, #14141a);
  --hint: var(--tg-theme-hint-color, #8b8b93);
  --accent: #6656e8;
  --accent-text: #ffffff;
  --border: rgba(0, 0, 0, 0.07);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --border: rgba(255, 255, 255, 0.08);
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 16px 16px 32px;
}

h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 4px 0 18px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.banner-admin-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 10px;
}

.banner-admin-item {
  position: relative;
  flex: 0 0 auto;
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-soft);
}

.banner-admin-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-admin-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 20, 26, 0.6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-upload-label {
  display: block;
  margin-bottom: 4px;
}

h3 {
  font-size: 15px;
  margin: 0 0 4px;
}

.hidden {
  display: none !important;
}

.denied {
  text-align: center;
  padding: 60px 20px;
  color: var(--hint);
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text);
}

.btn-danger {
  background: #e05353;
  color: #ffffff;
}

.full {
  width: 100%;
  margin-bottom: 12px;
}

.card {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--hint);
  margin: 12px 0 5px;
}

.form input[type="text"],
.form input[type="number"],
.form textarea {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.form input[type="text"]:focus,
.form input[type="number"]:focus,
.form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.form input[type="file"] {
  width: 100%;
  font-size: 12.5px;
  color: var(--hint);
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.form-actions .btn {
  flex: 1;
}

.error {
  color: #e05353;
  font-size: 13px;
  margin-top: 8px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.product-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--border);
  flex-shrink: 0;
}

.product-thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-meta {
  font-size: 12.5px;
  color: var(--hint);
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

.badge-active {
  background: #1fa855;
  color: #fff;
}

.badge-inactive {
  background: var(--hint);
  color: #fff;
}

.product-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.product-actions .btn {
  padding: 9px 12px;
  font-size: 12.5px;
}

.edit-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.current-photo-preview {
  width: 100%;
  max-width: 220px;
  border-radius: var(--radius-sm);
  display: block;
  margin: 4px 0 10px;
}

.edit-panel .muted {
  font-size: 13px;
  color: var(--hint, #888);
  margin: 0 0 10px;
}
