/* bimebazar mini‑app – Modern, Royal, Fully Responsive
   Primary: Gold (D4AF37) for accents & warmth
   Secondary: Bale Green (#01AC80) for interactivity & status
   Rounded (pill‑shaped) bottom navigation – premium & sophisticated */

/* ---------- Font ---------- */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 400;
  src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 500;
  src: url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 700;
  src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
}

:root {
  --gold: #D4AF37;
  --gold-dark: #C5A234;
  --gold-light: #E8D5A3;
  --gold-subtle: rgba(212, 175, 55, 0.12);
  --gold-glow: rgba(212, 175, 55, 0.25);
  --gold-text: #766019;
  --bale-green: #01AC80;
  --bale-green-light: #02C791;
  --bale-green-dark: #018F6A;
  --bale-green-subtle: rgba(1, 172, 128, 0.12);
  --bale-green-glow: rgba(1, 172, 128, 0.3);
  --black: #1A1A1A;
  --gray-100: #F8F9FA;
  --gray-200: #E9ECEF;
  --gray-800: #343A40;
  --gray-900: #212529;
  --white: #FFFFFF;
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.03);
  --shadow-md: 0 8px 28px rgba(0,0,0,0.05);
  --card-bg: rgba(255,255,255,0.85);
  --text-color: #2B2B2B;
  --border-color: rgba(0,0,0,0.06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-nav-height: 70px;
}

/* ── Skeleton loading placeholders ── */
.skeleton-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
}
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--gold-subtle), transparent);
  animation: skeleton-shimmer 1.4s infinite;
}
@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}
.skeleton-line {
  height: 14px;
  margin-bottom: 0.5rem;
}
.skeleton-line.short { width: 35%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* ── Fixed form action bar ── */
.form-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: rgba(245, 241, 233, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(212,175,55,0.15);
  box-shadow: 0 -4px 24px rgba(212,175,55,0.08);
}
body.bale-dark-theme .form-action-bar {
  background: rgba(20, 20, 20, 0.92);
  border-top-color: rgba(255,255,255,0.05);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}
.form-action-bar .btn-primary,
.form-action-bar .btn-secondary { flex: 1; }
.card.has-form-action-bar {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}
@media (orientation: landscape) and (max-height: 500px) {
  .form-action-bar {
    padding: 0.4rem 1rem;
    padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px));
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Vazirmatn', 'Tahoma', system-ui, sans-serif;
  background: #F5F1E9;
  background-image: radial-gradient(circle at 20% 10%, rgba(212,175,55,0.06) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-color);
  line-height: 1.7;
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.bale-dark-theme {
  background: #121212;
  background-image: radial-gradient(circle at 80% 20%, rgba(1,172,128,0.06) 0%, transparent 50%);
  color: #E0E0E0;
  --card-bg: rgba(25,25,25,0.8);
  --text-color: #E0E0E0;
  --border-color: rgba(255,255,255,0.07);
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(20, 20, 20, 0.85);
  border-bottom: 1px solid rgba(212,175,55,0.15);
  padding: 0.4rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  color: white;
}
body.bale-dark-theme .app-header {
  background: rgba(20, 20, 20, 0.9);
  border-bottom-color: rgba(255,255,255,0.05);
}
.header-logo img { height: 30px; }
.notification-wrapper { position: relative; }
.header-icon-btn {
  background: transparent;
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.2s;
}
.header-icon-btn svg {
  width: 1.3rem; height: 1.3rem;
  stroke: white; stroke-width: 1.5; fill: none;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.15); }
.notif-badge {
  position: absolute;
  top: 0; right: 0;
  background: #D32F2F;
  color: white;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 0.65rem;
  display: none;
  align-items: center;
  justify-content: center;
}
.notif-badge.visible { display: flex; }

/* ---------- Location Bar ---------- */
.location-bar {
  background: var(--bale-green-subtle);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(1,172,128,0.1);
  padding: 0.3rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--bale-green);
  cursor: pointer;
  transition: background 0.2s;
}
.location-bar:hover { background: rgba(1,172,128,0.15); }
.location-bar:active { background: rgba(1,172,128,0.2); }
.location-icon svg {
  width: 1.1rem; height: 1.1rem;
  stroke: var(--bale-green);
}
.location-arrow { margin-right: auto; opacity: 0.6; }

