@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900");
:root {
  color-scheme: dark;
  --bg: #07111e;
  --panel: rgba(18, 31, 45, .78);
  --panel-strong: #152334;
  --panel-soft: rgba(29, 44, 61, .66);
  --line: rgba(164, 196, 188, .13);
  --text: #edf6f3;
  --muted: #93a9a4;
  --green: #28d8a1;
  --green-soft: rgba(40, 216, 161, .13);
  --red: #ff6376;
  --red-soft: rgba(255, 99, 118, .12);
  --amber: #f2b84b;
  --violet: #9a8cff;
  --cyan: #62c4ff;
  --radius: 22px;
  --shadow: 0 22px 55px rgba(0, 0, 0, .26);
  --font: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% -10%, rgba(40,216,161,.09), transparent 31%), var(--bg); color: var(--text); font-family: var(--font); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.ambient { position: fixed; z-index: 0; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .12; }
.ambient-one { width: 330px; height: 330px; background: var(--green); top: 12%; right: 10%; }
.ambient-two { width: 260px; height: 260px; background: var(--violet); left: 12%; bottom: 4%; }
.app-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px 20px; background: rgba(5, 15, 28, .82); border-inline-end: 1px solid var(--line); backdrop-filter: blur(24px); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand > span:last-child { display: grid; }
.brand b { font-size: 22px; line-height: 1; }
.brand small { margin-top: 7px; color: var(--green); letter-spacing: .22em; font-size: 9px; font-weight: 800; }
.brand-mark { width: 42px; height: 42px; padding: 9px; border-radius: 14px; background: linear-gradient(145deg, var(--green), #0e8b6b); box-shadow: 0 10px 28px rgba(40,216,161,.2); display: flex; align-items: end; justify-content: center; gap: 3px; }
.brand-mark i { width: 5px; background: #04281e; border-radius: 4px 4px 1px 1px; transform: skew(-9deg); }
.brand-mark i:nth-child(1) { height: 11px; }.brand-mark i:nth-child(2) { height: 20px; }.brand-mark i:nth-child(3) { height: 15px; }
.side-nav { display: grid; gap: 7px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 13px; border-radius: 14px; color: var(--muted); transition: .18s ease; }
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-link.active { color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px rgba(40,216,161,.12); }
.nav-icon { width: 24px; text-align: center; font-size: 18px; }
.nav-label { font-weight: 700; font-size: 14px; }
.sidebar-foot { margin-top: auto; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.025); color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 8px; }
.privacy-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }
.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 86px; padding: 17px clamp(20px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(7,17,30,.73); border-bottom: 1px solid var(--line); backdrop-filter: blur(22px); }
.topbar h1 { margin: 2px 0 0; font-size: clamp(20px, 2vw, 28px); }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.data-chip { min-height: 34px; padding: 0 12px; display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.data-chip span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px rgba(242,184,75,.65); }
.icon-button, .language-button, .primary-button, .secondary-button, .danger-button { border: 0; color: var(--text); transition: transform .16s ease, background .16s ease; }
.icon-button:active, .language-button:active, .primary-button:active, .secondary-button:active, .danger-button:active { transform: scale(.97); }
.icon-button, .language-button { width: 40px; height: 40px; border-radius: 13px; background: var(--panel-soft); border: 1px solid var(--line); }
.language-button { color: var(--green); font-size: 12px; font-weight: 900; }
.primary-button, .secondary-button, .danger-button { min-height: 42px; padding: 0 15px; border-radius: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.primary-button { background: var(--green); color: #02251b; box-shadow: 0 10px 24px rgba(40,216,161,.16); }
.secondary-button { background: var(--panel-soft); border: 1px solid var(--line); }
.danger-button { background: var(--red); color: #2f050b; }

#app { padding: 30px clamp(20px, 4vw, 54px) 70px; max-width: 1580px; margin: 0 auto; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 18px; margin-bottom: 18px; }
.glass { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.portfolio-hero { position: relative; overflow: hidden; padding: clamp(22px, 3vw, 34px); min-height: 230px; display: flex; flex-direction: column; justify-content: space-between; }
.portfolio-hero::after { content: ""; position: absolute; width: 250px; height: 250px; inset-inline-end: -80px; top: -110px; border-radius: 50%; background: var(--accent, var(--green)); filter: blur(72px); opacity: .16; }
.hero-meta, .section-head, .holding-head, .holding-bottom, .summary-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.hero-meta { position: relative; z-index: 1; }
.market-label { color: var(--muted); font-size: 12px; }
.refresh-button { border: 0; background: transparent; color: var(--green); font-weight: 800; display: inline-flex; align-items: center; gap: 7px; }
.hero-value { position: relative; z-index: 1; }
.hero-value small { display: block; color: var(--muted); margin-bottom: 7px; }
.hero-value strong { font-size: clamp(32px, 5vw, 54px); letter-spacing: -.03em; }
.hero-value .masked { letter-spacing: .14em; }
.hero-change { margin-top: 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.profit { color: var(--green) !important; }.loss { color: var(--red) !important; }.neutral { color: var(--amber) !important; }
.pill { padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.pill.profit { background: var(--green-soft); }.pill.loss { background: var(--red-soft); }.pill.neutral { background: rgba(242,184,75,.12); }
.allocation { padding: 22px; display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 22px; }
.donut { --value: 64; width: 124px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--accent, var(--green)) calc(var(--value) * 1%), rgba(255,255,255,.055) 0); position: relative; display: grid; place-items: center; }
.donut::after { content: ""; width: 84px; aspect-ratio: 1; border-radius: inherit; background: #101d2b; border: 1px solid var(--line); }
.donut-label { position: absolute; z-index: 1; text-align: center; }.donut-label b { display: block; font-size: 20px; }.donut-label small { color: var(--muted); font-size: 9px; }
.mini-stats { display: grid; gap: 14px; }.mini-stat { padding-bottom: 11px; border-bottom: 1px solid var(--line); }.mini-stat:last-child { border: 0; padding: 0; }.mini-stat small { color: var(--muted); display: block; font-size: 10px; }.mini-stat b { display: block; margin-top: 4px; font-size: 14px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.summary-card { padding: 17px; min-width: 0; }.summary-card small { color: var(--muted); font-size: 10px; }.summary-card strong { display: block; margin-top: 7px; font-size: clamp(15px, 2vw, 21px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.summary-card span { margin-top: 5px; display: block; font-size: 10px; color: var(--muted); }
.toolbar { margin: 0 0 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-wrap { flex: 1 1 280px; position: relative; }.search-wrap::before { content: "⌕"; position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 22px; }.search-input, .field input, .field select { width: 100%; height: 46px; background: rgba(15, 29, 43, .8); color: var(--text); border: 1px solid var(--line); border-radius: 14px; outline: none; }.search-input { padding-inline: 43px 14px; }.search-input:focus, .field input:focus, .field select:focus { border-color: rgba(40,216,161,.55); box-shadow: 0 0 0 3px rgba(40,216,161,.08); }
.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }.chip { white-space: nowrap; min-height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-soft); color: var(--muted); padding: 0 12px; }.chip.active { color: #02251b; background: var(--green); border-color: transparent; font-weight: 900; }
.section-head { margin: 23px 0 13px; }.section-head h2 { margin: 0; font-size: 18px; }.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.holdings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.holding-card { padding: 18px; position: relative; overflow: hidden; }
.holding-card::before { content: ""; position: absolute; inset-inline-start: 0; top: 20px; bottom: 20px; width: 3px; border-radius: 3px; background: var(--state); }
.asset-info { display: flex; align-items: center; gap: 11px; min-width: 0; }.asset-logo { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(145deg, var(--panel-strong), rgba(255,255,255,.07)); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 900; color: var(--accent, var(--green)); }.asset-copy { min-width: 0; }.asset-copy h3 { margin: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.asset-copy p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }.card-menu { border: 0; color: var(--muted); background: transparent; font-size: 18px; }
.holding-body { margin: 20px 0 16px; display: grid; grid-template-columns: 1fr 142px; gap: 18px; align-items: center; }.price-block small { display: block; color: var(--muted); font-size: 10px; }.price-block strong { display: block; margin: 5px 0 12px; font-size: 23px; }.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }.metric { padding: 9px; border-radius: 11px; background: rgba(255,255,255,.025); }.metric span { display: block; color: var(--muted); font-size: 9px; }.metric b { display: block; margin-top: 3px; font-size: 11px; }
.gauge-wrap { text-align: center; }.gauge { position: relative; width: 138px; height: 74px; overflow: hidden; }.gauge-arc { position: absolute; width: 138px; height: 138px; border-radius: 50%; background: conic-gradient(from 270deg, var(--red) 0 16.5%, var(--amber) 16.5% 33%, var(--green) 33% 50%, transparent 50% 100%); }.gauge-arc::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #111f2e; }.needle { position: absolute; z-index: 2; width: 55px; height: 2px; background: var(--text); border-radius: 4px; bottom: 5px; left: 14px; transform-origin: calc(100% - 1px) 50%; transform: rotate(var(--needle)); transition: transform .6s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 9px rgba(255,255,255,.55); }.needle::after { content: ""; position: absolute; right: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--text); }.gauge-value { margin-top: 4px; font-weight: 900; font-size: 12px; }
.holding-bottom { padding-top: 12px; border-top: 1px solid var(--line); }.quantity { color: var(--muted); font-size: 10px; }.quantity b { color: var(--text); font-size: 12px; }.card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }.mini-button { min-height: 32px; padding: 0 9px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--muted); font-size: 10px; display: inline-flex; align-items: center; justify-content: center; }.mini-button:hover { color: var(--text); }.mini-button.danger:hover { color: var(--red); border-color: rgba(255,99,118,.3); }
.empty-state { grid-column: 1/-1; padding: 52px 20px; text-align: center; }.empty-state .empty-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--green-soft); color: var(--green); font-size: 27px; }.empty-state h3 { margin: 0; }.empty-state p { color: var(--muted); font-size: 12px; }

.simulator-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr); gap: 18px; }.sim-card { padding: clamp(20px,3vw,30px); }.sim-card h2 { margin: 0 0 4px; }.sim-card > p { color: var(--muted); margin: 0 0 24px; font-size: 12px; }.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }.field { display: grid; gap: 7px; }.field.full { grid-column: 1/-1; }.field label { color: var(--muted); font-size: 11px; font-weight: 700; }.field input, .field select { padding: 0 12px; }.result-panel { min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, rgba(154,140,255,.13), var(--panel)); }.scenario-value { margin: 10px 0 24px; font-size: clamp(36px,6vw,62px); }.scenario-details { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }.scenario-details div { padding: 13px; background: rgba(255,255,255,.025); border-radius: 13px; }.scenario-details small { color: var(--muted); display: block; }.scenario-details b { display: block; margin-top: 6px; }
.settings-list { display: grid; gap: 12px; max-width: 850px; }.setting-row { min-height: 78px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }.setting-copy h3 { margin: 0; font-size: 14px; }.setting-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }.switch { width: 48px; height: 27px; padding: 3px; border-radius: 999px; background: var(--panel-soft); border: 1px solid var(--line); }.switch::after { content: ""; display: block; width: 19px; height: 19px; border-radius: 50%; background: var(--muted); transition: .2s; }.switch.active { background: var(--green-soft); border-color: rgba(40,216,161,.25); }.switch.active::after { background: var(--green); transform: translateX(-19px); } html[dir="ltr"] .switch.active::after { transform: translateX(19px); }
.notice { padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(242,184,75,.18); background: rgba(242,184,75,.07); color: #e8cf9a; font-size: 11px; line-height: 1.8; }

.modal { width: min(610px, calc(100% - 28px)); color: var(--text); background: #0e1b2a; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 30px 90px rgba(0,0,0,.55); padding: 0; }
.modal::backdrop { background: rgba(1,7,13,.75); backdrop-filter: blur(8px); }.modal form { padding: 22px; }.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }.modal-head h2 { margin: 3px 0 0; }.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }.confirm-modal { max-width: 420px; text-align: center; }.confirm-icon { width: 56px; height: 56px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 18px; color: var(--red); background: var(--red-soft); font-size: 23px; font-weight: 900; }.confirm-modal p { color: var(--muted); }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translate(-50%, 25px); opacity: 0; pointer-events: none; padding: 12px 16px; background: #1b2b3b; border: 1px solid var(--line); color: var(--text); border-radius: 13px; box-shadow: var(--shadow); font-size: 12px; transition: .25s; }.toast.show { transform: translate(-50%, 0); opacity: 1; }
.mobile-nav { display: none; }
.hidden-values .money { filter: blur(9px); user-select: none; }

