/* ==============================
   Investment Portfolio Plugin CSS
   Futuristic Luxury Design — v4.0
   Black | Gold | Neon Gold
   ============================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800;900&display=swap');

:root {
  /* ── User-adjustable font scale (1 = 100%) ── */
  --inv-fs-scale: 1;

  /* ── حجم موحّد لكل صناديق الإحصائيات بكل الموقع (عنوان + قيمة) ── */
  --inv-fs-stat-label: 0.85em;
  --inv-fs-stat-value: 1.15em;

  /* ── Deep Black Background ── */
  --inv-bg:        #07070e;
  --inv-bg2:       #0c0c16;
  --inv-card:      rgba(255,255,255,0.025);
  --inv-card2:     rgba(255,255,255,0.045);
  --inv-card3:     rgba(255,255,255,0.065);
  --inv-border:    rgba(255,255,255,0.065);
  --inv-border2:   rgba(212,175,90,0.30);

  /* ── Pure Gold System ── */
  --inv-gold:      #d4aa50;
  --inv-gold2:     #a07830;
  --inv-gold3:     #f0d888;
  --inv-neon:      #f0d888;
  --inv-neon2:     #d4aa50;
  --inv-gold-glow: rgba(212,175,90,0.22);
  --inv-gold-dim:  rgba(212,175,90,0.07);
  --inv-neon-glow: rgba(240,216,136,0.25);

  /* ── Accent Colors ── */
  --inv-blue:      #4f86d6;
  --inv-blue2:     #6fa3e8;
  --inv-cyan:      #4ee2c8;
  --inv-purple:    #9b7fff;
  --inv-pink:      #c8789e;
  --inv-green:     #2ecc80;
  --inv-green-old: #22c378;
  --inv-red:       #e5484d;
  --inv-orange:    #d4aa50;

  /* ── Text — Warm Gold Tint ── */
  --inv-text:      #f2e8d0;
  --inv-text2:     #9a8870;
  --inv-muted:     #5a5040;

  /* ── Profit / Loss ── */
  --inv-profit:    #22c378;
  --inv-loss:      #e5484d;

  /* ── Radius ── */
  --inv-r:         14px;
  --inv-r2:        10px;
  --inv-r3:        8px;

  /* ── Shadows ── */
  --inv-shadow:      0 8px 40px rgba(0,0,0,0.80);
  --inv-shadow-gold: 0 0 30px rgba(212,175,90,0.12);
  --inv-shadow-neon: 0 0 20px rgba(212,175,90,0.18);
}

/* ==============================
   BASE
============================== */
#inv-portfolio {
  font-family: 'Cairo', 'Arabic Typesetting', 'Segoe UI', 'Tahoma', sans-serif;
  direction: rtl;
  color: var(--inv-text);
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 18px;
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%,  rgba(212,175,90,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 55% 40% at 88% 8%,  rgba(212,175,90,0.04) 0%, transparent 55%),
    var(--inv-bg);
  min-height: 100vh;
  font-size: calc(14px * var(--inv-fs-scale));
  letter-spacing: 0.2px;
  position: relative;
}

/* Gold shimmer particle overlay */
#inv-portfolio::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle 1px at 20% 15%, rgba(212,175,90,0.35) 0%, transparent 100%),
    radial-gradient(circle 1px at 80% 25%, rgba(212,175,90,0.25) 0%, transparent 100%),
    radial-gradient(circle 1px at 45% 60%, rgba(212,175,90,0.20) 0%, transparent 100%),
    radial-gradient(circle 1px at 70% 80%, rgba(212,175,90,0.30) 0%, transparent 100%),
    radial-gradient(circle 1px at 10% 70%, rgba(212,175,90,0.20) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Fine gold grid lines — luxury financial dashboard feel */
#inv-portfolio::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(212,175,90,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,90,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}

#inv-portfolio > * { position: relative; z-index: 1; }

/* الودجة العائمة (المحلل الذكي) لازم تبقى fixed وفوق كل شي دايمًا،
   حتى لو كانت ابن مباشر لـ #inv-portfolio */
#inv-portfolio > .inv-gemini-widget {
  position: fixed !important;
  z-index: 2147483000 !important;
}

@media (max-width: 768px) {
  #inv-portfolio { padding: 14px 10px; font-size: calc(14px * var(--inv-fs-scale)); }
}

/* ==============================
   LOGO
============================== */
.inv-logo-img {
  max-height: 80px;
  max-width: 220px;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 4px 24px rgba(212,175,90,0.4));
}
.inv-logo-emoji {
  font-size: 3.8em;
  line-height: 1;
  display: block;
  filter: drop-shadow(0 4px 20px rgba(212,175,90,0.5));
}

/* ==============================
   HEADER
============================== */
.inv-header {
  background: linear-gradient(135deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.035) 100%);
  border: 1px solid rgba(212,175,90,0.18);
  border-radius: 16px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--inv-shadow), 0 0 40px rgba(160,106,255,0.10);
  min-height: 110px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.inv-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--inv-cyan), var(--inv-gold), var(--inv-purple), transparent);
  opacity: 0.9;
  animation: invHeaderGlow 3s ease-in-out infinite;
}

.inv-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(170,150,255,0.3), transparent);
}

@keyframes invHeaderGlow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; box-shadow: 0 0 12px rgba(212,175,90,0.5); }
}

.inv-header-icon { margin-bottom: 10px; }

/* ══════════════════════════════════════════════════════
   HEADER v2 — لوغو يسار + أدوات يمين
══════════════════════════════════════════════════════ */
.inv-hv2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  min-height: 70px;
}

.inv-hv2-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.inv-hv2-logo {
  flex-shrink: 0;
}
.inv-hv2-logo .inv-logo-emoji { font-size: 2.4em; line-height: 1; }
.inv-hv2-logo .inv-logo-img   { width: 52px; height: 52px; object-fit: contain; border-radius: 12px; }

.inv-hv2-titles {
  min-width: 0;
}
.inv-hv2-titles .inv-title {
  font-size: 1.35em !important;
  margin: 0 0 3px !important;
  line-height: 1.2;
}
.inv-hv2-titles .inv-subtitle {
  font-size: 0.78em !important;
  margin: 0 !important;
}

/* أدوات المستخدم */
.inv-hv2-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* أيقونة الرسائل والتنبيهات — تصميم فخم بدل الجرس */
.inv-hv2-icon-btn {
  position: relative;
  background: linear-gradient(145deg, rgba(212,175,80,.18), rgba(255,255,255,.035));
  border: 1px solid rgba(212,175,80,.5);
  color: #f1ce72;
  border-radius: 13px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 5px 18px rgba(212,175,80,.12);
}
.inv-hv2-icon-btn svg { filter: drop-shadow(0 2px 5px rgba(212,175,80,.35)); }
.inv-hv2-icon-btn:hover, .inv-hv2-icon-btn:focus-visible {
  border-color: #f6d77e;
  color: #ffe7a1;
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 8px 24px rgba(212,175,80,.25);
  outline: none;
}
.inv-hv2-notif-dot {
  position: absolute;
  top: -7px; left: -7px;
  background: linear-gradient(135deg,#ff5b75,#d91846);
  color: #fff;
  border: 2px solid #15131a;
  border-radius: 999px;
  font-size: .61em;
  font-weight: 900;
  min-width: 19px; height: 19px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  box-shadow: 0 3px 10px rgba(255,77,109,.35);
}

/* تحكم حجم الخط */
.inv-hv2-font-ctrl {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--inv-border2);
  border-radius: 10px;
  padding: 3px 4px;
}
.inv-hv2-font-ctrl button {
  background: none; border: none;
  color: var(--inv-gold);
  cursor: pointer;
  padding: 5px 8px;
  font-weight: 800;
  font-size: 0.75em;
  border-radius: 7px;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}
.inv-hv2-font-ctrl button:hover {
  background: rgba(212,175,90,0.12);
}

/* زر الخروج */
.inv-hv2-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,77,109,0.07);
  border: 1px solid rgba(255,77,109,0.22);
  color: #ff6b88;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.8em;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
}
.inv-hv2-logout:hover {
  background: rgba(255,77,109,0.15);
  border-color: rgba(255,77,109,0.45);
  color: #ff4d6d;
}
.inv-hv2-logout svg { flex-shrink: 0; }

/* شعار Gemini بجانب صورة البروفايل */
.inv-gemini-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  width: 48px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.inv-gemini-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
.inv-gemini-badge:hover .inv-gemini-badge-icon {
  transform: scale(1.06);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 4px 12px rgba(66,133,244,0.35);
}
.inv-gemini-badge-label {
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--inv-muted);
  direction: rtl;
  white-space: normal;
  line-height: 1.15;
  text-align: center;
}

/* صورة البروفايل */
.inv-hv2-avatar {
  background: none;
  border: 2px solid rgba(212,175,90,0.28);
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.inv-hv2-avatar:hover {
  border-color: var(--inv-gold);
  box-shadow: 0 0 0 3px rgba(212,175,90,0.12);
}
.inv-hv2-avatar .inv-profile-avatar {
  width: 38px; height: 38px;
  font-size: 0.88em;
}

/* موبايل */
@media (max-width: 640px) {
  .inv-hv2 {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 10px;
  }
  .inv-hv2-brand { order: 1; flex: 1 1 100%; min-width: 0; }
  .inv-hv2-tools { order: 2; flex: 1 1 100%; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  .inv-hv2-logout span { display: none; }
  .inv-hv2-logout { padding: 9px 10px; }
  .inv-hv2-titles .inv-title { font-size: 1.1em !important; }
  .inv-hv2-logo .inv-logo-emoji { font-size: 2em; }
}
.inv-title {
  font-size: 2em;
  font-weight: 900;
  background: linear-gradient(135deg, var(--inv-gold3) 0%, var(--inv-neon) 40%, var(--inv-gold) 70%, var(--inv-gold2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 6px;
  letter-spacing: -0.5px;
  text-shadow: none;
  filter: drop-shadow(0 0 8px rgba(212,175,90,0.3));
}
.inv-subtitle {
  color: var(--inv-text2);
  margin: 0;
  font-size: 0.84em;
  font-weight: 400;
}

/* Header action buttons */
.inv-btn-share-header,
.inv-notif-bell {
  background: rgba(212,175,90,0.05);
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: 12px;
  color: var(--inv-text2);
  cursor: pointer;
  font-size: 1em;
  padding: 8px 12px;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  font-family: inherit;
  backdrop-filter: blur(8px);
}
.inv-btn-share-header:hover {
  background: rgba(212,175,90,0.12);
  border-color: rgba(212,175,90,0.5);
  color: var(--inv-gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,175,90,0.2);
}
.inv-notif-bell:hover {
  background: var(--inv-gold-dim);
  border-color: rgba(212,175,90,0.5);
  color: var(--inv-neon);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,175,90,0.2);
}

/* ==============================
   ENTRY LABEL TAG
============================== */
.inv-entry-label {
  font-size: 0.65em;
  font-weight: 700;
  color: var(--inv-neon);
  background: rgba(212,175,90,0.08);
  border: 1px solid rgba(212,175,90,0.25);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==============================
   NOTIFICATION BELL
============================== */
.inv-notif-bell-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}
.inv-notif-bell { position: relative; }
.inv-notif-count {
  position: absolute;
  top: -7px;
  left: -7px;
  background: var(--inv-red);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.65em;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(255,77,109,0.5);
  animation: invPulse 2s infinite;
}
@keyframes invPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255,77,109,0.5); }
  50% { box-shadow: 0 0 16px rgba(255,77,109,0.8); }
}

/* ==============================
   NOTIFICATION PANEL
============================== */
.inv-notif-panel {
  background: var(--inv-card);
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: var(--inv-r);
  margin-bottom: 16px;
  max-height: 400px;
  overflow-y: auto;
  animation: invSlideDown 0.2s ease;
  box-shadow: var(--inv-shadow), 0 0 20px rgba(212,175,90,0.05);
}
.inv-notif-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--inv-border);
  font-size: 0.85em;
  font-weight: 700;
  color: var(--inv-gold);
  position: sticky;
  top: 0;
  background: var(--inv-card);
  backdrop-filter: blur(10px);
}
.inv-notif-clear {
  background: transparent;
  border: none;
  color: var(--inv-muted);
  cursor: pointer;
  font-size: 0.8em;
  font-family: inherit;
  transition: color 0.2s;
}
.inv-notif-clear:hover { color: var(--inv-red); }
.inv-notif-item {
  padding: 13px 18px;
  border-bottom: 1px solid var(--inv-border);
  cursor: pointer;
  transition: background 0.15s;
}
.inv-notif-item:hover { background: var(--inv-card2); }
.inv-notif-item.unread { border-right: 3px solid var(--inv-neon); }
.inv-notif-item-title { font-weight: 700; font-size: 0.85em; margin-bottom: 3px; }
.inv-notif-item-msg   { font-size: 0.76em; color: var(--inv-text2); }
.inv-notif-item-time  { font-size: 0.7em; color: var(--inv-muted); margin-top: 4px; }

/* ==============================
   SHARE PANEL
============================== */
.inv-btn-share-header {
  background: rgba(212,175,90,0.06);
  color: var(--inv-gold);
  border: 1px solid rgba(212,175,90,0.2);
}
.inv-share-panel {
  background: var(--inv-card);
  border: 1px solid rgba(212,175,90,0.25);
  border-radius: var(--inv-r);
  padding: 20px 22px;
  margin-bottom: 16px;
  animation: invSlideDown 0.2s ease;
  box-shadow: var(--inv-shadow), 0 0 20px rgba(212,175,90,0.05);
}
.inv-sp-title { font-weight: 800; color: var(--inv-gold); margin: 0 0 10px; font-size: 0.92em; }
.inv-sp-note  { color: var(--inv-text2); font-size: 0.8em; margin: 0 0 12px; line-height: 1.7; }
.inv-sp-url-row { display: flex; gap: 8px; margin-bottom: 10px; }
.inv-sp-url-input {
  flex: 1;
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r2);
  color: var(--inv-text2);
  padding: 9px 12px;
  font-size: 0.8em;
  direction: ltr;
  font-family: 'Courier New', monospace;
}
.inv-sp-copy-btn {
  background: linear-gradient(135deg, var(--inv-neon), var(--inv-gold), var(--inv-gold2));
  color: #0a0800;
  border: none;
  padding: 9px 18px;
  border-radius: var(--inv-r2);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82em;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(212,175,90,0.3);
}
.inv-sp-copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(212,175,90,0.5);
}
.inv-sp-revoke {
  background: rgba(255,77,109,0.08);
  color: var(--inv-red);
  border: 1px solid rgba(255,77,109,0.25);
  padding: 7px 14px;
  border-radius: var(--inv-r2);
  font-size: 0.78em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.inv-sp-revoke:hover { background: var(--inv-red); color: #fff; }

/* ==============================
   PRICE PANEL (Quick Prices)
============================== */
#inv-price-panel {
  background: linear-gradient(135deg, var(--inv-card) 0%, var(--inv-card2) 100%) !important;
  border: 1px solid rgba(212,175,90,0.2) !important;
  border-radius: var(--inv-r) !important;
  padding: 16px 18px !important;
  margin-bottom: 16px !important;
  box-shadow: var(--inv-shadow), 0 0 20px rgba(212,175,90,0.05);
  position: relative;
  overflow: hidden;
}
#inv-price-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--inv-neon), var(--inv-gold), transparent);
  opacity: 0.7;
}

/* ==============================
   PRICES SECTION
============================== */
.inv-prices-section {
  background: var(--inv-card);
  border: 1px solid rgba(212,175,90,0.15);
  border-radius: var(--inv-r);
  padding: 16px 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.inv-prices-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--inv-gold), transparent);
  opacity: 0.5;
}
.inv-prices-section-title {
  font-size: 0.76em;
  font-weight: 700;
  color: var(--inv-gold);
  margin: 14px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--inv-border);
  letter-spacing: 0.04em;
}
.inv-stock-prices-inner { margin-top: 0; }

