:root {
  /* Color palette - refined */
  --bg: #f0f6f3;
  --surface: #ffffff;
  --surface-soft: #f3f9f6;
  --text: #0f2b22;
  --text-secondary: #3d5a4e;
  --muted: #5e7b6f;
  --primary: #0e7c66;
  --primary-hover: #0b6553;
  --primary-active: #095342;
  --primary-soft: rgba(14, 124, 102, 0.08);
  --primary-ghost: rgba(14, 124, 102, 0.12);
  --danger: #d14343;
  --danger-hover: #b83a3a;
  --danger-soft: #fef2f2;
  --warning: #ca861e;
  --warning-soft: #fffbeb;
  --success: #1b9e5a;
  --success-soft: #f0fdf4;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --border: #d4e5dc;
  --border-strong: #b8d1c5;
  --border-focus: #8cb3f2;

  /* Shadows - consistent system */
  --shadow-sm: 0 1px 3px rgba(24, 51, 39, 0.06);
  --shadow-md: 0 4px 12px rgba(24, 51, 39, 0.08);
  --shadow-lg: 0 8px 24px rgba(24, 51, 39, 0.1);
  --shadow-xl: 0 16px 36px rgba(24, 51, 39, 0.12);
  --shadow-card: 0 1px 4px rgba(24, 51, 39, 0.04), 0 4px 16px rgba(24, 51, 39, 0.06);

  /* Radius - consistent */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 999px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
}

/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  direction: rtl;
  font-family: "Cairo", "Tajawal", "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 12%, rgba(88, 187, 159, 0.28) 0, transparent 40%),
    radial-gradient(circle at 86% 8%, rgba(250, 208, 132, 0.22) 0, transparent 36%),
    radial-gradient(circle at 82% 74%, rgba(146, 191, 255, 0.16) 0, transparent 32%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Layout */
.page-wrap {
  width: min(1160px, 100% - 32px);
  margin-inline: auto;
  padding-block: 32px 48px;
}

.hidden {
  display: none !important;
}

/* Status/Note messages */
.status-note {
  margin: 0;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid #dce3ed;
  line-height: 1.7;
  animation: fadeSlideIn var(--duration-slow) var(--ease-smooth) both;
}

.status-note.error {
  background: var(--danger-soft);
  color: #991b1b;
  border-color: #fecaca;
}

.status-note.success {
  background: var(--success-soft);
  color: #166534;
  border-color: #bbf7d0;
}

.status-note.info {
  background: var(--info-soft);
  color: #1e40af;
  border-color: #bfdbfe;
}

/* Buttons base */
.btn,
button {
  border: 0;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-smooth),
    opacity var(--duration-fast) var(--ease-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active,
button:active {
  transform: scale(0.97);
}

.btn:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  pointer-events: none;
}

/* Button variants */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #0a8f73 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(14, 124, 102, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #0c7a64 100%);
  box-shadow: 0 6px 20px rgba(14, 124, 102, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(14, 124, 102, 0.2);
}

.btn-secondary {
  background: #e6f2ed;
  color: #1a4d3e;
  border: 1px solid #d4e5dc;
}

.btn-secondary:hover {
  background: #d9ebe5;
  border-color: #b8d1c5;
  transform: translateY(-1px);
}

.btn-secondary:active {
  background: #cce3da;
  transform: translateY(0) scale(0.97);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(209, 67, 67, 0.25);
}

.btn-danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 6px 18px rgba(209, 67, 67, 0.32);
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(209, 67, 67, 0.15);
}

/* Stack layout */
.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Auth pages shell */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: cardRise var(--duration-slow) var(--ease-out) both;
}

.auth-card-login {
  position: relative;
  overflow: hidden;
  border-color: #cfe1f2;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.auth-card-login::before {
  content: "";
  position: absolute;
  inset: -140px auto auto -140px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(15, 118, 110, 0.18) 0, rgba(15, 118, 110, 0) 68%);
  pointer-events: none;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.auth-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

.auth-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: var(--radius-full);
  background: #e7f7f3;
  color: #0b635a;
  border: 1px solid #b7e6dd;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* Form */
.portal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 700;
}

/* Inputs, textarea, select */
input,
textarea,
select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth);
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: #9caeb3;
  opacity: 1;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--border-strong);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(105, 161, 238, 0.15), 0 1px 2px rgba(0, 0, 0, 0.04);
}