/* ---------- Arc Decoration ---------- */
.arc-decoration {
  text-align: center;
  margin: 2px auto 0 auto;
  position: relative;
  width: 100%;
  max-width: 100px;
  pointer-events: none;
}
.arc-svg { width: 100%; height: auto; }
.arc-icon {
  margin-top: -6px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.arc-icon svg {
  width: 24px; height: 24px;
  stroke: currentColor; stroke-width: 1.5; fill: none;
  color: var(--gold);
  animation: arcGlow 3s ease-in-out infinite;
}
@keyframes arcGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ---------- Main Content ---------- */
main {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.2rem 1rem 100px;
  width: 100%;
  box-sizing: border-box;
}
main.compact-main { padding-bottom: 20px; }
#app { animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0 0.1rem;
}
.hero .slogan {
  font-size: 0.9rem;
  color: var(--gold-text);
  font-weight: 600;
  position: relative;
  display: inline-block;
  padding-bottom: 0.3rem;
}
.hero .slogan::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

/* ---------- Menu Cards – clean, asymmetric ---------- */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.menu-card {
  background: var(--card-bg);               /* plain clean background */
  backdrop-filter: blur(10px);
  border-radius: 28px 12px 28px 12px;       /* asymmetric shape */
  padding: 1.2rem 0.8rem 2.2rem;            /* extra bottom room for badge */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  border: 1.5px solid rgba(212,175,55,0.18);
  position: relative;
  overflow: visible;                        /* allows badge to pop out */
}

body.bale-dark-theme .menu-card {
  background: rgba(30,30,30,0.8);
  border-color: rgba(255,255,255,0.06);
}

/* No ::before / ::after – completely clean interior */

.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(1,172,128,0.12), 0 0 0 2px var(--bale-green-subtle);
  border-color: var(--bale-green);
}

.menu-card:active { transform: scale(0.97); }

.menu-icon {
  width: 3rem; height: 3rem;
  background: linear-gradient(135deg, rgba(212,175,55,0.22), rgba(212,175,55,0.08));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(212,175,55,0.2);
}
.menu-icon svg {
  width: 1.5rem; height: 1.5rem;
  stroke: currentColor; fill: none;
}

.menu-text h3 {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.2rem;
  color: var(--gold-text);
}

.menu-text p {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  color: #8b7a4a;
  background: rgba(212,175,55,0.08);
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  border: 1px solid rgba(212,175,55,0.15);
  line-height: 1.4;
  margin-top: 0.1rem;
  white-space: nowrap;
}
body.bale-dark-theme .menu-text p {
  color: #cfb87c;
  background: rgba(212,175,55,0.1);
  border-color: rgba(212,175,55,0.2);
}

.subtext-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.2rem;
  margin-right: 0.15rem;
}
.subtext-icon svg {
  width: 0.9rem;
  height: 0.9rem;
  stroke: var(--bale-green);
}

/* ── Prepayment Badge – straight sticky note, no arrow ── */
.menu-badge {
  position: absolute;
  top: -0.3rem;
  left: -0.3rem;
  background: #E3F2FD;
  color: var(--bale-green);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.25rem 0.8rem 0.25rem 0.6rem;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08), 1px 1px 0 rgba(1,172,128,0.1);
  /* no rotation, no arrow */
  z-index: 5;
  white-space: nowrap;
  line-height: 1.3;
}

/* ── Installment Banner – zigzag ribbon with two sections ── */
.installment-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
  color: #3E2723;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.5rem 0.2rem;
  margin: 0.8rem 0 1rem;
  position: relative;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08), 0 0 0 1px rgba(1,172,128,0.1);
  border-radius: 8px 40px 8px 40px;
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 100%, 0% 100%,
    0% 80%, 4% 85%, 0% 90%, 4% 95%,
    0% 60%, 4% 65%, 0% 70%, 4% 75%,
    0% 40%, 4% 45%, 0% 50%, 4% 55%,
    0% 20%, 4% 25%, 0% 30%, 4% 35%,
    0% 0%
  );
  overflow: visible;
}

