/* Mahajena design system - shared by the storefront, seller hub and admin panel. */
:root {
  --brand: #4530d9;
  --brand-600: #3826b8;
  --brand-50: #f0efff;
  --accent: #ff8a00;
  --accent-50: #fff4e5;
  --gold: #c9a227;
  --gold-2: #f4d77a;
  --ink: #161827;
  --text: #2a2d3e;
  --muted: #6b7086;
  --line: #e6e7ef;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --ok: #0f9d58;
  --ok-50: #e7f6ee;
  --warn: #b7791f;
  --warn-50: #fdf5e6;
  --danger: #d93838;
  --danger-50: #fdecec;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 22, 40, 0.05), 0 4px 16px rgba(20, 22, 40, 0.06);
  --shadow-lg: 0 20px 50px rgba(20, 22, 40, 0.18);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --brand: #7c73ff;
    --brand-600: #9a93ff;
    --brand-50: #23214a;
    --accent-50: #3a2a12;
    --ink: #f2f3f8;
    --text: #d9dbe6;
    --muted: #9a9fb5;
    --line: #2b2e40;
    --bg: #0f1018;
    --surface: #171925;
    --surface-2: #1c1f2d;
    --ok-50: #10301f;
    --warn-50: #33270f;
    --danger-50: #3a1717;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --brand: #7c73ff;
  --brand-600: #9a93ff;
  --brand-50: #23214a;
  --accent-50: #3a2a12;
  --ink: #f2f3f8;
  --text: #d9dbe6;
  --muted: #9a9fb5;
  --line: #2b2e40;
  --bg: #0f1018;
  --surface: #171925;
  --surface-2: #1c1f2d;
  --ok-50: #10301f;
  --warn-50: #33270f;
  --danger-50: #3a1717;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.35rem;
}
h3 {
  font-size: 1.1rem;
}
p {
  margin: 0 0 1em;
}
button {
  font: inherit;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.center {
  text-align: center;
}
.hidden {
  display: none !important;
}
.nowrap {
  white-space: nowrap;
}
.strike {
  text-decoration: line-through;
  color: var(--muted);
}
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ------------------------------ layout helpers ------------------------------ */
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.row.end {
  justify-content: flex-end;
}
.stack > * + * {
  margin-top: 12px;
}
.grid {
  display: grid;
  gap: 16px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 860px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------ buttons ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--brand);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn.primary:hover {
  background: var(--brand-600);
}
.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #1b1200;
}
.btn.gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-color: var(--gold);
  color: #1a1405;
}
.btn.danger {
  color: var(--danger);
}
.btn.danger.solid {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.ghost:hover {
  background: var(--brand-50);
}
.btn.sm {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.85rem;
}
.btn.lg {
  min-height: 48px;
  padding: 10px 22px;
  font-size: 1rem;
}
.btn.block {
  width: 100%;
}
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}
.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------ forms ------------------------------ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field > span,
.label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.field small {
  color: var(--muted);
  font-size: 0.8rem;
}
.input,
input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='tel'],
input[type='url'],
input[type='search'],
input[type='date'],
input[type='datetime-local'],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  min-height: 96px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
input[type='color'] {
  width: 48px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}
.otp-input {
  letter-spacing: 0.6em;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
}

/* toggle switch */
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.switch:last-child {
  border-bottom: 0;
}
.switch input {
  appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background 0.2s;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.switch input:checked {
  background: var(--brand);
}
.switch input:checked::after {
  transform: translateX(18px);
}

/* ------------------------------ surfaces ------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card.flat {
  box-shadow: none;
}
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.card-title h2,
.card-title h3 {
  margin: 0;
}
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-50);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  font-size: 0.9rem;
}
.alert.warn {
  background: var(--warn-50);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}
.alert.ok {
  background: var(--ok-50);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}
.alert.danger {
  background: var(--danger-50);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.empty .icon {
  font-size: 2.6rem;
  margin-bottom: 8px;
}

/* ------------------------------ badges ------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--brand-50);
  color: var(--brand);
  white-space: nowrap;
}
.badge.ok {
  background: var(--ok-50);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-50);
  color: var(--warn);
}
.badge.danger {
  background: var(--danger-50);
  color: var(--danger);
}
.badge.muted {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge.accent {
  background: var(--accent-50);
  color: var(--accent);
}
.badge.premium {
  background: linear-gradient(135deg, #1b1a24, #34302a);
  color: var(--gold-2);
  border: 1px solid var(--gold);
}

/* ------------------------------ tables ------------------------------ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th,
.table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table .thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ tabs ------------------------------ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tabs button {
  padding: 10px 14px;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs button.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ------------------------------ modal + toast ------------------------------ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 25, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  animation: fade 0.15s ease;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: pop 0.18s ease;
}
.modal.wide {
  max-width: 820px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1100;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  background: var(--ink);
  color: var(--surface);
  padding: 11px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  animation: pop 0.2s ease;
}
.toast.error {
  background: var(--danger);
  color: #fff;
}
.toast.ok {
  background: var(--ok);
  color: #fff;
}

/* ------------------------------ auth ------------------------------ */
.auth-card {
  max-width: 420px;
  margin: 32px auto;
}
.auth-card h1 {
  font-size: 1.5rem;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 16px 0;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.dev-code {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.2em;
}
.google-slot {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

/* ------------------------------ demo razorpay sheet ------------------------------ */
.rzp-demo {
  max-width: 380px;
  overflow: hidden;
}
.rzp-demo .rzp-head {
  background: #0b1f4d;
  color: #fff;
  padding: 18px 20px;
}
.rzp-demo .rzp-head h3 {
  color: #fff;
  margin: 0 0 4px;
}
.rzp-demo .rzp-amount {
  font-size: 1.6rem;
  font-weight: 800;
}
.rzp-demo .rzp-methods {
  display: grid;
  gap: 8px;
}
.rzp-demo .rzp-methods label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.rzp-demo .rzp-methods input {
  accent-color: #3395ff;
}

/* ------------------------------ misc ------------------------------ */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
  min-height: 16px;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.stars {
  color: #f5a623;
  letter-spacing: 1px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.img-drop {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.img-drop .tile {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.img-drop .tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-drop .tile button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.img-drop .add {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.6rem;
}
.img-drop .add:hover {
  border-color: var(--brand);
  color: var(--brand);
}