/* ==============================
   PRICE BOXES & TOP-PANEL INPUTS
   (stocks + crypto price entry)
============================== */
.inv-prices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.inv-prices-sublabel {
  font-size: 11px;
  font-weight: 700;
  color: var(--inv-muted);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.inv-price-box {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border);
  border-radius: var(--inv-r2);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inv-price-box label {
  font-size: 10px;
  color: var(--inv-muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-price-icon {
  font-size: 14px;
  line-height: 1;
}
/* All top-panel number inputs inside price boxes */
.inv-price-box input[type="number"],
.inv-top-stock-price,
.inv-top-crypto-price,
.inv-stock-price-input,
.inv-crypto-price-input {
  background: var(--inv-card3, #1a1a28) !important;
  border: 1px solid var(--inv-border) !important;
  border-radius: var(--inv-r2) !important;
  color: var(--inv-text) !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  font-family: 'Courier New', monospace !important;
  width: 100% !important;
  box-sizing: border-box !important;
  direction: ltr !important;
  text-align: center !important;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s;
}
.inv-price-box input[type="number"]:focus,
.inv-top-stock-price:focus,
.inv-top-crypto-price:focus,
.inv-stock-price-input:focus,
.inv-crypto-price-input:focus {
  outline: none !important;
  border-color: var(--inv-gold) !important;
  box-shadow: 0 0 0 2px rgba(212,175,90,0.1) !important;
}
.inv-price-box input[type="number"]::placeholder,
.inv-top-stock-price::placeholder,
.inv-top-crypto-price::placeholder,
.inv-stock-price-input::placeholder,
.inv-crypto-price-input::placeholder {
  color: var(--inv-muted) !important;
  opacity: 0.6 !important;
}

/* Badges */
.inv-badge-gold-18  { background: rgba(180,140,40,0.12); color: #c8a030; border: 1px solid rgba(180,140,40,0.25); }
.inv-badge-platinum { background: rgba(160,188,208,0.12); color: #90b0c8; border: 1px solid rgba(160,188,208,0.25); }

/* ==============================
   TABS
============================== */
.inv-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 22px;
  background: linear-gradient(135deg, #0f0f08 0%, #0a0a05 100%);
  border: 1px solid rgba(212,175,90,0.22);
  border-radius: 16px;
  padding: 6px;
  box-shadow: var(--inv-shadow), inset 0 1px 0 rgba(212,175,90,0.06);
}
.inv-tab-btn {
  background: transparent;
  border: none;
  color: var(--inv-muted);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.82em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-align: center;
  flex: 1 1 auto;
  min-width: max-content;
}
.inv-tab-btn:hover {
  background: rgba(212,175,90,0.08);
  color: var(--inv-gold3);
}
.inv-tab-btn.active {
  background: linear-gradient(135deg, rgba(212,175,90,0.20) 0%, rgba(160,120,40,0.15) 100%);
  color: var(--inv-neon);
  border: 1px solid rgba(212,175,90,0.40);
  box-shadow: 0 2px 16px rgba(212,175,90,0.15), inset 0 1px 0 rgba(240,216,136,0.15);
  text-shadow: 0 0 10px rgba(212,175,90,0.50);
  text-shadow: 0 0 8px rgba(212,175,90,0.4);
}
@media (max-width: 600px) {
  .inv-tab-btn { font-size: 0.8em; padding: 10px 6px; }
}

/* ==============================
   TAB CONTENT
============================== */
.inv-tab-content { animation: invFadeIn 0.25s ease; }
.inv-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.inv-tab-header h2 {
  font-size: 1.1em;
  font-weight: 800;
  color: var(--inv-text);
  margin: 0;
  letter-spacing: -0.3px;
}

/* ==============================
   BUTTONS
============================== */
.inv-btn-add {
  background: linear-gradient(135deg, #f0d888 0%, #d4aa50 40%, #a07830 100%);
  color: #0a0800;
  border: none;
  padding: 10px 22px;
  border-radius: var(--inv-r2);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82em;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 4px 20px rgba(212,175,90,0.3);
  letter-spacing: 0.02em;
}
.inv-btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(212,175,90,0.5);
}
.inv-btn-add:active { transform: translateY(0); }

.inv-btn-refresh {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  color: var(--inv-text2);
  padding: 8px 16px;
  border-radius: var(--inv-r2);
  font-size: 0.78em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.inv-btn-refresh:hover { border-color: var(--inv-gold); color: var(--inv-gold); }
.inv-btn-print {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  color: var(--inv-text2);
  padding: 8px 16px;
  border-radius: var(--inv-r2);
  font-size: 0.78em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.inv-btn-print:hover { border-color: var(--inv-blue, #4a90e8); color: var(--inv-blue, #4a90e8); }

.inv-btn-export {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  color: var(--inv-text2);
  padding: 8px 16px;
  border-radius: var(--inv-r2);
  font-size: 0.78em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.inv-btn-export:hover { border-color: var(--inv-green); color: var(--inv-green); }
.inv-btn-export-pdf:hover { border-color: var(--inv-red); color: var(--inv-red); }

.inv-btn-edit {
  background: rgba(212,175,90,0.06);
  color: var(--inv-gold);
  border: 1px solid rgba(212,175,90,0.2);
  padding: 5px 12px;
  border-radius: var(--inv-r3);
  font-size: 0.75em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.inv-btn-edit:hover { background: rgba(212,175,90,0.12); border-color: rgba(212,175,90,0.4); }

.inv-btn-sell {
  background: rgba(0,214,143,0.08);
  color: var(--inv-green);
  border: 1px solid rgba(0,214,143,0.2);
  padding: 5px 12px;
  border-radius: var(--inv-r3);
  font-size: 0.75em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.inv-btn-sell:hover { background: rgba(0,214,143,0.16); border-color: rgba(0,214,143,0.4); }

.inv-btn-del {
  background: rgba(255,77,109,0.06);
  color: var(--inv-red);
  border: 1px solid rgba(255,77,109,0.18);
  padding: 5px 10px;
  border-radius: var(--inv-r3);
  font-size: 0.75em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.inv-btn-del:hover { background: var(--inv-red); color: #fff; }

/* ==============================
   SUMMARY BAR — Futuristic Gold
============================== */
.inv-summary-bar {
  background: linear-gradient(135deg, #0a0a00 0%, #141400 50%, #0a0a00 100%);
  border: 1px solid rgba(212,175,90,0.3);
  border-radius: var(--inv-r);
  padding: 28px 32px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(212,175,90,0.08), var(--inv-shadow);
}
.inv-summary-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--inv-neon), var(--inv-gold), var(--inv-neon), transparent);
  opacity: 0.9;
}
.inv-sb-item {
  text-align: center;
  min-width: 140px;
  padding: 18px 20px;
  background: rgba(212,175,90,0.04);
  border: 1px solid rgba(212,175,90,0.15);
  border-radius: var(--inv-r2);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.inv-sb-item:hover {
  background: rgba(212,175,90,0.08);
  border-color: rgba(212,175,90,0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212,175,90,0.12);
}
.inv-sb-item span {
  display: block;
  font-size: 0.82em;
  color: var(--inv-text2);
  margin-bottom: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.inv-sb-item strong {
  font-size: 1.25em;
  font-family: 'Courier New', monospace;
  direction: ltr;
  display: block;
  color: var(--inv-text);
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* ==============================
   CARDS — Futuristic
============================== */
.inv-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.04) 0%, rgba(0,0,0,0.20) 100%);
  border: 1px solid rgba(212,175,90,0.18);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0,0,0,0.5), inset 0 1px 0 rgba(212,175,90,0.08);
}
.inv-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,90,0.6), rgba(240,216,136,0.8), rgba(212,175,90,0.6), transparent);
  opacity: 1;
}
.inv-card:hover {
  border-color: rgba(212,175,90,0.40);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px rgba(212,175,90,0.08);
}

.inv-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.inv-card-name { flex: 1; font-weight: 700; font-size: 0.95em; color: var(--inv-text); }
.inv-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.inv-badge {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 0.95em;
  font-weight: 800;
  white-space: nowrap;
}
.inv-badge-wide {
  width: auto;
  height: auto;
  padding: 6px 12px;
  flex-shrink: 0;
}
.inv-badge-gold   {
  background: rgba(212,175,90,0.12);
  color: var(--inv-gold);
  border: 1px solid rgba(212,175,90,0.3);
}
.inv-badge-silver {
  background: rgba(200,212,232,0.1);
  color: #c0d0e8;
  border: 1px solid rgba(200,212,232,0.2);
}
.inv-badge-stock  {
  background: rgba(79,134,214,0.12);
  color: var(--inv-blue2);
  border: 1px solid rgba(79,134,214,0.3);
}
.inv-badge-crypto {
  background: rgba(78,226,200,0.1);
  color: var(--inv-cyan);
  border: 1px solid rgba(78,226,200,0.28);
}
.inv-badge-asset {
  background: rgba(212,175,90,0.12);
  color: var(--inv-gold);
  border: 1px solid rgba(212,175,90,0.3);
}

/* Stats grid inside cards — responsive across phone / tablet / desktop */
.inv-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.inv-stat {
  background: var(--inv-card2);
  border-radius: var(--inv-r2);
  padding: 9px 12px;
  border: 1px solid var(--inv-border);
  transition: border-color 0.2s;
  min-width: 0;
}
.inv-stat:hover { border-color: var(--inv-border2); }
.inv-stat-lbl {
  display: block;
  font-size: var(--inv-fs-stat-label);
  color: var(--inv-text2);
  margin-bottom: 6px;
  font-weight: 700;
}
.inv-stat-val {
  font-size: var(--inv-fs-stat-value);
  font-weight: 800;
  direction: ltr;
  display: block;
  font-family: 'Courier New', monospace;
  color: var(--inv-text);
  word-break: break-word;
}
.profit { color: var(--inv-profit) !important; }
.loss   { color: var(--inv-loss) !important; }

/* Dual currency display — USD / KWD together */
.inv-dual-cur {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}
.inv-dual-usd { color: var(--inv-gold); }
.inv-dual-sep { color: var(--inv-muted); font-weight: 400; }
.inv-dual-kwd { color: var(--inv-text); font-size: 0.92em; }

@media (max-width: 480px) {
  .inv-stats { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
  .inv-card { padding: 12px; }
  .inv-dual-cur { flex-direction: column; gap: 1px; align-items: flex-start; }
}


.inv-needs-price {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.78em;
  color: var(--inv-muted);
  font-style: italic;
  padding: 4px;
}

/* Stock current price row */
.inv-stock-price-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--inv-card2);
  border-radius: var(--inv-r2);
  padding: 9px 12px;
  flex-wrap: wrap;
  border: 1px solid var(--inv-border);
}
.inv-stock-price-row label {
  font-size: 0.72em;
  color: var(--inv-muted);
  font-weight: 700;
  white-space: nowrap;
}
.inv-stock-price-row input {
  background: var(--inv-card3);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r3);
  color: var(--inv-text);
  padding: 5px 10px;
  font-size: 0.88em;
  width: 90px;
  direction: ltr;
  text-align: center;
  font-family: 'Courier New', monospace;
  transition: border-color 0.2s;
}
.inv-stock-price-row input:focus { outline: none; border-color: var(--inv-gold); }
.inv-stock-pnl-display {
  font-size: 0.8em;
  font-weight: 700;
  direction: ltr;
  font-family: 'Courier New', monospace;
}

/* ==============================
   EMPTY STATE
============================== */
.inv-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--inv-muted);
  font-size: 0.88em;
}
.inv-empty::before {
  content: '◆';
  display: block;
  font-size: 2.5em;
  margin-bottom: 14px;
  color: rgba(212,175,90,0.2);
}

/* ==============================
   CURRENT PRICE ROW (SCP)
============================== */
.inv-stock-curprice-row,
.inv-crypto-curprice-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--inv-border);
}
.inv-scp-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.inv-scp-label {
  font-size: 0.78em;
  color: var(--inv-gold);
  font-weight: 700;
  white-space: nowrap;
}
.inv-scp-input {
  background: var(--inv-card3);
  border: 1px solid rgba(212,175,90,0.25);
  border-radius: var(--inv-r2);
  color: var(--inv-text);
  padding: 8px 14px;
  font-size: 0.9em;
  width: 120px;
  direction: ltr;
  text-align: center;
  font-family: 'Courier New', monospace;
  transition: all 0.2s;
}
.inv-scp-input:focus {
  outline: none;
  border-color: var(--inv-neon);
  box-shadow: 0 0 0 3px rgba(212,175,90,0.1);
}
.inv-scp-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
@media (max-width: 600px) {
  .inv-scp-results { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
}
.inv-scp-result-item {
  background: rgba(212,175,90,0.04);
  border: 1px solid rgba(212,175,90,0.12);
  border-radius: var(--inv-r2);
  padding: 10px 8px;
  text-align: center;
  min-width: 0;
}
.inv-scp-result-item span {
  display: block;
  font-size: var(--inv-fs-stat-label);
  color: var(--inv-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 5px;
  white-space: normal;      /* يلف النص بدل ما يقص كلمة "مقدار الزكاة" لنص "ار الزكاة" */
  line-height: 1.3;
  word-break: break-word;
}
.inv-scp-result-item strong {
  font-size: var(--inv-fs-stat-value);
  font-family: 'Courier New', monospace;
  direction: ltr;
  display: block;
  font-weight: 900;
  color: var(--inv-text);
}
.inv-scp-hint {
  font-size: 0.78em;
  color: var(--inv-muted);
  font-style: italic;
  padding: 8px 0;
  text-align: center;
}

/* ==============================
   TRANSACTIONS
============================== */
.inv-tx-list { margin-top: 10px; }
.inv-tx-row {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border);
  border-radius: var(--inv-r2);
  padding: 10px 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82em;
  flex-wrap: wrap;
  transition: border-color 0.2s;
}
.inv-tx-row:hover { border-color: rgba(212,175,90,0.2); }
.inv-tx-date { color: var(--inv-muted); min-width: 80px; }
.inv-tx-name { flex: 1; font-weight: 700; }
.inv-tx-type { font-size: 0.75em; color: var(--inv-text2); }
.inv-tx-pnl  { font-family: 'Courier New', monospace; font-weight: 700; direction: ltr; }
.inv-btn-del-tx {
  background: transparent;
  color: var(--inv-red);
  border: 1px solid rgba(255,77,109,0.3);
  padding: 4px 10px;
  border-radius: var(--inv-r3);
  font-size: 0.72em;
  cursor: pointer;
  transition: all 0.15s;
  margin-right: auto;
  flex-shrink: 0;
  font-family: inherit;
}
.inv-btn-del-tx:hover { background: var(--inv-red); color: #fff; }

/* ==============================
   EMBED
============================== */
.inv-embed-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--inv-border);
}
.inv-embed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.inv-embed-header h2 { font-size: 0.95em; color: var(--inv-gold); margin: 0; }
.inv-embed-link { color: var(--inv-gold); font-size: 0.82em; text-decoration: none; }
.inv-embed-link:hover { text-decoration: underline; }
.inv-iframe-container {
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r);
  overflow: hidden;
  background: #fff;
}
.inv-iframe-container iframe { display: block; }
.inv-iframe-fallback {
  padding: 40px 20px;
  text-align: center;
  background: var(--inv-card2);
  color: var(--inv-text);
}
.inv-iframe-fallback p { margin: 0 0 16px; font-size: 0.88em; }

/* ==============================
   MODALS
============================== */
.inv-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  align-items: center;
  justify-content: center;
}
.inv-modal.open { display: flex; }
.inv-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
}
.inv-modal-box {
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, #111108 0%, #0a0a06 60%, #0e0c08 100%);
  border: 1px solid rgba(212,175,90,0.28);
  border-radius: 22px;
  padding: 28px;
  width: 92%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  direction: rtl;
  box-shadow:
    0 24px 80px rgba(0,0,0,0.90),
    0 0 60px rgba(0,0,0,0.60),
    inset 0 1px 0 rgba(212,175,90,0.12),
    0 0 0 1px rgba(212,175,90,0.06);
  animation: invModalIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
/* ── عرض النوافذ المنبثقة حسب حجم الشاشة: جوال / آيباد-تابلت / كمبيوتر ──
   الهدف: الحقول تكبر وتصير واضحة بدل ما تبقى بعرض الجوال على شاشة أوسع */
@media (min-width: 601px) and (max-width: 1024px) {
  /* آيباد وتابلت (بورتريت ولاندسكيب) */
  .inv-modal-box    { max-width: 640px; padding: 30px 34px; }
  .inv-modal-sm .inv-modal-box { max-width: 440px; }
}
@media (min-width: 1025px) {
  /* كمبيوتر / لابتوب */
  .inv-modal-box    { max-width: 620px; padding: 32px 36px; }
  .inv-modal-sm .inv-modal-box { max-width: 460px; }
}
.inv-modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240,216,136,0.9), rgba(212,175,90,1), rgba(240,216,136,0.9), transparent);
  border-radius: 22px 22px 0 0;
}
@keyframes invModalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.inv-modal-sm .inv-modal-box { max-width: 380px; }
.inv-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  font-size: 1em;
  font-weight: 800;
  color: var(--inv-gold);
}
.inv-modal-close {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--inv-border);
  color: var(--inv-muted);
  font-size: 1em;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--inv-r3);
  line-height: 1;
  transition: all 0.2s;
}
.inv-modal-close:hover { background: rgba(255,77,109,0.1); border-color: rgba(255,77,109,0.3); color: var(--inv-red); }

