:root {
  --accent-700: #d94a30;
  --accent-600: #F05D40;
  --accent-500: #ff7a5f;
  --accent-300: #ffc2b4;
  --accent-100: #fff1ee;
  --surface: #fff8fb;
  --panel: #ffffff;
  --ink: #2d2130;
  --muted: #9b7180;
  --line: #efd0d8;
  --shadow: 0 18px 50px rgba(188, 92, 104, 0.14);
  font-family: Quicksand, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  font-family: Quicksand, "Segoe UI", Arial, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -20%, rgba(217, 137, 147, 0.16), transparent 38%),
    var(--surface);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 44px;
}

.site-header {
  display: grid;
  gap: 18px;
}

.top-card,
.panel-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.top-card {
  padding: 20px 22px;
}

.top-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.brand-row,
.filter-row,
.action-row,
.time-row,
.load-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent-600);
  font-size: 14px;
  font-weight: 800;
}

.social-link:hover,
button:hover {
  background: var(--accent-700);
}

.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 4px;
}

.logo-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-700);
  background: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(188, 92, 104, 0.12);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: 0;
}

main {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.converter,
.tracking-card {
  padding: 20px 22px;
}

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

.converter h2,
.tracking-card h2 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 800;
}

.panel-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.cashback-badge {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--accent-300);
  border-radius: 999px;
  color: var(--accent-700);
  background: #fff7f8;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.tracking-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
}

.withdraw-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 12px 14px;
}

.withdraw-box summary {
  color: var(--accent-700);
  cursor: pointer;
  font-weight: 900;
}

.withdraw-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.withdraw-form button {
  grid-column: 1 / -1;
}

.cashback-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.cashback-summary div {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.cashback-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cashback-summary strong {
  color: var(--accent-700);
  font-size: 18px;
  line-height: 1.2;
}

.cashback-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.cashback-history h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-shell {
  max-width: 1180px;
}

.admin-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 900;
}

.admin-shell.is-locked .admin-private {
  display: none;
}

.admin-textarea {
  height: 180px;
  margin: 12px 0;
  overflow: auto;
  resize: vertical;
}