body.bale-dark-theme .installment-banner {
  background: linear-gradient(135deg, #2E2E2E, #1A1A1A);
  color: #FFECB3;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3), 0 0 0 1px rgba(1,172,128,0.2);
}

.insta-part {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  justify-content: center;
  padding: 0.3rem 0;
}

.insta-divider {
  width: 2px;
  height: 24px;
  background: rgba(212,175,55,0.4);
  margin: 0 0.3rem;
  border-radius: 1px;
}

.insta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.insta-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  stroke: var(--bale-green);
}

/* Make text slightly smaller for mobile */
.insta-part span:last-child {
  font-size: 0.72rem;
  white-space: nowrap;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 28px;
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.05);
}
body.bale-dark-theme .card {
  background: rgba(20,20,20,0.85);
  border-color: rgba(212,175,55,0.15);
}

/* ---------- Form Elements (unchanged) ---------- */
.form-section { margin-bottom: 1.25rem; }
.form-section-title,
.modal-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gold-text);
  border-bottom: none;
  padding-bottom: 0.25rem;
}
.form-section-title svg {
  width: 1.2rem; height: 1.2rem;
  stroke: var(--gold); fill: none;
}
.form-group { margin-bottom: 0.8rem; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: #555;
}
body.bale-dark-theme .form-group label { color: #ccc; }

/* ===== Unified Select Styling ===== */
.form-select,
.form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--card-bg);
  color: var(--text-color);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23D4AF37' d='M6 8.825L1.175 4 2.238 2.938 6 6.7 9.763 2.937 10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  padding-left: 2.5rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
body.bale-dark-theme .form-select,
body.bale-dark-theme .form-group select {
  background-color: var(--gray-800);
  border-color: var(--gray-700);
  color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23D4AF37' d='M6 8.825L1.175 4 2.238 2.938 6 6.7 9.763 2.937 10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  padding-left: 2.5rem;
}
.form-select:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}

/* ===== Field Icons for Labels ===== */
.field-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
  color: var(--gold);
}
.field-icon svg {
  width: 1.1rem; height: 1.1rem;
  stroke: currentColor; fill: none;
}

/* ===== Inputs ===== */
.form-group input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--card-bg);
  color: var(--text-color);
}
body.bale-dark-theme .form-group input {
  background: var(--gray-800);
  border-color: var(--gray-700);
  color: var(--white);
}
.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}

/* Checkboxes */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.checkbox-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.4rem; height: 1.4rem;
  border: 2px solid var(--gray-200);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  flex-shrink: 0;
  position: relative;
}
body.bale-dark-theme .checkbox-group input[type="checkbox"] {
  border-color: var(--gray-700);
}
.checkbox-group input[type="checkbox"]:checked {
  background: var(--bale-green);
  border-color: var(--bale-green);
}
.checkbox-group input[type="checkbox"]::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg) scale(0);
  transition: transform 0.1s;
}
.checkbox-group input[type="checkbox"]:checked::after {
  transform: translate(-50%, -60%) rotate(45deg) scale(1);
}
.checkbox-group label {
  margin-bottom: 0;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}