input:disabled,
textarea:disabled,
select:disabled,
input[readonly] {
  background: #f8fafb;
  border-color: #e2e9e5;
  color: var(--muted);
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235e7b6f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 36px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Auth links */
.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-links a {
  color: var(--primary);
  font-weight: 700;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.auth-links a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.auth-links-login {
  border-top: 1px dashed #d7e3ef;
  padding-top: 16px;
}

/* Login benefits */
.login-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.login-benefit {
  border-radius: var(--radius-md);
  border: 1px solid #d4e2f0;
  background: #f4f8fd;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth);
}

.login-benefit:hover {
  border-color: #b8cee6;
  box-shadow: var(--shadow-sm);
}

.login-benefit strong {
  font-size: 0.92rem;
  color: #1a304a;
}

.login-benefit small {
  color: #4f637d;
  line-height: 1.6;
  font-size: 0.85rem;
}

/* OTP */
.otp-wrap {
  display: flex;
  justify-content: center;
  gap: 10px;
  direction: ltr;
}

.otp-digit {
  width: 52px;
  height: 56px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.otp-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.15);
}

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

.otp-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(248, 254, 251, 0.88);
  border-bottom: 1px solid #d6e7de;
  box-shadow: 0 4px 20px rgba(20, 67, 52, 0.08);
}

.topbar-inner {
  width: min(1160px, 100% - 32px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand actions"
    "tabs tabs";
  align-items: center;
  padding: 10px 0 12px;
  gap: 8px 16px;
}

.brand-title {
  grid-area: brand;
  font-weight: 800;
  color: var(--primary);
  font-size: 1.08rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.topbar-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  flex-wrap: wrap;
}

.topbar-actions .pill {
  background: #e2f4ee;
  color: #155545;
  border: 1px solid #c4e5d9;
}

/* User menu */
.user-menu {
  position: relative;
}

.avatar-trigger {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 2px solid #b8ddd0;
  background: linear-gradient(145deg, #f8fffc 0%, #e8f7f1 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(12, 88, 68, 0.12);
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-out);
}

.avatar-trigger:hover {
  transform: translateY(-1px);
  border-color: #98ccb9;
  box-shadow: 0 6px 16px rgba(12, 88, 68, 0.18);
}

.avatar-trigger:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(14, 124, 102, 0.24),
    0 4px 12px rgba(12, 88, 68, 0.12);
}

.avatar-trigger:active {
  transform: scale(0.95);
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 800;
  color: #0f5f4a;
  font-size: 1rem;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Notification bell */
.notif-bell {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #d4e8e0;
  background: linear-gradient(145deg, #fafffe 0%, #eef9f4 100%);
  color: #0f5f4a;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
  box-shadow: 0 2px 8px rgba(12,88,68,0.08);
}
.notif-bell:hover {
  border-color: #0f5f4a;
  box-shadow: 0 4px 12px rgba(12,88,68,0.15);
  transform: scale(1.05);
}
.notif-badge {
  position: absolute;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #dc3545, #e74c6f);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 8px rgba(220,53,69,0.45);
  border: 2px solid #fff;
}
.notif-dropdown {
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid #d4e8e0;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  animation: fadeIn 0.15s ease-out both;
}
.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.95rem;
}
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
  transition: background var(--duration-fast);
  cursor: default;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fffc; }
