* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-page: #0b1324;
  --phone-bg: #f4f7fb;
  --card-bg: #ffffff;
  --navy: #0f2a43;
  --anb-blue: #004b87;
  --emerald: #047857;
  --emerald-light: #ecfdf5;
  --amber: #b45309;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --base-scale: 1;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
  background: radial-gradient(circle at top, #172a46 0%, #090f1d 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.workspace {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* إطار الجوال */
.phone-shell {
  width: 100%;
  max-width: 430px;
  height: 850px;
  max-height: 94vh;
  background: var(--phone-bg);
  border-radius: 46px;
  border: 10px solid #1e293b;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65), inset 0 0 0 2px #334155;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-shell.large-font {
  --base-scale: 1.14;
}

/* الجزيرة التفاعلية */
.dynamic-island {
  width: 118px;
  height: 26px;
  background: #090d16;
  border-radius: 20px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.camera-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1e293b;
}

.sensor-pill {
  width: 34px;
  height: 5px;
  border-radius: 4px;
  background: #172033;
}

/* شريط الحالة */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 6px;
  font-size: 12px;
  font-weight: 700;
  z-index: 20;
  color: #1e293b;
}

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

/* إدارة الشاشات */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.screen.active {
  display: flex;
}

/* 1. شاشة القفل */
.lock-screen {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 55%, #064e3b 100%);
  color: #ffffff;
  padding: 28px 18px 20px;
  justify-content: space-between;
}

.lock-header {
  text-align: center;
  margin-top: 10px;
}

.hijri-date {
  font-size: 13px;
  color: #cbd5e1;
}

.lock-clock {
  font-size: 58px;
  font-weight: 300;
  line-height: 1.1;
  margin-top: 4px;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  padding: 4px 2px;
}

.notif-card {
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 10px 13px;
}

.notif-card.highlight-sanad {
  background: linear-gradient(135deg, rgba(4, 120, 87, 0.85), rgba(0, 75, 135, 0.85));
  border: 1px solid #34d399;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.notif-card.highlight-sanad:hover {
  transform: scale(1.015);
}

.notif-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #a7f3d0;
  margin-bottom: 3px;
}

.notif-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.notif-body {
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.45;
}

.unlock-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

/* 2. الشاشة الرئيسية للجوال */
.home-screen {
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 55%, #e2e8f0 100%);
  padding: 18px 18px 16px;
  justify-content: space-between;
}

