/* ============================================
   Via Sakan A2A — Shared Design System
   Palette: deep purple + red + white + black
   ============================================ */

:root {
  /* Brand — Via Sakan */
  --vs-green-900: #1A0A2E;
  --vs-green-800: #2D1B54;
  --vs-green-700: #5B21B6;          /* primary brand purple */
  --vs-green-600: #6D28D9;          /* hover */
  --vs-green-100: #EDE9FE;
  --vs-green-50:  #F5F3FF;

  --vs-gold:      #E11D48;          /* refined rose accent (was harsh red) */
  --vs-gold-600:  #BE123C;
  --vs-gold-100:  #FFE4E6;
  --vs-gold-50:   #FFF1F2;

  --vs-cream:     #F8F8F8;
  --vs-paper:     #FAFAFA;          /* page background */
  --vs-card:      #FFFFFF;

  --vs-ink:       #0A0A0F;
  --vs-ink-soft:  #52525B;
  --vs-line:      #E4E4E7;
  --vs-line-soft: #F4F4F5;

  --vs-success:   #16A34A;
  --vs-warn:      #D97706;
  --vs-danger:    #E11D48;
  --vs-hot:       #E11D48;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --sh-1: 0 1px 2px rgba(26, 10, 46, .05), 0 1px 3px rgba(26, 10, 46, .04);
  --sh-2: 0 4px 12px rgba(26, 10, 46, .07), 0 2px 4px rgba(26, 10, 46, .04);
  --sh-3: 0 16px 40px rgba(26, 10, 46, .12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Cairo', system-ui, -apple-system, sans-serif;
  color: var(--vs-ink);
  background: var(--vs-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[dir="rtl"], html[dir="rtl"] body {
  font-family: 'Cairo', 'Inter', system-ui, sans-serif;
}

/* ============================================
   Brand mark
   ============================================ */
.vs-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--vs-green-900);
  text-decoration: none;
}
.vs-logo .mark {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--vs-green-700);
  color: var(--vs-gold);
  display: grid; place-items: center;
  font-family: 'Cairo', serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  border: 1px solid var(--vs-gold);
}
.vs-logo .name { line-height: 1; }
.vs-logo .name small { display:block; font-size: 10px; color: var(--vs-ink-soft); font-weight: 500; letter-spacing: 0.15em; margin-top: 3px; }

/* ============================================
   iPhone frame for mobile mockups
   ============================================ */
.iphone-frame {
  width: 390px;
  height: 844px;
  background: var(--vs-green-900);
  border-radius: 56px;
  padding: 14px;
  box-shadow: var(--sh-3), 0 0 0 2px #1f2a25 inset, 0 0 0 1px var(--vs-green-900);
  position: relative;
  flex-shrink: 0;
}

.iphone-screen {
  width: 100%;
  height: 100%;
  background: var(--vs-paper);
  border-radius: 44px;
  overflow: hidden;
  position: relative;
}

.iphone-notch {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 124px;
  height: 36px;
  background: var(--vs-green-900);
  border-radius: 20px;
  z-index: 50;
  pointer-events: none;
}

.iphone-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--vs-ink);
}

.iphone-status-bar .icons { display: flex; gap: 6px; align-items: center; }