.notif-item.notif-unread { background: #e8f8f2; border-inline-start: 3px solid #0f5f4a; }
.notif-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.notif-body { min-width: 0; }
.notif-body strong { display: block; font-size: 0.85rem; color: #1a1a2e; }
.notif-body p { margin: 3px 0 0; font-size: 0.78rem; color: #6c757d; line-height: 1.4; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* User menu overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
}

/* User menu panel (centered modal) */
.user-menu-panel {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(340px, calc(100vw - 28px));
  height: fit-content;
  max-height: calc(100vh - 40px);
  border-radius: var(--radius-lg);
  border: 1px solid #cde6dc;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(19, 61, 48, 0.18);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 121;
  animation: fadeIn 0.2s ease-out both;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #d8e8e1;
  position: relative;
}

.menu-close-btn {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f0f2f5;
  color: #6c757d;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast);
}
.menu-close-btn:hover { background: #dee2e6; color: #1a1a2e; }

.avatar-preview {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2px solid #c1e2d6;
  background: #ecf8f3;
  flex: 0 0 auto;
}

.avatar-fallback-lg {
  font-size: 1.2rem;
}

.user-menu-email {
  margin: 0;
  font-weight: 700;
  color: #1f3d34;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.user-menu-actions {
  display: grid;
  gap: 8px;
}

.user-menu-actions .btn-secondary,
.user-menu-actions .btn-danger {
  width: 100%;
}

/* Logout confirm overlay */
.logout-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(14, 31, 25, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.logout-confirm-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.logout-confirm-card {
  width: min(420px, 100%);
  border-radius: var(--radius-xl);
  border: 1px solid #cfe6dc;
  background: #fff;
  box-shadow: 0 24px 48px rgba(11, 46, 35, 0.28);
  padding: 24px;
  transform: translateY(16px) scale(0.96);
  transition: transform var(--duration-normal) var(--ease-out);
}

.logout-confirm-overlay.is-open .logout-confirm-card {
  transform: translateY(0) scale(1);
}

.logout-confirm-card h3 {
  margin: 0 0 10px;
  color: #153b30;
  font-size: 1.2rem;
}

.logout-confirm-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.95rem;
}

.logout-confirm-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Tabs navigation */
.tabs-nav {
  grid-area: tabs;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tabs-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  color: #1e4f40;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid #d4e5dc;
  background: #f3faf7;
  transition:
    all var(--duration-fast) var(--ease-smooth);
  text-decoration: none;
}

.tabs-nav a:hover {
  background: #e9f5f0;
  border-color: #bcd9cd;
  transform: translateY(-1px);
}

.tabs-nav a:active {
  transform: translateY(0);
}

.tabs-nav a.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(14, 124, 102, 0.25);
}

/* Section card */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 22px;
  transition: box-shadow var(--duration-normal) var(--ease-smooth);
}

.section-card:hover {
  box-shadow: var(--shadow-lg);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  line-height: 1.4;
}

.section-head h2 {
  font-size: 1.3rem;
}

.section-head h3 {
  font-size: 1.1rem;
}

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

/* Products grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-soft);
  transition:
    box-shadow var(--duration-normal) var(--ease-smooth),
    transform var(--duration-normal) var(--ease-out);
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.product-media {
  height: 155px;
  background: linear-gradient(140deg, #dbe5f7, #f2f6fc);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-preview {
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-preview .product-media {
  height: 180px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.product-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-title {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.4;
}

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  background: #e5edf9;
  color: #2f3f58;
  line-height: 1.5;
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.price-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.02rem;
}

.price-line del {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.88rem;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.stat-tile {
  background: #eff8f4;
  border: 1px solid #d3e9df;
  border-radius: var(--radius-md);
  padding: 14px;
  transition: border-color var(--duration-fast) var(--ease-smooth);
}

.stat-tile:hover {
  border-color: #b0d5c6;
}

.stat-tile small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.stat-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

/* Filters */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: #e9f6f1;
  color: #1f5242;
  border: 1px solid #cae6dc;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    all var(--duration-fast) var(--ease-smooth);
  font-family: inherit;
  line-height: 1.4;
}

.chip:hover {
  background: #dcefe8;
  border-color: #b0d5c6;
  transform: translateY(-1px);
}

.chip:active {
  transform: translateY(0);
}

.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(14, 124, 102, 0.2);
}

.chip.active:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Orders list */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--duration-normal) var(--ease-smooth),
    border-color var(--duration-fast) var(--ease-smooth);
}

.order-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

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

.order-id {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
}

.order-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.status-pending {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.status-preparing {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.status-shipped {
  background: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.status-delivered {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Order items */
.order-items {
  margin-top: 12px;
  border-top: 1px dashed #d7dfeb;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-item-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f2f5;
}

.order-item-line:last-child {
  border-bottom: none;
}

.order-item-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: #f8f9fa;
  border: 1px solid #eef0f3;
}

.order-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.order-item-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.4;
}

.order-item-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.order-item-total {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.order-customer {
  margin-top: 12px;
  background: #f8fafc;
  border: 1px solid #eef0f4;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customer-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.customer-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.order-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.order-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.order-total .total-label {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.order-total strong {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.order-summary {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-box {
  background: #f4faf7;
  border: 1px solid #d8ebe2;
  border-radius: var(--radius-md);
  padding: 12px;
  line-height: 1.6;
}

.summary-box small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.summary-box strong {
  display: block;
  margin-top: 2px;
  font-size: 1.05rem;
}

/* Account page */
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-item {
  background: #f4faf7;
  border: 1px solid #d8ebe2;
  border-radius: var(--radius-md);
  padding: 14px;
  transition: border-color var(--duration-fast) var(--ease-smooth);
}

.account-item:hover {
  border-color: #b0d5c6;
}

.account-page .section-card {
  animation: cardRise 0.45s ease both;
}

.account-page .section-card:nth-of-type(2) {
  animation-delay: 0.06s;
}

.account-page .section-card:nth-of-type(3) {
  animation-delay: 0.12s;
}

/* Account hero */
.account-hero {
  position: relative;
  overflow: hidden;
  border-color: #c7e5d8;
  background: linear-gradient(145deg, #ffffff 0%, #eef8f3 100%);
}

.account-hero::before {
  content: "";
  position: absolute;
  inset: -150px -100px auto auto;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(14, 124, 102, 0.2) 0, rgba(14, 124, 102, 0) 70%);
  pointer-events: none;
}

.account-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.account-hero-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 2.1vw, 1.9rem);
  line-height: 1.3;
}

.account-hero-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.account-hero-pills {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #19624f;
  background: #e7f6ef;
  border: 1px solid #c8e7dc;
}

.account-hero-notice {
  border-radius: var(--radius-md);
  border: 1px solid #d5e9df;
  background: #f8fcfa;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-hero-notice small {
  color: #3d6b5f;
  font-weight: 700;
  font-size: 0.8rem;
}

.account-hero-notice strong {
  line-height: 1.7;
  font-size: 0.95rem;
}

.account-hero-notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.9rem;
}

