:root {
  --fondo: #f7f7f5;
  --card: #ffffff;
  --inchiostro: #141414;
  --grigio: #6e6e73;
  --grigio-chiaro: #a3a3a8;
  --bordo: rgba(20, 20, 20, 0.08);
  --riga: #f6f6f4;
  --aperta: #fafaf8;
  --accento: #2e7d5b;
  --accento-chiaro: #e6f2ec;
  --attesa: #f4efe4;
  --attesa-testo: #8a6a24;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 12px;
}

.wrap { width: min(560px, 100%); display: flex; align-items: flex-start; }

.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 18px;
  padding: clamp(12px, 3.2vmin, 18px) clamp(10px, 3vmin, 16px) clamp(8px, 2vmin, 12px);
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 18px 46px -20px rgba(20, 20, 20, 0.18);
}

.card__head { display: flex; align-items: center; gap: 10px; padding: 0 4px clamp(8px, 2.4vmin, 12px); }
.card__mark { width: 28px; height: 28px; padding: 5px; border-radius: 8px; background: var(--inchiostro); fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.card__brand { font-size: 14px; font-weight: 640; letter-spacing: -0.01em; }
.card__brand span { color: var(--grigio-chiaro); font-weight: 480; }
.card__sub { font-size: 12px; color: var(--grigio); margin-top: 1px; }

.thead, .row__line {
  display: grid;
  grid-template-columns: 62px 1.3fr 74px 72px 86px 22px;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.thead { height: 28px; font-size: 11px; font-weight: 560; color: var(--grigio-chiaro); letter-spacing: 0.01em; border-bottom: 1px solid var(--bordo); }
.col-num { text-align: right; }

.row { border-bottom: 1px solid var(--bordo); position: relative; }
.row:last-child { border-bottom: 0; }
.row__bg { position: absolute; inset: 2px 0; border-radius: 10px; background: var(--riga); opacity: 0; pointer-events: none; }
.row.is-open .row__bg { background: var(--aperta); }

.row__line {
  position: relative;
  height: clamp(34px, 8.2vh, 42px);
  width: 100%;
  font: inherit;
  font-size: 12.5px;
  color: inherit;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.row__line:focus-visible { outline: 2px solid var(--accento); outline-offset: -2px; border-radius: 10px; }
.row__id { font-weight: 600; font-variation-settings: "wdth" 92; }
.row__who { color: var(--inchiostro); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__date { color: var(--grigio); white-space: nowrap; }
.row__total { text-align: right; font-weight: 560; }

.tag {
  justify-self: start;
  display: inline-flex;
  height: 20px;
  border-radius: 6px;
  padding: 0 7px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 580;
  background: var(--riga);
  color: var(--grigio);
}
.tag__roll { display: flex; flex-direction: column; }
.tag__roll span { height: 20px; line-height: 20px; white-space: nowrap; }
.tag--paid { background: var(--attesa); color: var(--attesa-testo); }
.tag--shipped { background: var(--accento-chiaro); color: var(--accento); }

.chev { width: 16px; height: 16px; fill: none; stroke: var(--grigio); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; justify-self: end; }

.row__panel { height: 0; overflow: hidden; position: relative; }
.panel { padding: 2px 10px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }

.items { display: grid; gap: 5px; align-content: start; }
.item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.item__pic { width: 26px; height: 26px; border-radius: 7px; background: var(--riga); display: grid; place-items: center; flex: none; }
.item__pic svg { width: 16px; height: 16px; fill: none; stroke: var(--inchiostro); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.item__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__qty { color: var(--grigio-chiaro); }
.item__price { font-weight: 560; }

.ship { display: grid; gap: 8px; align-content: start; }
.ship__label { font-size: 11px; color: var(--grigio); font-weight: 560; }
.track { position: relative; height: 2px; background: var(--bordo); border-radius: 2px; margin: 4px 4px 0; }
.track__fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--accento); border-radius: 2px; transform-origin: 0 50%; transform: scaleX(0); }
.track__tick { position: absolute; top: -3px; width: 2px; height: 8px; border-radius: 1px; background: var(--grigio-chiaro); transform: translateX(-1px); }
.track__tick.is-done { background: var(--accento); }
.steps { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--grigio-chiaro); }
.steps span.is-done { color: var(--inchiostro); }

.actions { display: flex; gap: 6px; margin-top: 2px; }
.btn {
  height: 28px;
  padding: 0 11px;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 580;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--bordo);
  background: #fff;
  color: var(--inchiostro);
}
.btn--solid { background: var(--inchiostro); color: #fff; border-color: var(--inchiostro); }
.btn:disabled { cursor: default; opacity: 1; }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.is-done { background: var(--accento); border-color: var(--accento); }
.btn.is-hover { filter: brightness(1.08); }
@media (hover: hover) { .btn:hover { filter: brightness(1.08); } .row:hover .row__bg { opacity: 1; } }
.row.is-hover .row__bg, .row.is-open .row__bg { opacity: 1; }
.btn:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

.ghost {
  position: absolute;
  left: 0; top: 0;
  width: 22px; height: 22px;
  fill: #141414;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

@media (max-width: 520px) {
  .thead, .row__line { grid-template-columns: 52px 1fr 64px 76px 18px; gap: 6px; padding: 0 6px; }
  .col-date, .row__date { display: none; }
  .row__line { font-size: 12px; }
  .panel { grid-template-columns: 1fr; gap: 8px; padding: 0 8px 10px; }
  .item:nth-child(n+3) { display: none; }
}
