/* ==========================================================================
   SANAD | سند — Mature Private-Wealth & iOS Experience Stylesheet
   ========================================================================== */

:root {
  --navy-950: #071324;
  --navy-900: #0b1f3a;
  --navy-800: #132d52;
  --emerald-800: #064e3b;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-50: #ecfdf5;
  --gold-700: #b45309;
  --gold-600: #d97706;
  --gold-50: #fffbeb;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --danger-700: #b91c1c;
  --danger-50: #fef2f2;
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --font-main: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
  --scale: 1;
}

[data-large-text="true"] {
  --scale: 1.14;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at 20% 15%, #dce6f2 0%, #cfdbe9 45%, #c4d1e2 100%);
  color: var(--slate-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  padding: 12px;
  font-size: calc(14px * var(--scale));
  line-height: 1.55;
}

.num {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: inline-block;
}

/* Studio Top Utility Bar (Discreet, Sanad-Only) */
.studio-bar {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(11, 31, 58, 0.06);
  font-size: 12px;
  color: var(--navy-900);
}

.studio-bar-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.studio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-700);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.18);
}

.studio-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-btn {
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--navy-900);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.studio-btn:hover {
  background: var(--navy-900);
  color: var(--white);
  border-color: var(--navy-900);
}

.studio-btn.active {
  background: var(--emerald-700);
  color: var(--white);
  border-color: var(--emerald-700);
}

/* ==========================================================================
   iPhone 16 Pro Max Hardware Chassis
   ========================================================================== */
.iphone-frame {
  position: relative;
  width: 472px;
  max-width: 97vw;
  height: 880px;
  max-height: 90vh;
  background: #141923;
  border-radius: 54px;
  padding: 12px;
  box-shadow:
    0 30px 70px -15px rgba(7, 19, 36, 0.38),
    0 0 0 2px #364152,
    0 0 0 5px #1e2634,
    inset 0 0 12px rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* Side Hardware Buttons */
.iphone-frame::before {
  content: '';
  position: absolute;
  right: -7px;
  top: 185px;
  width: 4px;
  height: 82px;
  background: #2c3545;
  border-radius: 0 4px 4px 0;
}

.iphone-frame::after {
  content: '';
  position: absolute;
  left: -7px;
  top: 155px;
  width: 4px;
  height: 115px;
  background: #2c3545;
  border-radius: 4px 0 0 4px;
}

.iphone-screen {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  background: var(--slate-50);
  border-radius: 43px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Dynamic Island & iOS Status Bar */
.ios-statusbar {
  position: relative;
  z-index: 40;
  height: 44px;
  padding: 10px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  direction: ltr;
  flex-shrink: 0;
  transition: color 0.3s ease, background 0.3s ease;
}

.ios-statusbar.light-text {
  color: var(--white);
}

.ios-statusbar.dark-text {
  color: var(--slate-900);
  background: var(--white);
}

.dynamic-island {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  width: 116px;
  height: 30px;
  background: #05070b;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.dynamic-island-lens {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2a4365 0%, #090d16 70%);
  border: 1px solid #1e293b;
}

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

/* iOS Home Indicator Bar */
.ios-home-bar-wrap {
  position: relative;
  z-index: 40;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  background: transparent;
}

.ios-home-bar-wrap.white-bg {
  background: var(--white);
}

.ios-home-bar {
  width: 134px;
  height: 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.28);
  transition: transform 0.2s ease, background 0.2s ease;
}

.ios-home-bar.light {
  background: rgba(255, 255, 255, 0.55);
}

.ios-home-bar-wrap:hover .ios-home-bar {
  transform: scaleX(1.06);
}

/* ==========================================================================
   SCREEN 1: iPhone Home Screen (Only Sanad App Icon)
   ========================================================================== */
.ios-homescreen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 24px 14px;
  background:
    radial-gradient(circle at 80% 18%, rgba(4, 120, 87, 0.42) 0%, transparent 48%),
    radial-gradient(circle at 18% 72%, rgba(180, 83, 9, 0.24) 0%, transparent 45%),
    linear-gradient(165deg, #071324 0%, #0f294a 52%, #0a1c36 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
  transition: opacity 0.35s ease;
}

.ios-clock-widget {
  text-align: center;
  margin-top: 12px;
}

.ios-date-label {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.2px;
}

.ios-time-big {
  font-size: 68px;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.78) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ios-app-center-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  gap: 14px;
}