/* ==============================
   FORM ELEMENTS
============================== */
.inv-fg { margin-bottom: 18px; }
.inv-frow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .inv-frow { grid-template-columns: 1fr; } }

.inv-fg label {
  display: block;
  font-size: 0.76em;
  color: var(--inv-text2);
  margin-bottom: 7px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.req { color: var(--inv-neon); }

.inv-fg input,
.inv-fg select,
.inv-fg textarea {
  width: 100%;
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r2);
  color: var(--inv-text);
  padding: 13px 16px;
  font-size: max(16px, 0.92em); /* يمنع تكبير سفاري تلقائياً على الآيفون/الآيباد عند التركيز */
  box-sizing: border-box;
  font-family: inherit;
  transition: all 0.25s;
  min-height: 48px;
}
/* حقول داخل flex row تنمو وتأخذ المساحة المتاحة */
.inv-fg > div[style*="flex"] > input,
.inv-fg > div[style*="flex"] > select {
  flex: 1 1 140px;
  width: auto;
  min-width: 90px;
}
/* على الشاشات الصغيرة: الحقل ياخذ العرض كامل والزر ينزل تحته بدل ما يضغطه */
@media (max-width: 480px) {
  .inv-fg > div[style*="flex"] {
    flex-wrap: wrap;
  }
  .inv-fg > div[style*="flex"] > input,
  .inv-fg > div[style*="flex"] > select {
    flex: 1 1 100%;
    min-width: 0;
  }
  .inv-fg > div[style*="flex"] > button {
    flex: 1 1 100%;
  }
}
/* عدد الأسهم/الكمية: تكبير حجم الخط والمسافة حتى لا يبدو الحقل ضيقاً، خصوصاً مع أسهم الأرقام في WebKit */
.inv-fg input[type="number"] {
  font-size: 1em;
  padding-inline-end: 10px;
}
.inv-fg input:focus,
.inv-fg select:focus,
.inv-fg textarea:focus {
  outline: none;
  border-color: var(--inv-gold);
  background: var(--inv-card3);
  box-shadow: 0 0 0 3px rgba(212,175,90,0.08);
}
.inv-fg input::placeholder { color: var(--inv-muted); }
.inv-fg input[type="date"] { direction: ltr; }
.inv-fg select option { background: var(--inv-card); }
.inv-fg small { display: block; font-size: 0.7em; color: var(--inv-muted); margin-top: 5px; }
.inv-fg textarea { resize: vertical; min-height: 60px; }

.inv-radio-group { display: flex; gap: 10px; margin-top: 2px; }
.inv-radio {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85em;
  cursor: pointer;
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r2);
  padding: 9px 14px;
  transition: all 0.2s;
  flex: 1;
  justify-content: center;
}
.inv-radio:has(input:checked) {
  border-color: var(--inv-gold);
  background: var(--inv-gold-dim);
  color: var(--inv-neon);
}
.inv-radio input { accent-color: var(--inv-gold); }

.inv-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.inv-btn-primary {
  flex: 1;
  background: linear-gradient(135deg, #f0d888 0%, #d4aa50 40%, #a07830 100%);
  color: #0a0800;
  border: none;
  padding: 13px;
  border-radius: var(--inv-r2);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88em;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(212,175,90,0.35);
}
.inv-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(212,175,90,0.55);
}
.inv-btn-ghost {
  background: transparent;
  color: var(--inv-text2);
  border: 1px solid var(--inv-border2);
  padding: 13px 18px;
  border-radius: var(--inv-r2);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85em;
  transition: all 0.2s;
}
.inv-btn-ghost:hover { border-color: var(--inv-text2); color: var(--inv-text); }
.inv-btn-danger {
  flex: 1;
  background: linear-gradient(135deg, var(--inv-red), #cc3355);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: var(--inv-r2);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88em;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(255,77,109,0.2);
}
.inv-btn-danger:hover { opacity: 0.88; transform: translateY(-1px); }

.inv-info-chip {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r2);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.82em;
  color: var(--inv-text2);
}

/* ==============================
   ANIMATIONS
============================== */
@keyframes invFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes invSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==============================
   ZAKAT TAB
============================== */
.inv-zk-summary {
  background: linear-gradient(135deg, #080f0a 0%, #0d1810 100%);
  border: 1px solid rgba(0,214,143,0.25);
  border-radius: var(--inv-r);
  padding: 24px 22px;
  text-align: center;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,214,143,0.06);
}
.inv-zk-summary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--inv-green), transparent);
  opacity: 0.5;
}
.inv-zk-summary-icon { font-size: 2.6em; margin-bottom: 10px; }
.inv-zk-summary h3 { color: var(--inv-green); margin: 0 0 4px; font-size: 1em; font-weight: 800; }
.inv-zk-note {
  font-size: 0.73em;
  color: var(--inv-text2);
  margin: 6px 0 0;
  line-height: 1.7;
}
.inv-zk-amount {
  font-size: 1.6em;
  font-weight: 900;
  color: var(--inv-green);
  font-family: 'Courier New', monospace;
  direction: ltr;
  display: block;
  margin: 10px 0 4px;
  text-shadow: 0 0 20px rgba(0,214,143,0.3);
}
.inv-zk-row {
  background: var(--inv-card);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r2);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.inv-zk-row:hover { border-color: rgba(0,214,143,0.2); }
.inv-zk-row-name { font-weight: 700; font-size: 0.88em; flex: 1; }
.inv-zk-row-meta { font-size: 0.78em; color: var(--inv-text2); }
.inv-zk-due { color: var(--inv-red); font-weight: 700; }
.inv-zk-soon { color: var(--inv-orange); font-weight: 700; }
.inv-zk-ok { color: var(--inv-green); font-weight: 700; }

/* Zakat history */
.inv-zk-hist-row {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border);
  border-radius: var(--inv-r2);
  padding: 10px 14px;
  margin-bottom: 6px;
  font-size: 0.82em;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--inv-text2);
}

/* ==============================
   COMPARE TAB
============================== */
.inv-compare-controls {
  background: var(--inv-card);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r);
  padding: 20px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  box-shadow: var(--inv-shadow);
}
.inv-compare-period { flex: 1; min-width: 200px; }
.inv-compare-period label {
  display: block;
  font-size: 0.75em;
  font-weight: 800;
  color: var(--inv-gold);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.inv-compare-dates {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inv-compare-dates input {
  flex: 1;
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r2);
  color: var(--inv-text);
  padding: 9px 10px;
  font-family: inherit;
  font-size: 0.85em;
  direction: ltr;
  transition: border-color 0.2s;
}
.inv-compare-dates input:focus { outline: none; border-color: var(--inv-gold); }
.inv-compare-dates span { color: var(--inv-muted); }
.inv-compare-vs {
  font-size: 0.88em;
  font-weight: 800;
  color: var(--inv-muted);
  padding: 0 6px;
}
.inv-compare-presets {
  width: 100%;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.inv-preset-btn {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  border-radius: 20px;
  color: var(--inv-text2);
  padding: 7px 16px;
  font-size: 0.75em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.inv-preset-btn:hover { border-color: var(--inv-gold); color: var(--inv-gold); background: var(--inv-gold-dim); }

.inv-cmp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--inv-card);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r);
  padding: 16px 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.inv-cmp-period { flex: 1; min-width: 140px; }
.inv-cmp-period span { display: block; font-size: 0.7em; color: var(--inv-muted); margin-bottom: 4px; font-weight: 700; text-transform: uppercase; }
.inv-cmp-period strong { font-size: 0.85em; direction: ltr; display: block; font-family: 'Courier New', monospace; }
.inv-cmp-a strong { color: var(--inv-blue2); }
.inv-cmp-b strong { color: var(--inv-orange); }
.inv-cmp-vs { font-size: 1.2em; font-weight: 900; color: var(--inv-muted); }

.inv-cmp-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--inv-card);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r);
  overflow: hidden;
}
.inv-cmp-table thead th {
  background: var(--inv-card2);
  padding: 11px 14px;
  font-size: 0.76em;
  font-weight: 800;
  color: var(--inv-muted);
  border-bottom: 1px solid var(--inv-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.inv-cmp-table thead th:nth-child(2) { color: var(--inv-blue2); }
.inv-cmp-table thead th:nth-child(4) { color: var(--inv-orange); }
.inv-cmp-table tbody tr { border-bottom: 1px solid var(--inv-border); transition: background 0.15s; }
.inv-cmp-table tbody tr:last-child { border-bottom: none; }
.inv-cmp-table tbody tr:hover { background: var(--inv-card2); }
.inv-cmp-label { padding: 12px 14px; font-size: 0.85em; font-weight: 600; }
.inv-cmp-val   { padding: 12px 14px; font-family: 'Courier New', monospace; font-size: 0.85em; text-align: center; }
.inv-cmp-arrow { padding: 12px 8px; text-align: center; font-size: 1em; font-weight: 900; }

.inv-cmp-verdict {
  text-align: center;
  padding: 14px 20px;
  border-radius: var(--inv-r);
  font-weight: 800;
  font-size: 0.92em;
  margin-bottom: 14px;
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
}
.inv-cmp-better { background: rgba(0,214,143,0.08); border-color: rgba(0,214,143,0.3); color: var(--inv-green); }
.inv-cmp-worse  { background: rgba(255,77,109,0.08); border-color: rgba(255,77,109,0.3); color: var(--inv-red); }

/* ==============================
   PRICE HISTORY TAB
============================== */
.inv-ph-notice {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r2);
  padding: 12px 16px;
  font-size: 0.78em;
  color: var(--inv-text2);
  margin-bottom: 16px;
  line-height: 1.7;
}
.inv-ph-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--inv-card);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r);
  overflow: hidden;
  font-size: 0.85em;
}
.inv-ph-table thead th {
  background: var(--inv-card2);
  padding: 11px 12px;
  font-size: 0.75em;
  font-weight: 800;
  color: var(--inv-muted);
  border-bottom: 1px solid var(--inv-border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.inv-ph-table tbody tr { border-bottom: 1px solid var(--inv-border); transition: background 0.15s; }
.inv-ph-table tbody tr:last-child { border-bottom: none; }
.inv-ph-table tbody tr:hover { background: var(--inv-card2); }
.inv-ph-date  { padding: 10px 12px; white-space: nowrap; font-weight: 600; }
.inv-ph-price { padding: 10px 12px; text-align: center; font-family: 'Courier New', monospace; direction: ltr; }
.inv-ph-notes { padding: 10px 12px; color: var(--inv-text2); font-size: 0.85em; }
.inv-ph-na    { color: var(--inv-border2); }

/* ==============================
   STOCK EXCHANGES
============================== */
.inv-exchanges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.inv-exchange-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r);
  padding: 24px 16px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.inv-exchange-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.inv-exchange-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.inv-exchange-card:hover::before { opacity: 1; }
.inv-exc-kw { border-color: rgba(0,169,80,0.3); }
.inv-exc-kw::before { background: radial-gradient(ellipse at center, rgba(0,169,80,0.06), transparent 70%); }
.inv-exc-kw:hover { border-color: rgba(0,169,80,0.6); }
.inv-exc-us { border-color: rgba(74,144,232,0.3); }
.inv-exc-us::before { background: radial-gradient(ellipse at center, rgba(74,144,232,0.06), transparent 70%); }
.inv-exc-us:hover { border-color: rgba(74,144,232,0.6); }
.inv-exc-uk { border-color: rgba(200,0,40,0.3); }
.inv-exc-uk::before { background: radial-gradient(ellipse at center, rgba(200,0,40,0.06), transparent 70%); }
.inv-exc-uk:hover { border-color: rgba(200,0,40,0.6); }
.inv-exc-flag { font-size: 2.4em; line-height: 1; }
.inv-exc-name { color: var(--inv-text); font-weight: 800; font-size: 0.92em; }
.inv-exc-sub  { color: var(--inv-muted); font-size: 0.73em; direction: ltr; }
.inv-exc-arrow {
  position: absolute;
  top: 10px;
  left: 12px;
  color: var(--inv-muted);
  font-size: 0.88em;
  transition: color 0.2s;
}
.inv-exchange-card:hover .inv-exc-arrow { color: var(--inv-gold); }

/* ==============================
   BACKUP TAB
============================== */
.inv-backup-section {
  background: var(--inv-card);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r);
  padding: 28px;
  margin-bottom: 16px;
  text-align: center;
  transition: border-color 0.2s;
}
.inv-backup-section:hover { border-color: rgba(212,175,90,0.2); }
.inv-backup-import-section { text-align: right; }
.inv-backup-icon { font-size: 2.6em; margin-bottom: 12px; }
.inv-backup-section h3 { color: var(--inv-gold); font-size: 1em; margin: 0 0 8px; font-weight: 800; }
.inv-backup-section p { color: var(--inv-text2); font-size: 0.82em; margin: 0 0 20px; line-height: 1.7; }
.inv-backup-btn { display: inline-block; }

.inv-backup-upload-area {
  border: 2px dashed var(--inv-border2);
  border-radius: var(--inv-r);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--inv-card2);
  margin-bottom: 14px;
}
.inv-backup-upload-area:hover,
.inv-backup-drop-active {
  border-color: var(--inv-gold);
  background: var(--inv-gold-dim);
}
.inv-backup-drop-icon { font-size: 2.2em; display: block; margin-bottom: 10px; }
#inv-backup-drop-label { color: var(--inv-text2); font-size: 0.85em; }

.inv-backup-preview { margin-bottom: 14px; }
.inv-backup-preview-inner {
  background: var(--inv-card2);
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: var(--inv-r);
  padding: 16px;
}
.inv-bp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--inv-border);
  font-size: 0.85em;
}
.inv-bp-row:last-of-type { border-bottom: none; }
.inv-bp-row span { color: var(--inv-text2); }
.inv-bp-row strong { color: var(--inv-text); font-family: inherit; }
.inv-bp-note {
  color: var(--inv-orange);
  font-size: 0.76em;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--inv-border);
}
.inv-backup-action-row { display: flex; gap: 10px; margin-bottom: 14px; }
.inv-backup-success {
  background: rgba(0,214,143,0.08);
  border: 1px solid rgba(0,214,143,0.3);
  border-radius: var(--inv-r2);
  padding: 14px 18px;
  color: var(--inv-green);
  font-size: 0.88em;
  line-height: 1.8;
}

/* ==============================
   REPORT STOCK ROW
============================== */
.inv-rsp-cells {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 8px;
}
@media (max-width: 480px) {
  .inv-rsp-cells { grid-template-columns: repeat(2, 1fr); }
}
.inv-rsp-cell {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border);
  border-radius: var(--inv-r2);
  padding: 9px 8px;
  text-align: center;
  min-width: 0;
}
.inv-rsp-cell em {
  display: block;
  font-style: normal;
  font-size: 0.67em;
  color: var(--inv-muted);
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.inv-rsp-cell strong {
  font-size: 0.85em;
  font-family: 'Courier New', monospace;
  direction: ltr;
  display: block;
}
.inv-report-stock-row .inv-report-row-meta {
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: wrap;
}
/* إجبار سطر الاسم/الشارة يكون دايمًا بسطره الخاص، والشبكة تحته بسطر منفصل — بغض النظر عن طول النص */
.inv-report-stock-row {
  flex-direction: column;
  align-items: stretch;
}
.inv-report-stock-row > div {
  width: 100%;
  flex: 0 0 100%;
}

/* Sell preview strip inside modal */
.inv-rsp-wrap { display: inline-flex; align-items: center; gap: 6px; }
.inv-rsp-input {
  background: var(--inv-card3);
  border: 1px solid rgba(212,175,90,0.25);
  border-radius: var(--inv-r3);
  color: var(--inv-text);
  padding: 5px 8px;
  font-size: 0.82em;
  width: 88px;
  direction: ltr;
  text-align: center;
  font-family: 'Courier New', monospace;
  transition: border-color 0.2s;
}
.inv-rsp-input:focus { outline: none; border-color: var(--inv-gold); }

/* Prices empty message */
.inv-prices-empty-msg {
  text-align: center;
  color: var(--inv-muted);
  font-size: 0.8em;
  font-style: italic;
  padding: 8px 0 4px;
}

/* Mfg note */
.inv-mfg-note {
  font-size: 0.7em;
  color: var(--inv-orange);
  display: block;
  margin-top: 5px;
}

/* ==============================
   OZ BUTTON
============================== */
#inv-oz-btn:hover { background: var(--inv-gold-dim) !important; }
/* ==============================
   HEADER — 3-column grid
============================== */
.inv-header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 20px;
  gap: 12px;
  min-height: 90px;
}

/* Right column — empty, reserved */
.inv-hcol-right {
  min-width: 0;
}

