:root {
  --bg: #0a131a;
  --bg-soft: #101924;
  --panel: #111b26;
  --panel-2: #152130;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #f3f8fb;
  --muted: #9db1be;
  --green: #59c8ff;
  --green-deep: #1577bc;
  --orange: #ff8f3c;
  --gold: #d8b310;
  --blue: #4eb4ff;
  --danger: #ff6f6f;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  --radius: 24px;
}

body[data-theme="light"] {
  --bg: #eef3f1;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f7faf8;
  --line: rgba(11, 19, 19, 0.08);
  --line-strong: rgba(11, 19, 19, 0.12);
  --text: #101717;
  --muted: #5d706b;
  --shadow: 0 20px 50px rgba(18, 27, 25, 0.08);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body[data-theme="light"] { color-scheme: light; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(89, 200, 255, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(78, 180, 255, 0.08), transparent 20%),
    linear-gradient(180deg, var(--bg) 0%, #0a1010 100%);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
input, textarea, select {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  color-scheme: dark;
}
select option { background: #111919; color: #f5f7f6; }
input[type="file"] {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
}
body[data-theme="light"] input,
body[data-theme="light"] textarea,
body[data-theme="light"] select {
  background: rgba(11, 19, 19, 0.03);
}
body[data-theme="light"] select option { background: #ffffff; color: #101716; }
textarea { min-height: 120px; resize: vertical; }
label { display: grid; gap: 0.4rem; color: var(--muted); font-size: 0.92rem; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-size: 0.84rem; text-transform: uppercase; letter-spacing: 0.04em; }

.container {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
}
.page-stack,
.hero-grid,
.hero-side,
.dashboard-grid,
.admin-two-column,
.list-stack,
.metric-grid,
.product-grid,
.admin-product-grid,
.admin-user-grid,
.compact-category-grid,
.footer-grid,
.chat-history,
.chat-messages {
  display: grid;
  gap: 1rem;
}
.page-stack { padding: 1.4rem 0 3rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(9, 15, 15, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
body[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.9);
}
.topbar,
.category-bar,
.top-actions,
.page-head,
.section-head,
.hero-actions,
.banner-actions,
.product-actions,
.cart-row,
.cart-row-meta,
.summary-row,
.order-card-head,
.order-card-meta,
.filter-row,
.filter-group,
.admin-header-actions,
.admin-card-actions,
.checkbox-row,
.chat-header,
.chat-status-line {
  display: flex;
  align-items: center;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(340px, 1fr) auto;
  gap: 1rem;
  padding: 0.9rem 0;
}
.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.brand strong {
  display: block;
  font-size: 1.65rem;
  line-height: 1;
}
.brand span { color: var(--muted); font-size: 0.88rem; }
.brand-mark,
.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  background: linear-gradient(135deg, #56c8ff, #93ecff);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
.brand-mark {
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #081522;
}

.search-shell {
  flex: 1;
  display: flex;
  gap: 0.6rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.search-shell input {
  border: 0;
  background: transparent;
}

.button,
.ghost-link,
.chat-trigger,
.search-shell button,
.chat-form button,
.mini-chip {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.button:hover,
.ghost-link:hover,
.chat-trigger:hover,
.search-shell button:hover,
.chat-form button:hover,
.mini-chip:hover {
  transform: translateY(-1px);
}
.button,
.ghost-link,
.chat-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.05rem;
}
.button.primary,
.search-shell button,
.chat-trigger,
.chat-form button,
.pill,
.mini-chip.active {
  background: linear-gradient(135deg, var(--green), #93ecff);
  color: #061521;
}
.button.secondary,
.ghost-link,
.mini-chip,
.social-button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--line);
}
.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
}
.danger-text { color: var(--danger); }
.full { width: 100%; }

.top-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.top-pref-form { margin: 0; }
.mini-chip {
  padding: 0.7rem 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
}
.mini-panel {
  min-width: 126px;
  display: grid;
  gap: 0.16rem;
  padding: 0.72rem 0.88rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--line);
  position: relative;
  min-height: 78px;
  align-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.mini-panel strong { font-size: 1rem; line-height: 1.1; }
.mini-panel span { color: var(--green); font-size: 0.8rem; line-height: 1.25; }
.mini-panel--account { min-width: 160px; }
.admin-shortcut span { color: var(--blue); }

.balance-popover-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  display: none;
  z-index: 10;
  margin-top: 0.7rem;
  padding: 1rem;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.balance-panel.open .balance-popover-card { display: block; }
.compact-list {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.category-bar {
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0 0 0.9rem;
}
.category-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 0.96rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.category-button--all { background: rgba(89, 200, 255, 0.14); }
.category-thumb {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.category-thumb--fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
}

.notice {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.notice.success { background: rgba(89, 200, 255, 0.16); }
.notice.error { background: rgba(255, 111, 111, 0.12); }

.glass-card,
.page-panel,
.social-banner,
.stats-strip,
.site-footer,
.product-card,
.promo-card,
.hero-main {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.glass-card,
.page-panel,
.social-banner,
.stats-strip,
.site-footer {
  background: linear-gradient(180deg, rgba(20, 31, 29, 0.96), rgba(10, 16, 15, 0.98));
}
body[data-theme="light"] .glass-card,
body[data-theme="light"] .page-panel,
body[data-theme="light"] .social-banner,
body[data-theme="light"] .stats-strip,
body[data-theme="light"] .site-footer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 247, 0.98));
}
.glass-card,
.page-panel { padding: 1.25rem; }

.page-head,
.section-head {
  justify-content: space-between;
  gap: 1rem;
}
.page-head h1,
.section-head h2,
.hero-frame h1 {
  margin: 0;
  font-weight: 900;
}
.page-head p,
.section-head p,
.hero-frame p,
.product-content p,
.promo-card p,
.social-banner p,
.site-footer p,
.empty-state p,
.chat-header span,
.chat-status-line span {
  color: var(--muted);
}

.hero-grid {
  grid-template-columns: 2fr 0.95fr;
}
.hero-main {
  min-height: 500px;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(125deg, rgba(10, 19, 28, 0.34), rgba(7, 12, 18, 0.74)),
    radial-gradient(circle at 78% 18%, rgba(89, 200, 255, 0.36), transparent 20%),
    linear-gradient(135deg, rgba(24, 47, 68, 0.98), rgba(11, 23, 34, 0.98));
  background-size: cover;
  background-position: center;
}
.hero-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 11, 17, 0.52) 0%, rgba(5, 11, 17, 0.18) 46%, rgba(5, 11, 17, 0.52) 100%);
  pointer-events: none;
}
.hero-main > * {
  position: relative;
  z-index: 1;
}
.hero-grid--enhanced .hero-main {
  display: grid;
  align-content: space-between;
}
.hero-points {
  display: grid;
  gap: 0.95rem;
  font-weight: 700;
}
.hero-points--vertical {
  max-width: 320px;
}
.hero-points--vertical span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(6, 16, 24, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
}
.hero-frame {
  max-width: 650px;
  padding: 1.7rem;
  border-radius: 24px;
  background: rgba(8, 18, 28, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  backdrop-filter: blur(6px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}
.hero-frame h1 {
  margin-top: 0.6rem;
  font-size: clamp(3rem, 5vw, 5rem);
  line-height: 0.95;
  max-width: 540px;
}
.hero-actions { gap: 0.7rem; margin-top: 1.2rem; }
.hero-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}
.hero-counter-bar {
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.hero-counter-bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #eaf7f2);
  transform-origin: left center;
}
.hero-counter-bar i.animate {
  animation: heroProgress 3s linear infinite;
}
@keyframes heroProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.hero-side { grid-template-rows: 1fr 1fr; }
.promo-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 240px;
}
.promo-card span {
  display: block;
  max-width: 280px;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 0.98;
  font-weight: 900;
}
.promo-card--green {
  background: linear-gradient(135deg, rgba(46, 145, 214, 0.95), rgba(18, 72, 121, 0.95));
}
.promo-card--gold {
  background: linear-gradient(135deg, rgba(171, 146, 5, 0.95), rgba(92, 75, 5, 0.95));
}

.section-block { display: grid; gap: 1rem; }
.product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.product-card {
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15, 24, 23, 0.98), rgba(8, 13, 12, 0.98));
}
.product-art {
  min-height: 245px;
  padding: 1rem;
  display: flex;
  align-items: flex-end;
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.12), transparent 18%),
    linear-gradient(145deg, rgba(89, 200, 255, 0.2), rgba(13, 16, 16, 0.22)),
    #10202b;
  background-size: cover;
  background-position: center;
}
.product-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 10%, rgba(0,0,0,0.82));
}
.product-badge {
  position: absolute;
  top: 0.95rem;
  left: 0.95rem;
  z-index: 1;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffca3a, #ff9024);
  color: #151009;
  font-size: 0.75rem;
  font-weight: 800;
}
.product-art-copy {
  position: relative;
  z-index: 1;
}
.eyebrow,
.product-category {
  display: inline-block;
  color: rgba(255,255,255,0.74);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.76rem;
}
.product-art-copy strong {
  display: -webkit-box;
  margin-top: 0.6rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 1.45rem;
  line-height: 1.02;
  text-transform: uppercase;
}
.product-content {
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
}
.product-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.34;
}
.price-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.price-row strong {
  color: var(--green);
  font-size: 1.35rem;
}
.price-row span {
  color: var(--muted);
  text-decoration: line-through;
}
.product-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.product-actions,
.banner-actions {
  gap: 0.7rem;
  flex-wrap: wrap;
}