.sanad-icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  outline: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sanad-icon-btn:hover {
  transform: scale(1.06);
}

.sanad-icon-btn:active {
  transform: scale(0.94);
}

.sanad-app-squircle {
  position: relative;
  width: 82px;
  height: 82px;
  border-radius: 21px;
  background: linear-gradient(145deg, #0d2b4e 0%, #064e3b 100%);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.22),
    inset 0 2px 4px rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sanad-app-squircle::after {
  content: '';
  position: absolute;
  top: -35%;
  left: -20%;
  width: 140%;
  height: 70%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 100%);
  transform: rotate(-12deg);
  pointer-events: none;
}

.sanad-pulse-ring {
  position: absolute;
  inset: -8px;
  border-radius: 27px;
  border: 1.5px solid rgba(52, 211, 153, 0.45);
  animation: pulseRing 2.4s infinite cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

@keyframes pulseRing {
  0% { transform: scale(0.96); opacity: 0.85; }
  70% { transform: scale(1.13); opacity: 0; }
  100% { transform: scale(1.13); opacity: 0; }
}

.sanad-icon-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.ios-tap-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ios-page-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.ios-page-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.ios-page-dots span.active {
  background: var(--white);
}

.ios-empty-dock {
  height: 78px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

/* Smooth iOS App Open Spring Transition */
.app-launch-overlay {
  position: absolute;
  inset: 0;
  z-index: 35;
  background: linear-gradient(155deg, #0b1f3a 0%, #064e3b 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--white);
  animation: iosSpringOpen 0.52s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes iosSpringOpen {
  0% {
    opacity: 0.3;
    transform: scale(0.22);
    border-radius: 90px;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    border-radius: 0;
  }
}

.screen-fade-in {
  animation: screenSlideUp 0.36s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes screenSlideUp {
  0% { opacity: 0; transform: translateY(12px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   SCREEN 2: Login & Welcome Screen
   ========================================================================== */
.login-screen {
  flex: 1;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  padding: 18px 22px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.login-brand-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 6px;
}

.login-logo-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(145deg, #0b1f3a 0%, #047857 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(11, 31, 58, 0.18);
  margin-bottom: 10px;
}

.login-brand-title {
  font-size: calc(22px * var(--scale));
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.3px;
}

.login-brand-sub {
  font-size: calc(12px * var(--scale));
  color: var(--slate-500);
  margin-top: 2px;
}

.login-welcome-box {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  margin: 12px 0;
}

.login-welcome-title {
  font-size: calc(16px * var(--scale));
  font-weight: 700;
  color: var(--navy-900);
}

.login-welcome-desc {
  font-size: calc(12px * var(--scale));
  color: var(--slate-500);
  margin-top: 3px;
}

.profile-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 12px 0 14px;
}

.profile-pill {
  padding: 8px 6px;
  border-radius: 12px;
  border: 1.5px solid var(--slate-200);
  background: var(--slate-50);
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.profile-pill.active {
  border-color: var(--emerald-700);
  background: var(--emerald-50);
  color: var(--emerald-800);
}

.profile-pill-name {
  font-size: calc(12px * var(--scale));
  font-weight: 700;
  display: block;
}

.profile-pill-role {
  font-size: 10px;
  color: var(--slate-500);
  display: block;
  margin-top: 1px;
}

.input-group {
  margin-bottom: 12px;
}

.input-label {
  display: block;
  font-size: calc(12px * var(--scale));
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 5px;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border-radius: 12px;
  border: 1.5px solid var(--slate-200);
  background: var(--slate-50);
  font-family: inherit;
  font-size: calc(14px * var(--scale));
  color: var(--slate-900);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.password-input:focus {
  outline: none;
  border-color: var(--navy-900);
  background: var(--white);
}

.eye-btn {
  position: absolute;
  left: 10px;
  background: none;
  border: none;
  color: var(--slate-500);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.btn-primary-sanad {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #0b1f3a 0%, #047857 100%);
  color: var(--white);
  font-family: inherit;
  font-size: calc(14px * var(--scale));
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(4, 120, 87, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary-sanad:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(4, 120, 87, 0.28);
}

.btn-faceid {
  width: 100%;
  height: 44px;
  margin-top: 9px;
  border-radius: 13px;
  border: 1.5px solid var(--slate-200);
  background: var(--white);
  color: var(--navy-900);
  font-family: inherit;
  font-size: calc(13px * var(--scale));
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-faceid:hover {
  border-color: var(--emerald-700);
  background: var(--emerald-50);
  color: var(--emerald-800);
}

.login-footer-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--slate-500);
  padding-top: 6px;
}

/* Face ID Modal Overlay */
.faceid-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(7, 19, 36, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.faceid-card {
  width: 210px;
  padding: 24px 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  text-align: center;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

.faceid-ring {
  width: 68px;
  height: 68px;
  margin: 0 auto 12px;
  border-radius: 20px;
  background: var(--emerald-50);
  color: var(--emerald-700);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--emerald-600);
  animation: pulseFace 1s infinite alternate;
}

@keyframes pulseFace {
  from { transform: scale(0.95); }
  to { transform: scale(1.04); }
}

/* ==========================================================================
   SCREEN 3: Main Sanad App Shell (Top Header + Right Sidebar + Scroll Content)
   ========================================================================== */
.app-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--slate-50);
  overflow: hidden;
}

.app-topbar {
  height: 50px;
  padding: 0 14px;
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

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

.app-mini-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0b1f3a, #047857);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.app-topbar-title {
  font-size: calc(14px * var(--scale));
  font-weight: 700;
  color: var(--navy-900);
}

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

.user-chip-btn {
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
  color: var(--navy-900);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lock-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-700);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lock-icon-btn:hover {
  background: var(--danger-50);
  color: var(--danger-700);
  border-color: #fecaca;
}

/* Body with Right-Side Navigation Menu */
.app-body-split {
  flex: 1;
  display: flex;
  flex-direction: row; /* In RTL, first child is on the RIGHT! */
  overflow: hidden;
  position: relative;
}

/* Right-Side Navigation Menu */
.right-nav-rail {
  width: 78px;
  background: var(--white);
  border-left: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  padding: 8px 5px;
  gap: 4px;
  flex-shrink: 0;
  overflow-y: auto;
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 20;
}

.right-nav-rail.expanded {
  width: 176px;
  padding: 8px 8px;
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.08);
}

.nav-expand-btn {
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
  color: var(--slate-700);
  border-radius: 10px;
  padding: 6px;
  margin-bottom: 4px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-rail-item {
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 8px 4px;
  cursor: pointer;
  font-family: inherit;
  color: var(--slate-500);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  transition: all 0.18s ease;
  position: relative;
}

.right-nav-rail.expanded .nav-rail-item {
  flex-direction: row;
  justify-content: flex-start;
  text-align: right;
  padding: 9px 10px;
  gap: 9px;
}

.nav-rail-item:hover {
  background: var(--slate-100);
  color: var(--navy-900);
}

.nav-rail-item.active {
  background: var(--emerald-50);
  color: var(--emerald-800);
  font-weight: 700;
}

.nav-rail-item.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 3.5px;
  border-radius: 4px 0 0 4px;
  background: var(--emerald-700);
}

.nav-rail-text {
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 600;
}

.right-nav-rail.expanded .nav-rail-text {
  font-size: 12px;
}

/* Main Scrollable Content Area */
.main-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.main-viewport::-webkit-scrollbar,
.right-nav-rail::-webkit-scrollbar {
  width: 4px;
}

.main-viewport::-webkit-scrollbar-thumb,
.right-nav-rail::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
}

/* ==========================================================================
   Reusable Cards, Badges, Sliders & Controls
   ========================================================================== */
.hero-summary-card {
  background: linear-gradient(140deg, #0b1f3a 0%, #102a4c 55%, #064e3b 100%);
  color: var(--white);
  border-radius: var(--radius-xl);
  padding: 15px;
  box-shadow: 0 12px 28px rgba(11, 31, 58, 0.16);
  position: relative;
  overflow: hidden;
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.28);
}

.hero-main-label {
  font-size: calc(11.5px * var(--scale));
  color: rgba(255, 255, 255, 0.78);
  margin-top: 10px;
}

.hero-main-value {
  font-size: calc(25px * var(--scale));
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hero-main-unit {
  font-size: 12px;
  font-weight: 400;
  color: #a7f3d0;
}

.hero-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-metric-box {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 11px;
  padding: 7px 8px;
}

.hero-metric-lbl {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.74);
}

.hero-metric-val {
  font-size: calc(12.5px * var(--scale));
  font-weight: 700;
  margin-top: 2px;
}

.card-box {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.025);
}

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

.card-title {
  font-size: calc(13.5px * var(--scale));
  font-weight: 700;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-sub {
  font-size: calc(11.5px * var(--scale));
  color: var(--slate-500);
  margin-bottom: 10px;
}

/* Two-Fund Allocation Stacked Bar */
.split-bar-track {
  height: 11px;
  width: 100%;
  background: var(--slate-100);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  margin: 8px 0;
}

.split-bar-sukuk {
  background: linear-gradient(90deg, #0b1f3a, #1d4ed8);
  height: 100%;
  transition: width 0.25s ease;
}

.split-bar-re {
  background: linear-gradient(90deg, #047857, #10b981);
  height: 100%;
  transition: width 0.25s ease;
}

.two-funds-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.fund-mini-pill {
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
}

.fund-mini-pill.sukuk {
  border-right: 3.5px solid #1d4ed8;
}

.fund-mini-pill.realestate {
  border-right: 3.5px solid var(--emerald-700);
}

/* Custom Range Sliders */
.slider-field {
  margin-bottom: 11px;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: calc(12px * var(--scale));
  margin-bottom: 4px;
}

.slider-label-row span:first-child {
  color: var(--slate-700);
  font-weight: 600;
}

.slider-val-badge {
  font-weight: 700;
  color: var(--navy-900);
  background: var(--slate-100);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--slate-200);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy-900);
  border: 2.5px solid var(--white);
  box-shadow: 0 2px 6px rgba(11, 31, 58, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

/* Quick Preset Chips */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
  color: var(--slate-700);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.chip-btn:hover {
  border-color: var(--emerald-700);
  color: var(--emerald-800);
}

.chip-btn.active {
  background: var(--navy-900);
  color: var(--white);
  border-color: var(--navy-900);
}

.chip-btn.emerald-solid {
  background: var(--emerald-700);
  color: var(--white);
  border-color: var(--emerald-700);
}

/* Status & Alert Boxes */
.status-banner {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: calc(11.5px * var(--scale));
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}

.status-banner.ok {
  background: var(--emerald-50);
  color: var(--emerald-800);
  border: 1px solid #a7f3d0;
}

.status-banner.warn {
  background: var(--gold-50);
  color: #92400e;
  border: 1px solid #fde68a;
}

.status-banner.danger {
  background: var(--danger-50);
  color: var(--danger-700);
  border: 1px solid #fecaca;
}

/* Toggle Switch Row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--slate-100);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-info-title {
  font-size: calc(12.5px * var(--scale));
  font-weight: 700;
  color: var(--slate-900);
}

.toggle-info-sub {
  font-size: 11px;
  color: var(--slate-500);
}

.ios-switch {
  position: relative;
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: var(--slate-300, #cbd5e1);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.22s ease;
}

.ios-switch.on {
  background: var(--emerald-600);
}

.ios-switch::after {
  content: '';
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.ios-switch.on::after {
  transform: translateX(19px);
}

/* SMS / WhatsApp Notification Mockup */
.sms-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--slate-200);
}

.sms-header {
  background: #075e54;
  color: var(--white);
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sms-body {
  background: #efeae2;
  padding: 10px;
}

.sms-bubble {
  background: var(--white);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: calc(11.5px * var(--scale));
  color: #111b21;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  line-height: 1.5;
}

/* Holding Item Rows inside Funds */
.holding-item {
  padding: 9px 10px;
  border-radius: 11px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  margin-bottom: 7px;
  font-size: 11.5px;
}

.holding-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: var(--navy-900);
}

.holding-meta {
  display: flex;
  justify-content: space-between;
  color: var(--slate-500);
  font-size: 10.5px;
  margin-top: 3px;
}

/* Voice Assistant Wave */
.voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 26px;
}

.voice-wave span {
  width: 4px;
  height: 10px;
  border-radius: 999px;
  background: var(--emerald-600);
  animation: waveBar 0.8s infinite ease-in-out alternate;
}

.voice-wave span:nth-child(2) { animation-delay: 0.15s; height: 18px; }
.voice-wave span:nth-child(3) { animation-delay: 0.3s; height: 24px; }
.voice-wave span:nth-child(4) { animation-delay: 0.45s; height: 16px; }
.voice-wave span:nth-child(5) { animation-delay: 0.6s; height: 11px; }

@keyframes waveBar {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1.15); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========================================================================== 
   SANAD v2 — iPhone-first presentation and compact right-side navigation
   ========================================================================== */
html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
}

html {
  height: 100%;
  background: #071324;
}

body {
  height: 100dvh;
  min-height: 100dvh;
  padding: 18px;
  overflow: hidden;
  justify-content: center;
  align-items: center;
}

#app-root {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.iphone-frame {
  width: 430px;
  height: min(920px, calc(100dvh - 36px));
  max-width: calc(100vw - 36px);
  max-height: none;
  min-height: 0;
  padding: 10px;
  border-radius: 50px;
  flex: 0 1 auto;
}

.iphone-screen {
  min-height: 0;
  border-radius: 41px;
  isolation: isolate;
}

.ios-statusbar {
  height: calc(44px + env(safe-area-inset-top, 0px));
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
}

.ios-home-bar-wrap {
  height: calc(25px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Keep the simulated phone app as the only visible product surface. */
.studio-bar {
  display: none !important;
}

.app-shell {
  min-height: 0;
  min-width: 0;
}

.app-topbar {
  height: 56px;
  padding-inline: 13px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
}

.app-topbar-title {
  font-size: calc(14px * var(--scale));
}

.app-body-split {
  min-height: 0;
  min-width: 0;
}

.right-nav-rail {
  position: relative;
  width: 66px;
  padding: 9px 4px;
  gap: 5px;
  overflow-x: hidden;
  border-left-color: #edf1f5;
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.015);
}

.right-nav-rail.expanded {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(198px, 72%);
  padding: 10px 9px;
  overflow-y: auto;
  border-left: 1px solid var(--slate-200);
  border-radius: 0 0 0 16px;
  box-shadow: -12px 6px 28px rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(18px);
}

.nav-expand-btn {
  min-height: 37px;
  padding: 7px 4px;
  gap: 4px;
  border-radius: 11px;
  font-size: 9.5px;
  white-space: nowrap;
}

.nav-rail-item {
  min-height: 55px;
  padding: 7px 2px;
  border-radius: 11px;
  gap: 4px;
}

.nav-rail-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.nav-rail-text {
  width: 100%;
  font-size: 9px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.right-nav-rail.expanded .nav-rail-item {
  min-height: 43px;
  padding: 9px 10px;
  gap: 10px;
}

.right-nav-rail.expanded .nav-rail-text {
  font-size: 12px;
}

.main-viewport {
  min-width: 0;
  min-height: 0;
  padding: 11px 10px 14px;
  gap: 10px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.hero-summary-card {
  border-radius: 18px;
  padding: 14px;
}

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

.hero-metric-box:last-child {
  grid-column: 1 / -1;
}

.card-box {
  border-radius: 17px;
  padding: 13px;
  scroll-margin-top: 12px;
}

.card-header {
  align-items: flex-start;
}

.card-title {
  line-height: 1.4;
}

.demo-profile-label {
  margin-top: 12px;
  color: var(--slate-700);
  font-size: 11px;
  font-weight: 700;
}

.login-error {
  min-height: 0;
  color: var(--danger-700);
  font-size: 11px;
  line-height: 1.4;
  margin: -5px 1px 8px;
}

.login-demo-note {
  color: var(--slate-500);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: 8px 10px;
  text-align: center;
  font-size: 10px;
  line-height: 1.5;
  margin: 0 0 8px;
}

.login-footer-badges {
  font-size: 9.5px;
  gap: 6px;
  padding-bottom: 2px;
}

.login-screen {
  justify-content: flex-start;
  gap: 9px;
  padding: 15px 19px 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.login-brand-head {
  margin-top: 4px;
}

.login-welcome-box {
  margin: 5px 0;
  padding: 14px;
}

.profile-pills {
  margin: 9px 0 12px;
}

.profile-pill {
  padding: 8px 4px;
}

.login-footer-badges {
  margin-top: auto;
}

.ios-homescreen {
  padding-top: max(26px, env(safe-area-inset-top, 0px));
  padding-bottom: 14px;
}

.ios-tap-hint {
  text-align: center;
}

/* Responsive device shell: on an iPhone the webpage itself becomes the phone. */
@media (max-width: 600px) {
  body {
    padding: 0;
    background: #071324;
  }

  #app-root {
    width: 100vw;
    height: 100dvh;
  }

  .iphone-frame {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
  }

  .iphone-frame::before,
  .iphone-frame::after {
    display: none;
  }

  .iphone-screen {
    border-radius: 0;
  }
}

@media (max-width: 380px) {
  .right-nav-rail {
    width: 59px;
  }

  .nav-rail-text {
    font-size: 8px;
  }

  .main-viewport {
    padding-inline: 8px;
  }

  .hero-summary-card,
  .card-box {
    padding: 11px;
  }

  .hero-main-value {
    font-size: calc(22px * var(--scale));
  }

  .two-funds-mini-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Prevent the scroll-column flex layout from shrinking dashboard cards. */
.main-viewport > * {
  flex: 0 0 auto;
}

.hero-summary-card {
  min-height: 184px;
}


.prototype-ribbon {
  min-height: 25px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #475569;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 9.5px;
  line-height: 1.35;
  flex: 0 0 auto;
}

/* Company companion app: analytics & retiree financial dashboard */
.company-homescreen{background:linear-gradient(145deg,#071324,#153454 62%,#24516a)!important;}
.app-grid-stage{display:grid!important;grid-template-columns:1fr 1fr;align-items:start;justify-items:center;max-width:280px;margin:auto;gap:12px 18px;}
.grid-hint{grid-column:1/-1;margin-top:5px!important;}
.company-app-squircle{width:68px;height:68px;border-radius:21px;background:linear-gradient(145deg,#f5fafc,#d4e7ef 50%,#adc9d8);display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:0 10px 25px #0003,inset 0 1px 2px #fff9;color:#153454;}
.company-app-mark{font-family:Arial,sans-serif;font-size:35px;font-weight:800;line-height:.95;color:#153454;}
.company-app-mini{font-family:Arial,sans-serif;font-size:6px;font-weight:800;letter-spacing:2px;margin-top:4px;color:#436c83;}
.company-launch-screen{flex:1;background:linear-gradient(145deg,#071324,#143956);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;}
.company-launch-screen p{color:#b9d2df;font-size:13px}.launch-logo{width:88px;height:88px;border-radius:26px;margin-bottom:10px}.launch-loader{width:28px;height:28px;border:3px solid #ffffff40;border-top-color:#a7f3d0;border-radius:50%;animation:company-spin .8s linear infinite;margin-top:12px}@keyframes company-spin{to{transform:rotate(360deg)}}
.company-shell{background:#f4f7fb;flex:1;min-height:0;overflow-y:auto;padding:12px 14px 22px;color:#12243a;direction:rtl;font-family:var(--font-main);}
.company-header{display:flex;align-items:center;justify-content:space-between;padding:6px 2px 14px}.company-header small{font-size:10px;color:#718096}.company-header h2{font-size:20px;margin-top:2px}.company-home-btn{border:0;background:#e2ebf2;border-radius:12px;font-size:23px;width:42px;height:42px;color:#17354f;cursor:pointer}
.company-tabs{display:flex;background:#e7edf3;border-radius:13px;padding:4px;margin-bottom:12px}.company-tabs button{flex:1;border:0;background:transparent;border-radius:10px;padding:9px;font:inherit;font-size:13px;color:#62758a;cursor:pointer}.company-tabs button.active{background:white;color:#153454;font-weight:700;box-shadow:0 2px 8px #152b4412}
.company-content{display:flex;flex-direction:column;gap:12px}.company-hero{background:linear-gradient(120deg,#0c2440,#145c55);color:white;border-radius:20px;padding:18px;display:flex;justify-content:space-between;align-items:center;box-shadow:0 12px 24px #0c24401a}.company-hero span{font-size:12px;color:#c7e2dc}.company-hero h3{font-size:27px;margin:7px 0}.company-hero h3 small{font-size:13px}.company-hero p{font-size:11px;color:#c2d4dc}.company-hero-icon{font-size:36px;color:#b5e4cf}
.company-kpis{display:grid;grid-template-columns:1fr 1fr;gap:9px}.company-kpis article,.company-panel{background:white;border:1px solid #e4eaf0;border-radius:16px;padding:13px;box-shadow:0 3px 12px #0f172a06}.company-kpis article{display:flex;flex-direction:column;gap:6px}.company-kpis small{font-size:11px;color:#6d7d8f}.company-kpis b{font-size:14px;color:#1c344d}.company-panel h3{font-size:15px;margin-bottom:12px;color:#18334d}.company-inputs{display:grid;grid-template-columns:1fr 1fr;gap:10px}.company-inputs label{display:flex;flex-direction:column;gap:5px;color:#6a7b8d;font-size:11px}.company-inputs input{width:100%;padding:10px 8px;border:1px solid #dce5ec;border-radius:10px;background:#f8fafc;color:#20364b;font:inherit;font-size:13px;direction:ltr;text-align:right;outline:none}.company-inputs input:focus{border-color:#0d9870;box-shadow:0 0 0 3px #0d987015}.company-primary{width:100%;border:0;background:#0d735a;color:#fff;border-radius:12px;padding:12px;font:inherit;font-size:14px;font-weight:700;margin-top:14px;cursor:pointer;transition:transform .15s,opacity .15s}.company-primary:active{transform:scale(.98);opacity:.85}.company-footnote{font-size:10px;color:#8795a4;margin-top:9px;line-height:1.6}.company-result{background:#eaf7f1;border:1px solid #cce9db;color:#22543d;border-radius:12px;padding:12px;margin-top:12px;font-size:12px;line-height:1.7}.analytics-bars{display:flex;align-items:flex-end;justify-content:space-around;height:210px;border-bottom:1px solid #e6edf2;padding:12px 5px 0}.bar-group{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:7px;height:100%;font-size:11px;color:#718096}.bar-group b{font-size:10px;color:#23384e}.bar-group span{white-space:nowrap}.bar-group div{width:36px;border-radius:9px 9px 3px 3px;min-height:8px}.pension-bar{background:linear-gradient(#61b99c,#178569)}.expense-bar{background:linear-gradient(#96abc0,#516b87)}.gap-bar{background:linear-gradient(#f3bf6a,#d98a2f)}.company-line-chart svg{width:100%;height:135px;overflow:visible}.chart-axis{display:flex;justify-content:space-between;color:#8493a2;font-size:10px}.chart-legend{font-size:11px;color:#6d7d8f;margin-top:9px}.legend-green{display:inline-block;width:9px;height:9px;background:#059669;border-radius:50%;margin-left:5px}.event-panel{text-align:center}.event-panel p{font-size:12px;color:#6a7b8d}.event-count{font-size:40px;font-weight:800;color:#0d735a;padding:8px}.event-panel small{color:#8795a4;font-size:10px}.company-shell::-webkit-scrollbar{width:3px}.company-shell::-webkit-scrollbar-thumb{background:#ccd7e1;border-radius:5px}
@media(max-width:500px){.company-shell{padding:10px 12px}.company-header h2{font-size:18px}.company-kpis b{font-size:12px}.company-hero h3{font-size:23px}}