.claims-section .checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.claims-section .checkbox-group input[type="text"] {
  width: 4rem;
  padding: 0.4rem 0.6rem;
  text-align: center;
  margin-right: 0.5rem;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

/* ---------- Step Indicator ---------- */
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  position: relative;
}
.step-indicator:before {
  content: '';
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.step-item {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}
.step-circle {
  width: 24px; height: 24px;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.7rem;
  margin: 0 auto 0.15rem;
  transition: all 0.2s ease;
  color: var(--text-color);
}
.step-circle.active {
  border-color: transparent;
  background: var(--bale-green);
  color: white;
  box-shadow: 0 0 0 2px var(--bale-green-subtle);
}
.step-circle.completed {
  border-color: var(--gold-dark);
  background: var(--gold);
  color: #000;
  box-shadow: 0 0 0 2px var(--gold-subtle);
}
.step-label { font-size: 0.55rem; opacity: 0.7; }

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  touch-action: manipulation;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  box-shadow: 0 4px 12px var(--gold-glow);
}
.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(212,175,55,0.35);
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(0,0,0,0.04);
  color: #333;
}
body.bale-dark-theme .btn-secondary {
  background: rgba(255,255,255,0.08);
  color: #ddd;
}
.btn-secondary:hover {
  background: var(--bale-green);
  color: #fff;
  transform: translateY(-1px);
}
.btn-icon {
  padding: 0.4rem 0.8rem !important;
  font-size: 1.2rem !important;
  min-width: auto !important;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-green {
  background: var(--bale-green);
  color: #fff;
  box-shadow: 0 2px 8px var(--bale-green-glow);
}
.btn-green:hover {
  background: var(--bale-green-light);
  box-shadow: 0 2px 12px rgba(1,172,128,0.4);
}

/* Summary Box */
.summary-box {
  background: var(--gold-subtle);
  border-radius: 20px;
  padding: 0.8rem;
  font-size: 0.8rem;
  text-align: right;
  margin: 0.6rem 0;
  border-right: 3px solid var(--gold);
  max-height: 42vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Toast */
#customToast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(1,172,128,0.92);
  backdrop-filter: blur(8px);
  color: white;
  padding: 10px 20px;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: fadeInUp 0.2s ease;
  max-width: 90%;
  text-align: center;
}
#customToast.error { background: rgba(211,47,47,0.92); }

/* Footer */
.app-footer {
  text-align: center;
  padding: 0.3rem;
  font-size: 0.65rem;
  border-top: 1px solid rgba(0,0,0,0.05);
  margin-top: 0.4rem;
  margin-bottom: calc(var(--bottom-nav-height) + 0.2rem + env(safe-area-inset-bottom, 0px));
  width: 100%;
  box-sizing: border-box;
  color: var(--gold-text);
}
body.bale-dark-theme .app-footer {
  border-top-color: rgba(255,255,255,0.05);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal-card {
  background: var(--card-bg);
  border-radius: 28px;
  padding: 1.5rem;
  width: 90%;
  max-width: 400px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  overflow: visible !important;
}
.modal-card h3 { margin-bottom: 1rem; }
.modal-card input,
.modal-card select {
  width: 100%;
  padding: 0.7rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--card-bg);
  color: var(--text-color);
}
.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
  margin-top: 1rem;
}
.modal-buttons .btn-secondary,
.modal-buttons .btn-primary {
  width: 100%;
  justify-content: center;
  font-size: 0.9rem;
  padding: 0.7rem 1.2rem;
  border-radius: 40px;
}
.status-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.status-icon svg { width: 16px; height: 16px; stroke-width: 2; }
.status-icon.success svg { stroke: var(--bale-green); }
.status-icon.error svg { stroke: #D32F2F; }

/* Profile & Reminders list items */
#carsList > .border-b,
#carsList ~ hr + .border-b {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(212,175,55,0.1) !important;
  border-radius: 16px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: none !important;
}
body.bale-dark-theme #carsList > .border-b,
body.bale-dark-theme #carsList ~ hr + .border-b {
  background: rgba(30,30,30,0.6);
  border-color: rgba(212,175,55,0.15) !important;
}
#deleteMotoBtn ~ .border-b {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(212,175,55,0.1) !important;
  border-radius: 16px;
  padding: 0.75rem;
  border-bottom: none !important;
}
.space-y-2 .border-b {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(212,175,55,0.08) !important;
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem;
  border-bottom: none !important;
}
body.bale-dark-theme .space-y-2 .border-b {
  background: rgba(30,30,30,0.5);
  border-color: rgba(212,175,55,0.12) !important;
}

/* Policy Card */
.policy-card {
  background: var(--card-bg);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--gold);
  transition: transform 0.2s, box-shadow 0.2s;
}
body.bale-dark-theme .policy-card {
  background: rgba(30,30,30,0.65);
  border-color: rgba(212,175,55,0.15);
}
.policy-card.expired { border-left-color: var(--bale-green); }
.policy-card.active { border-left-color: var(--gold); }
.policy-card:hover { box-shadow: 0 4px 12px var(--gold-glow); }
.policy-card .policy-info { flex: 1; }
.policy-card .policy-actions { display: flex; gap: 0.4rem; }
.policy-card .btn-icon {
  padding: 0.4rem !important;
  font-size: 1.1rem !important;
  border-radius: 50%;
  width: 2.2rem; height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.05);
  color: var(--gray-800);
  transition: all 0.15s ease;
}
body.bale-dark-theme .policy-card .btn-icon {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}
.policy-card .btn-icon:hover { background: var(--bale-green); color: white; }