.social-banner,
.stats-strip {
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
}
.banner-actions--social {
  justify-content: flex-end;
}
.social-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.82rem 0.95rem;
  border-radius: 16px;
}
.social-button--instagram { border-color: rgba(255, 75, 142, 0.35); }
.social-button--youtube { border-color: rgba(255, 60, 60, 0.35); }
.social-button--tiktok { border-color: rgba(56, 207, 206, 0.35); }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 0.95rem;
  border-radius: 999px;
}

.stats-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stats-strip--showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(89, 200, 255, 0.14), transparent 35%),
    linear-gradient(310deg, rgba(78, 180, 255, 0.08), transparent 28%);
}
.stats-item {
  position: relative;
  display: grid;
  gap: 0.3rem;
  justify-items: center;
}
.stats-item strong {
  color: var(--green);
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.compact-category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}
.compact-category-card {
  min-height: 110px;
  padding: 1rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(20, 28, 27, 0.98), rgba(8, 12, 12, 0.98));
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.compact-category-card span {
  font-size: 1.1rem;
  font-weight: 800;
}
.compact-category-icon {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: contain;
  background: rgba(255,255,255,0.04);
}

.cart-layout,
.checkout-layout,
.dashboard-grid,
.admin-two-column {
  grid-template-columns: 1.3fr 0.95fr;
}
.cart-row {
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-row-meta {
  gap: 1rem;
  justify-content: flex-end;
}
.summary-row {
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
}
.summary-row.total {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.coupon-form,
.coupon-remove {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.coupon-form { margin-bottom: 0.8rem; }
.order-summary { display: grid; gap: 0.8rem; align-content: start; }

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.balance-strong { color: var(--green); }
.order-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}
.order-card--full { display: grid; gap: 0.8rem; }
.order-card-head {
  justify-content: space-between;
  gap: 0.9rem;
}
.order-card-meta {
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}
.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

.admin-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
}
.admin-sidebar {
  position: sticky;
  top: 112px;
  height: fit-content;
}
.admin-sidebar-head h2 { margin: 0; }
.admin-sidebar-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}
.admin-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.admin-nav-card {
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  display: grid;
  gap: 0.3rem;
}
.admin-nav-card span { color: var(--muted); font-size: 0.88rem; }
.admin-nav-card.active {
  border-color: rgba(89, 200, 255, 0.42);
  background: rgba(89, 200, 255, 0.12);
}
.admin-content { display: grid; gap: 1rem; min-width: 0; }
.admin-header-card { padding-bottom: 1rem; }
.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.metric-grid--wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-grid--stock { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card {
  text-align: center;
  display: grid;
  gap: 0.35rem;
}
.metric-card strong {
  font-size: 1.8rem;
  color: var(--green);
}
.metric-card span { color: var(--muted); }

.filter-row {
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.filter-group {
  gap: 0.6rem;
  flex-wrap: wrap;
}

.admin-product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.admin-product-card {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.admin-product-cover {
  min-height: 190px;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  background:
    linear-gradient(180deg, rgba(10,12,12,0.25), rgba(10,12,12,0.85)),
    linear-gradient(140deg, rgba(89, 200, 255, 0.16), rgba(255, 143, 60, 0.1));
  background-size: cover;
  background-position: center;
}
.admin-product-body {
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}
.admin-card-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}
.admin-card-meta--stack {
  display: grid;
  gap: 0.45rem;
}
.stock-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.admin-card-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.admin-user-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-user-card {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  display: grid;
  gap: 0.3rem;
}
.admin-user-card span,
.admin-user-card small { color: var(--muted); }

.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
}
.support-list-stack {
  display: grid;
  gap: 1rem;
}
.support-row-card {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.support-row-head,
.support-row-meta,
.support-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.support-row-meta {
  margin: 0.6rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.support-inline-form {
  display: grid;
  gap: 0.7rem;
  flex: 1 1 360px;
}
.support-inline-form--status {
  flex: 0 1 260px;
}
.support-history {
  margin-bottom: 0.9rem;
}
.compact-form {
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.stock-preview-box,
.stock-note-box {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.stock-preview-box strong,
.stock-note-box strong {
  display: block;
  margin-bottom: 0.55rem;
}
.stock-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.stock-preview-list code {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: rgba(89, 200, 255, 0.12);
  color: #cceeff;
  border: 1px solid rgba(89, 200, 255, 0.22);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.84rem;
}
.stock-note-box p {
  margin: 0;
  color: var(--muted);
}
.admin-media-preview {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.inner-card {
  padding: 1rem;
}

.chat-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
}
.chat-trigger {
  min-width: 128px;
  box-shadow: var(--shadow);
}
.chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(360px, calc(100vw - 28px));
  display: none;
  padding: 1rem;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.chat-widget.open .chat-panel { display: grid; gap: 0.8rem; }
.chat-header {
  justify-content: space-between;
  gap: 1rem;
}
.chat-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 1.2rem;
}
.chat-status-line {
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(89, 200, 255, 0.12);
}
.chat-messages,
.chat-history {
  max-height: 280px;
  overflow-y: auto;
}
.chat-message {
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.chat-message.user { border-color: rgba(78, 180, 255, 0.25); }
.chat-message.ai { border-color: rgba(89, 200, 255, 0.25); }

.content-page {
  display: grid;
  gap: 1.2rem;
}
.content-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.content-block h2 {
  margin-top: 0;
  margin-bottom: 0.85rem;
}
.content-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}
.chat-message.admin { border-color: rgba(255, 143, 60, 0.25); }
.chat-form {
  display: flex;
  gap: 0.7rem;
}

.site-footer { padding: 1.4rem 0 0; margin-top: 2rem; }
.footer-grid {
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  padding: 0 1.4rem 1.2rem;
}
.footer-grid h3 { margin: 0 0 0.8rem; }
.footer-grid ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
}
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 1rem 1.4rem 1.2rem;
  text-align: center;
  color: var(--muted);
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
}

.split-two,
.split-three {
  display: grid;
  gap: 0.9rem;
}
.split-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checkbox-row {
  gap: 0.65rem;
  justify-content: flex-start;
}
.checkbox-row input {
  width: auto;
}

@media (max-width: 1200px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .top-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .hero-grid,
  .admin-shell,
  .admin-two-column,
  .cart-layout,
  .checkout-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .metric-grid--wide,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .product-grid,
  .admin-product-grid,
  .admin-user-grid,
  .content-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .compact-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .container { width: min(100vw - 20px, 1440px); }
  .brand { min-width: 0; }
  .brand strong { font-size: 1.45rem; }
  .search-shell { width: 100%; }
  .hero-frame h1 { font-size: 2.4rem; }
  .product-grid,
  .admin-product-grid,
  .admin-user-grid,
  .compact-category-grid,
  .metric-grid,
  .metric-grid--wide,
  .content-page-grid,
  .footer-grid,
  .split-two,
  .split-three,
  .admin-nav-grid {
    grid-template-columns: 1fr;
  }
  .stats-strip { grid-template-columns: 1fr; }
  .chat-form { flex-direction: column; }
  .product-actions,
  .banner-actions--social,
  .filter-row,
  .filter-group,
  .hero-actions,
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }
}