.account-panel {
  border-color: #d2e8de;
}

.account-panel-kicker {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: #e9f7f1;
  border: 1px solid #cae8dc;
  color: #1f6b59;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
}

#partnerSummary .account-item small {
  display: inline-block;
  margin-bottom: 5px;
  font-size: 0.82rem;
}

#partnerSummary .account-item strong {
  font-size: 1.02rem;
  color: #173d32;
}

/* Keyframes */
@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes catalogRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive - Tablets & small screens */
@media (max-width: 900px) {
  .field-grid,
  .account-grid,
  .order-summary,
  .login-benefits {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "actions"
      "tabs";
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .tabs-nav {
    justify-content: stretch;
  }

  .tabs-nav a {
    flex: 1 1 120px;
    min-width: 120px;
  }

  .account-hero-grid {
    grid-template-columns: 1fr;
  }

  .page-wrap {
    padding-block: 24px 36px;
  }

  .section-card {
    padding: 18px;
  }

  .auth-card {
    padding: 24px 20px;
  }
}

/* Responsive - Mobile */
@media (max-width: 600px) {
  .page-wrap {
    width: min(1160px, 100% - 16px);
    padding-block: 20px 28px;
  }

  .topbar-inner {
    width: min(1160px, 100% - 16px);
    padding: 8px 0 10px;
    gap: 6px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .avatar-trigger {
    width: 40px;
    height: 40px;
  }

  .user-menu-panel {
    width: min(290px, calc(100vw - 16px));
  }

  .logout-confirm-actions {
    justify-content: stretch;
  }

  .logout-confirm-actions .btn-secondary,
  .logout-confirm-actions .btn-danger {
    width: 100%;
  }

  .auth-card {
    padding: 20px 16px;
    border-radius: var(--radius-xl);
  }

  .otp-digit {
    width: 44px;
    height: 48px;
    font-size: 1.2rem;
  }

  .section-card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .stack {
    gap: 16px;
  }

  .tabs-nav a {
    min-width: 100px;
    padding: 8px 12px;
    font-size: 0.82rem;
    flex: 1 1 auto;
  }

  .filter-row {
    gap: 6px;
  }

  .chip {
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-tile {
    padding: 10px;
  }

  .stat-tile strong {
    font-size: 1.1rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .order-summary {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    padding: 20px 12px;
  }

  .login-benefits {
    grid-template-columns: 1fr;
  }

  .account-hero-grid {
    gap: 14px;
  }

  .logout-confirm-card {
    padding: 18px;
  }
}

/* Catalog hero */
.catalog-hero {
  position: relative;
  overflow: hidden;
  border-color: #c8dff4;
  background:
    radial-gradient(circle at 85% 12%, rgba(81, 161, 255, 0.14) 0, transparent 45%),
    radial-gradient(circle at 12% 75%, rgba(18, 164, 132, 0.14) 0, transparent 45%),
    linear-gradient(150deg, #ffffff 0%, #f5faff 100%);
}

.catalog-hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  align-items: end;
}

.catalog-hero-grid h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.2vw, 1.95rem);
  line-height: 1.3;
}

.catalog-hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.add-product-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  text-decoration: none;
}

.is-disabled-link {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.25);
}

/* Blocked page */
.blocked-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.blocked-wrap {
  width: min(720px, 100%);
}