.policy-detail-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}
.policy-detail-row svg {
  flex-shrink: 0;
  width: 1.1rem; height: 1.1rem;
  stroke: var(--gold);
}
.policy-detail-row strong {
  min-width: 80px;
  display: inline-block;
  color: var(--text-color);
}

.notif-item.clickable {
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item.clickable:hover { background: var(--bale-green-subtle); }
.notif-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.4rem 0.3rem;
  padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px));
  background: rgba(18, 18, 18, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: none;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
  min-height: var(--bottom-nav-height);
  width: 100%;
  border-radius: 28px 28px 0 0;
}
.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 0.45rem;
  font-weight: 500;
  padding: 0.2rem 0.3rem;
  border-radius: 12px;
  min-width: 36px;
  transition: all 0.2s ease;
  position: relative;
  touch-action: manipulation;
  flex: 1;
  max-width: 70px;
}
.bottom-nav .nav-item .nav-icon svg {
  width: 1.3rem; height: 1.3rem;
  stroke: currentColor; stroke-width: 1.8; fill: none;
  transition: stroke 0.2s, transform 0.2s;
}
.bottom-nav .nav-item.active { color: #fff; }
.bottom-nav .nav-item.active .nav-icon svg {
  stroke: var(--bale-green);
  transform: scale(1.05);
  filter: drop-shadow(0 0 6px rgba(1,172,128,0.3));
}
.bottom-nav .nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 2.5px;
  background: var(--bale-green);
  border-radius: 4px;
}
.bottom-nav .nav-home {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 50%;
  width: 52px; height: 52px;
  min-width: 52px;
  margin-top: -14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 4px 16px rgba(212,175,55,0.3);
}
.bottom-nav .nav-home .nav-icon svg {
  stroke: #000;
  width: 1.5rem; height: 1.5rem;
}
.bottom-nav .nav-home.active {
  box-shadow: 0 6px 24px rgba(212,175,55,0.4);
  transform: translateY(-2px);
}
.bottom-nav .nav-home::after { display: none; }
.bottom-nav .nav-home .nav-label { display: none; }

@media (max-width: 380px) {
  .bottom-nav {
    padding: 0.3rem 0.2rem;
    padding-bottom: calc(0.3rem + env(safe-area-inset-bottom, 0px));
    min-height: 52px;
    border-radius: 20px 20px 0 0;
  }
  .bottom-nav .nav-item {
    min-width: 30px;
    font-size: 0.4rem;
    padding: 0.1rem 0.2rem;
    max-width: 56px;
  }
  .bottom-nav .nav-item .nav-icon svg { width: 1.1rem; height: 1.1rem; }
  .bottom-nav .nav-home {
    width: 44px; height: 44px;
    min-width: 44px;
    margin-top: -10px;
  }
  .bottom-nav .nav-home .nav-icon svg { width: 1.3rem; height: 1.3rem; }
}
@media (min-width: 600px) {
  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 28px 28px 0 0;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .bottom-nav {
    min-height: 48px;
    padding: 0.2rem 0.3rem;
    border-radius: 18px 18px 0 0;
  }
  .bottom-nav .nav-item .nav-icon svg { width: 1rem; height: 1rem; }
  .bottom-nav .nav-home {
    width: 36px; height: 36px;
    min-width: 36px;
    margin-top: -6px;
  }
  .bottom-nav .nav-home .nav-icon svg { width: 1.1rem; height: 1.1rem; }
}