.file-upload {
  min-height: 52px;
  display: grid;
  place-items: center;
  width: 100%;
  margin-top: 8px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  color: #b995a3;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.file-upload:hover,
.file-upload:focus-within {
  border-color: var(--accent-500);
  background: #fff7f8;
  color: var(--accent-700);
  box-shadow: 0 0 0 4px rgba(217, 137, 147, 0.12);
}

.file-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-upload .has-file {
  color: var(--accent-700);
}

.sync-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.sync-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sync-controls select {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  font: inherit;
  font-weight: 700;
  outline: none;
}

.sync-controls select:focus,
.sync-controls input:focus {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 4px rgba(217, 137, 147, 0.18);
}

.sync-controls.is-preset .sync-custom-date {
  display: none;
}

.admin-row {
  grid-template-columns: minmax(180px, 1fr) auto minmax(220px, 1fr) auto auto auto;
}

.admin-row button {
  min-height: 36px;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 13px;
}

.admin-action-button {
  margin-top: 12px;
}

.history-item strong {
  color: var(--accent-700);
}

.history-item small {
  color: var(--muted);
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  outline: none;
}

textarea {
  resize: none;
  overflow: hidden;
  height: 48px;
  min-height: 48px;
  padding: 13px 18px;
}

input {
  height: 52px;
  padding: 0 18px;
}

textarea::placeholder,
input::placeholder {
  color: #b995a3;
}

textarea:focus,
input:focus {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 4px rgba(217, 137, 147, 0.18);
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent-600);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

button:focus {
  outline: none;
}

button:focus-visible {
  outline: 3px solid rgba(201, 111, 123, 0.24);
  outline-offset: 2px;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.paste-chip {
  min-height: 38px;
  border: 1px solid var(--accent-600);
  border-radius: 14px;
  color: var(--accent-700);
  background: #fff;
  padding: 0 18px;
}

.paste-chip:hover,
.secondary-button:hover,
.filter-button:hover,
.filter-button.is-active,
.time-card:hover,
.time-card.is-active {
  color: var(--accent-700);
  border-color: var(--accent-600);
  background: #fff7f8;
}

.sort-button.is-active {
  color: #fff;
  border-color: var(--accent-600);
  background: var(--accent-600);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.estimate-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #ffd7a8;
  border-radius: 16px;
  background: #fff8ed;
}

.estimate-card[hidden] {
  display: none;
}

.estimate-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.estimate-card strong {
  color: #16b978;
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
}

.estimate-title {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-button,
.filter-button {
  color: var(--accent-700);
  border: 1px solid var(--accent-500);
  background: #fff;
}

.status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  text-align: center;
}

.status.is-error {
  color: #a43944;
}

.status.is-success {
  color: var(--accent-700);
}

.controls {
  display: grid;
  gap: 14px;
  padding: 20px 22px;
}

.time-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.time-card {
  min-height: 68px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
}

.time-card strong {
  color: var(--accent-700);
  font-size: 18px;
  line-height: 1;
}

.time-card span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-row {
  align-items: center;
}

.filter-button {
  min-width: 72px;
  min-height: 48px;
  border-radius: 999px;
}

.filter-button[data-filter="asc"] {
  min-width: 112px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  padding: 0;
}

.product-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(188, 92, 104, 0.09);
}

.product-card a {
  display: block;
  height: 100%;
}

.image-wrap {
  position: relative;
  aspect-ratio: 1;
  margin: 12px;
  overflow: hidden;
  border-radius: 12px;
  background: #f7edf0;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.discount {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--accent-700);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(45, 33, 48, 0.12);
}

.product-info {
  padding: 0 14px 16px;
}

.product-name {
  min-height: 44px;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.price {
  color: var(--accent-700);
  font-size: 18px;
  font-weight: 900;
}

.meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

.load-row {
  justify-content: center;
  margin-top: 4px;
}

.load-row button {
  min-width: 190px;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.policy-card,
.support-card {
  padding: 20px 22px;
}

.policy-card h2,
.support-card h2 {
  margin-bottom: 12px;
  font-size: 18px;
  line-height: 1.35;
}

.policy-section {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid rgba(239, 208, 216, 0.78);
}

.policy-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.policy-section h3 {
  margin: 0;
  color: var(--accent-700);
  font-size: 15px;
  line-height: 1.35;
}

.policy-section ul,
.policy-section ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.policy-note {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(239, 208, 216, 0.78);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.support-card p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.support-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 0 16px;
  color: #fff;
  font-weight: 900;
}

.support-button.zalo,
.float-button.zalo {
  background: #0b83ff;
}

.support-button.facebook,
.float-button.facebook {
  background: #1877f2;
}

.support-button:hover,
.float-button:hover {
  filter: brightness(0.94);
}

.floating-contact {
  position: fixed;
  right: 22px;
  bottom: 32px;
  z-index: 20;
  display: grid;
  gap: 14px;
}

.float-button {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(35, 49, 68, 0.26);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  animation: floatPulse 2.4s ease-in-out infinite;
  isolation: isolate;
}

.float-button::before {
  content: "";
  position: absolute;
  inset: -6px;
  z-index: -1;
  border-radius: inherit;
  background: currentColor;
  opacity: 0.14;
  transform: scale(0.82);
  animation: contactRipple 2.4s ease-out infinite;
}

.float-button:hover {
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 16px 34px rgba(35, 49, 68, 0.34);
  filter: brightness(1.03);
  animation-play-state: paused;
}

.float-button:hover::before {
  animation-play-state: paused;
  opacity: 0.2;
  transform: scale(1.05);
}

.float-button.facebook {
  font-family: Arial, sans-serif;
  font-size: 34px;
  line-height: 1;
}

@keyframes contactRipple {
  0% {
    opacity: 0.22;
    transform: scale(0.78);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(1.34);
  }
}

@keyframes floatPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.035);
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 0;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 560px);
    padding-top: 14px;
  }

  .top-card,
  .panel-card {
    border-radius: 18px;
  }

  .top-card,
  .converter,
  .tracking-card,
  .controls {
    padding: 16px;
  }

  .brand-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .social-link:last-child {
    grid-column: 1 / -1;
  }

  .hero {
    gap: 12px;
  }

  .logo-mark {
    width: 54px;
    height: 54px;
    font-size: 19px;
  }

  .tracking-form,
  .withdraw-form,
  .cashback-summary,
  .panel-heading,
  .action-row,
  .time-row {
    grid-template-columns: 1fr;
  }

  .history-item,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .sync-controls {
    grid-template-columns: 1fr;
  }

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

  .panel-heading {
    display: grid;
  }

  .paste-chip {
    width: 100%;
  }

  .filter-button {
    flex: 1;
    min-width: 78px;
  }

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

  .product-info {
    padding: 0 10px 12px;
  }

  .floating-contact {
    right: 14px;
    bottom: 24px;
    gap: 10px;
  }

  .float-button {
    width: 52px;
    height: 52px;
    font-size: 16px;
  }

  .float-button.facebook {
    font-size: 30px;
  }
}