/* Center column — logo always centered */
.inv-hcol-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}

/* Left column — buttons stacked vertically, aligned start */
.inv-hcol-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

/* Each item in left column stretches full width */
.inv-hbtn {
  width: 100%;
}

/* Profile + Bell row: side by side */
.inv-profile-bell-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.inv-profile-bell-row .inv-profile-btn {
  flex: 0 0 auto;
  width: auto;
}
.inv-profile-bell-row .inv-notif-bell {
  flex: 1;
  text-align: center;
}

/* Mobile ≤640px: 2 rows — logo top, buttons below */
@media (max-width: 640px) {
  .inv-header-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    padding: 14px 14px;
    gap: 10px;
    min-height: auto;
  }
  .inv-hcol-right  { display: none; }
  .inv-hcol-center { order: 1; width: 100%; }
  .inv-hcol-left   {
    order: 2;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 8px;
  }
  .inv-hbtn      { width: auto; }
  .inv-logo-emoji { font-size: 2.6em; }
  .inv-title      { font-size: 1.4em !important; }
}

@media (max-width: 500px) {
  #inv-oz-btn { align-items: center !important; }
}

/* ==============================
   SCROLLBAR STYLING
============================== */
#inv-portfolio ::-webkit-scrollbar { width: 6px; height: 6px; }
#inv-portfolio ::-webkit-scrollbar-track { background: var(--inv-bg); }
#inv-portfolio ::-webkit-scrollbar-thumb { background: rgba(212,175,90,0.2); border-radius: 3px; }
#inv-portfolio ::-webkit-scrollbar-thumb:hover { background: var(--inv-gold2); }

/* ==============================
   PRICE INPUT LABELS
============================== */
.inv-price-label {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--inv-text2);
  margin-bottom: 5px;
  display: block;
}
.inv-price-input {
  width: 100%;
  background: var(--inv-card3);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r3);
  color: var(--inv-text);
  padding: 8px 10px;
  font-size: 0.88em;
  box-sizing: border-box;
  font-family: 'Courier New', monospace;
  direction: ltr;
  text-align: center;
  transition: border-color 0.2s;
}
.inv-price-input:focus { outline: none; border-color: var(--inv-gold); }
.inv-price-input::placeholder { color: var(--inv-muted); }

/* ==============================
   REPORT SUMMARY CHIPS
============================== */
.inv-report-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.inv-chip {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border2);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.76em;
  font-weight: 700;
  color: var(--inv-text2);
}
.inv-chip-gold { border-color: rgba(212,175,90,0.25); color: var(--inv-neon); }
.inv-chip-green { border-color: rgba(0,214,143,0.25); color: var(--inv-green); }
.inv-chip-red { border-color: rgba(255,77,109,0.25); color: var(--inv-red); }



/* ==============================
   WEBVIEW SECTION
============================== */
.inv-webview-section {
  margin-top: 24px;
  border-radius: var(--inv-r);
  overflow: hidden;
  border: 1px solid var(--inv-border2);
  box-shadow: var(--inv-shadow);
}
.inv-webview-section iframe {
  display: block;
  width: 100%;
  border: none;
}

/* ==============================
   MFG RECOVERABLE TOGGLE
============================== */
.inv-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.inv-toggle-wrap input[type="checkbox"] {
  display: none;
}
.inv-toggle-track {
  width: 40px;
  height: 22px;
  background: rgba(255,255,255,0.1);
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.15);
  position: relative;
  transition: background 0.25s, border-color 0.25s;
}
.inv-toggle-wrap input:checked + .inv-toggle-track {
  background: rgba(46,204,128,0.25);
  border-color: rgba(46,204,128,0.5);
}
.inv-toggle-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--inv-muted);
  transition: transform 0.25s, background 0.25s;
}
.inv-toggle-wrap input:checked + .inv-toggle-track .inv-toggle-thumb {
  transform: translateX(-18px);
  background: #2ecc80;
}
.inv-toggle-label {
  font-size: 0.82em;
  font-weight: 700;
  color: var(--inv-muted);
  min-width: 18px;
  transition: color 0.2s;
}
.inv-toggle-wrap input:checked ~ .inv-toggle-label {
  color: #2ecc80;
}

/* ==============================
   LOADING SPINNER
============================== */
.inv-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--inv-muted);
  font-size: 0.85em;
}
.inv-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--inv-border2);
  border-top-color: var(--inv-neon);
  border-radius: 50%;
  animation: invSpin 0.8s linear infinite;
}
@keyframes invSpin { to { transform: rotate(360deg); } }

/* ==============================
   RESPONSIVE ADJUSTMENTS
============================== */
@media (max-width: 480px) {
  .inv-modal-box { padding: 20px 16px; }
  .inv-tabs { gap: 3px; padding: 4px; }
  .inv-tab-btn { font-size: 0.68em; padding: 7px 6px; }
  .inv-card { padding: 14px; }
  .inv-stats { grid-template-columns: 1fr 1fr; }
}

/* ==============================
   LIVE PRICES WIDGET — Gold Theme
============================== */
.inv-live-prices-widget {
  background: linear-gradient(135deg, #0a0a00 0%, #141400 50%, #0a0a00 100%);
  border: 1px solid rgba(212,175,90,0.3);
  border-radius: var(--inv-r);
  padding: 22px 24px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(212,175,90,0.08), var(--inv-shadow);
}
.inv-live-prices-widget::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--inv-neon), var(--inv-gold), var(--inv-neon), transparent);
  opacity: 0.9;
}
.inv-live-prices-widget::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,90,0.3), transparent);
  opacity: 0.6;
}

.inv-lpw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.inv-lpw-title-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inv-lpw-title-row h3 {
  margin: 0;
  font-size: 1.1em;
  font-weight: 900;
  color: var(--inv-neon);
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(212,175,90,0.4);
}
.inv-lpw-subtitle {
  font-size: 0.78em;
  color: var(--inv-text2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inv-lpw-update-btn {
  background: linear-gradient(135deg, var(--inv-neon), var(--inv-gold), var(--inv-gold2));
  color: #0a0800;
  border: none;
  border-radius: var(--inv-r2);
  padding: 12px 20px;
  font-size: 0.88em;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 8px 24px rgba(212,175,90,0.3);
  letter-spacing: 0.02em;
}
.inv-lpw-update-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(212,175,90,0.5);
}
.inv-lpw-update-btn:active { transform: translateY(0); }
.inv-lpw-update-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.inv-lpw-update-icon {
  font-size: 1.1em;
  display: inline-block;
  animation: inv-spin 1s linear infinite;
  animation-play-state: paused;
}
.inv-lpw-update-btn:disabled .inv-lpw-update-icon { animation-play-state: running; }
@keyframes inv-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.inv-lpw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.inv-lpw-item {
  background: rgba(212,175,90,0.04);
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: var(--inv-r2);
  padding: 12px 10px;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.inv-lpw-item:hover {
  background: rgba(212,175,90,0.08);
  border-color: rgba(212,175,90,0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(212,175,90,0.12);
}

.inv-lpw-item-icon {
  font-size: 1.2em;
  display: block;
  margin-bottom: 5px;
}

.inv-lpw-item-label {
  font-size: 0.7em;
  color: var(--inv-text2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
  display: block;
}

.inv-lpw-item-price {
  font-size: 0.95em;
  font-weight: 900;
  color: var(--inv-neon);
  font-family: 'Courier New', monospace;
  direction: ltr;
  letter-spacing: 0.01em;
  text-shadow: 0 0 8px rgba(212,175,90,0.3);
}

.inv-lpw-item-unit {
  font-size: 0.65em;
  color: var(--inv-text2);
  font-weight: 700;
  margin-top: 3px;
}

.inv-lpw-last-update {
  font-size: 0.75em;
  color: var(--inv-text2);
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid rgba(212,175,90,0.15);
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ==============================
   GROUP CONTAINER — Futuristic Gold
============================== */
.inv-group-container {
  background: linear-gradient(135deg, #0a0a00 0%, #121200 50%, #0a0a00 100%);
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: var(--inv-r);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(212,175,90,0.05), var(--inv-shadow);
}

.inv-group-header {
  background: linear-gradient(90deg, rgba(212,175,90,0.06), rgba(212,175,90,0.03));
  border-bottom: 1px solid rgba(212,175,90,0.15);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.inv-group-title {
  font-size: 1.1em;
  font-weight: 900;
  color: var(--inv-neon);
  letter-spacing: 0.02em;
  text-shadow: 0 0 10px rgba(212,175,90,0.3);
}

.inv-group-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.inv-gs-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inv-gs-item span {
  font-size: var(--inv-fs-stat-label);
  color: var(--inv-text2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inv-gs-item strong {
  font-size: var(--inv-fs-stat-value);
  font-weight: 900;
  color: var(--inv-text);
  font-family: 'Courier New', monospace;
  direction: ltr;
}

.inv-gs-item span.profit { color: var(--inv-profit); }
.inv-gs-item span.loss { color: var(--inv-loss); }
.inv-gs-item strong.profit { color: var(--inv-profit); }
.inv-gs-item strong.loss { color: var(--inv-loss); }

.inv-group-cards {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==============================
   ZAKAT CARDS — Premium Design v4
============================== */
.inv-zk-card {
  background: linear-gradient(135deg, var(--inv-card) 0%, var(--inv-card2) 100%);
  border: 1px solid rgba(240,192,64,0.25);
  border-radius: var(--inv-r);
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.inv-zk-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212,175,90,0.5), transparent);
  opacity: 0.6;
}
.inv-zk-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.inv-zk-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.inv-zk-name {
  flex: 1;
  font-weight: 800;
  font-size: 0.92em;
  color: var(--inv-text);
}
.inv-zk-weight {
  font-weight: 400;
  color: var(--inv-text2);
  font-size: 0.9em;
}
.inv-zk-status {
  font-size: 0.8em;
  font-weight: 700;
  flex-shrink: 0;
}

.inv-zk-due-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(212,175,90,0.18), rgba(212,175,90,0.12));
  border: 1px solid rgba(212,175,90,0.45);
  color: var(--inv-neon);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.88em;
  font-weight: 800;
  animation: invZakatGlow 2s ease-in-out infinite;
}
@keyframes invZakatGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(212,175,90,0.2); }
  50%       { box-shadow: 0 0 18px rgba(212,175,90,0.5); }
}

.inv-zk-pending-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--inv-border2);
  color: var(--inv-text2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.88em;
  font-weight: 600;
}
.inv-zk-pending-badge strong {
  color: var(--inv-gold);
  font-size: 1.05em;
}

.inv-zk-progress-wrap {
  background: rgba(0,0,0,0.35);
  border-radius: 6px;
  height: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
}
.inv-zk-progress-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  background: linear-gradient(90deg, var(--inv-gold2), var(--inv-neon));
  box-shadow: 0 0 8px rgba(212,175,90,0.4);
}
.inv-zk-progress-pct {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6em;
  font-weight: 800;
  color: rgba(255,255,255,0.6);
  font-family: monospace;
  line-height: 1;
}

.inv-zk-dates {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 0.78em;
  color: var(--inv-text2);
}
.inv-zk-dates span { display: flex; align-items: center; gap: 5px; }
.inv-zk-dates strong { color: var(--inv-text); font-weight: 700; }

.inv-zk-due-amount {
  color: var(--inv-neon) !important;
  font-size: 1.15em !important;
  text-shadow: 0 0 12px rgba(212,175,90,0.35);
}

.inv-zk-action-row {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid rgba(212,175,90,0.12);
}

.inv-zk-pay-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.inv-zk-date-inp {
  background: var(--inv-card2);
  border: 1px solid rgba(212,175,90,0.3);
  border-radius: var(--inv-r2);
  color: var(--inv-text);
  padding: 7px 10px;
  font-size: 0.85em;
  direction: ltr;
  cursor: pointer;
}
.inv-zk-date-inp:focus { outline: none; border-color: var(--inv-gold); }
.inv-zk-pay-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.inv-zk-date-inp {
  background: var(--inv-card2);
  border: 1px solid rgba(212,175,90,0.3);
  border-radius: var(--inv-r2);
  color: var(--inv-text);
  padding: 7px 10px;
  font-size: 0.83em;
  direction: ltr;
  cursor: pointer;
  font-family: 'Courier New', monospace;
}
.inv-zk-date-inp:focus { outline: none; border-color: var(--inv-gold); }
.inv-btn-pay-zk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(0,214,143,0.15), rgba(0,176,112,0.1));
  border: 1px solid rgba(0,214,143,0.4);
  color: var(--inv-green);
  padding: 9px 20px;
  border-radius: var(--inv-r2);
  font-size: 0.85em;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 4px 14px rgba(0,214,143,0.1);
}
.inv-btn-pay-zk:hover {
  background: linear-gradient(135deg, rgba(0,214,143,0.25), rgba(0,176,112,0.2));
  border-color: rgba(0,214,143,0.7);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,214,143,0.25);
}
.inv-btn-pay-zk:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,214,143,0.15);
}

/* ==============================
   SECTION TITLE
============================== */
.inv-section-title {
  font-size: 0.82em;
  font-weight: 800;
  color: var(--inv-neon);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212,175,90,0.15);
  width: 100%;
  clear: both;
}
.inv-section-title::before {
  content: '';
  display: inline-block;
  vertical-align: middle;
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, var(--inv-neon), var(--inv-gold2));
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(212,175,90,0.4);
  margin-left: 8px;
}

/* ==============================
   REPORT — Premium Futuristic
============================== */
.inv-report-grand {
  background: linear-gradient(135deg, #080800 0%, #0f0f00 50%, #080800 100%);
  border: 1px solid rgba(212,175,90,0.25);
  border-radius: var(--inv-r);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(212,175,90,0.08), var(--inv-shadow);
}
.inv-report-grand::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--inv-neon), var(--inv-gold), var(--inv-neon), transparent);
  opacity: 0.9;
}
.inv-report-grand h3 {
  color: var(--inv-neon);
  margin: 0 0 18px;
  font-size: 1em;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(212,175,90,0.3);
  letter-spacing: 0.02em;
}
.inv-grand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.inv-grand-item {
  background: rgba(212,175,90,0.04);
  border: 1px solid rgba(212,175,90,0.15);
  border-radius: var(--inv-r2);
  padding: 16px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.inv-grand-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,90,0.2), transparent);
}
.inv-grand-item:hover {
  background: rgba(212,175,90,0.08);
  border-color: rgba(212,175,90,0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212,175,90,0.1);
}
.inv-grand-item span {
  display: block;
  font-size: 0.66em;
  color: var(--inv-muted);
  margin-bottom: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.inv-grand-item strong {
  display: block;
  font-size: 1.1em;
  font-family: 'Courier New', monospace;
  direction: ltr;
  color: var(--inv-text);
  font-weight: 900;
  letter-spacing: 0.02em;
}
.inv-grand-item em {
  display: block;
  font-style: normal;
  font-size: 0.78em;
  font-family: 'Courier New', monospace;
  direction: ltr;
  margin-top: 4px;
  font-weight: 700;
}
.inv-grand-total {
  background: linear-gradient(135deg, rgba(212,175,90,0.08), rgba(212,175,90,0.04));
  border-color: rgba(212,175,90,0.3);
}
.inv-grand-total strong {
  color: var(--inv-neon);
  text-shadow: 0 0 8px rgba(212,175,90,0.3);
}

.inv-report-row {
  background: var(--inv-card);
  border: 1px solid var(--inv-border2);
  border-radius: var(--inv-r2);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.inv-report-row:hover { border-color: rgba(212,175,90,0.2); }
.inv-report-row-name { font-weight: 800; font-size: 0.95em; flex: 1; min-width: 120px; color: var(--inv-text); }
.inv-report-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85em;
  color: var(--inv-text2);
  align-items: center;
  font-weight: 700;
}
.inv-report-row-meta span.profit,
.inv-report-row-meta span.loss { font-family: 'Courier New', monospace; }

/* ==============================
   STOCKS SUMMARY — Futuristic Gold Boxes
============================== */
.inv-stocks-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 0;
  margin-bottom: 22px;
}

.inv-ss-item {
  background: linear-gradient(135deg, rgba(212,175,90,0.06), rgba(212,175,90,0.02));
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: var(--inv-r2);
  padding: 18px 14px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.inv-ss-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212,175,90,0.4), transparent);
  opacity: 0.7;
}