.home-top-widget {
  background: linear-gradient(135deg, #0f2a43 0%, #047857 100%);
  color: #ffffff;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 12px 24px rgba(15, 42, 67, 0.2);
  cursor: pointer;
  margin-top: 8px;
}

.widget-badge {
  display: inline-block;
  background: rgba(52, 211, 153, 0.22);
  color: #a7f3d0;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.widget-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.widget-main h3 {
  font-size: 17px;
  margin-bottom: 4px;
}

.widget-main p {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
}

.widget-amount {
  background: rgba(255, 255, 255, 0.12);
  padding: 10px 12px;
  border-radius: 14px;
  text-align: center;
  min-width: 92px;
}

.widget-amount span {
  display: block;
  font-size: 19px;
  font-weight: 800;
  color: #6ee7b7;
}

.widget-amount small {
  font-size: 10px;
  color: #e2e8f0;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 10px;
  margin: auto 0;
}

.app-tile {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.app-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
  position: relative;
  transition: transform 0.15s ease;
}

.app-tile:hover .app-icon {
  transform: translateY(-2px);
}

.sanad-icon {
  background: linear-gradient(135deg, #047857 0%, #004b87 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  border: 2px solid #34d399;
  box-shadow: 0 8px 20px rgba(4, 120, 87, 0.35);
}

.new-dot {
  position: absolute;
  top: -6px;
  left: -6px;
  background: #f59e0b;
  color: #ffffff;
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 99px;
}

.app-label {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.dock-bar {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.dock-btn {
  border: none;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 15px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.sanad-dock {
  background: #047857;
  color: #ffffff;
  font-size: 14px;
  padding: 10px 20px;
}

/* 3. تطبيق سند (SANAD) */
.sanad-screen {
  background: #f8fafc;
}

.sanad-header {
  background: linear-gradient(135deg, #0f2a43 0%, #004b87 100%);
  color: #ffffff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-home-btn {
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.sanad-brand {
  text-align: center;
}

.sanad-brand strong {
  display: block;
  font-size: 16px;
}

.sanad-brand span {
  font-size: 11px;
  color: #93c5fd;
}

.a11y-tools {
  display: flex;
  gap: 6px;
}

.tool-chip {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 32px;
  height: 30px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.tool-chip.active {
  background: #10b981;
  border-color: #10b981;
}

.trust-strip {
  background: #ecfdf5;
  color: #065f46;
  border-bottom: 1px solid #a7f3d0;
  padding: 6px 12px;
  font-size: calc(11px * var(--base-scale));
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sanad-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
  gap: 4px;
}

.s-tab {
  background: transparent;
  border: none;
  padding: 8px 4px;
  border-radius: 10px;
  font-size: calc(11px * var(--base-scale));
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.s-tab.active {
  background: #047857;
  color: #ffffff;
}

.sanad-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 20px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.tab-pane.active {
  display: flex;
}

.persona-bar {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}

.sec-label {
  display: block;
  font-size: calc(11px * var(--base-scale));
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.persona-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.p-pill {
  flex: 1;
  min-width: 95px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: calc(11px * var(--base-scale));
  font-weight: 700;
  cursor: pointer;
}

.p-pill.active {
  background: #0f2a43;
  color: #ffffff;
  border-color: #0f2a43;
}

/* بطاقة الراتب الإضافي */
.hero-income-card {
  background: linear-gradient(135deg, #064e3b 0%, #0f2a43 100%);
  color: #ffffff;
  border-radius: 18px;
  padding: 15px;
  box-shadow: 0 10px 22px rgba(6, 78, 59, 0.22);
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: calc(12px * var(--base-scale));
  color: #a7f3d0;
}

.payday-badge {
  background: rgba(255, 255, 255, 0.14);
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 10px;
  color: #ffffff;
}

.hero-figure {
  margin: 8px 0 12px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hero-figure strong {
  font-size: calc(32px * var(--base-scale));
  font-weight: 800;
  color: #ffffff;
}

.hero-figure span {
  font-size: calc(13px * var(--base-scale));
  color: #6ee7b7;
}

.hero-subgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px;
  border-radius: 12px;
}

.hero-subgrid small {
  display: block;
  font-size: 10px;
  color: #cbd5e1;
  margin-bottom: 2px;
}

.hero-subgrid b {
  font-size: calc(12px * var(--base-scale));
}

.status-ok {
  color: #6ee7b7;
}

.status-warn {
  color: #fcd34d;
}

/* الصناديق التفاعلية */
.card-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px;
}

.box-title {
  font-size: calc(14px * var(--base-scale));
  color: var(--navy);
  margin-bottom: 8px;
}

.box-desc {
  font-size: calc(12px * var(--base-scale));
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.stepper-item {
  margin-bottom: 11px;
}

.stepper-head {
  display: flex;
  justify-content: space-between;
  font-size: calc(12px * var(--base-scale));
  margin-bottom: 5px;
}

.stepper-head strong {
  color: var(--emerald);
}

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-controls button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
}

.stepper-controls input[type="range"] {
  flex: 1;
  accent-color: #047857;
}

.gap-summary-strip {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 11px;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  font-size: calc(12px * var(--base-scale));
  color: #065f46;
}

.transparency-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 12px;
}

.transparency-box h5 {
  font-size: calc(13px * var(--base-scale));
  color: #1e3a8a;
  margin-bottom: 6px;
}

.transparency-box ul {
  padding-right: 16px;
  font-size: calc(11.5px * var(--base-scale));
  color: #1e293b;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* شريط توزيع المسارات */
.allocation-bar {
  display: flex;
  height: 28px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
}

.alloc-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.25s ease;
}

.seg-sukuk { background: #047857; }
.seg-re { background: #004b87; }
.seg-liq { background: #d97706; }

.path-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px;
  margin-bottom: 10px;
  background: #f8fafc;
}

.path-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.path-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  margin-bottom: 4px;
}

.tag-green { background: #d1fae5; color: #065f46; }
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-amber { background: #fef3c7; color: #92400e; }

.path-head h5 {
  font-size: calc(13px * var(--base-scale));
  color: var(--navy);
}

.path-pct {
  font-size: 16px;
  color: var(--emerald);
}

.path-text {
  font-size: calc(12px * var(--base-scale));
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.path-meta {
  display: flex;
  justify-content: space-between;
  font-size: calc(11px * var(--base-scale));
  background: #ffffff;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
}

.guarantee-pill {
  font-size: calc(11px * var(--base-scale));
  background: #ecfdf5;
  color: #065f46;
  padding: 7px 9px;
  border-radius: 8px;
  line-height: 1.45;
  margin-bottom: 8px;
}

.weight-btns {
  display: flex;
  gap: 8px;
}

.weight-btns button {
  flex: 1;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* مسار المستقبل */
.scenario-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.scen-btn {
  text-align: right;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}

.scen-btn strong {
  display: block;
  font-size: calc(12.5px * var(--base-scale));
  color: var(--navy);
  margin-bottom: 2px;
}

.scen-btn span {
  font-size: calc(11px * var(--base-scale));
  color: var(--text-muted);
}

.scen-btn.active {
  background: #ecfdf5;
  border-color: #047857;
}

.masar-result-card {
  background: #0f2a43;
  color: #ffffff;
  border-radius: 14px;
  padding: 13px;
}

.masar-badge {
  display: inline-block;
  background: #10b981;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.masar-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.masar-metrics div {
  background: rgba(255, 255, 255, 0.09);
  padding: 8px 10px;
  border-radius: 10px;
}

.masar-metrics small {
  display: block;
  font-size: 10px;
  color: #cbd5e1;
}

.masar-metrics strong {
  font-size: calc(15px * var(--base-scale));
  color: #6ee7b7;
}

.masar-advice {
  font-size: calc(12px * var(--base-scale));
  color: #e2e8f0;
  line-height: 1.5;
}

/* الأمان والتحكم */
.bell-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bell-icon {
  font-size: 28px;
  background: #fef3c7;
  padding: 8px;
  border-radius: 12px;
}

.bell-head h4 {
  font-size: calc(14px * var(--base-scale));
  color: var(--navy);
}

.bell-head p {
  font-size: calc(11.5px * var(--base-scale));
  color: var(--text-muted);
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: calc(12px * var(--base-scale));
  font-weight: 600;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: #047857;
}

.action-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.act-btn {
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  font-size: calc(12.5px * var(--base-scale));
  font-weight: 700;
  cursor: pointer;
}

.primary-act {
  background: #047857;
  color: #ffffff;
  border: none;
}

.outline-act {
  background: #ffffff;
  color: #004b87;
  border: 1.5px solid #004b87;
}

.sms-preview-card {
  background: #1e293b;
  color: #f8fafc;
  border-radius: 14px;
  padding: 12px;
}

.sms-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #93c5fd;
  margin-bottom: 5px;
}

.sms-preview-card p {
  font-size: calc(12px * var(--base-scale));
  line-height: 1.5;
}

.phone-home-indicator {
  width: 130px;
  height: 5px;
  background: #94a3b8;
  border-radius: 99px;
  margin: 6px auto 10px;
  cursor: pointer;
}

/* نافذة منبثقة */
.mini-modal {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 40;
}

.mini-modal.open {
  display: flex;
}

.mini-modal-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 18px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.mini-modal-card h4 {
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 8px;
}

.mini-modal-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-line;
  margin-bottom: 14px;
}

.modal-close-btn {
  width: 100%;
  background: #047857;
  color: #ffffff;
  border: none;
  padding: 10px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.toast-msg {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 50;
  white-space: nowrap;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