.blocked-card {
  border-radius: var(--radius-2xl);
  border: 1px solid #f4b6b6;
  background: linear-gradient(160deg, #fff 0%, #fff4f4 100%);
  box-shadow: 0 24px 48px rgba(110, 26, 26, 0.16);
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.blocked-illustration {
  width: min(420px, 100%);
  height: auto;
}

.blocked-card h1 {
  margin: 0;
  color: #991b1b;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 1.3;
}

.blocked-card p {
  margin: 0;
  line-height: 1.9;
  color: #5f2d2d;
  max-width: 560px;
  font-size: 0.95rem;
}

.blocked-logout-btn {
  min-width: 200px;
}

/* Products catalog list */
.products-catalog-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Empty state */
.catalog-empty {
  border-radius: var(--radius-lg);
  border: 1.5px dashed #c8dfd5;
  background: linear-gradient(150deg, #fcfffd 0%, #f1faf7 100%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.catalog-empty h3 {
  margin: 0;
  font-size: 1.1rem;
}

/* Catalog product card */
.catalog-product-card {
  display: grid;
  direction: ltr;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  border-radius: var(--radius-lg);
  border: 1px solid #d1e5dc;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(17, 53, 40, 0.06);
  animation: catalogRise 0.35s ease both;
  transition:
    box-shadow var(--duration-normal) var(--ease-smooth),
    transform var(--duration-normal) var(--ease-out);
}

.catalog-product-card:hover {
  box-shadow: 0 6px 20px rgba(17, 53, 40, 0.1);
  transform: translateY(-2px);
}

.card-pending {
  opacity: 0.65;
  border-color: #e8c87a;
  background: #fefce8;
}

.card-rejected {
  opacity: 0.5;
  border-color: #cbd5e1;
  background: #f8fafc;
  filter: grayscale(0.7);
  pointer-events: none;
}

.card-rejected .catalog-product-media {
  filter: grayscale(1);
}

.card-rejected .btn-secondary,
.card-rejected .btn-danger {
  opacity: 0.4;
  pointer-events: none;
}

.catalog-pending-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: #fef9e7;
  border: 1px solid #f0d78e;
  color: #8b6914;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.catalog-pending-banner i {
  font-size: 1.2rem;
}

.catalog-product-media {
  position: relative;
  min-height: 180px;
  background:
    radial-gradient(circle at 25% 25%, rgba(123, 177, 255, 0.25) 0, transparent 50%),
    linear-gradient(145deg, #eaf3ff 0%, #f5f8fc 100%);
  overflow: hidden;
}
.catalog-product-media[data-gallery-id] { cursor: pointer; }

.catalog-product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-gallery-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 300ms ease;
}
.catalog-gallery-img.active { opacity: 1; }

.catalog-img-dots {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0,0,0,0.25); backdrop-filter: blur(2px); z-index: 3;
}
.catalog-img-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,0.5); cursor: pointer;
  transition: background 200ms, transform 200ms;
}
.catalog-img-dots span.active { background: #fff; transform: scale(1.3); }

.catalog-video-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  color: #fff; pointer-events: none;
}
.catalog-img-counter {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  padding: 1px 7px; border-radius: 999px;
  background: rgba(0,0,0,0.35); backdrop-filter: blur(2px);
  color: #fff; font-size: 0.6rem; font-weight: 700; line-height: 1.4;
  z-index: 3; pointer-events: none; white-space: nowrap; direction: ltr;
}

