:root {
  color-scheme: light;
  --pink: #4b0c9b;
  --pink2: #6b21a8;
  --bg: #f3ebfa;
  --panel: rgba(255, 255, 255, 0.92);
  --panel2: #f5ecfc;
  --card: #fffcff;
  --line: #d9baff;
  --text: #250743;
  --muted: #70518e;
  --outside: #eee0f8;
  --soft: #eee0f8;
  --tint: #f8f2fe;
  --green: #15803d;
  --red: #b91c1c;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--outside, #eee0f8);
  color-scheme: light;
}

body {
  margin: 0;
  background: linear-gradient(145deg, rgba(139, 44, 220, 0.12), rgba(220, 180, 255, 0.22)), url('/assets/aistudio/image_a5b9d3ec.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  font: 14px Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  line-height: 1.7;
}

.app {
  max-width: 520px;
  margin: auto;
  min-height: 100dvh;
  padding: 18px 17px 108px;
  background: rgba(245, 235, 255, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  isolation: isolate;
  overflow-x: clip;
}

@media (min-width: 700px) {
  .app {
    box-shadow: 0 0 0 1px #d8c6e6, 0 12px 70px rgba(112, 80, 128, 0.12);
    margin: 22px auto;
    border-radius: 25px;
    min-height: calc(100dvh - 44px);
  }
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 22px;
}

h1 {
  font-size: 24px;
  font-weight: 900;
  margin: 0;
  color: var(--pink);
}

h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 20px 0 12px;
  color: var(--text);
}

h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 7px;
  color: var(--text);
}

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

.logo {
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  color: var(--pink);
  padding: 11px 13px;
  font-size: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(75, 12, 155, 0.08);
}

.hero {
  background: linear-gradient(135deg, #ebd8fc, #f7effd);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 19px;
  color: var(--text);
  box-shadow: 0 6px 20px rgba(75, 12, 155, 0.07);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.stat,
.card {
  border: 1px solid rgba(217, 186, 255, 0.65);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px;
  margin-bottom: 11px;
  box-shadow: 0 4px 16px rgba(75, 12, 155, 0.06);
}

.stat b {
  font-size: 22px;
  display: block;
  color: var(--pink);
  margin-top: 6px;
}

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

.tag {
  display: inline-block;
  border-radius: 20px;
  padding: 5px 11px;
  background: var(--soft);
  color: var(--pink);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: bold;
}

.tag.ok {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.tag.no {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

button {
  font: inherit;
  font-weight: bold;
  background: var(--pink);
  border: 0;
  color: #ffffff;
  padding: 11px 15px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:active {
  transform: scale(0.98);
}

button.secondary {
  background: rgba(255, 255, 255, 0.88);
  color: var(--pink);
  border: 1px solid var(--line);
}

button.danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

input,
select,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  font: inherit;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(75, 12, 155, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

label {
  display: block;
  margin: 12px 0 6px;
  color: var(--pink);
  font-weight: 700;
  font-size: 13px;
}

textarea {
  min-height: 75px;
}

nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 252, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(217, 186, 255, 0.55);
  border-radius: 24px 24px 0 0;
  padding: 10px 5px calc(12px + env(safe-area-inset-bottom));
  z-index: 9;
  box-shadow: 0 -4px 25px rgba(75, 12, 155, 0.08);
}

nav button {
  background: transparent;
  color: var(--muted);
  padding: 6px 0;
  font-size: 11px;
  font-weight: normal;
  border: 0;
}

nav button.active {
  color: var(--pink);
  font-weight: bold;
}

nav span {
  display: block;
  font-size: 21px;
  margin-bottom: 4px;
}

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

.money {
  color: var(--pink);
  font-weight: bold;
}

.notice {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  border-radius: 13px;
  padding: 12px;
  margin: 10px 0;
  font-size: 12px;
}

.preview-img {
  width: 100%;
  height: 145px;
  object-fit: cover;
  border-radius: 12px;
  margin: 8px 0;
  border: 1px solid var(--line);
}

.prod-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.tabs button {
  white-space: nowrap;
  padding: 9px 13px;
  font-size: 12px;
}

.switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 12px;
  margin: 10px 0;
  color: var(--text);
  font-weight: 600;
}

.switch input {
  width: 20px;
  height: 20px;
  accent-color: var(--pink);
}

.empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 15px;
  margin-bottom: 10px;
}

#toast {
  position: fixed;
  bottom: 105px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pink);
  color: #ffffff;
  border-radius: 14px;
  padding: 12px 20px;
  display: none;
  max-width: 90%;
  z-index: 20;
  text-align: center;
  font-weight: bold;
  box-shadow: 0 6px 24px rgba(75, 12, 155, 0.28);
}