.app-content {
  height: calc(100% - 50px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 100px;
}

.app-content::-webkit-scrollbar { display: none; }

/* ===== Touch / mouse "tap" feel for mobile demo =====
   Detailed press + ripple is added by mobile-shell.js. Here we only
   prevent native text selection on UI chrome inside the iPhone screen
   so the cursor stays as a pointer (not I-beam). Inputs override this. */
.iphone-screen { -webkit-tap-highlight-color: rgba(26,77,58,.15); }

/* ===== Real-mobile mode: drop the iPhone frame on actual phones / installed PWA ===== */
@media (max-width: 480px), (display-mode: standalone) {
  body[data-mpage], body.is-mobile-app {
    background: var(--vs-paper) !important;
    padding: 0 !important;
    display: block !important;
    min-height: 100vh;
  }
  .back-pill, .back-pill-mobile { display: none !important; }
  .iphone-frame {
    width: 100% !important; height: 100vh !important; height: 100dvh !important;
    border-radius: 0 !important; padding: 0 !important;
    box-shadow: none !important; background: var(--vs-paper) !important;
  }
  .iphone-screen { border-radius: 0 !important; height: 100vh !important; height: 100dvh !important; }
  .iphone-notch { display: none !important; }
  /* Use real iOS status bar — hide our fake one */
  .iphone-status-bar { display: none !important; }
  .app-content { height: calc(100dvh - 0px) !important; padding-top: env(safe-area-inset-top, 14px); padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important; }
  .tab-bar { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================
   Bottom tab bar (mobile)
   ============================================ */
.tab-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--vs-line);
  border-radius: 28px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: var(--sh-2);
  z-index: 40;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 14px;
  cursor: pointer;
  color: var(--vs-ink-soft);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s;
}
.tab-btn.active {
  color: var(--vs-green-700);
  background: var(--vs-green-50);
}
.tab-btn svg { width: 22px; height: 22px; }

/* ============================================
   Generic UI atoms
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--vs-green-700); color: #fff; }
.btn-primary:hover { background: var(--vs-green-600); }
.btn-gold { background: var(--vs-gold); color: var(--vs-green-900); }
.btn-gold:hover { background: var(--vs-gold-600); color: #fff; }
.btn-dark { background: var(--vs-green-900); color: var(--vs-gold); border: 1px solid var(--vs-gold); }
.btn-dark:hover { background: var(--vs-green-800); }
.btn-ghost { background: transparent; color: var(--vs-ink); }
.btn-ghost:hover { background: var(--vs-line-soft); }
.btn-outline { background: #fff; color: var(--vs-green-900); border: 1px solid var(--vs-line); }
.btn-outline:hover { border-color: var(--vs-green-700); color: var(--vs-green-700); }
.btn-icon {
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  background: #fff; border: 1px solid var(--vs-line); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--vs-line-soft);
  color: var(--vs-ink);
}
.chip-primary { background: var(--vs-green-50); color: var(--vs-green-700); border: 1px solid var(--vs-green-100); }
.chip-gold    { background: var(--vs-gold-50); color: var(--vs-gold-600); border: 1px solid var(--vs-gold-100); }
.chip-success { background: #E6F4ED; color: var(--vs-success); }
.chip-hot     { background: var(--vs-green-900); color: var(--vs-gold); }
.chip-dark    { background: var(--vs-green-900); color: var(--vs-gold); }

.card {
  background: var(--vs-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--vs-line);
  box-shadow: var(--sh-1);
}

/* Match score ring */
.score-ring {
  --score: 85;
  --color: var(--vs-green-700);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: conic-gradient(var(--color) calc(var(--score) * 1%), var(--vs-line) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.score-ring::before {
  content: '';
  position: absolute;
  inset: 4px;
  background: #fff;
  border-radius: 50%;
}
.score-ring span {
  position: relative;
  font-weight: 700;
  font-size: 13px;
  color: var(--vs-green-900);
}

/* Image placeholder fallback (neutral) */
.img-cover { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Scrollbar hide for horizontal sliders */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* RTL helpers */
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ============================================
   App shell — shared sidebar/topbar for all
   web app pages (dashboard, listings, etc.)
   ============================================ */
.app-shell { display: flex; min-height: 100vh; background: var(--vs-paper); }

.app-side {
  width: 240px; background: var(--vs-green-900); color: #fff;
  display: flex; flex-direction: column;
  padding: 18px 14px; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
  overflow-y: auto;
}
.app-side .brand {
  display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px;
  text-decoration: none; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 14px;
}
.app-side .brand .mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--vs-green-700); border: 1px solid var(--vs-gold);
  color: var(--vs-gold); font-weight: 800; display: grid; place-items: center;
  font-size: 13px; flex-shrink: 0;
}
.app-side .brand .label { display: flex; flex-direction: column; line-height: 1.1; }
.app-side .brand .label b { font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.app-side .brand .label small { font-size: 9.5px; color: rgba(255,255,255,.5); letter-spacing: .14em; margin-top: 2px; }

.app-side .nav-section {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.35); padding: 14px 10px 6px; font-weight: 700;
}
.app-side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.app-side a.nav-item {
  height: 40px; border-radius: 10px; padding: 0 12px;
  display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.7);
  position: relative; transition: all .15s; text-decoration: none;
  font-size: 13.5px; font-weight: 500;
}
.app-side a.nav-item i { flex-shrink: 0; color: rgba(255,255,255,.55); }
.app-side a.nav-item span.label { flex: 1; }
.app-side a.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-side a.nav-item:hover i { color: var(--vs-gold); }
.app-side a.nav-item.active {
  background: var(--vs-green-700); color: #fff;
  border: 1px solid rgba(201,169,97,.4); font-weight: 600;
}
.app-side a.nav-item.active i { color: var(--vs-gold); }
.app-side a.nav-item .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--vs-gold); flex-shrink: 0;
}
.app-side a.nav-item .badge {
  min-width: 22px; height: 20px; padding: 0 7px;
  border-radius: 10px; background: var(--vs-gold-50); color: var(--vs-gold-600);
  font-size: 11px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0;
}
.app-side .side-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; margin-top: 10px; }
.app-side .side-foot .me {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; text-decoration: none; color: #fff;
}
.app-side .side-foot .me:hover { background: rgba(255,255,255,.06); }
.app-side .side-foot .me img { width: 32px; height: 32px; border-radius: 50%; }
.app-side .side-foot .me .who { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.app-side .side-foot .me .who b { font-size: 12.5px; }
.app-side .side-foot .me .who small { font-size: 10.5px; color: rgba(255,255,255,.5); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-top {
  height: 64px; background: #fff; border-bottom: 1px solid var(--vs-line);
  padding: 0 24px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 30;
}
.app-top .crumb { font-size: 13px; color: var(--vs-ink-soft); }
.app-top .crumb b { color: var(--vs-ink); }
.app-top .search {
  flex: 1; max-width: 480px; position: relative;
}
.app-top .search input {
  width: 100%; padding: 9px 14px 9px 38px;
  background: var(--vs-paper); border: 1px solid var(--vs-line);
  border-radius: 12px; font-size: 13px; outline: none;
}
.app-top .search input:focus { border-color: var(--vs-green-700); background: #fff; }
.app-top .search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--vs-ink-soft);
}

.app-body { padding: 28px; }
.app-body h1.page-title {
  font-family: 'Playfair Display', 'Cairo', serif;
  font-size: 30px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 4px;
}
.app-body .page-sub { color: var(--vs-ink-soft); font-size: 14px; margin: 0 0 22px; }

/* Form atoms */
.field { display: block; margin-bottom: 14px; }
.field > label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--vs-ink-soft); margin-bottom: 6px;
}
.input, .select, textarea.input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--vs-line); border-radius: 12px;
  background: #fff; font-size: 14px; outline: none;
  font-family: inherit; color: var(--vs-ink);
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--vs-green-700); }
textarea.input { min-height: 100px; resize: vertical; }