/* Full-screen Gallery Overlay */
.catalog-gallery-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  animation: noonFadeIn 0.2s ease;
}
.catalog-gallery-overlay-inner {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.catalog-gallery-overlay-close {
  position: absolute; top: 12px; left: 12px; z-index: 10;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 1.6rem;
  line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.catalog-gallery-overlay-close:hover { background: rgba(255,255,255,0.3); }
.catalog-gallery-overlay-main {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 800px; padding: 0 8px;
}
.catalog-gallery-overlay-image-wrap {
  position: relative; flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; aspect-ratio: 3/4; max-height: 80vh;
}
.catalog-gallery-overlay-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; opacity: 0; transition: opacity 0.3s ease;
}
.catalog-gallery-overlay-img.active { opacity: 1; }
.catalog-gallery-overlay-img[src=""],
.catalog-gallery-overlay-img:not([src]) { display: none; }
.catalog-gallery-overlay-img video,
video.catalog-gallery-overlay-img {
  object-fit: contain; background: #000;
}
.catalog-gallery-overlay-arrow {
  flex-shrink: 0; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.catalog-gallery-overlay-arrow:hover { background: rgba(255,255,255,0.3); }
.catalog-gallery-overlay-arrow svg { width: 22px; height: 22px; stroke: #fff; }
.catalog-gallery-overlay-bottom {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.catalog-gallery-overlay-dots { display: flex; gap: 6px; }
.catalog-gallery-overlay-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.4); cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.catalog-gallery-overlay-dots span.active { background: #fff; transform: scale(1.3); }
.catalog-gallery-overlay-counter {
  color: rgba(255,255,255,0.8); font-size: 0.75rem; font-weight: 600; direction: ltr;
}
@keyframes noonFadeIn { from { opacity: 0; } to { opacity: 1; } }

.catalog-no-image {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #4a6178;
  font-weight: 700;
  font-size: 0.9rem;
}

.catalog-product-body {
  direction: rtl;
  text-align: right;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.catalog-product-head h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.catalog-product-description {
  margin: 0;
  line-height: 1.8;
  color: var(--text-secondary);
}

.catalog-price-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #0c3d30;
  font-size: 1.05rem;
}

.catalog-price-line del {
  color: #708277;
  font-weight: 600;
  font-size: 0.9rem;
}

.catalog-actions {
  margin-top: auto;
}

.catalog-actions .btn-secondary,
.catalog-actions .btn-danger {
  min-width: 112px;
}

/* Product editor */
.product-editor-page .section-card {
  animation: cardRise 0.4s ease both;
}

.editor-hero {
  position: relative;
  overflow: hidden;
  border-color: #c6e4da;
  background:
    radial-gradient(circle at 12% 18%, rgba(15, 124, 102, 0.16) 0, transparent 42%),
    radial-gradient(circle at 88% 80%, rgba(249, 170, 86, 0.18) 0, transparent 40%),
    linear-gradient(150deg, #ffffff 0%, #f4fbf8 100%);
}

.editor-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: center;
}

.editor-hero-grid h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.1vw, 1.85rem);
  line-height: 1.3;
}

.editor-hero-actions {
  display: flex;
  justify-content: flex-end;
}

.editor-preview-grid {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(240px, 1fr);
  gap: 16px;
  align-items: start;
}

.editor-preview-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-preview-main .product-media {
  height: 210px;
  border: 1px solid #c9ddd4;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.editor-preview-thumbs {
  margin-top: 8px;
  border-radius: var(--radius-md);
  border: 1.5px dashed #cde2d8;
  background: #f7fcfa;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: 112px;
}

.editor-thumb {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #d5e8df;
  background: #fff;
  height: 86px;
  transition: border-color var(--duration-fast) var(--ease-smooth);
}

.editor-thumb:hover {
  border-color: #a8cdbd;
}

.editor-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-thumb-placeholder {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 16px;
}

.editor-actions .btn-primary,
.editor-actions .btn-secondary {
  min-width: 140px;
  text-decoration: none;
  text-align: center;
}

/* Sales page */
.sales-hero {
  position: relative;
  overflow: hidden;
  border-color: #c8dbed;
  background:
    radial-gradient(circle at 88% 18%, rgba(115, 182, 255, 0.2) 0, transparent 40%),
    radial-gradient(circle at 18% 84%, rgba(14, 124, 102, 0.18) 0, transparent 45%),
    linear-gradient(145deg, #ffffff 0%, #f4f9ff 100%);
}

.sales-kpi-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.sales-kpi-card {
  border-radius: var(--radius-md);
  border: 1px solid #cfe1f0;
  background: #ffffff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    box-shadow var(--duration-fast) var(--ease-smooth),
    border-color var(--duration-fast) var(--ease-smooth);
}

.sales-kpi-card:hover {
  border-color: #a8c5de;
  box-shadow: var(--shadow-sm);
}

.sales-kpi-card small {
  color: #57708b;
  font-size: 0.8rem;
  font-weight: 600;
}

.sales-kpi-card strong {
  color: #173a56;
  font-size: 1.08rem;
  line-height: 1.6;
  font-weight: 800;
}

.sales-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sales-row-card {
  border-radius: var(--radius-md);
  border: 1px solid #d0e3ef;
  background: #fdfefe;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr);
  gap: 14px;
  align-items: center;
  transition:
    box-shadow var(--duration-fast) var(--ease-smooth),
    border-color var(--duration-fast) var(--ease-smooth);
}

.sales-row-card:hover {
  border-color: #a8c5de;
  box-shadow: var(--shadow-sm);
}

.sales-row-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sales-row-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sales-row-metrics span {
  border-radius: var(--radius-sm);
  border: 1px solid #d8e8f3;
  background: #f8fbff;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sales-row-metrics small {
  color: #5d7389;
  font-size: 0.78rem;
  font-weight: 600;
}

.sales-row-metrics strong {
  color: #1b4363;
  font-size: 0.95rem;
  font-weight: 700;
}

.sales-invoice-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sales-invoice-card {
  border-radius: var(--radius-lg);
  border: 1px solid #d7e6f2;
  background: linear-gradient(150deg, #ffffff 0%, #f8fbff 100%);
  padding: 16px;
  transition:
    box-shadow var(--duration-fast) var(--ease-smooth),
    border-color var(--duration-fast) var(--ease-smooth);
}

.sales-invoice-card:hover {
  border-color: #b8cfe0;
  box-shadow: var(--shadow-sm);
}

.sales-invoice-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.sales-invoice-head h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.sales-invoice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sales-invoice-grid div {
  border-radius: var(--radius-sm);
  border: 1px solid #d6e6f0;
  background: #ffffff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sales-invoice-grid small {
  color: #556f85;
  font-size: 0.78rem;
  font-weight: 600;
}

.sales-invoice-grid strong {
  color: #173e5c;
  font-size: 0.95rem;
}

.invoice-summary {
  background: linear-gradient(150deg, #f0f7ff 0%, #e8f4fe 100%) !important;
  border-color: #b8d8f0 !important;
}

.invoice-summary-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invoice-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #d6e6f0;
  border-radius: var(--radius-md);
}

.invoice-summary-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #556f85;
}

.invoice-summary-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #173e5c;
}

.invoice-summary-total {
  background: #173e5c !important;
  border-color: #173e5c !important;
}

.invoice-summary-total .invoice-summary-label {
  color: #a0c4e8;
}

.invoice-summary-total .invoice-summary-value {
  color: #ffffff;
  font-size: 1.3rem;
}

.invoice-summary-clickable {
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-smooth);
}

.invoice-summary-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(23, 62, 92, 0.25) !important;
}