@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }.allocation { grid-template-columns: 128px 1fr; }.summary-grid { grid-template-columns: repeat(2,1fr); }.holdings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .app-shell { display: block; }.sidebar { display: none; }.topbar { min-height: 72px; padding: 11px 16px; }.topbar .eyebrow, .data-chip, .primary-button b { display: none; }.topbar h1 { font-size: 19px; }.top-actions { gap: 6px; }.primary-button { width: 40px; min-height: 40px; padding: 0; }.icon-button, .language-button { width: 38px; height: 38px; }
  #app { padding: 17px 13px 35px; }.portfolio-hero { min-height: 205px; }.hero-value strong { font-size: 37px; }.allocation { grid-template-columns: 105px 1fr; padding: 17px; }.donut { width: 102px; }.donut::after { width: 68px; }.summary-grid { gap: 8px; }.summary-card { padding: 13px; }.summary-card strong { font-size: 15px; }
  .holding-card { padding: 15px; }.holding-body { grid-template-columns: 1fr 118px; gap: 10px; }.gauge, .gauge-arc { width: 116px; }.gauge-arc { height: 116px; }.needle { width: 45px; left: 14px; }.metrics { grid-template-columns: 1fr 1fr; }.holding-bottom { align-items: flex-end; }
  .simulator-grid { grid-template-columns: 1fr; }.form-grid { grid-template-columns: 1fr; }.field.full { grid-column: auto; }.scenario-details { grid-template-columns: 1fr 1fr; }
  .mobile-nav { position: fixed; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); left: 10px; right: 10px; bottom: max(9px, env(safe-area-inset-bottom)); padding: 8px 5px; background: rgba(12,25,38,.92); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 50px rgba(0,0,0,.46); backdrop-filter: blur(22px); }.mobile-nav .nav-link { min-height: 49px; padding: 5px; display: grid; justify-items: center; gap: 1px; border-radius: 13px; }.mobile-nav .nav-icon { font-size: 17px; }.mobile-nav .nav-label { font-size: 8px; }
}
@media (max-width: 420px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }.holding-body { grid-template-columns: 1fr; }.gauge-wrap { width: 138px; margin-inline: auto; }.gauge, .gauge-arc { width: 138px; }.gauge-arc { height: 138px; }.needle { width: 55px; left: 14px; }.allocation { grid-template-columns: 92px 1fr; gap: 13px; }.donut { width: 90px; }.donut::after { width: 60px; }.hero-meta { align-items: flex-start; }.market-label { max-width: 190px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