.inv-ss-item:hover {
  background: linear-gradient(135deg, rgba(212,175,90,0.1), rgba(212,175,90,0.05));
  border-color: rgba(212,175,90,0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(212,175,90,0.12);
}

.inv-ss-item span {
  font-size: var(--inv-fs-stat-label);
  color: var(--inv-text2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inv-ss-item strong {
  font-size: var(--inv-fs-stat-value);
  font-weight: 900;
  color: var(--inv-text);
  font-family: 'Courier New', monospace;
  direction: ltr;
}

.inv-ss-item span.profit { color: var(--inv-profit); }
.inv-ss-item strong.profit {
  color: var(--inv-profit);
  text-shadow: 0 0 8px rgba(0,214,143,0.3);
}
.inv-ss-item span.loss { color: var(--inv-loss); }
.inv-ss-item strong.loss {
  color: var(--inv-loss);
  text-shadow: 0 0 8px rgba(255,77,109,0.3);
}

/* ==============================
   PER-SYMBOL SUMMARY STRIP
============================== */

/* ==============================
   PER-SYMBOL SUMMARY STRIP
============================== */
.inv-sym-summary-list {
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inv-sym-row {
  background: linear-gradient(135deg, rgba(212,175,90,0.05), rgba(212,175,90,0.02));
  border: 1px solid rgba(212,175,90,0.18);
  border-right: 3px solid rgba(212,175,90,0.5);
  border-radius: var(--inv-r2);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  transition: background 0.2s;
}

.inv-sym-row:hover {
  background: linear-gradient(135deg, rgba(212,175,90,0.09), rgba(212,175,90,0.04));
  border-color: rgba(212,175,90,0.35);
}

.inv-sym-badge {
  font-size: 0.88em;
  font-weight: 900;
  color: var(--inv-neon);
  background: rgba(212,175,90,0.12);
  border: 1px solid rgba(212,175,90,0.3);
  border-radius: 6px;
  padding: 6px 14px;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.05em;
  min-width: 68px;
  text-align: center;
  display: inline-block;
  align-self: flex-start;
}

.inv-sym-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  flex: 1;
  width: 100%;
}

.inv-sym-stat {
  background: linear-gradient(135deg, rgba(212,175,90,0.06), rgba(212,175,90,0.02));
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: var(--inv-r2);
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.inv-sym-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212,175,90,0.4), transparent);
  opacity: 0.7;
}
.inv-sym-stat:hover {
  background: linear-gradient(135deg, rgba(212,175,90,0.1), rgba(212,175,90,0.05));
  border-color: rgba(212,175,90,0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(212,175,90,0.12);
}

.inv-sym-stat span {
  font-size: var(--inv-fs-stat-label);
  color: var(--inv-text2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-sym-stat strong {
  font-size: var(--inv-fs-stat-value);
  font-weight: 900;
  color: var(--inv-text);
  font-family: 'Courier New', monospace;
  direction: ltr;
  white-space: normal;
  word-break: break-word;
}

/* Profit / Loss colors */
.inv-sym-stat strong.profit {
  color: var(--inv-profit) !important;
  text-shadow: 0 0 8px rgba(0,214,143,0.3);
}
.inv-sym-stat strong.loss {
  color: var(--inv-loss) !important;
  text-shadow: 0 0 8px rgba(255,77,109,0.3);
}

/* Dual currency inside sym stat */
.inv-sym-stat strong .inv-dual-cur {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.inv-sym-stat strong .inv-dual-usd { font-size: 0.82em; opacity: 0.7; }
.inv-sym-stat strong .inv-dual-sep { display: none; }
.inv-sym-stat strong .inv-dual-kwd { font-size: 1em; }
.inv-sym-stat strong.profit .inv-dual-usd,
.inv-sym-stat strong.profit .inv-dual-kwd { color: var(--inv-profit); }
.inv-sym-stat strong.loss .inv-dual-usd,
.inv-sym-stat strong.loss .inv-dual-kwd   { color: var(--inv-loss); }

/* ---- ألوان مخصصة حسب نوع القسم (بدل الذهبي الموحّد) ---- */
.inv-sym-row.inv-sym-row-stock {
  background: linear-gradient(135deg, rgba(111,163,232,0.05), rgba(111,163,232,0.02));
  border-color: rgba(111,163,232,0.18);
  border-right-color: rgba(111,163,232,0.5);
}
.inv-sym-row.inv-sym-row-stock:hover {
  background: linear-gradient(135deg, rgba(111,163,232,0.09), rgba(111,163,232,0.04));
  border-color: rgba(111,163,232,0.35);
}
.inv-sym-row.inv-sym-row-stock .inv-sym-badge {
  color: var(--inv-blue2);
  background: rgba(111,163,232,0.12);
  border-color: rgba(111,163,232,0.3);
}
.inv-sym-row.inv-sym-row-stock .inv-sym-stat {
  background: linear-gradient(135deg, rgba(111,163,232,0.06), rgba(111,163,232,0.02));
  border-color: rgba(111,163,232,0.2);
}
.inv-sym-row.inv-sym-row-stock .inv-sym-stat::before {
  background: linear-gradient(90deg, transparent, rgba(111,163,232,0.4), transparent);
}
.inv-sym-row.inv-sym-row-stock .inv-sym-stat:hover {
  background: linear-gradient(135deg, rgba(111,163,232,0.1), rgba(111,163,232,0.05));
  border-color: rgba(111,163,232,0.4);
}

.inv-sym-row.inv-sym-row-crypto {
  background: linear-gradient(135deg, rgba(78,226,200,0.05), rgba(78,226,200,0.02));
  border-color: rgba(78,226,200,0.18);
  border-right-color: rgba(78,226,200,0.5);
}
.inv-sym-row.inv-sym-row-crypto:hover {
  background: linear-gradient(135deg, rgba(78,226,200,0.09), rgba(78,226,200,0.04));
  border-color: rgba(78,226,200,0.35);
}
.inv-sym-row.inv-sym-row-crypto .inv-sym-badge {
  color: var(--inv-cyan);
  background: rgba(78,226,200,0.12);
  border-color: rgba(78,226,200,0.3);
}
.inv-sym-row.inv-sym-row-crypto .inv-sym-stat {
  background: linear-gradient(135deg, rgba(78,226,200,0.06), rgba(78,226,200,0.02));
  border-color: rgba(78,226,200,0.2);
}
.inv-sym-row.inv-sym-row-crypto .inv-sym-stat::before {
  background: linear-gradient(90deg, transparent, rgba(78,226,200,0.4), transparent);
}
.inv-sym-row.inv-sym-row-crypto .inv-sym-stat:hover {
  background: linear-gradient(135deg, rgba(78,226,200,0.1), rgba(78,226,200,0.05));
  border-color: rgba(78,226,200,0.4);
}

/* إجبار عرض الأرقام العربية الغربية (0-9) بدل الأرقام الهندية بكل حقول الإدخال الرقمية */
#inv-portfolio input[type="number"],
#inv-portfolio input[type="tel"] {
  font-variant-numeric: normal;
  -moz-font-feature-settings: normal;
  font-feature-settings: normal;
  direction: ltr;
  unicode-bidi: plaintext;
}

@media (max-width: 768px) {
  .inv-sym-row {
    padding: 10px 12px;
    gap: 10px;
  }
  .inv-sym-badge {
    font-size: 0.8em;
    min-width: 56px;
    padding: 5px 10px;
  }
  .inv-sym-stats {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
  }
  .inv-sym-stat {
    padding: 10px 8px;
  }
}

@media (max-width: 480px) {
  .inv-sym-row {
    padding: 9px 10px;
    gap: 8px;
  }
  .inv-sym-badge {
    font-size: 0.75em;
    min-width: 50px;
    padding: 4px 8px;
  }
  .inv-sym-stats {
    grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
    gap: 6px;
  }
  .inv-sym-stat {
    padding: 8px 6px;
  }
}

/* ==============================
   TOAST NOTIFICATIONS
============================== */
.inv-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--inv-card2);
  border: 1px solid rgba(212,175,90,0.25);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 0.88em;
  font-weight: 700;
  color: var(--inv-text);
  z-index: 9999999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(212,175,90,0.1);
  white-space: nowrap;
  max-width: 90vw;
  font-family: 'Cairo', sans-serif;
}
.inv-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.inv-toast-success { border-color: rgba(0,214,143,0.4); color: var(--inv-green); }
.inv-toast-error   { border-color: rgba(255,77,109,0.4); color: var(--inv-red); }
.inv-toast-warn    { border-color: rgba(240,160,48,0.4); color: var(--inv-orange); }

/* ==============================
   BONUS BUTTON
============================== */
.inv-btn-bonus {
  background: rgba(212,175,90,0.06);
  color: var(--inv-gold);
  border: 1px solid rgba(212,175,90,0.2);
  padding: 5px 12px;
  border-radius: var(--inv-r3);
  font-size: 0.75em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.inv-btn-bonus:hover {
  background: rgba(212,175,90,0.12);
  border-color: rgba(212,175,90,0.4);
  color: var(--inv-neon);
}

/* ==============================
   SELL PREVIEW
============================== */
#sell-bar-pnl-preview,
#sell-stock-pnl-preview {
  border-radius: var(--inv-r2);
  padding: 10px 14px;
  font-size: 0.85em;
  font-weight: 700;
  margin-top: 8px;
  font-family: 'Courier New', monospace;
  direction: ltr;
  text-align: center;
}

/* ==============================
   STOCK PRICES PANEL
============================== */
#inv-stock-prices-panel {
  background: linear-gradient(135deg, var(--inv-card) 0%, var(--inv-card2) 100%);
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: var(--inv-r);
  padding: 16px 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
#inv-stock-prices-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--inv-neon), var(--inv-gold), transparent);
  opacity: 0.7;
}

/* ==============================
   REPORT — TOP STATS BOXES (4 Boxes)
============================== */
.inv-report-top-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.inv-rts-box {
  background: linear-gradient(135deg, rgba(212,175,90,0.06), rgba(212,175,90,0.02));
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: var(--inv-r2);
  padding: 18px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.inv-rts-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212,175,90,0.5), transparent);
}
.inv-rts-box:hover {
  background: linear-gradient(135deg, rgba(212,175,90,0.1), rgba(212,175,90,0.04));
  border-color: rgba(212,175,90,0.35);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(212,175,90,0.12);
}
.inv-rts-main {
  background: linear-gradient(135deg, rgba(212,175,90,0.1), rgba(212,175,90,0.05));
  border-color: rgba(212,175,90,0.35);
}
.inv-rts-label {
  display: block;
  font-size: 0.7em;
  color: var(--inv-text2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.inv-rts-val {
  display: block;
  font-size: 1.15em;
  font-weight: 900;
  font-family: 'Courier New', monospace;
  direction: ltr;
  color: var(--inv-text);
  margin-bottom: 6px;
}
.inv-rts-main .inv-rts-val {
  color: var(--inv-neon);
  text-shadow: 0 0 10px rgba(212,175,90,0.3);
}
.inv-rts-sub {
  display: block;
  font-style: normal;
  font-size: 0.72em;
  color: var(--inv-muted);
  font-weight: 600;
}
.inv-rts-mini-bar {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin: 6px 0 8px;
}
.inv-rts-mini-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--inv-gold), var(--inv-neon));
}

/* ==============================
   REPORT — CHARTS ROW
============================== */
.inv-report-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 6px;
}
@media (max-width: 640px) {
  .inv-report-charts-row { grid-template-columns: 1fr; }
}

.inv-report-chart-left,
.inv-report-chart-right {
  background: rgba(212,175,90,0.03);
  border: 1px solid rgba(212,175,90,0.12);
  border-radius: var(--inv-r2);
  padding: 16px;
}

.inv-rch-title {
  font-size: 0.75em;
  font-weight: 800;
  color: var(--inv-gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212,175,90,0.12);
}

/* Bar chart rows */
.inv-rch-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.inv-rch-bar-label {
  font-size: 0.75em;
  color: var(--inv-text2);
  font-weight: 700;
  min-width: 70px;
  white-space: nowrap;
}
.inv-rch-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}
.inv-rch-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 6px currentColor;
}
.inv-rch-bar-val {
  font-size: 0.72em;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  direction: ltr;
  min-width: 80px;
  text-align: left;
}

/* Donut chart */
.inv-rch-donut-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.inv-rch-donut {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(212,175,90,0.2));
}
.inv-rch-donut-label {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8.5px;
  font-weight: 900;
  color: #ffe566;
  font-family: 'Cairo', sans-serif;
  text-align: center;
  white-space: nowrap;
  direction: rtl;
}
.inv-rch-legend {
  flex: 1;
  min-width: 100px;
}
.inv-rch-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.76em;
}
.inv-rch-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.inv-rch-legend-label {
  flex: 1;
  color: var(--inv-text2);
  font-weight: 600;
}
.inv-rch-legend-pct {
  font-weight: 800;
  color: var(--inv-text);
  font-family: 'Courier New', monospace;
}

/* ==============================
   REPORT — GRAND TOTAL (compact)
============================== */
.inv-grand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.inv-grand-item {
  background: rgba(212,175,90,0.04);
  border: 1px solid rgba(212,175,90,0.15);
  border-radius: var(--inv-r2);
  padding: 16px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.inv-grand-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,90,0.2), transparent);
}
.inv-grand-item:hover {
  background: rgba(212,175,90,0.08);
  border-color: rgba(212,175,90,0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212,175,90,0.1);
}
.inv-grand-item span {
  display: block;
  font-size: 0.66em;
  color: var(--inv-muted);
  margin-bottom: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.inv-grand-item strong {
  display: block;
  font-size: 1.1em;
  font-family: 'Courier New', monospace;
  direction: ltr;
  color: var(--inv-text);
  font-weight: 900;
  letter-spacing: 0.02em;
}
.inv-grand-item em {
  display: block;
  font-style: normal;
  font-size: 0.78em;
  font-family: 'Courier New', monospace;
  direction: ltr;
  margin-top: 4px;
  font-weight: 700;
}
.inv-grand-total {
  background: linear-gradient(135deg, rgba(212,175,90,0.08), rgba(212,175,90,0.04));
  border-color: rgba(212,175,90,0.3);
}
.inv-grand-total strong {
  color: var(--inv-neon);
  text-shadow: 0 0 8px rgba(212,175,90,0.3);
}

/* ============================================================
   PROFILE BUTTON & AVATAR — HEADER
   ============================================================ */

.inv-profile-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.2s;
}
.inv-profile-btn:hover { transform: scale(1.08); }

.inv-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(212,175,90,0.5);
  background: linear-gradient(135deg, #1a1500, #2a2000);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px rgba(212,175,90,0.12), 0 3px 12px rgba(0,0,0,0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.inv-profile-btn:hover .inv-profile-avatar {
  border-color: rgba(212,175,90,0.9);
  box-shadow: 0 0 0 3px rgba(212,175,90,0.2), 0 3px 16px rgba(212,175,90,0.2);
}
.inv-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.inv-avatar-initials {
  font-size: 16px;
  font-weight: 800;
  color: #d4aa50;
  line-height: 1;
  font-family: inherit;
}

/* ============================================================
   LOGOUT BUTTON — REDESIGNED
   ============================================================ */

.inv-btn-logout-new {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: #ff6b84;
  background: linear-gradient(135deg, rgba(255,77,109,0.08), rgba(255,50,80,0.04));
  border: 1px solid rgba(255,77,109,0.25);
  box-shadow: 0 2px 8px rgba(255,77,109,0.08), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.inv-btn-logout-new::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,77,109,0.12), transparent);
  opacity: 0;
  transition: opacity 0.22s;
}
.inv-btn-logout-new:hover {
  color: #fff;
  border-color: rgba(255,77,109,0.6);
  background: linear-gradient(135deg, rgba(255,77,109,0.18), rgba(255,50,80,0.1));
  box-shadow: 0 4px 16px rgba(255,77,109,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
  transform: translateY(-1px);
}
.inv-btn-logout-new:hover::before { opacity: 1; }
.inv-btn-logout-new svg { flex-shrink: 0; transition: transform 0.22s; }
.inv-btn-logout-new:hover svg { transform: translateX(-2px); }

/* ============================================================
   PROFILE MODAL
   ============================================================ */

.inv-profile-modal-box {
  max-width: 480px !important;
  width: 92% !important;
}

.inv-profile-photo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 18px;
}

.inv-profile-photo-wrap {
  position: relative;
  cursor: pointer;
  border-radius: 50%;
}

.inv-profile-photo-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(212,175,90,0.5);
  background: linear-gradient(135deg, #1a1500, #2a2000);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 5px rgba(212,175,90,0.08), 0 8px 32px rgba(0,0,0,0.5);
  transition: border-color 0.2s;
}
.inv-profile-photo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.inv-profile-initials-big {
  font-size: 36px;
  font-weight: 800;
  color: #d4aa50;
  line-height: 1;
}

.inv-profile-photo-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.inv-profile-photo-wrap:hover .inv-profile-photo-overlay { opacity: 1; }
.inv-profile-photo-wrap:hover .inv-profile-photo-circle { border-color: rgba(212,175,90,0.9); }

