:root {
  --teal: #09aeb4;
  --teal-dark: #087f85;
  --coral: #ff5a35;
  --ink: #11283a;
  --ink-soft: #4f6472;
  --line: #dce7ea;
  --paper: #ffffff;
  --mist: #f4f8f8;
  --sand: #fff7ef;
  --success: #168a5b;
  --danger: #b42318;
  --shadow: 0 20px 60px rgba(17, 40, 58, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 10px clamp(18px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(9, 174, 180, 0.16);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: 148px;
  text-decoration: none;
}

.brand img {
  width: 148px;
  height: 56px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  font-size: 0.94rem;
  font-weight: 700;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--teal-dark);
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  background: var(--coral);
}

.cart-button strong {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--coral);
  background: white;
}

.primary-button {
  color: white;
  background: var(--teal);
}

.primary-button:hover {
  background: var(--teal-dark);
}

.secondary-button {
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.danger-button {
  color: white;
  background: var(--ink);
}

.loading-screen {
  display: grid;
  place-items: center;
  min-height: 50vh;
  color: var(--ink-soft);
}

.loader {
  width: 42px;
  height: 42px;
  border: 4px solid var(--line);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.storefront {
  background:
    linear-gradient(90deg, rgba(9, 174, 180, 0.08), transparent 38%),
    linear-gradient(180deg, var(--mist), white 580px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
  align-items: center;
  gap: clamp(28px, 6vw, 78px);
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  min-height: calc(100vh - 76px);
  padding: clamp(34px, 6vw, 74px) 0;
}

.announcement {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 20px;
  border: 1px solid rgba(255, 90, 53, 0.22);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--coral);
  background: #fff4ef;
  font-size: 0.9rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  font-family: "Syne", system-ui, sans-serif;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.6rem, 7vw, 5.9rem);
  line-height: 0.95;
}

.hero-copy {
  color: var(--ink-soft);
  max-width: 620px;
  margin: 22px 0 0;
  font-size: 1.11rem;
  line-height: 1.7;
}

.product-badge {
  color: var(--teal-dark);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin: 26px 0;
}

.price {
  font-family: "Syne", system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
}

.compare {
  color: var(--ink-soft);
  font-size: 1.25rem;
  text-decoration: line-through;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.trust-line {
  margin-top: 26px;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.product-media {
  overflow: hidden;
  border-radius: 8px;
  background: var(--sand);
  box-shadow: var(--shadow);
}

.gallery-stage,
.product-media img,
.image-fallback {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.gallery-stage {
  background: var(--sand);
}

.main-product-image,
.gallery-thumb img {
  object-fit: cover;
}

.main-product-image {
  height: 100%;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(17, 40, 58, 0.08);
  background: white;
}

.gallery-thumb {
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  background: var(--mist);
}

.gallery-thumb.active {
  border-color: var(--teal);
}

.gallery-thumb img {
  width: 100%;
  height: 76px;
}

.image-fallback {
  display: grid;
  place-items: center;
  padding: 36px;
  color: var(--teal-dark);
  background:
    linear-gradient(135deg, rgba(9, 174, 180, 0.14), rgba(255, 90, 53, 0.12)),
    white;
  font-family: "Syne", system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  text-align: center;
}

.product-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid rgba(17, 40, 58, 0.08);
  background: white;
}

.strip-item {
  min-height: 86px;
  padding: 18px;
  border-right: 1px solid rgba(17, 40, 58, 0.08);
}

.strip-item:last-child {
  border-right: 0;
}

.strip-item strong {
  display: block;
  margin-bottom: 6px;
}

.strip-item span {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.details-section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 52px 0 82px;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--coral);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.details-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 36px;
  align-items: start;
}

.details-section h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.details-copy {
  margin: 16px 0 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.feature-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  background: white;
  font-weight: 700;
}

.admin-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.status-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 76px);
  padding: 32px;
  background: var(--mist);
}

.status-panel {
  width: min(680px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(28px, 6vw, 54px);
  background: white;
  box-shadow: var(--shadow);
}

.status-panel h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.status-panel .primary-button {
  margin-top: 22px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 28px;
}

.admin-header h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
}

.panel,
.metric,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.panel {
  padding: 22px;
}

.panel h2,
.panel h3 {
  margin: 0 0 18px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.stack-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 800;
}

.stack-form input,
.stack-form select,
.stack-form textarea {
  width: 100%;
  border: 1px solid #cfdde1;
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--ink);
  background: linear-gradient(180deg, white, #fbfdfd);
  box-shadow: 0 1px 0 rgba(17, 40, 58, 0.04);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: white;
  box-shadow: 0 0 0 4px rgba(9, 174, 180, 0.14);
}

.stack-form input::placeholder,
.stack-form textarea::placeholder {
  color: #8fa0aa;
}

.stack-form textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.form-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--success);
  font-weight: 800;
}