.kpi {
  background: #fff; border: 1px solid var(--vs-line);
  border-radius: 16px; padding: 18px;
}
.kpi .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--vs-ink-soft); }
.kpi .value { font-size: 28px; font-weight: 800; margin-top: 6px; line-height: 1; }
.kpi .delta { font-size: 12px; margin-top: 6px; color: var(--vs-success); display: inline-flex; align-items: center; gap: 4px; }

/* Section heading inside body */
.sec-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--vs-line);
}
.sec-head h2 {
  font-family: 'Playfair Display','Cairo',serif;
  font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.01em;
}

/* Generic table */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--vs-line); }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; font-size: 13px; vertical-align: middle; }
.tbl thead th { background: var(--vs-paper); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--vs-ink-soft); border-bottom: 1px solid var(--vs-line); }
.tbl tbody tr + tr td { border-top: 1px solid var(--vs-line-soft); }
.tbl tbody tr:hover { background: var(--vs-paper); }

/* Floating "back to showcase" pill — reused on every page */
.back-pill {
  position: fixed; top: 14px; right: 14px; z-index: 100;
  background: var(--vs-green-900); color: var(--vs-gold);
  border: 1px solid var(--vs-gold); border-radius: 999px;
  padding: 8px 14px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; box-shadow: var(--sh-2);
}
.back-pill:hover { background: var(--vs-green-800); }

/* Demo banner used across pages so they look "live" */
.demo-banner {
  background: linear-gradient(90deg, var(--vs-green-900), var(--vs-green-700));
  color: #fff; font-size: 12px; padding: 6px 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.demo-banner b { color: var(--vs-gold); }

/* Avatar circle */
.avatar { border-radius: 50%; object-fit: cover; }

/* Headings serif by default in app body */
.app-body h2, .app-body h3 { font-family: 'Playfair Display','Cairo',serif; letter-spacing: -.01em; }