.inv-profile-photo-hint {
  color: #5a5570;
  font-size: 11px;
  margin: 8px 0 0;
  text-align: center;
}

.inv-profile-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #d4aa50;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212,175,90,0.12);
}

.inv-profile-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 20px 0;
}

.inv-pass-wrap {
  position: relative;
}
.inv-pass-wrap input {
  width: 100%;
  padding-left: 40px;
}
.inv-pass-toggle {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  color: #6a6070;
  transition: color 0.2s;
}
.inv-pass-toggle:hover { color: #d4aa50; }

/* ============================================================
   TABS — 4 × 2 GRID WITH BIGGER FONT
   ============================================================ */

/* ============================================================
   AUTOCOMPLETE DROPDOWN — Stock & Crypto search
   ============================================================ */
.inv-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 9999;
  background: #161620;
  border: 1px solid #2a2a3e;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  max-height: 280px;
  overflow-y: auto;
  direction: rtl;
}

.inv-ac-item {
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.inv-ac-item:last-child { border-bottom: none; }
.inv-ac-item:hover { background: rgba(212,175,90,0.08); }

.inv-ac-symbol {
  font-family: monospace;
  font-size: 13px;
  font-weight: 800;
  color: #d4aa50;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.inv-ac-name {
  font-size: 12px;
  color: #d0c8b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-ac-exchange {
  font-size: 10px;
  color: #6a6070;
  margin-top: 2px;
}
.inv-ac-rank {
  font-size: 10px;
  color: #6a6070;
  font-weight: 400;
  font-family: monospace;
}
.inv-ac-loading,
.inv-ac-empty {
  padding: 14px 16px;
  color: #6a6070;
  font-size: 13px;
  text-align: center;
}

/* Pulse animation on live-updated numbers */
@keyframes inv-num-pulse {
  0%   { opacity: 1; }
  30%  { opacity: 0.5; color: #d4aa50; }
  100% { opacity: 1; }
}
.inv-live-updated {
  animation: inv-num-pulse 0.6s ease;
}

/* Live price badge in ticker */
.inv-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc80;
  margin-left: 4px;
  animation: inv-blink 2s infinite;
  vertical-align: middle;
}
@keyframes inv-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* ==============================
   GOLD COUNTDOWN LOADER
============================== */
.inv-gold-timer-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 200, 66, 0.05);
  border: 1px solid rgba(245, 200, 66, 0.2);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  position: relative;
  margin-right: 8px;
  box-shadow: 0 0 10px rgba(245, 200, 66, 0.1);
}

.inv-gold-timer-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--inv-gold);
  font-family: monospace;
  z-index: 2;
}

.inv-gold-timer-svg {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 24px;
  height: 24px;
  transform: rotate(-90deg);
}

.inv-gold-timer-circle {
  fill: none;
  stroke: var(--inv-gold);
  stroke-width: 1.5;
  stroke-dasharray: 69; /* 2 * PI * 11 */
  stroke-dashoffset: 0;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

/* Zakat History Bottom Styling */
.inv-zakat-history-bottom {
  margin-top: 30px;
  background: linear-gradient(135deg, #0a1a12 0%, #050c08 100%);
  border: 1px solid rgba(0, 214, 143, 0.2);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.inv-zhb-title {
  font-size: 15px;
  font-weight: 800;
  color: #00d68f;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==============================
   PRINT STYLES
============================== */
@media print {
  /* إخفاء العناصر غير الضرورية عند الطباعة */
  .inv-tabs, 
  .inv-header-grid .inv-hcol-left, 
  .inv-btn-add, 
  .inv-btn-refresh, 
  .inv-btn-export,
  .inv-report-actions,
  .inv-btn-logout-new,
  .inv-font-ctrl,
  #inv-notif-bell,
  .inv-profile-bell-row,
  .inv-live-prices-widget,
  #inv-price-panel,
  .inv-share-panel,
  .inv-notif-panel,
  .inv-modal,
  .inv-toast,
  .inv-rsp-wrap label,
  .inv-rsp-input,
  button {
    display: none !important;
  }

  /* تحسين مظهر الحاوية الرئيسية */
  #inv-portfolio {
    background: #fff !important;
    color: #000 !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    min-height: auto !important;
  }

  #inv-portfolio::before,
  #inv-portfolio::after {
    display: none !important;
  }

  /* إظهار تبويب التقرير فقط وإخفاء الباقي */
  .inv-tab-content {
    display: none !important;
  }
  #inv-tab-report {
    display: block !important;
    padding: 0 !important;
  }

  /* تحسين مظهر الهيدر في الطباعة */
  .inv-header {
    background: #f9f9f9 !important;
    border: 1px solid #eee !important;
    color: #000 !important;
    box-shadow: none !important;
    margin-bottom: 30px !important;
    padding: 20px !important;
    display: block !important;
    text-align: center !important;
  }

  .inv-title {
    background: none !important;
    -webkit-text-fill-color: #000 !important;
    color: #000 !important;
    font-size: 24pt !important;
    margin-bottom: 5px !important;
  }

  .inv-subtitle {
    color: #666 !important;
    font-size: 12pt !important;
  }

  /* تحسين كروت التقرير */
  .inv-report-row {
    break-inside: avoid;
    border: 1px solid #eee !important;
    background: #fff !important;
    margin-bottom: 15px !important;
    padding: 15px !important;
    color: #000 !important;
  }

  .inv-report-row-name {
    color: #000 !important;
    font-weight: bold !important;
  }

  .inv-scp-results {
    background: #fcfcfc !important;
    border: 1px solid #f0f0f0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .inv-scp-result-item span {
    color: #666 !important;
  }

  .inv-scp-result-item strong {
    color: #000 !important;
  }

  /* الحفاظ على ألوان الربح والخسارة حتى في الطباعة */
  .profit { color: #008000 !important; font-weight: bold !important; }
  .loss { color: #d00000 !important; font-weight: bold !important; }

  /* ملخص التقرير العلوي */
  .inv-report-summary {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
    margin-bottom: 30px !important;
  }

  .inv-sum-card {
    border: 1px solid #eee !important;
    padding: 15px !important;
    text-align: center !important;
  }

  .inv-sum-label { color: #666 !important; }
  .inv-sum-val { color: #000 !important; font-size: 18pt !important; }

  /* تذييل الصفحة للطباعة */
  .print-footer {
    display: block !important;
    text-align: center;
    font-size: 10pt;
    color: #999;
    margin-top: 50px;
    border-top: 1px solid #eee;
    padding-top: 10px;
  }
}

/* إخفاء تذييل الطباعة في العرض العادي */
.print-footer { display: none; }

/* ===================================
   مخططات أسعار المعادن - TradingView
   =================================== */

.inv-metal-charts-section {
  background: var(--inv-card);
  border: 1px solid var(--inv-border);
  border-radius: var(--inv-r);
  padding: 20px;
  margin: 0 0 20px 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.inv-metal-charts-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--inv-gold2), var(--inv-gold), var(--inv-gold2), transparent);
}

.inv-metal-charts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.inv-metal-charts-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--inv-gold3);
  margin: 0;
  letter-spacing: 0.3px;
}

.inv-metal-charts-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--inv-muted);
  background: var(--inv-card2);
  border: 1px solid var(--inv-border);
  border-radius: 20px;
  padding: 3px 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.inv-metal-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.inv-metal-chart-card {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border);
  border-radius: var(--inv-r2);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.inv-metal-chart-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}

.inv-metal-chart-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 6px;
  font-size: 12px;
  font-weight: 700;
  direction: rtl;
}

.inv-metal-chart-icon {
  font-size: 16px;
}

/* ألوان مميزة لكل معدن */
.inv-metal-chart-gold {
  border-color: rgba(212,175,90,0.25);
  background: linear-gradient(160deg, rgba(212,175,90,0.05) 0%, var(--inv-card2) 60%);
}
.inv-metal-chart-gold .inv-metal-chart-label {
  color: var(--inv-gold);
}

.inv-metal-chart-silver {
  border-color: rgba(192,200,220,0.2);
  background: linear-gradient(160deg, rgba(192,200,220,0.05) 0%, var(--inv-card2) 60%);
}
.inv-metal-chart-silver .inv-metal-chart-label {
  color: #c8d0e0;
}

.inv-metal-chart-platinum {
  border-color: rgba(100,160,220,0.2);
  background: linear-gradient(160deg, rgba(100,160,220,0.05) 0%, var(--inv-card2) 60%);
}
.inv-metal-chart-platinum .inv-metal-chart-label {
  color: var(--inv-blue2);
}

.inv-tv-chart {
  width: 100%;
  flex: 1;
  min-height: 180px;
}

.inv-tv-chart .tradingview-widget-container__widget {
  width: 100%;
  height: 180px;
}

/* استجابة الشاشات الصغيرة */
@media (max-width: 700px) {
  .inv-metal-charts-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (min-width: 701px) and (max-width: 1000px) {
  .inv-metal-charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .inv-metal-chart-platinum {
    grid-column: 1 / -1;
  }
}

/* ===================================
   تبويبات المعادن للمخطط المتقدم
   =================================== */

.inv-metal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  direction: rtl;
  flex-wrap: wrap;
}

.inv-metal-tab {
  padding: 8px 20px;
  border-radius: 10px;
  border: 1px solid var(--inv-border2);
  background: var(--inv-card2);
  color: var(--inv-text2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.inv-metal-tab:hover {
  background: var(--inv-card3);
  color: var(--inv-text);
}

.inv-metal-tab-gold.active {
  background: linear-gradient(135deg, rgba(212,175,90,0.18), rgba(160,120,40,0.1));
  border-color: var(--inv-gold2);
  color: var(--inv-gold);
  box-shadow: 0 0 14px rgba(212,175,90,0.15);
}
.inv-metal-tab-silver.active {
  background: linear-gradient(135deg, rgba(200,208,224,0.12), rgba(160,170,190,0.06));
  border-color: rgba(200,208,224,0.4);
  color: #c8d0e0;
  box-shadow: 0 0 14px rgba(200,208,224,0.1);
}
.inv-metal-tab-platinum.active {
  background: linear-gradient(135deg, rgba(106,171,255,0.14), rgba(74,144,232,0.07));
  border-color: rgba(106,171,255,0.35);
  color: var(--inv-blue2);
  box-shadow: 0 0 14px rgba(106,171,255,0.1);
}

.inv-metal-chart-wrap {
  border-radius: var(--inv-r2);
  overflow: hidden;
  border: 1px solid var(--inv-border);
  background: var(--inv-card2);
}

/* ===================================
   خرائط الحرارة - Heatmaps
   =================================== */

.inv-heatmap-section {
  background: var(--inv-card);
  border: 1px solid var(--inv-border);
  border-radius: var(--inv-r);
  padding: 20px;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.inv-heatmap-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--inv-gold2), var(--inv-gold), var(--inv-gold2), transparent);
}

.inv-heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
  direction: rtl;
}

.inv-heatmap-wrap {
  border-radius: var(--inv-r2);
  overflow: hidden;
  border: 1px solid var(--inv-border);
  height: 520px;
  width: 100%;
}

.inv-heatmap-wrap .tradingview-widget-container__widget {
  height: calc(100% - 32px);
  width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   WATCHLIST & PAPER TRADING — يطابق التصميم العام للبلغن
══════════════════════════════════════════════════════════════ */

/* نقطة التحديث الحي */
.inv-live-dot {
  width: 7px;
  height: 7px;
  background: var(--inv-green);
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  box-shadow: 0 0 7px rgba(0,214,143,0.7);
  animation: invPulseLive 2s infinite;
  vertical-align: middle;
}
@keyframes invPulseLive {
  0%,100% { opacity:1; box-shadow:0 0 5px rgba(0,214,143,0.5); }
  50%      { opacity:0.5; box-shadow:0 0 12px rgba(0,214,143,0.9); }
}

/* شبكة الكروت — نفس grid الأسهم */
.inv-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
@media (max-width: 600px) { .inv-cards-grid { grid-template-columns: 1fr; } }

/* ── شبكة تفاصيل الكارت ─────────────────────────────────── */
.inv-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--inv-border);
}
.inv-cg-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.inv-cg-item span {
  font-size: 0.72em;
  color: var(--inv-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.inv-cg-item strong {
  font-size: 0.88em;
  font-weight: 800;
  color: var(--inv-text);
}
.inv-cg-item strong.inv-mono { font-family: 'Courier New', monospace; direction: ltr; display: block; }
.inv-cg-pnl { grid-column: 1 / -1; }

/* ── سعر كبير في المراقبة ────────────────────────────────── */
.inv-wl-price-display {
  margin: 12px 0 8px;
  direction: ltr;
}
.inv-wl-big-price {
  font-size: 1.55em;
  font-weight: 900;
  font-family: 'Courier New', monospace;
  color: var(--inv-text);
  letter-spacing: 0.02em;
}
.inv-currency {
  font-size: 0.65em;
  color: var(--inv-muted);
  margin-right: 4px;
  font-weight: 700;
}
.inv-wl-loading {
  font-size: 0.82em;
  color: var(--inv-muted);
  font-style: italic;
}
.inv-dots::after {
  content: '...';
  animation: invDots 1.4s steps(4, end) infinite;
}
@keyframes invDots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

/* ── صف تنبيه السعر ─────────────────────────────────────── */
.inv-wl-alert-row {
  font-size: 0.78em;
  font-weight: 700;
  margin-top: 6px;
  font-family: 'Courier New', monospace;
  direction: ltr;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── ملاحظة أسفل الكارت ─────────────────────────────────── */
.inv-card-note {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--inv-border);
  font-size: 0.77em;
  color: var(--inv-text2);
  line-height: 1.6;
}

/* ── شارة ticker ─────────────────────────────────────────── */
.inv-ticker-badge {
  font-size: 0.72em;
  font-family: 'Courier New', monospace;
  color: var(--inv-gold);
  background: rgba(212,175,90,0.08);
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── شارات نوع الأصل ─────────────────────────────────────── */
.inv-badge-stock  { background:rgba(74,144,232,0.1);  color:#4a90e8; border-color:rgba(74,144,232,0.25); }
.inv-badge-crypto { background:rgba(255,165,0,0.1);   color:#ffa500; border-color:rgba(255,165,0,0.25); }
.inv-badge-metal  { background:rgba(212,175,90,0.1);  color:var(--inv-gold); border-color:rgba(212,175,90,0.25); }

/* ── شريط ملخص محفظة التجريبي ───────────────────────────── */
.inv-paper-stats-bar { margin-bottom: 18px; }

/* ── تبويبات داخلية التجريبي ─────────────────────────────── */
.inv-paper-inner-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--inv-card);
  border: 1px solid rgba(212,175,90,0.1);
  border-radius: var(--inv-r2);
  padding: 4px;
}
.inv-paper-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--inv-muted);
  padding: 9px 6px;
  border-radius: 10px;
  font-size: 0.84em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  text-align: center;
}
.inv-paper-tab:hover { background: rgba(212,175,90,0.06); color: var(--inv-text); }
.inv-paper-tab.active {
  background: linear-gradient(135deg, #1a1500, #2a2000);
  color: var(--inv-neon);
  border: 1px solid rgba(212,175,90,0.25);
  box-shadow: 0 2px 10px rgba(212,175,90,0.1);
}

/* ── فلاتر المراقبة ──────────────────────────────────────── */
.inv-wl-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.inv-wl-filter-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--inv-border2);
  background: var(--inv-card2);
  color: var(--inv-text2);
  font-size: 0.8em;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.inv-wl-filter-btn:hover { border-color: var(--inv-gold); color: var(--inv-gold); }
.inv-wl-filter-btn.active {
  background: rgba(212,175,90,0.08);
  border-color: rgba(212,175,90,0.4);
  color: var(--inv-neon);
}

/* ── معاينة البيع في المودال ─────────────────────────────── */
.inv-sell-preview { border-radius: 10px; padding: 12px 14px; margin: 8px 0; }
.inv-sell-preview-pos { background: rgba(0,214,143,0.06); border: 1px solid rgba(0,214,143,0.2); }
.inv-sell-preview-neg { background: rgba(255,77,109,0.06); border: 1px solid rgba(255,77,109,0.2); }
.inv-sp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84em;
  padding: 3px 0;
}
.inv-sp-row span { color: var(--inv-text2); }
.inv-sp-total {
  border-top: 1px solid var(--inv-border);
  margin-top: 6px;
  padding-top: 6px;
  font-weight: 800;
}

/* ── معاينة التكلفة التجريبي ─────────────────────────────── */
.inv-cost-preview {
  background: rgba(212,175,90,0.05);
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: 10px;
  padding: 9px 14px;
  margin-bottom: 12px;
  font-size: 0.84em;
  color: var(--inv-text2);
}