/* ── In‑App Chat Modal ── */
.chat-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0a0a0a;
  z-index: 3000;
  display: flex;
  flex-direction: column;
}
.chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.2rem;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-bottom: 2px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  flex-shrink: 0;
}
.chat-agent-info { display: flex; align-items: center; gap: 0.6rem; }
.agent-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gold-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}
.agent-avatar svg { width: 24px; height: 24px; }
.agent-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
  display: block;
  text-shadow: 0 0 8px var(--gold-glow);
}
.agent-status {
  font-size: 0.7rem;
  color: var(--bale-green);
  display: flex;
  align-items: center;
  gap: 4px;
}
.online-dot {
  width: 8px; height: 8px;
  background: var(--bale-green);
  border-radius: 50%;
  display: inline-block;
}
.header-chat-actions { display: flex; gap: 0.3rem; }
.btn-icon-only {
  background: none;
  border: none;
  padding: 0.4rem;
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  transition: color 0.2s, transform 0.15s;
}
.btn-icon-only:hover { color: var(--gold); background: transparent; }
.btn-icon-only:active { transform: scale(0.9); }
.btn-icon-only svg {
  width: 20px; height: 20px;
  stroke: currentColor; stroke-width: 2; fill: none;
}
.chat-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.chat-bubble {
  max-width: 80%;
  padding: 0.6rem 1rem;
  border-radius: 18px;
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.chat-bubble.customer {
  align-self: flex-end;
  background: var(--gold);
  color: #000;
  border-bottom-right-radius: 4px;
}
.chat-bubble.agent {
  align-self: flex-start;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-bottom-left-radius: 4px;
}
.chat-bubble small {
  display: block;
  font-size: 0.6rem;
  opacity: 0.7;
  margin-top: 0.3rem;
  text-align: right;
}
.typing-indicator { display: flex; align-items: center; gap: 0.5rem; }
.typing-bubble {
  background: rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #aaa;
  font-size: 0.75rem;
}
.typing-bubble svg { width: 24px; height: 6px; }
.typing-bubble svg circle { animation: typingBounce 1.2s infinite ease-in-out; }
.typing-bubble svg circle.dot2 { animation-delay: 0.2s; }
.typing-bubble svg circle.dot3 { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
}
.chat-modal-footer {
  flex-shrink: 0;
  padding: 0.8rem 1rem;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-top: 2px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
}
.chat-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border-radius: 30px;
  padding: 0.3rem 0.3rem 0.3rem 1rem;
  gap: 0.4rem;
}
.chat-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  padding: 0.4rem 0;
  font-family: inherit;
}
.chat-input-wrapper input::placeholder { color: rgba(255,255,255,0.5); }
.send-btn {
  background: var(--bale-green);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s;
}
.send-btn:active { transform: scale(0.9); }
.send-btn svg { width: 20px; height: 20px; }

