:root {
  --bg: #f4f4f5;
  --bg-soft: #ececee;
  --card: #ffffff;
  --text: #111114;
  --text-muted: #6b6b74;
  --line: #ececee;
  --line-strong: #e1e1e5;
  --pink: #ec4899;
  --pink-soft: #fce7f3;
  --pink-ink: #be185d;
  --shadow-sm: 0 1px 2px rgba(17, 17, 20, 0.04);
  --shadow-md: 0 8px 24px rgba(17, 17, 20, 0.06);
  --shadow-lg: 0 20px 40px rgba(17, 17, 20, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  min-height: 100vh;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 22px 40px;
}
.shell--admin { max-width: 760px; }

/* ============== HEADER ============== */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 64px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
}
.brand__logo--dark { background: var(--text); }
.brand__txt h1 {
  margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 8px;
}
.brand__txt p { margin: 1px 0 0; font-size: 12.5px; color: var(--text-muted); }
.brand__tag {
  font-size: 11px; font-weight: 600;
  background: var(--text); color: #fff;
  padding: 3px 10px; border-radius: 999px;
}

.live {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card);
  padding: 9px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.01em;
}
.live__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  100% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}
.live__txt { color: #ef4444; font-weight: 800; letter-spacing: 0.02em; }
.live__meta { color: var(--text-muted); font-weight: 500; }

/* ============== HERO ============== */
.hero-pub { margin-bottom: 48px; }
.hero-pub__title {
  margin: 0 0 20px;
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  max-width: 22ch;
}
.hero-pub__lead {
  margin: 0; font-size: 16px; line-height: 1.6;
  color: var(--text-muted);
  max-width: 62ch;
}
.hero-pub__lead b { color: var(--text); font-weight: 600; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  background: var(--pink-soft);
  color: var(--pink-ink);
  border-radius: 999px;
}
.chip--dark { background: var(--text); color: #fff; }

.likes-pill {
  margin-top: 28px;
  display: inline-flex; align-items: center; flex-wrap: wrap;
  column-gap: 10px; row-gap: 2px;
  padding: 10px 18px 10px 14px;
  background: var(--pink-soft);
  color: var(--pink-ink);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 10px rgba(236,72,153,0.10);
}
.likes-pill__icon {
  display: inline-flex;
  color: var(--pink);
  animation: heart-beat 2.4s ease-in-out infinite;
}
@keyframes heart-beat {
  0%, 70%, 100% { transform: scale(1); }
  12%  { transform: scale(1.18); }
  24%  { transform: scale(1.00); }
  36%  { transform: scale(1.12); }
}
.likes-pill__num {
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.likes-pill__label {
  font-size: 13px; font-weight: 600;
  color: var(--pink-ink);
}
.likes-pill__status {
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  padding-left: 10px;
  border-left: 1px solid rgba(190, 24, 93, 0.2);
}

.quote {
  margin-top: 32px;
  padding: 24px 26px 22px 50px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.quote::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(236,72,153,0.06), transparent 45%);
  pointer-events: none;
}
.quote__mark {
  position: absolute; left: 14px; top: -8px;
  font-family: Georgia, serif;
  font-size: 72px; line-height: 1;
  color: var(--pink); opacity: 0.45;
  font-weight: 700;
}
.quote p {
  margin: 0 0 8px;
  font-size: 17px; font-weight: 500;
  line-height: 1.5;
  position: relative;
}
.quote__who {
  font-size: 12px; color: var(--text-muted);
  position: relative;
}

/* ============== CARDS ============== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

/* ============== BANK (big counter) ============== */
.bank {
  position: relative; overflow: hidden;
  padding: 32px 32px 28px;
  background:
    radial-gradient(140% 80% at 100% 0%, rgba(236,72,153,0.10), transparent 55%),
    var(--card);
}
.bank::after {
  content: '🍩';
  position: absolute; right: -24px; bottom: -40px;
  font-size: 180px; line-height: 1;
  opacity: 0.16;
  transform: rotate(-12deg);
  pointer-events: none;
}
.bank > * { position: relative; z-index: 1; }
.bank__row {
  display: flex; justify-content: flex-end; align-items: center;
  position: relative; z-index: 1;
}
.tag {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.tag[data-status="shipping"] { color: var(--pink); }
.tag[data-status="done"]     { color: #16a34a; }

.bank__line {
  margin-top: 18px;
  display: flex; align-items: baseline; flex-wrap: wrap;
  column-gap: 16px; row-gap: 6px;
}
.bank__line .bank__label {
  width: 100%; margin: 0;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
}
.bank__amount {
  font-weight: 900; letter-spacing: -0.04em;
  font-size: clamp(44px, 7.5vw, 76px);
  line-height: 1;
  display: inline-flex; align-items: baseline;
}
.bank__cur { font-size: 0.45em; color: var(--text-muted); font-weight: 700; }
.bank__of {
  font-size: 15px; font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.bank__of strong {
  color: var(--text); font-weight: 800; letter-spacing: -0.015em;
}
.bank__pct {
  font-size: 13px; font-weight: 800;
  color: var(--pink);
  font-variant-numeric: tabular-nums;
}

.progress {
  margin-top: 28px; position: relative;
  height: 14px; border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
  z-index: 1;
}
.progress__bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #f9a8d4, #ec4899 60%, #be185d);
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  box-shadow: 0 0 12px rgba(236,72,153,0.45);
}
.progress__bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 2.8s linear infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
.progress__pct {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 10px; font-weight: 800; letter-spacing: 0.05em;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  z-index: 2;
}

.countdown {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--line-strong);
  position: relative; z-index: 1;
}
.countdown__grid {
  margin-top: 14px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.countdown__grid > div {
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 12px 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.countdown__grid strong {
  display: block;
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.1;
}
.countdown__grid span {
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
}
.countdown.is-finished .countdown__grid > div { background: var(--pink-soft); color: var(--pink-ink); }

/* ============== GRID + STATS ============== */
.grid { display: grid; gap: 16px; margin-top: 24px; }
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 740px) {
  .grid--4 { grid-template-columns: 1fr 1fr; }
  .grid--3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .grid--3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .bank__nums { grid-template-columns: 1fr; }
}

.stat {
  padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 132px;
  position: relative; overflow: hidden;
}
.stat__label {
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
}
.stat__value {
  font-size: 28px; font-weight: 800; letter-spacing: -0.025em;
  display: flex; align-items: baseline; gap: 5px;
  font-variant-numeric: tabular-nums;
}
.stat__value--sm { font-size: 18px; }
.stat__unit { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat__foot { font-size: 12px; color: var(--text-muted); margin-top: auto; }

/* ============== REGISTRY ============== */
.registry { margin-top: 40px; }
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; margin-bottom: 14px;
  flex-wrap: wrap;
}
.section-head--lg { margin: 0 0 24px; }
.section-head h2 {
  margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
}
.section-head .muted { margin: 0; color: var(--text-muted); font-size: 13.5px; }
.muted { color: var(--text-muted); }

.filters-inline input[type="search"] {
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13.5px;
  outline: none;
  min-width: 240px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filters-inline input[type="search"]:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(236,72,153,0.14);
}

.table-card { padding: 0; overflow: hidden; }
.table-head {
  display: grid;
  grid-template-columns: 1.1fr 1.7fr 0.55fr 0.95fr 0.55fr;
  gap: 10px;
  padding: 16px 22px;
  background: #fafafb;
  border-bottom: 1px solid var(--line);
}
.th {
  background: none; border: none; cursor: pointer; padding: 0;
  text-align: left; font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
  font-family: inherit;
}
.th:hover { color: var(--text); }
.th.is-active { color: var(--pink); }
.th--num { justify-content: flex-end; }
.th--icon { justify-content: center; }
.caret { width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; opacity: 0; }
.th.is-active .caret { opacity: 1; border-top: 4px solid var(--pink); }
.th.is-active.is-asc .caret { border-top: none; border-bottom: 4px solid var(--pink); }

.table-body { display: flex; flex-direction: column; }
.trow {
  display: grid;
  grid-template-columns: 1.1fr 1.7fr 0.55fr 0.95fr 0.55fr;
  gap: 10px;
  padding: 18px 22px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  transition: background 0.12s;
}
.trow:last-child { border-bottom: none; }
.trow:hover { background: #fafafb; }
.trow .td--date { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.trow .td--shop { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .td--count { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.trow .td--sum { text-align: right; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.trow .td--receipt { display: grid; place-items: center; }
.receipt-btn {
  width: 34px; height: 34px; border-radius: 10px;
  border: none; cursor: pointer;
  background: var(--pink-soft); color: var(--pink-ink);
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s, transform 0.08s;
}
.receipt-btn:hover { background: var(--pink); color: #fff; }
.receipt-btn:active { transform: scale(0.94); }
.receipt-btn--disabled {
  background: var(--bg-soft); color: #c3c3c8; cursor: default;
}
.receipt-btn--disabled:hover { background: var(--bg-soft); color: #c3c3c8; }

.empty {
  padding: 72px 20px; text-align: center;
  color: var(--text-muted); font-size: 13.5px;
}

.table-note {
  margin: 20px 4px 0;
  font-size: 13px; color: var(--text-muted);
  display: flex; gap: 8px;
}

@media (max-width: 640px) {
  .table-head, .trow { grid-template-columns: 0.9fr 1.4fr 0.4fr 0.8fr 0.5fr; padding: 12px 14px; font-size: 12.5px; gap: 8px; }
  .table-head { padding: 12px 14px; }
}

/* ============== FOOTER ============== */
.page-foot {
  margin-top: 28px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-muted);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.page-foot strong { color: var(--text); font-weight: 700; }
.page-foot__links { display: flex; gap: 8px; align-items: center; }
.dot { opacity: 0.5; }
.foot-link { color: var(--text-muted); border-bottom: 1px dashed var(--line-strong); }
.foot-link:hover { color: var(--text); border-color: var(--text); }

/* ============== BUTTONS ============== */
.btn {
  padding: 12px 18px;
  border-radius: 14px;
  border: none;
  font-weight: 700; font-size: 14px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s;
  letter-spacing: -0.005em;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: var(--pink); color: #fff;
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.32);
}
.btn--primary:hover { background: #db2777; }
.btn--ghost {
  background: var(--bg-soft); color: var(--text);
}
.btn--ghost:hover { background: var(--line-strong); }
.btn--danger { color: #c0314a; }
.btn--inline { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 13px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: none; cursor: pointer;
  background: var(--card);
  color: var(--text);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}
.icon-btn:active { transform: scale(0.96); }
.icon-btn--ghost { background: transparent; box-shadow: none; }
.icon-btn--ghost:hover { background: rgba(0,0,0,0.04); }

/* ============== ADMIN ============== */
.admin-card { margin-top: 28px; }
.admin-card:first-of-type { margin-top: 0; }
.card-head { margin-bottom: 22px; }
.card-head--row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0 0 2px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.card-head .muted { font-size: 13px; margin: 0; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  display: flex; justify-content: space-between;
}
.field__hint { font-weight: 400; font-size: 12px; }
.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  font-family: inherit;
  resize: vertical;
}
.field textarea { min-height: 64px; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.14);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

.file { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file input[type="file"] { display: none; }
.file__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-radius: 12px;
  background: var(--bg-soft); color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.file__btn:hover { background: var(--line-strong); }
.file__clear {
  background: none; border: none; color: var(--text-muted);
  font-size: 12px; cursor: pointer; padding: 6px 8px;
}
.receipt-preview {
  margin-top: 6px;
  max-height: 240px; object-fit: contain;
  border-radius: 12px;
  background: var(--bg-soft);
}

.form__actions {
  display: flex; gap: 10px; margin-top: 6px;
  justify-content: flex-end;
}
.form__actions .btn { flex: 0 0 auto; }

.list { display: flex; flex-direction: column; gap: 8px; }
.list--manage .row { background: #fafafb; box-shadow: none; border: 1px solid var(--line); }
.row {
  background: var(--card);
  border-radius: var(--radius);
  padding: 13px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.row--manage { align-items: stretch; }
.row__icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--pink-soft); color: var(--pink-ink);
  display: grid; place-items: center;
  font-size: 18px; flex-shrink: 0;
}
.row__main { flex: 1; min-width: 0; }
.row__shop {
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row__meta {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
}
.row__actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.row-btn {
  padding: 6px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--card); color: var(--text);
  cursor: pointer; font-family: inherit;
}
.row-btn:hover { border-color: var(--text); }
.row-btn--danger { color: #c0314a; border-color: #f3d3da; }
.row-btn--danger:hover { border-color: #c0314a; background: #fff1f3; }

/* ============== MODAL ============== */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 24px 16px;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(17, 17, 20, 0.5);
  backdrop-filter: blur(4px);
  animation: fade 0.18s ease;
}
.modal__sheet {
  position: relative;
  width: 100%; max-width: 560px;
  background: var(--card);
  border-radius: 22px;
  padding: 22px;
  max-height: 88vh; overflow-y: auto;
  animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: var(--shadow-lg);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: translateY(12px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 14px;
}
.modal__head h3 { margin: 8px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -0.015em; }
.modal__body img { border-radius: 16px; background: var(--bg-soft); width: 100%; }

/* ============== TOAST ============== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff;
  padding: 11px 18px; border-radius: 12px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: toastIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes toastIn { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