/* ── جداول التقارير ──────────────────────────────────────── */
.inv-section-title {
  font-size: 0.9em;
  font-weight: 800;
  color: var(--inv-gold);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212,175,90,0.15);
  letter-spacing: 0.02em;
}
.inv-table-wrap {
  overflow-x: auto;
  border-radius: var(--inv-r);
  border: 1px solid var(--inv-border2);
  margin-bottom: 4px;
}
.inv-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--inv-card);
  font-size: 0.84em;
  min-width: 500px;
}
.inv-table thead th {
  background: var(--inv-card2);
  padding: 10px 12px;
  font-size: 0.75em;
  font-weight: 800;
  color: var(--inv-muted);
  border-bottom: 1px solid var(--inv-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-align: right;
}
.inv-table tbody tr { border-bottom: 1px solid var(--inv-border); transition: background 0.15s; }
.inv-table tbody tr:last-child { border-bottom: none; }
.inv-table tbody tr:hover { background: var(--inv-card2); }
.inv-table td { padding: 10px 12px; vertical-align: middle; text-align: right; }
.inv-table td.inv-mono { font-family: 'Courier New', monospace; direction: ltr; text-align: left; }

/* ── popup تنبيه السعر المستهدف ──────────────────────────── */
.inv-price-alert-popup {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999999;
  background: linear-gradient(135deg, #1a1500, #2a2000);
  border: 1px solid rgba(212,175,90,0.5);
  border-radius: 16px;
  max-width: 320px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 30px rgba(212,175,90,0.15);
  animation: invSlideUp 0.35s cubic-bezier(0.34,1.56,0.64,1);
  direction: rtl;
  overflow: hidden;
}
@keyframes invSlideUp {
  from { opacity:0; transform:translateY(24px) scale(0.94); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
.inv-pap-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 44px 18px 18px;
}
.inv-pap-icon  { font-size: 1.8em; flex-shrink:0; }
.inv-pap-title { font-size: 0.9em; font-weight: 800; color: var(--inv-neon); margin-bottom: 5px; }
.inv-pap-msg   { font-size: 0.82em; color: var(--inv-text2); line-height: 1.7; }
.inv-pap-close {
  position: absolute;
  top: 10px; left: 12px;
  background: transparent;
  border: none;
  color: var(--inv-muted);
  cursor: pointer;
  font-size: 1em;
  padding: 4px 7px;
  border-radius: 6px;
  transition: all 0.2s;
}
.inv-pap-close:hover { background: rgba(255,77,109,0.1); color: var(--inv-red); }
@media (max-width: 480px) { .inv-price-alert-popup { left:10px; right:10px; max-width:none; bottom:14px; } }

/* ── ألوان ر/خ ────────────────────────────────────────────── */
.inv-profit { color: var(--inv-profit) !important; }
.inv-loss   { color: var(--inv-loss) !important; }
.inv-muted  { color: var(--inv-muted) !important; }
.inv-mono   { font-family: 'Courier New', monospace; }

/* ── طباعة ────────────────────────────────────────────────── */
.inv-wl-print-footer,
.inv-paper-print-footer { display: none; }
@media print {
  .inv-card-actions,
  .inv-wl-filter-bar,
  .inv-paper-inner-tabs,
  .inv-tab-header button,
  .inv-modal { display: none !important; }
  .inv-wl-print-footer,
  .inv-paper-print-footer {
    display: block !important;
    border-top: 2px solid #ccc;
    margin-top: 16px;
    padding-top: 10px;
    font-size: 11px;
    color: #555;
    text-align: center;
  }
  .inv-cards-grid { grid-template-columns: 1fr 1fr; }
  .inv-card { break-inside: avoid; }
  .inv-profit { color: #1a7a3a !important; }
  .inv-loss   { color: #c02020 !important; }
}

/* ── شريط تحذير الوضع التجريبي ─────────────────────────── */
.inv-paper-warning-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255,165,0,0.08), rgba(255,140,0,0.04));
  border: 1px solid rgba(255,165,0,0.35);
  border-radius: var(--inv-r2);
  padding: 11px 16px;
  margin-bottom: 18px;
  font-size: 0.84em;
  color: var(--inv-text2);
  direction: rtl;
}
.inv-paper-warning-bar strong { color: #ffaa00; }
.inv-paper-warning-icon { font-size: 1.2em; flex-shrink: 0; }

/* ── زر تفعيل واتساب ─────────────────────────────────── */
.inv-btn-wa-activate {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  background: linear-gradient(135deg, rgba(37,211,102,0.12), rgba(37,211,102,0.06));
  border: 1px solid rgba(37,211,102,0.4);
  border-radius: var(--inv-r2);
  color: #25d366;
  font-family: inherit;
  font-size: 0.9em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: right;
  direction: rtl;
}
.inv-btn-wa-activate:hover {
  background: linear-gradient(135deg, rgba(37,211,102,0.2), rgba(37,211,102,0.1));
  border-color: rgba(37,211,102,0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37,211,102,0.2);
}
.inv-btn-wa-activate span:first-child { font-size: 1.3em; flex-shrink: 0; }

/* ── عنوان قسم الملف الشخصي ─────────────────────────── */
.inv-profile-section-title {
  font-size: 0.75em;
  font-weight: 800;
  color: var(--inv-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 0 4px;
  border-top: 1px solid var(--inv-border);
  margin-bottom: 4px;
}

/* ── مفتاح اختيار العملة (د.ك / دولار) عند إضافة بند ──────────── */
.inv-currency-toggle {
  display: inline-flex;
  gap: 4px;
  background: #161620;
  border: 1px solid var(--inv-border);
  border-radius: 8px;
  padding: 3px;
  margin: 6px 0 4px;
}
.inv-cur-btn {
  border: none;
  background: transparent;
  color: var(--inv-muted);
  font-family: inherit;
  font-size: 0.78em;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s;
}
.inv-cur-btn:hover { color: var(--inv-neon); }
.inv-cur-btn.active {
  background: linear-gradient(135deg, var(--inv-neon), var(--inv-gold));
  color: #1a1408;
  box-shadow: 0 2px 8px var(--inv-gold-glow);
}
.inv-cur-hint {
  display: block;
  font-size: 0.72em;
  color: var(--inv-muted);
  margin: 0 0 8px 2px;
}

/* ── زر جلب السعر الحالي تلقائياً عند إضافة صفقة تجريبية ──────── */
.inv-btn-fetch-price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(74,144,232,0.1);
  border: 1px solid rgba(74,144,232,0.3);
  color: #6aabff;
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 0.76em;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}
.inv-btn-fetch-price:hover {
  border-color: #6aabff;
  background: rgba(74,144,232,0.18);
}
.inv-btn-fetch-price:disabled { opacity: 0.55; cursor: wait; }

/* ── زر تعديل صفقة تجريبية ─────────────────────────────────────── */
.inv-btn-editpaper {
  background: rgba(212,175,90,0.1);
  border: 1px solid rgba(212,175,90,0.3);
  color: var(--inv-gold);
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 0.76em;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
}
.inv-btn-editpaper:hover { border-color: var(--inv-gold); background: rgba(212,175,90,0.18); }

/* ── ملاحظات الكرت ─────────────────────────────────────── */
.inv-card-notes {
  margin: 10px 0 0;
  padding: 8px 12px 8px 10px;
  background: rgba(212,175,90,0.04);
  border-right: 3px solid rgba(212,175,90,0.25);
  border-radius: 0 8px 8px 0;
  color: var(--inv-muted);
  font-size: 0.8em;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-style: italic;
}
.inv-card-notes-collapsible { cursor: pointer; }
.inv-notes-line1 { white-space: pre-wrap; word-break: break-word; }
.inv-notes-rest { margin-top: 4px; white-space: normal; }
.inv-notes-toggle {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  border: 1px solid rgba(212,175,90,0.35);
  border-radius: 20px;
  background: rgba(212,175,90,0.08);
  color: var(--inv-gold);
  font-size: 0.85em;
  font-style: normal;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
}
.inv-notes-toggle:hover { background: rgba(212,175,90,0.18); border-color: var(--inv-gold); }

/* ─── بطاقة الرصيد التجريبي ─────────────────────────────────── */
.inv-paper-balance-bar {
  background: linear-gradient(135deg, #0a0a00 0%, #141400 50%, #0a0a00 100%);
  border: 1px solid rgba(212,175,90,0.3);
  border-radius: var(--inv-r);
  padding: 18px 24px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 12px 40px rgba(212,175,90,0.08), var(--inv-shadow);
}
.inv-paper-balance-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.inv-paper-balance-icon {
  font-size: 28px;
  line-height: 1;
}
.inv-paper-balance-label {
  font-size: 12.5px;
  color: var(--inv-muted);
  margin-bottom: 4px;
}
.inv-paper-balance-val {
  font-family: monospace;
  font-weight: 800;
  font-size: 22px;
  color: var(--inv-gold);
  direction: ltr;
  display: inline-block;
}

/* ─── دفعات الأسهم (Multi-lot) ──────────────────────────── */
.inv-stock-lot {
  background: rgba(212,175,90,0.04);
  border: 1px solid rgba(212,175,90,0.2);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  position: relative;
  transition: border-color 0.2s;
}
.inv-stock-lot:hover { border-color: rgba(212,175,90,0.4); }
.inv-stock-lot-total {
  font-size: 12px;
  color: var(--inv-muted);
  margin-top: 4px;
  direction: ltr;
  text-align: right;
  font-family: monospace;
}

/* ══════════════════════════════════════════════════════════════
   REDESIGNED MODALS — Section Labels, Company Cards, Lot Cards
══════════════════════════════════════════════════════════════ */

/* ─── Modal wide variant ─── */
.inv-modal-lg .inv-modal-box {
  max-width: 620px;
}
@media (min-width: 601px) and (max-width: 1024px) {
  .inv-modal-lg .inv-modal-box { max-width: 760px; }
}
@media (min-width: 1025px) {
  .inv-modal-lg .inv-modal-box { max-width: 820px; }
}

/* ─── Section separator labels inside modals ─── */
.inv-modal-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 10px;
  font-size: 0.78em;
  font-weight: 800;
  color: var(--inv-gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.inv-modal-section-label::before,
.inv-modal-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(212,175,90,0.25), transparent);
}
.inv-modal-section-label::before { background: linear-gradient(90deg, transparent, rgba(212,175,90,0.25)); }
.inv-modal-section-label > span { white-space: nowrap; }

/* ─── Company cards (multi-company stock modal) ─── */
.inv-company-card {
  background: rgba(212,175,90,0.03);
  border: 1px solid rgba(212,175,90,0.18);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
  position: relative;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.inv-company-card:hover {
  border-color: rgba(212,175,90,0.35);
  box-shadow: 0 4px 20px rgba(212,175,90,0.06);
}
.inv-company-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.inv-company-badge {
  font-size: 1.1em;
}
.inv-company-title {
  font-size: 0.85em;
  font-weight: 800;
  color: var(--inv-gold);
  letter-spacing: 0.03em;
}
.inv-company-remove {
  background: rgba(255,77,109,0.08);
  border: 1px solid rgba(255,77,109,0.2);
  color: #ff4d6d;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  transition: all 0.2s;
}
.inv-company-remove:hover {
  background: rgba(255,77,109,0.18);
  border-color: rgba(255,77,109,0.5);
}

/* ─── Lot cards ─── */
.inv-lots-container { }
.inv-lot-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.inv-lot-card:hover { border-color: rgba(212,175,90,0.25); }
.inv-lot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.inv-lot-total-line {
  font-size: 11px;
  color: var(--inv-muted);
  margin-top: 6px;
  font-family: monospace;
  direction: ltr;
  text-align: right;
  min-height: 14px;
}

/* ─── 3-col frow support ─── */
.inv-frow[style*="1fr 1fr 1fr"] {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 580px) {
  .inv-frow[style*="1fr 1fr 1fr"] {
    grid-template-columns: 1fr;
  }
}

/* ─── Modal head subtitle tweak ─── */
.inv-modal-head > div > div:first-child {
  font-size: 1em;
  font-weight: 800;
  color: var(--inv-gold);
}

/* ─── Add company button hover ─── */
#inv-add-company-btn:hover {
  background: rgba(212,175,90,0.08) !important;
  border-color: rgba(212,175,90,0.6) !important;
  transform: translateY(-1px);
}

/* ─── Currency toggle compact (inside lot cards) ─── */
.inv-lot-card .inv-currency-toggle {
  margin-top: 5px;
}
.inv-lot-card .inv-cur-btn {
  font-size: 10px !important;
  padding: 3px 8px !important;
}

/* ─── Three-column grid for lot cards ─── */
.inv-lot-card .inv-frow.inv-frow-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 580px) {
  .inv-lot-card .inv-frow.inv-frow-3 { grid-template-columns: 1fr; }
}

/* ==============================
   GEMINI FLOATING WIDGET
============================== */
.inv-gemini-widget {
  position: fixed !important;
  bottom: 20px;
  right: 20px;
  z-index: 2147483000 !important;
  direction: rtl;
  font-family: 'Cairo', sans-serif;
}

.inv-gemini-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--inv-purple), var(--inv-blue));
  border: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3), 0 0 20px rgba(155, 127, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 0;
}

.inv-gemini-toggle:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4), 0 0 30px rgba(155, 127, 255, 0.6);
}

.inv-gemini-icon {
  font-size: 30px;
  color: white;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.inv-gemini-stop-speak {
  position: fixed !important;
  bottom: 88px;
  right: 12px;
  z-index: 2147483000 !important;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: var(--inv-red);
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(229,72,77,0.45);
  animation: inv-gemini-mic-pulse 1.4s ease-in-out infinite;
}

.inv-gemini-stop-speak span {
  font-size: 13px;
  line-height: 1;
}

.inv-gemini-popup {
  position: fixed !important;
  bottom: 90px;
  right: 20px;
  width: 380px;
  height: 550px;
  max-height: calc(100vh - 120px);
  background: var(--inv-bg2, #0c0c16);
  background-color: #0c0c16;
  opacity: 1;
  border: 1px solid var(--inv-border2);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--inv-shadow), 0 0 40px rgba(0,0,0,0.5);
  overflow: hidden;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease, visibility 0.3s ease;
  z-index: 2147483000 !important;
}

.inv-gemini-popup.active {
  visibility: visible;
  transform: translateY(0) scale(1);
}

.inv-gemini-header {
  padding: 15px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--inv-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inv-gemini-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--inv-neon);
}

.inv-gemini-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.inv-gemini-voice-toggle {
  background: transparent;
  border: none;
  color: var(--inv-text2);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 6px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}

.inv-gemini-voice-toggle:hover {
  background: rgba(255,255,255,0.06);
}

.inv-gemini-voice-toggle.active {
  color: var(--inv-neon);
}

.inv-gemini-close {
  background: transparent;
  border: none;
  color: var(--inv-text2);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 5px;
  transition: color 0.2s;
}

.inv-gemini-close:hover {
  color: var(--inv-red);
}

.inv-gemini-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scrollbar-width: thin;
  scrollbar-color: var(--inv-border) transparent;
}

.inv-gemini-body::-webkit-scrollbar {
  width: 6px;
}

.inv-gemini-body::-webkit-scrollbar-thumb {
  background: var(--inv-border);
  border-radius: 10px;
}

.gemini-message {
  padding: 12px 16px;
  border-radius: 15px;
  max-width: 90%;
  font-size: 14px;
  line-height: 1.6;
}

.gemini-bot {
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--inv-border);
  color: var(--inv-text);
  border-bottom-right-radius: 2px;
}

.gemini-error {
  align-self: center;
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid var(--inv-red);
  color: var(--inv-red);
  text-align: center;
  width: 100%;
}

.gemini-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--inv-purple), var(--inv-blue));
  color: #fff;
  border-bottom-left-radius: 2px;
}

.gemini-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
}

.gemini-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--inv-neon);
  opacity: 0.4;
  animation: inv-gemini-typing 1s infinite ease-in-out;
}

.gemini-typing span:nth-child(2) { animation-delay: 0.15s; }
.gemini-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes inv-gemini-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.inv-gemini-footer {
  padding: 15px 20px;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--inv-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inv-gemini-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.inv-gemini-chat-input {
  flex: 1;
  resize: vertical;
  min-height: 68px;
  max-height: 220px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--inv-border2);
  background: rgba(255,255,255,0.04);
  color: var(--inv-text);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s;
}

.inv-gemini-chat-input:focus {
  border-color: var(--inv-neon);
}

.inv-gemini-chat-send-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--inv-purple), var(--inv-blue));
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
}

.inv-gemini-chat-send-btn:hover {
  transform: scale(1.08);
}