.chat-confirm-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-confirm-box {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 1.5rem;
  width: 85%;
  max-width: 320px;
  text-align: center;
  color: var(--text-color);
}
.chat-confirm-box h3 { margin-bottom: 0.8rem; }
.chat-confirm-box p { font-size: 0.85rem; margin-bottom: 1.2rem; color: #666; }
.confirm-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.confirm-actions .btn-primary,
.confirm-actions .btn-secondary {
  width: 100%;
  justify-content: center;
  font-size: 0.9rem;
}

.modal-card button,
.modal-card .btn-primary,
.modal-card .btn-secondary {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.modal-card button svg,
.modal-card button img { pointer-events: none; }
.modal-card button { touch-action: manipulation; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== Searchable Dropdown ===== */
.searchable-dropdown {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.searchable-dropdown:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}
.searchable-dropdown .dropdown-icon {
  display: flex; align-items: center; margin-left: 0.5rem; color: var(--gold); flex-shrink: 0;
}
.searchable-dropdown .dropdown-icon svg {
  width: 1.2rem; height: 1.2rem; stroke: currentColor; fill: none;
}
.searchable-dropdown .dropdown-input {
  border: none !important;
  background: transparent !important;
  padding: 0.7rem 0.5rem;
  flex: 1;
  min-width: 0;
  outline: none;
  box-shadow: none !important;
  font-size: 0.95rem;
  font-family: 'Vazirmatn', 'Tahoma', system-ui, sans-serif;
  color: var(--text-color);
}
.searchable-dropdown .dropdown-input::placeholder { color: #999; opacity: 0.7; }
body.bale-dark-theme .searchable-dropdown {
  background: var(--gray-800); border-color: var(--gray-700);
}
body.bale-dark-theme .searchable-dropdown .dropdown-input { color: #fff; }
body.bale-dark-theme .searchable-dropdown .dropdown-input::placeholder { color: #aaa; }
.searchable-dropdown .dropdown-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  max-height: 180px;
  overflow-y: auto;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gold-subtle);
  border-radius: 12px;
  padding: 6px 0;
  z-index: 600;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  scroll-behavior: smooth;
}
.searchable-dropdown .dropdown-list li {
  padding: 10px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  color: var(--text-color);
  border-bottom: 1px solid var(--gold-subtle);
  list-style: none;
}
.searchable-dropdown .dropdown-list li:last-child { border-bottom: none; }
.searchable-dropdown .dropdown-list li:hover { background: var(--gold-subtle); color: var(--gold-text); }
.searchable-dropdown .dropdown-list li:active { background: var(--gold-light); }
.searchable-dropdown .dropdown-list .no-result {
  color: #999; text-align: center; padding: 12px 16px; cursor: default; font-style: italic;
}
body.bale-dark-theme .searchable-dropdown .dropdown-list {
  background: var(--gray-900); border-color: var(--gold-subtle);
}
body.bale-dark-theme .searchable-dropdown .dropdown-list li { color: #ddd; }
body.bale-dark-theme .searchable-dropdown .dropdown-list li:hover { background: var(--gold-subtle); color: var(--gold); }
.searchable-dropdown .dropdown-input:-webkit-autofill,
.searchable-dropdown .dropdown-input:-webkit-autofill:hover,
.searchable-dropdown .dropdown-input:-webkit-autofill:focus,
.searchable-dropdown .dropdown-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--card-bg) inset !important;
  -webkit-text-fill-color: var(--text-color) !important;
  transition: background-color 5000s ease-in-out 0s;
}
body.bale-dark-theme .searchable-dropdown .dropdown-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px var(--gray-800) inset !important;
  -webkit-text-fill-color: #fff !important;
}
select[data-enhanced] { display: none !important; }

/* ===== Pure Dropdown ===== */
.pure-dropdown { position: relative; cursor: pointer; user-select: none; }
.pure-dropdown .dropdown-input { cursor: pointer; padding-left: 2.2rem !important; }
.pure-dropdown::after {
  content: '';
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--gold);
  pointer-events: none;
  transition: transform 0.2s ease;
}
.pure-dropdown.open::after { transform: translateY(-50%) rotate(180deg); }
body.bale-dark-theme .pure-dropdown::after { border-top-color: var(--gold); }
.pure-dropdown:hover { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-subtle); }
.pure-dropdown .dropdown-list { z-index: 600; }
.pure-dropdown .dropdown-list li[style*="background"] {
  background: var(--gold-subtle) !important;
  border-right: 3px solid var(--gold);
}
.pure-dropdown .dropdown-input {
  touch-action: manipulation;
  min-height: 44px;
}

/* ── Discount Trophy Modal ── */
.trophy-overlay { z-index: 5000; }
.trophy-card {
  background: linear-gradient(160deg, #fff8e6, #fff);
  border-radius: 28px;
  padding: 2rem 1.5rem 1.5rem;
  width: 90%;
  max-width: 340px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(212,175,55,0.35);
  animation: trophyPop 0.4s cubic-bezier(.34,1.56,.64,1);
}
body.bale-dark-theme .trophy-card { background: linear-gradient(160deg, #241d0a, #1a1a1a); }
@keyframes trophyPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.trophy-confetti {
  font-size: 1.4rem;
  letter-spacing: 0.4rem;
  margin-bottom: 0.5rem;
  animation: confettiFloat 2s ease-in-out infinite;
}
@keyframes confettiFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.trophy-icon-wrap {
  width: 84px; height: 84px;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px var(--gold-glow);
  animation: trophyBounce 1.2s ease-in-out infinite;
}
@keyframes trophyBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(-3deg); }
}
.trophy-icon { width: 44px; height: 44px; color: #fff; }
.trophy-title { font-size: 1.3rem; margin-bottom: 0.4rem; color: var(--gold-text); }
.trophy-subtitle { font-size: 0.85rem; margin-bottom: 0.8rem; }
.trophy-value {
  display: inline-block;
  background: var(--bale-green);
  color: #fff;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: 40px;
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
  box-shadow: 0 4px 14px var(--bale-green-glow);
}
.trophy-desc { font-size: 0.8rem; opacity: 0.75; margin-bottom: 1rem; }
.trophy-close { width: 100%; }