:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f6f8fc;
  --border: #dce3ef;
  --muted: #64748b;
  --panel: rgba(255, 255, 255, 0.9);
  --shadow: 0 18px 48px rgba(31, 45, 78, 0.09);
  --blue: #2563eb;
  --green: #059669;
  --violet: #7c3aed;
  --amber: #d97706;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(37, 99, 235, 0.10), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(124, 58, 237, 0.10), transparent 26%),
    linear-gradient(180deg, #fbfdff 0%, #f4f7fb 44%, #eef3f9 100%);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.95;
}

h2 {
  font-size: 19px;
}

p {
  margin: 8px 0 0;
}

a {
  color: #2456d6;
  text-decoration: none;
  font-weight: 650;
}

a:hover {
  text-decoration: underline;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 12px;
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 10px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  padding: 28px;
  border: 1px solid rgba(220, 227, 239, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.admin-hero {
  align-items: center;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: #172033;
  color: #fff;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.18);
}

.button:hover {
  text-decoration: none;
}

.button.secondary,
button.secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: #172033;
  box-shadow: none;
}

button.link {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: #2456d6;
  box-shadow: none;
}

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

.panel {
  margin: 20px 0;
  padding: 22px;
  border: 1px solid rgba(220, 227, 239, 0.9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(31, 45, 78, 0.06);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.metric-card {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  color: #fff;
  box-shadow: var(--shadow);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -28px;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.metric-card span,
.metric-card small,
.metric-card strong {
  position: relative;
  z-index: 1;
  display: block;
}

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

.metric-card strong {
  margin-top: 16px;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.05;
}

.metric-card small {
  margin-top: 12px;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.86;
}

.metric-card.blue {
  background: linear-gradient(135deg, #2563eb 0%, #0f766e 100%);
}

.metric-card.green {
  background: linear-gradient(135deg, #059669 0%, #0f766e 100%);
}

.metric-card.violet {
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
}

.metric-card.amber {
  background: linear-gradient(135deg, #d97706 0%, #be123c 100%);
}

.compact-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.compact-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.compact-list strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.section-title,
.action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-title {
  margin-bottom: 18px;
}

.section-title p,
.action-panel p {
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge.success {
  background: #d1fae5;
  color: #065f46;
}

.badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.badge.neutral {
  background: #e2e8f0;
  color: #334155;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: #172033;
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

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

.product-form {
  display: grid;
  gap: 18px;
}

.differentials-editor {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e7edf6;
  border-radius: 8px;
  background: #f8fbff;
}

.mini-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mini-heading span {
  color: var(--muted);
  font-size: 12px;
}

.differential-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(130px, 0.65fr);
  gap: 10px;
}

.muted-row {
  opacity: 0.78;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 14px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid #e8eef6;
  text-align: left;
  vertical-align: top;
}

th {
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 980px) {
  .metrics,
  .compact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .hero,
  .section-title,
  .action-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }

  .metrics,
  .compact-list {
    grid-template-columns: 1fr;
  }

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

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