.invoice-summary-clickable:active {
  transform: translateY(0);
}

body.account-suspended {
  position: relative;
}

body.account-suspended::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(200, 200, 200, 0.25);
  z-index: 9998;
  pointer-events: none;
}

body.account-suspended .topbar,
body.account-suspended .page-wrap,
body.account-suspended .tabs-nav {
  filter: grayscale(0.85);
  pointer-events: none;
  user-select: none;
}

body.account-suspended .btn,
body.account-suspended button,
body.account-suspended select,
body.account-suspended a,
body.account-suspended input,
body.account-suspended textarea {
  pointer-events: none !important;
  opacity: 0.5 !important;
  filter: grayscale(1) !important;
  cursor: not-allowed !important;
}

body.account-suspended .status-badge,
body.account-suspended .order-status-select {
  pointer-events: none !important;
  opacity: 0.4 !important;
}

/* Exception for the transfer page - stays fully functional */
body.account-suspended[data-page="transfer"]::before {
  display: none !important;
}

body.account-suspended[data-page="transfer"] .page-wrap,
body.account-suspended[data-page="transfer"] .topbar,
body.account-suspended[data-page="transfer"] .btn,
body.account-suspended[data-page="transfer"] button,
body.account-suspended[data-page="transfer"] select,
body.account-suspended[data-page="transfer"] a,
body.account-suspended[data-page="transfer"] input,
body.account-suspended[data-page="transfer"] textarea {
  filter: none !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  cursor: auto !important;
}

/* Suspended banner */
.suspended-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #dc3545;
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  pointer-events: auto;
}
body.account-suspended .suspended-pay-link {
  display: inline-block;
  background: #fff;
  color: #dc3545;
  padding: 4px 14px;
  border: none;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  filter: none !important;
  z-index: 100000;
  position: relative;
  transition: transform var(--duration-fast);
}
body.account-suspended .suspended-pay-link:hover {
  transform: scale(1.05);
}

body.account-suspended[data-page="transfer"] .suspended-banner {
  display: none;
}