.form-message.error {
  color: var(--danger);
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.upload-preview .empty-state {
  grid-column: 1 / -1;
}

.upload-thumb {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
}

.upload-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.upload-thumb span {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: white;
  background: rgba(17, 40, 58, 0.8);
  font-size: 0.78rem;
  font-weight: 800;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.11;
  pointer-events: none;
}

.metric-teal::before {
  background: linear-gradient(135deg, var(--teal), transparent 64%);
}

.metric-coral::before {
  background: linear-gradient(135deg, var(--coral), transparent 64%);
}

.metric-green::before {
  background: linear-gradient(135deg, var(--success), transparent 64%);
}

.metric-ink::before {
  background: linear-gradient(135deg, var(--ink), transparent 64%);
}

.metric span {
  position: relative;
  display: block;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  position: relative;
  display: block;
  margin-top: 8px;
  font-family: "Syne", system-ui, sans-serif;
  font-size: 1.85rem;
}

.metric em {
  position: relative;
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 700;
}

.analytics-area {
  display: grid;
  gap: 22px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.chart-panel {
  min-height: 260px;
}

.chart-panel-wide {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-heading span {
  display: block;
  margin-bottom: 4px;
  color: var(--coral);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-heading h2 {
  margin: 0;
}

.panel-heading > strong {
  color: var(--teal-dark);
  font-family: "Syne", system-ui, sans-serif;
  font-size: 1.2rem;
  white-space: nowrap;
}

.traffic-chart {
  display: grid;
  grid-template-columns: repeat(10, minmax(28px, 1fr));
  align-items: end;
  gap: 10px;
  height: 230px;
  padding-top: 8px;
}

.traffic-day {
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: end;
  gap: 7px;
  min-width: 0;
  height: 100%;
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.traffic-bar {
  width: 100%;
  min-height: 8px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, var(--teal), var(--teal-dark));
}

.traffic-day strong {
  color: var(--ink);
}

.bar-list,
.funnel-list {
  display: grid;
  gap: 15px;
}

.bar-row,
.funnel-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, 1.2fr) auto;
  align-items: center;
  gap: 12px;
}

.bar-label {
  min-width: 0;
}

.bar-label strong,
.funnel-row span {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-label span {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.bar-track,
.funnel-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: var(--gray-light);
}

.bar-track span,
.funnel-track strong {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--teal));
}

.bar-row b,
.funnel-row b {
  color: var(--ink);
  font-size: 0.9rem;
  white-space: nowrap;
}

.compact-bars .bar-row {
  grid-template-columns: minmax(80px, 0.8fr) minmax(110px, 1fr) auto;
}

.order-chart {
  display: grid;
  grid-template-columns: repeat(8, minmax(24px, 1fr));
  align-items: end;
  gap: 12px;
  height: 220px;
  padding-top: 12px;
}

.order-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 8px;
  height: 100%;
  min-width: 0;
}

.order-bar span {
  display: block;
  width: 100%;
  min-height: 10px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, var(--coral), var(--teal));
}

.order-bar strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.75rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-panel {
  margin-top: 0;
}

.dashboard-tools {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
}

.dashboard-tools span {
  display: block;
  margin-bottom: 4px;
  color: var(--coral);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-tools h2 {
  margin: 0;
}

.dashboard-tools .form-message {
  grid-column: 1 / -1;
  margin: 0;
}

.range-buttons,
.reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.range-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: white;
  font-weight: 800;
}

.range-button.active {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
}

.table-wrap {
  overflow: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.login-card {
  width: min(440px, calc(100% - 32px));
  margin: 80px auto;
}

.muted {
  color: var(--ink-soft);
  line-height: 1.6;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.modal[aria-hidden="false"] {
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 40, 58, 0.55);
}

.modal-panel {
  position: relative;
  width: min(460px, calc(100% - 28px));
  max-height: calc(100vh - 32px);
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 8px;
  padding: 28px;
  background: white;
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

.modal-panel h2 {
  margin: 0 0 10px;
}

.icon-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.empty-state {
  padding: 22px;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--mist);
}

@media (max-width: 880px) {
  .site-header {
    flex-wrap: wrap;
  }

  .brand,
  .brand img {
    width: 118px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .details-layout,
  .admin-grid,
  .chart-grid,
  .dashboard-tools {
    grid-template-columns: 1fr;
  }

  .product-strip,
  .metrics-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .traffic-chart {
    grid-template-columns: repeat(5, minmax(38px, 1fr));
    height: 260px;
  }

  .bar-row,
  .funnel-row,
  .compact-bars .bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .order-chart {
    grid-template-columns: repeat(4, minmax(34px, 1fr));
    height: 260px;
  }

  .admin-header {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .site-header {
    min-height: auto;
    gap: 12px;
  }

  .cart-button span {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions button,
  .hero-actions a {
    width: 100%;
  }
}
