:root {
  --white: #ffffff;
  --yellow: #f5c400;
  --pink: #e85d8e;
  --red: #e23b3b;
  --green: #1f9d55;
  --text: #14532d;
  --muted: #3f7a4f;
  --line: #f3c1d3;
  --card: #fff7fb;
  --shadow: 0 10px 28px rgba(226, 59, 59, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--white);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden { display: none !important; }

.screen { min-height: 100dvh; }

.login-screen {
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(245, 196, 0, 0.18), transparent 55%),
    radial-gradient(800px 380px at 100% 0%, rgba(232, 93, 142, 0.16), transparent 50%),
    var(--white);
}

.login-card {
  width: min(420px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.brand-mark {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  object-fit: cover;
  margin-bottom: 12px;
  border: 2px solid var(--pink);
}

.login-card h1 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: 0.04em;
}

.sub {
  margin: 8px 0 22px;
  color: var(--muted);
}

.login-card form {
  display: grid;
  gap: 10px;
  text-align: left;
}

label {
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--muted);
}

input, button {
  font: inherit;
}

input[type="password"],
input[type="search"] {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--white);
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(232, 93, 142, 0.16);
}

.login-card button,
#install-btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--pink);
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
}

.login-card button:active,
#install-btn:active,
.chip:active {
  transform: scale(0.98);
}

.error {
  margin: 0;
  color: var(--red);
  font-size: 0.9rem;
}

.app-screen {
  background: var(--white);
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--pink);
}

.brand strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.brand span {
  color: var(--muted);
  font-size: 0.78rem;
}

.install-bar {
  margin: 12px 16px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff4cc;
  border: 1px solid var(--yellow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.install-bar p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}

.toolbar {
  position: sticky;
  top: 66px;
  z-index: 15;
  padding: 12px 16px 8px;
  background: var(--white);
}

.search-wrap input {
  font-size: 16px;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
}

.chip span {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 650;
}

.chip.active {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--white);
}

.chip.active span { color: var(--white); }

.chip.pending.active { background: var(--yellow); border-color: var(--yellow); color: var(--text); }
.chip.pending.active span { color: var(--text); }
.chip.success.active { background: var(--green); border-color: var(--green); }
.chip.cancelled.active { background: var(--red); border-color: var(--red); }

.wrap {
  padding: 8px 16px 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.status-line {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.oid {
  font-weight: 800;
  font-size: 1.05rem;
}

.badge {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge.pending { background: #fff4cc; color: #8a6a00; }
.badge.success { background: #d9f5e5; color: var(--green); }
.badge.cancelled { background: #fde2e2; color: var(--red); }

.product {
  font-size: 1.05rem;
  font-weight: 750;
  margin: 0 0 12px;
}

.meta {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  font-size: 0.92rem;
}

.k {
  color: var(--muted);
  font-weight: 650;
}

.v {
  color: var(--text);
  word-break: break-word;
}

.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

@media (min-width: 820px) {
  .top { padding: 16px 28px; }
  .toolbar { padding: 16px 28px 8px; top: 74px; }
  .wrap { padding: 8px 28px 48px; }
  .list { grid-template-columns: 1fr 1fr; }
  .install-bar { margin: 16px 28px 0; }
}

@media (display-mode: standalone) {
  .install-bar { display: none !important; }
}

.top-nav {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.nav-btn {
  text-decoration: none;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.9rem;
}

.nav-btn.active {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--white);
}

.create-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.create-card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid .two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--white);
  color: var(--text);
  outline: none;
  font-size: 16px;
}

.form-grid input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(232, 93, 142, 0.16);
}

.form-grid button[type="submit"] {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
}

.form-error {
  color: var(--red);
  margin: 0;
  font-size: 0.9rem;
}

.promo-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.promo-item .meta { flex: 1; }

.menu-wrap { position: relative; }

.dots {
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--text);
  border-radius: 12px;
  width: 42px;
  height: 42px;
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.menu {
  display: none;
  position: absolute;
  right: 0;
  top: 46px;
  min-width: 160px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 30;
}

.menu.open { display: block; }

.menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--white);
  color: var(--text);
  padding: 12px 14px;
  font-weight: 650;
  cursor: pointer;
}

.menu button:hover { background: var(--card); }
.menu button.danger { color: var(--red); }

.stats-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 16px 8px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.stat .num {
  font-size: 1.35rem;
  font-weight: 800;
}

.stat .lbl {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

@media (min-width: 700px) {
  .stats-box { grid-template-columns: 1fr 1fr 1fr; margin: 0 28px 8px; }
  .form-grid .two { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 699px) {
  .form-grid .two { grid-template-columns: 1fr; }
}