/* Scramble order details */
body.account-suspended .order-card .order-head,
body.account-suspended .order-card .order-customer {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

/* Hide order select action */
body.account-suspended .order-status-select {
  display: none !important;
}

body.account-suspended .order-card::after {
  content: "🔒";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
}

.order-card {
  position: relative;
}

.transfer-hero {
  text-align: center;
  padding: 24px 0 8px;
}

.transfer-amount {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  margin-top: 8px;
  direction: ltr;
  display: inline-block;
}

.transfer-form .form-group {
  margin-bottom: 12px;
}

.transfer-form label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.transfer-history {
  min-height: 60px;
}

.wallet-options {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.wallet-option {
  flex: 1; min-width: 120px; display: flex; flex-direction: column; align-items: center;
  padding: 16px 12px; border: 2px solid #e0e0e0; border-radius: 14px; cursor: pointer;
  transition: all 0.2s; background: #fff; position: relative;
}
.wallet-option.active {
  border-color: #0e7c66; background: #f0fdf6;
}
.wallet-option.disabled {
  opacity: 0.5; cursor: not-allowed; background: #f5f5f5;
}
.wallet-option .wallet-icon { font-size: 1.6rem; margin-bottom: 6px; }
.wallet-option .wallet-label { font-size: 0.85rem; font-weight: 600; color: #333; }
.wallet-option .wallet-badge {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: #999; color: #fff; font-size: 0.65rem; padding: 2px 8px; border-radius: 20px;
  white-space: nowrap;
}
.receipt-upload-area {
  position: relative; border: 2px dashed #ccc; border-radius: 14px; padding: 24px;
  text-align: center; cursor: pointer; transition: border-color 0.2s; background: #fafafa;
}
.receipt-upload-area:hover { border-color: #0e7c66; }
.receipt-upload-placeholder { color: #888; }
.receipt-upload-placeholder p { margin: 8px 0 4px; font-weight: 600; }
.receipt-preview { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.receipt-img-wrap { position: relative; display: inline-block; }
.receipt-img-wrap img { max-width: 200px; max-height: 180px; border-radius: 10px; border: 1px solid #ddd; object-fit: cover; }
.receipt-img-wrap .receipt-remove {
  position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%;
  border: none; background: #e74c3c; color: #fff; font-size: 0.9rem; cursor: pointer;
  line-height: 26px; text-align: center; padding: 0;
}
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid #eee;
}
.history-item:last-child { border-bottom: none; }
.hist-info { display: flex; flex-direction: column; gap: 4px; }
.hist-date { font-weight: 600; color: #333; font-size: 0.9rem; }
.hist-phone { color: #666; font-size: 0.82rem; }
.hist-status { font-size: 0.8rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; }
.hist-pending { background: #fff3cd; color: #856404; }
.hist-success { background: #d4edda; color: #155724; }
.hist-danger { background: #f8d7da; color: #721c24; }
.required { color: #e74c3c; }

/* Keyframes (legacy support) */
@keyframes catalog-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive - up to 1000px */
@media (max-width: 1000px) {
  .sales-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-row-card {
    grid-template-columns: 1fr;
  }

  .sales-row-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-invoice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Responsive - up to 900px */
@media (max-width: 900px) {
  .catalog-hero-grid,
  .editor-hero-grid,
  .editor-preview-grid {
    grid-template-columns: 1fr;
  }

  .catalog-hero-actions,
  .editor-hero-actions {
    justify-content: flex-start;
  }

  .catalog-product-card {
    grid-template-columns: 1fr;
    direction: rtl;
  }

  .catalog-product-media {
    min-height: 190px;
  }
}

/* Responsive - up to 600px */
@media (max-width: 600px) {
  .sales-kpi-grid,
  .sales-row-metrics,
  .sales-invoice-grid {
    grid-template-columns: 1fr;
  }

  .editor-preview-thumbs {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Review Status Badges
   ============================================================ */
.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-badge.status-approved {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success);
}

.status-badge.status-pending {
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.status-badge.status-rejected {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger);
}

/* Notification Badge */
.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-right: 4px;
  line-height: 1;
}

.notification-badge.hidden {
  display: none;
}

/* Toast notification for partner */
.partner-toast-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.partner-toast-item {
  pointer-events: auto;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border-right: 4px solid var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  animation: toastIn 0.25s ease-out;
  direction: rtl;
}

.partner-toast-item.toast-success {
  border-right-color: var(--success);
}
.partner-toast-item.toast-error {
  border-right-color: var(--danger);
}
.partner-toast-item.toast-info {
  border-right-color: var(--info);
}
.partner-toast-item.toast-warning {
  border-right-color: var(--warning);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Products page enhancements */
.catalog-hero {
  position: relative;
}

.catalog-hero .refresh-status {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.products-catalog-page .section-card {
  transition: opacity 0.2s;
}

.products-catalog-page.loading .section-card {
  opacity: 0.6;
  pointer-events: none;
}

/* Notifications Section */
.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--info-soft);
  border: 1px solid transparent;
  transition: background 0.2s;
}

.notification-item.notification-read {
  background: transparent;
  opacity: 0.6;
}

.notification-icon {
  font-size: 1.2rem;
  line-height: 1.4;
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-body strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 2px;
}

.notification-body p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0 0 4px;
}

.notification-body small {
  font-size: 0.68rem;
  color: var(--muted);
}

.notification-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.8rem;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.15s;
}

.notification-dismiss:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text);
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-card-header h3 i {
  color: var(--warning);
}

body.dark-mode .notification-item {
  background: rgba(37, 99, 235, 0.1);
}
body.dark-mode .notification-item.notification-read {
  background: transparent;
}
body.dark-mode .notification-dismiss:hover {
  background: rgba(255,255,255,0.08);
}

.image-upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #f8fafc;
}

.image-upload-zone:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.image-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #64748b;
}

.image-upload-placeholder i {
  font-size: 2rem;
  color: #94a3b8;
}

.editor-upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.editor-upload-preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.editor-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-upload-preview .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-upload-preview .remove-btn:hover {
  background: rgba(220,38,38,0.8);
}