.inv-gemini-chat-send-btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.inv-gemini-mic-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--inv-border2);
  background: rgba(255,255,255,0.04);
  color: var(--inv-text2);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}

.inv-gemini-mic-btn:hover {
  color: var(--inv-neon);
  border-color: var(--inv-neon);
}

.inv-gemini-mic-btn.recording {
  background: var(--inv-red);
  border-color: var(--inv-red);
  color: #fff;
  animation: inv-gemini-mic-pulse 1.1s ease-in-out infinite;
}

.inv-gemini-mic-btn.thinking {
  background: var(--inv-gold);
  border-color: var(--inv-gold);
  color: #1a1200;
  animation: inv-gemini-mic-pulse 0.9s ease-in-out infinite;
}

.inv-gemini-mic-btn.speaking {
  background: var(--inv-purple);
  border-color: var(--inv-purple);
  color: #fff;
  animation: inv-gemini-mic-pulse 1.2s ease-in-out infinite;
}

.inv-gemini-voice-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--inv-neon);
  text-align: center;
  padding: 2px 0;
}

@keyframes inv-gemini-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(229,72,77,0); }
}

.inv-gemini-disclaimer {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--inv-muted);
  text-align: center;
}

.inv-gemini-send-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(90deg, var(--inv-gold), var(--inv-gold2));
  border: none;
  border-radius: 10px;
  color: #000;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.inv-gemini-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--inv-gold-glow);
}

.inv-gemini-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--inv-neon);
  border-radius: 50%;
  animation: inv-spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes inv-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .inv-gemini-popup {
    width: calc(100vw - 24px);
    right: 12px;
    left: 12px;
    bottom: 80px;
    height: min(560px, calc(100vh - 110px));
    height: min(560px, calc(100dvh - 110px));
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
  }
}

@media (max-width: 480px) {
  .inv-gemini-popup {
    bottom: 75px;
  }
}

/* الشاشات الكبيرة (كمبيوتر) — نافذة أكبر، على اليسار، وبمنتصف الشاشة عموديًا */
@media (min-width: 769px) {
  .inv-gemini-popup {
    right: auto;
    left: 24px;
    bottom: auto;
    top: 50%;
    transform: translateY(-45%) scale(0.95);
    width: 480px;
    height: 640px;
    max-height: calc(100vh - 80px);
  }
  .inv-gemini-popup.active {
    transform: translateY(-50%) scale(1);
  }
}

/* ============================================================
   الرسم البياني الحي للمحفظة (inv-live-chart.js)
============================================================ */
.inv-lc-wrap {
  background: var(--inv-card);
  border: 1px solid var(--inv-border);
  border-radius: var(--inv-r);
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: var(--inv-shadow-gold);
}
.inv-lc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.inv-lc-head h3 {
  margin: 0;
  color: var(--inv-text);
  font-size: 1.05em;
}
.inv-lc-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.inv-lc-mode {
  display: flex;
  background: var(--inv-bg2);
  border: 1px solid var(--inv-border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
/* شريط الفترات الزمنية أسفل الرسم — يشبه الشريط السفلي بتطبيقات المقارنة */
.inv-lc-periods {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--inv-border);
}
.inv-lc-periods .inv-lc-pbtn {
  border-radius: 10px;
}
.inv-lc-pbtn, .inv-lc-mbtn {
  background: transparent;
  border: none;
  color: var(--inv-text2);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.inv-lc-pbtn:hover, .inv-lc-mbtn:hover { color: var(--inv-text); }
.inv-lc-pbtn.active, .inv-lc-mbtn.active {
  background: linear-gradient(135deg, var(--inv-gold), var(--inv-gold2));
  color: #1a1508;
}
.inv-lc-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  min-height: 240px;
  max-height: 460px;
  direction: ltr;
}
.inv-lc-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.inv-lc-svg text {
  font-family: 'Cairo', 'Segoe UI', 'Tahoma', sans-serif;
  direction: ltr;
}
.inv-lc-empty {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--inv-muted);
  font-size: 13px;
  gap: 6px;
  line-height: 1.8;
  direction: rtl;
}
.inv-lc-empty span { font-size: 11px; color: var(--inv-muted); }
.inv-lc-tooltip {
  display: none;
  position: absolute;
  z-index: 5;
  background: rgba(10,10,18,0.95);
  border: 1px solid var(--inv-border2);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 160px;
  pointer-events: none;
  box-shadow: var(--inv-shadow);
  direction: rtl;
}
.inv-lc-tt-time {
  color: var(--inv-text2);
  font-size: 11px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--inv-border);
  padding-bottom: 4px;
}
.inv-lc-tt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 2px 0;
}
.inv-lc-tt-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.inv-lc-tt-label { color: var(--inv-text); flex: 1; }
.inv-lc-tt-val { font-weight: 800; }
.inv-lc-tt-val.up { color: var(--inv-profit); }
.inv-lc-tt-val.down { color: var(--inv-loss); }
/* صف الشرائح بالأعلى — كل العناصر مع بعض جنب بعض عشان تسهل مقارنة الأداء بلمحة */
.inv-lc-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}
.inv-lc-chip {
  --chip-color: var(--inv-gold);
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.6vw, 9px);
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.16);
  color: var(--inv-text);
  font-size: clamp(11px, 2.4vw, 14px);
  font-weight: 800;
  padding: clamp(5px, 1.6vw, 9px) clamp(9px, 3vw, 16px);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: all .18s;
  letter-spacing: .2px;
  white-space: nowrap;
}
.inv-lc-chip .inv-lc-dot {
  width: clamp(10px, 2.4vw, 14px);
  height: clamp(10px, 2.4vw, 14px);
  border-radius: 5px;
  background: var(--chip-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--chip-color) 65%, transparent);
  flex-shrink: 0;
  transition: all .18s;
}
.inv-lc-chip:hover {
  background: rgba(255,255,255,0.09);
  border-color: color-mix(in srgb, var(--chip-color) 55%, rgba(255,255,255,0.16));
  transform: translateY(-1px);
}
.inv-lc-chip.off {
  opacity: 0.4;
}
.inv-lc-chip.off .inv-lc-dot {
  background: var(--inv-muted);
  box-shadow: none;
}

@media (max-width: 600px) {
  .inv-lc-head { flex-direction: column; align-items: flex-start; }
  .inv-lc-box { aspect-ratio: 4 / 3.4; }
  .inv-lc-legend { gap: 6px; }
}

/* ==============================
   REPORT — جدول موحّد للمحفظة الحالية
   (يستبدل تكرار البطاقات + شريط الملخص بجدول واحد بصفوف قابلة للتوسيع)
============================== */
.inv-rtable {
  border: 1px solid var(--inv-border);
  border-radius: var(--inv-r2);
  overflow: hidden;
  background: rgba(255,255,255,0.015);
}
.inv-rtable-head, .inv-rtable-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.9fr 0.9fr 1fr 1fr 1fr 0.8fr;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
}
.inv-rtable-head {
  background: rgba(255,255,255,0.04);
  font-size: 0.72em;
  font-weight: 800;
  color: var(--inv-text2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--inv-border);
}
.inv-rtable-row {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.88em;
  transition: background .15s;
}
.inv-rtable-row:last-child { border-bottom: none; }
.inv-rtable-row:hover { background: rgba(255,255,255,0.03); }
.inv-rtable-expandable {
  cursor: pointer;
  background: linear-gradient(135deg, rgba(212,175,90,0.14), rgba(212,175,90,0.05));
  font-weight: 800;
  border: 2px solid rgba(212,175,90,0.55);
  border-radius: 10px;
  margin: 8px 8px 0;
  box-shadow: 0 2px 10px rgba(212,175,90,0.12);
}
.inv-rtable-expandable:hover {
  background: linear-gradient(135deg, rgba(212,175,90,0.2), rgba(212,175,90,0.08));
  border-color: rgba(212,175,90,0.8);
}
.inv-rtable-expandable .inv-rtc-name::after {
  content: 'الإجمالي';
  font-size: 0.68em;
  font-weight: 800;
  color: #0d0b06;
  background: var(--inv-gold);
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 8px;
}
.inv-rtable-sub {
  display: none;
  border-right: 3px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.18);
  margin: 0 8px 8px;
  border-radius: 0 0 8px 8px;
}
.inv-rtable-sub-caption {
  padding: 6px 14px 2px;
  font-size: 0.72em;
  color: var(--inv-muted);
  font-style: italic;
}
.inv-rtable-subrow {
  background: transparent;
  font-size: 0.84em;
  font-weight: 400;
  opacity: 0.85;
}
.inv-rtable-subrow .inv-rtc-asset { padding-right: 18px; }
.inv-rtable-subrow .inv-rtc-icon { opacity: 0.6; }

.inv-rtc { color: var(--inv-text); overflow: hidden; text-overflow: ellipsis; }
.inv-rtc-asset { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.inv-rtc-icon { flex-shrink: 0; }
.inv-rtc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-rt-arrow {
  display: inline-block;
  font-size: 0.8em;
  color: var(--inv-muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.inv-rt-arrow.open { transform: rotate(90deg); }

.inv-rtc-val {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.inv-rtc-val .inv-rsp-input {
  width: 90px;
  max-width: 100%;
  padding: 3px 6px;
  font-size: 0.85em;
  border-radius: 6px;
  border: 1px solid var(--inv-border);
  background: rgba(255,255,255,0.04);
  color: var(--inv-text);
  direction: ltr;
  text-align: right;
}
.inv-rtc-val strong { font-weight: 800; }

@media (max-width: 760px) {
  .inv-rtable-head { display: none; }
  .inv-rtable-row, .inv-rtable-subrow {
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: row;
    row-gap: 6px;
  }
  .inv-rtc-asset { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════════════
   قسم TP / SL في موديل التجريبي
   ═══════════════════════════════════════════════════ */
.inv-paper-tpsl-section {
  border: 1px solid var(--inv-border);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}
.inv-paper-tpsl-header {
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--inv-text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: background 0.15s;
}
.inv-paper-tpsl-header:hover { background: rgba(255,255,255,0.04); }
.inv-paper-tpsl-arrow {
  margin-right: auto;
  font-size: 10px;
  transition: transform 0.2s;
}
.inv-paper-tpsl-body {
  display: none;
  padding: 0 14px 14px;
}
.inv-paper-tpsl-body.inv-paper-tpsl-open { display: block; }

/* بطاقة TP/SL داخل عرض الصفقة */
.inv-paper-tpsl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
  white-space: nowrap;
}
.inv-paper-tp-badge {
  background: rgba(0,214,143,0.12);
  border: 1px solid rgba(0,214,143,0.3);
  color: #00d68f;
}
.inv-paper-sl-badge {
  background: rgba(255,71,87,0.12);
  border: 1px solid rgba(255,71,87,0.3);
  color: #ff4757;
}
.inv-paper-tpsl-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* زر تعديل TP/SL سريع من البطاقة */
.inv-btn-tpsl-edit {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid var(--inv-border);
  background: transparent;
  color: var(--inv-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.inv-btn-tpsl-edit:hover {
  border-color: var(--inv-neon);
  color: var(--inv-neon);
}

/* إشعار TP/SL نُفِّذ */
.inv-paper-triggered-banner {
  background: linear-gradient(135deg, rgba(212,170,80,0.15), rgba(212,170,80,0.05));
  border: 1px solid rgba(212,170,80,0.4);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #d4aa50;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: inv-tpsl-flash 0.6s ease-in-out 3;
}
@keyframes inv-tpsl-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ════════════════════════════════════════════════════
   العقارات — Property Module CSS
   ════════════════════════════════════════════════════ */

/* ── Inner Tabs (داخل قسم الأصول) ── */
.inv-inner-tabs { margin-top: 20px; }
.inv-inner-tab-btns {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--inv-border);
  margin-bottom: 18px;
  padding-bottom: 0;
}
.inv-inner-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--inv-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s, border-color 0.2s;
  border-radius: 8px 8px 0 0;
}
.inv-inner-tab-btn:hover { color: var(--inv-text); }
.inv-inner-tab-btn.active {
  color: var(--inv-neon);
  border-bottom-color: var(--inv-neon);
  background: rgba(212,170,80,0.06);
}

/* ── بطاقة العقار الرئيسية ── */
.inv-prop-card {
  background: var(--inv-card);
  border: 1px solid var(--inv-border);
  border-radius: 18px;
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.inv-prop-card:hover { box-shadow: 0 6px 28px rgba(0,0,0,0.35); }

.inv-prop-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.inv-prop-card-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.inv-prop-name {
  font-size: 1.05em;
  font-weight: 900;
  color: var(--inv-text);
}
.inv-prop-location {
  font-size: 0.78em;
  color: var(--inv-muted);
}
.inv-prop-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.inv-prop-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  padding: 0 18px 14px;
}
.inv-prop-kpi {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.inv-prop-kpi-lbl {
  font-size: 0.72em;
  color: var(--inv-text2);
  font-weight: 600;
}
.inv-prop-kpi-val {
  font-size: 0.92em;
  font-weight: 800;
  color: var(--inv-text);
  font-family: 'Courier New', monospace;
  direction: ltr;
}

/* ── تنبيه التقييم ── */
.inv-prop-valuation-alert {
  margin: 0 18px 14px;
  padding: 10px 14px;
  background: rgba(245,200,66,0.08);
  border: 1px solid rgba(245,200,66,0.3);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #f5c842;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.inv-prop-valuation-alert button {
  background: rgba(245,200,66,0.15);
  border: 1px solid rgba(245,200,66,0.4);
  color: #f5c842;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}
.inv-prop-valuation-alert button:hover { background: rgba(245,200,66,0.25); }

/* ── وحدات العقار ── */
.inv-prop-units-section {
  border-top: 1px solid var(--inv-border);
  padding: 14px 18px;
}
.inv-prop-units-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.inv-prop-units-title {
  font-size: 0.85em;
  font-weight: 800;
  color: var(--inv-text2);
}
.inv-prop-units-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── بطاقة الوحدة ── */
.inv-unit-card {
  background: var(--inv-card2);
  border: 1px solid var(--inv-border);
  border-radius: 14px;
  overflow: hidden;
}
.inv-unit-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  gap: 10px;
  flex-wrap: wrap;
}
.inv-unit-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.inv-unit-name {
  font-size: 0.92em;
  font-weight: 800;
  color: var(--inv-text);
}
.inv-unit-sub {
  font-size: 0.75em;
  color: var(--inv-muted);
}
.inv-unit-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}
.inv-unit-status-rented  { background: rgba(0,214,143,0.12); color: #00d68f; border: 1px solid rgba(0,214,143,0.3); }
.inv-unit-status-empty   { background: rgba(255,71,87,0.10);  color: #ff4757; border: 1px solid rgba(255,71,87,0.25); }
.inv-unit-status-maint   { background: rgba(245,200,66,0.10); color: #f5c842; border: 1px solid rgba(245,200,66,0.3); }

.inv-unit-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px,1fr));
  gap: 8px;
  padding: 8px 14px 12px;
}
.inv-unit-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.inv-unit-stat-lbl { font-size: 0.7em; color: var(--inv-text2); font-weight: 600; }
.inv-unit-stat-val { font-size: 0.85em; font-weight: 800; font-family: monospace; color: var(--inv-text); }

/* شريط الأفعال للوحدة */
.inv-unit-actions {
  display: flex;
  gap: 5px;
  padding: 0 10px 10px;
  flex-wrap: wrap;
}

/* ── فواتير ومصاريف ── */
.inv-prop-expenses-section {
  border-top: 1px solid var(--inv-border);
  padding: 12px 18px 14px;
}
.inv-expense-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--inv-border);
  font-size: 13px;
  gap: 8px;
}
.inv-expense-row:last-child { border-bottom: none; }
.inv-expense-month { color: var(--inv-text2); font-size: 0.82em; }
.inv-expense-amounts { font-family: monospace; font-weight: 700; color: var(--inv-text); }

/* ── تقرير الفراغ ── */
.inv-vacant-report {
  background: rgba(255,71,87,0.05);
  border: 1px solid rgba(255,71,87,0.2);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 18px 14px;
}
.inv-vacant-report-title {
  font-size: 12px;
  font-weight: 800;
  color: #ff6b7a;
  margin-bottom: 8px;
}
.inv-vacant-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
  color: var(--inv-text2);
}
.inv-vacant-item strong { color: #ff6b7a; font-family: monospace; }

/* ── أزرار Actions للعقار ── */
.inv-prop-actions {
  display: flex;
  gap: 6px;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--inv-border);
  flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .inv-prop-kpi-row { grid-template-columns: 1fr 1fr; }
  .inv-prop-card-header { padding: 13px 14px 11px; }
  .inv-prop-units-section { padding: 12px 14px; }
  .inv-unit-stats { grid-template-columns: 1fr 1fr; }
}
