@font-face {
  font-family: "IRANSansX";
  src: url("./fonts/IRANSansX-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IRANSansX";
  src: url("./fonts/IRANSansX-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme:dark;
  --bg:#14101f;
  --panel:#1d172b;
  --soft:#2b213d;
  --line:#3d3150;
  --text:#f8f2ff;
  --muted:#c0afd2;
  --pink:#8339e6;
  --bright:#bb87ff;
  --good:#67dec5;
  --bad:#ffa0b9;
  --shadow:0 12px 32px #08051130;
  font-family:"IRANSansX",Tahoma,Arial,sans-serif;
  font-size:14px;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  background:#100b19;
  color:var(--text);
}
body.light {
  color-scheme:light;
  --bg:#faf5ff;
  --panel:#fff;
  --soft:#efe1ff;
  --line:#dfcaf8;
  --text:#301b49;
  --muted:#695580;
  --good:#007e6a;
  --bad:#a12c53;
  --shadow:0 9px 28px #5930910e;
  background:#eee3fa;
}
button,input,select {
  font:inherit;
  color:inherit;
}
button {
  border:0;
  cursor:pointer;
}
button:focus-visible,input:focus-visible,select:focus-visible {
  outline:2px solid var(--bright);
  outline-offset:2px;
}
button:disabled {
  opacity:.45;
}
h1,h2,h3,p {
  margin:0;
}
h1 {
  font-size:19px;
}
h2 {
  font-size:16px;
}
h3 {
  font-size:14px;
}
.app {
  max-width:1080px;
  height:100dvh;
  margin:auto;
  position:relative;
  display:flex;
  flex-direction:column;
  background:radial-gradient(ellipse at 88% 0%,var(--soft),transparent 45%),var(--bg);
  overflow:hidden;
  box-shadow:0 0 60px #0004;
}
.bar {
  border-bottom:1px solid var(--line);
  background:var(--bg);
}
.bar-inner {
  display:flex;
  direction:rtl;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:68px;
  padding:8px clamp(15px,4vw,34px);
}
.brand,.bar-tools,.coach-identity {
  display:flex;
  align-items:center;
  gap:10px;
}
.brand strong { direction:inherit; }
[lang="en"] .brand strong { direction:ltr; }
.brand-mark,.coach-avatar {
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  flex:none;
  border-radius:14px;
  background:linear-gradient(145deg,#9b5def,#6730c4);
  color:#fff;
  font-size:22px;
  font-weight:700;
}
.brand-mark {
  display:block;
  border-radius:50%;
  object-fit:cover;
}
.coach-avatar {
  background:var(--soft);
}
#header-menu {
  width:39px;
  height:39px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  font-size:21px;
}
.bar strong {
  font-size:17px;
}
main {
  flex:1;
  min-height:0;
  overflow:auto;
  padding:24px clamp(15px,4vw,34px) 28px;
  scrollbar-width:thin;
  scrollbar-color:var(--line) transparent;
}
.greeting {
  margin:0 0 22px;
}
.greeting h1 {
  margin-top:6px;
  font-size:clamp(25px,5vw,38px);
  overflow-wrap:anywhere;
}
.greeting time { color:var(--muted); font-size:12px; }
.muted,small {
  color:var(--muted);
}
small {
  display:block;
  font-size:11px;
  line-height:1.8;
}
.lang {
  font-size:11px;
  border:1px solid var(--line);
  border-radius:24px;
  background:var(--panel);
  padding:4px;
  display:flex;
  direction:ltr;
  gap:3px;
  align-items:center;
  flex:none;
}
.lang span {
  padding:5px 10px;
  border-radius:14px;
}
.lang .selected {
  background:#7038c6;
  color:#fff;
}
.card {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:23px;
  padding:18px;
  margin-bottom:13px;
  box-shadow:var(--shadow);
}
.dashboard {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:14px;
}
.dashboard > .card { margin:0; }
.wealth {
  position:relative;
  isolation:isolate;
  overflow:hidden;
  color:#fff;
  background:radial-gradient(ellipse at 8% 12%,#ad76f5,transparent 63%),linear-gradient(128deg,#7137cc,#482890);
  border-color:#aa82ed7d;
  padding:clamp(16px,4vw,24px);
}
.wealth small { color:#f1e5ff; }
.wealth-content { position:relative; z-index:1; }
.wealth-art {
  position:absolute;
  inset-block-start:10px;
  inset-inline-end:2%;
  width:170px;
  height:150px;
  pointer-events:none;
  opacity:.75;
}
.wealth-art i {
  position:absolute;
  width:110px;
  height:68px;
  inset-block-start:24px;
  inset-inline-start:20px;
  border:1px solid #f1dfff65;
  border-radius:15px;
  background:linear-gradient(125deg,#ffffff3d,#ffffff06);
  transform:rotate(-18deg);
}
.wealth-art i:nth-child(2) { translate:16px 16px; }
.wealth-art i:nth-child(3) { translate:32px 32px; }
.wealth-art i:last-child::after {
  content:"";
  position:absolute;
  inset:auto 12px 12px auto;
  width:22px;
  height:15px;
  border:1px solid #f1dfff87;
  border-radius:4px;
}
.flex {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.icon {
  display:inline-grid;
  place-items:center;
  min-width:33px;
  height:33px;
  border-radius:11px;
  background:var(--soft);
  margin-inline-end:6px;
}
.add,.primary {
  background:linear-gradient(135deg,#8c50df,#662ac3);
  color:#fff;
  box-shadow:0 8px 20px #8339e660;
}
.amount {
  margin:6px 0 20px;
  font-size:clamp(31px,6vw,47px);
  font-variant-numeric:tabular-nums;
  font-weight:bold;
  overflow-wrap:anywhere;
}
.amount small {
  display:inline;
  font-size:12px;
  margin-inline-start:6px;
}
.asset-links,.flow-metrics,.quick-actions {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.metric {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  text-align:start;
  padding:10px 8px;
  font-size:12px;
  background:var(--soft);
  border:1px solid var(--line);
  border-radius:14px;
}
.metric > span:last-child { min-width:0; overflow-wrap:anywhere; }
.wealth .metric {
  background:#2d115c65;
  border-color:#ffffff35;
}
.metric-icon {
  display:grid;
  place-items:center;
  flex:none;
  width:30px;
  height:30px;
  border-radius:9px;
  font-size:17px;
  background:var(--panel);
}
.wealth .metric-icon { background:#ffffff24; }
.cashflow-heading { margin-bottom:12px; flex-wrap:wrap; }
.cashflow > .metric { width:100%; margin-top:10px; }
.chip {
  background:var(--soft);
  border:1px solid var(--line);
  border-radius:22px;
  padding:8px 12px;
}
.quick-actions { margin-top:13px; }
.quick-action {
  display:flex;
  align-items:center;
  gap:9px;
  padding:11px;
  border-radius:14px;
  background:var(--soft);
  border:1px solid var(--line);
}
.quick-action span { font-size:20px; }
.good {
  color:var(--good);
}
.bad {
  color:var(--bad);
}
.quick {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:13px;
}
.coach p {
  margin-top:12px;
  line-height:1.9;
}
.coach-tip {
  margin-top: 14px;
  padding: 12px;
  background: var(--soft);
  border-radius: 14px;
}
.coach-tip p {
  margin-top: 5px;
}
.coach-next {
  margin-top: 12px;
}
.nav-item {
  background:none;
  border-radius:15px;
  display:grid;
  place-content:center;
  gap:5px;
  font-size:10px;
  color:var(--muted);
  min-height:54px;
  padding:3px;
}
.nav-item b {
  font-size:22px;
  font-weight:400;
}
.nav-item.active {
  background:var(--soft);
  color:var(--text);
  font-weight:700;
}
.add {
  height:55px;
  width:55px;
  border-radius:19px;
  font-size:31px;
  justify-self:center;
  transform:translateY(-8px);
}
nav {
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:4px;
  padding:7px 9px max(7px,env(safe-area-inset-bottom));
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:19px 19px 0 0;
  z-index:1;
}
.page-title {
  padding:7px 5px 23px;
}
.tabs {
  display:flex;
  background:var(--soft);
  border-radius:15px;
  padding:4px;
  margin-bottom:10px;
}
.tabs button {
  flex:1;
  border-radius:12px;
  background:none;
  padding:11px 4px;
  color:var(--muted);
  font-size:12px;
}
.tabs button.active {
  background:var(--panel);
  color:var(--text);
  font-weight:bold;
}
input,select {
  background:var(--bg);
  border:1px solid var(--line);
  width:100%;
  padding:13px;
  border-radius:14px;
}
input::placeholder {
  color:var(--muted);
  opacity:.7;
}
.empty {
  text-align:center;
  padding:45px 14px;
  color:var(--muted);
}
.empty b {
  display:block;
  font-size:37px;
  margin-bottom:22px;
}
.row {
  display:flex;
  align-items:center;
  gap:9px;
  background:transparent;
  width:100%;
  padding:13px 0;
  text-align:start;
}
.row+.row {
  border-top:1px solid var(--line);
}
.row .details {
  flex:1;
  min-width:0;
  overflow-wrap:anywhere;
}
.row strong {
  display:block;
  margin-bottom:5px;
}
.section-title {
  border-inline-start:4px solid var(--pink);
  padding-inline-start:8px;
  margin:20px 4px 12px;
}
.period {
  margin:12px 0;
}
.period button,#close {
  border-radius:12px;
  background:var(--soft);
  padding:8px 13px;
}
.progress {
  height:8px;
  background:var(--soft);
  border-radius:10px;
  overflow:hidden;
  margin-top:9px;
}
.progress span {
  display:block;
  height:100%;
  background:var(--bright);
}
dialog {
  border:0;
  background:none;
  color:inherit;
  width:min(480px,100%);
  max-width:none;
  max-height:88dvh;
  padding:0;
  margin:auto auto 0;
}
dialog::backdrop {
  background:#0b0614ad;
}
.sheet {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:27px 27px 0 0;
  padding:22px 24px max(19px,env(safe-area-inset-bottom));
  min-height:200px;
}
.sheet h2 {
  text-align:center;
  margin:13px 0 20px;
}
.handle {
  height:4px;
  width:40px;
  background:var(--muted);
  opacity:.46;
  border-radius:10px;
  margin:auto;
}
#close {
  position:absolute;
  inset-inline-end:16px;
  top:13px;
}
.choice {
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:18px;
  padding:13px;
  margin-bottom:9px;
}
.choice .icon {
  min-width:43px;
  height:43px;
}
.sheet label {
  display:block;
  font-size:12px;
  margin:13px 0 5px;
}
.sheet .money {
  font-size:26px;
  text-align:center;
  padding:15px;
}
.primary {
  width:100%;
  padding:14px;
  border-radius:16px;
  font-weight:bold;
  margin-top:16px;
}
.secondary {
  width:100%;
  padding:11px;
  margin-top:8px;
  background:var(--soft);
  border-radius:13px;
}
.danger {
  color:var(--bad);
}
#toast {
  display:none;
  position:absolute;
  z-index:4;
  bottom:76px;
  left:50%;
  transform:translateX(-50%);
  background:var(--text);
  color:var(--bg);
  padding:11px 17px;
  border-radius:20px;
  white-space:nowrap;
}
#toast.visible {
  display:block;
}
.sheet .quick {
  flex-wrap:nowrap;
  overflow:auto;
}
.sheet .quick button {
  white-space:nowrap;
}
.error {
  color:var(--bad);
  min-height:1em;
  margin-top:7px;
}
.net {
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--line);
  flex-wrap:wrap;
}
.wealth .net { border-color:#ffffff35; }
.ledger-tools {
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:10px;
}
.ledger-tools select {
  flex:1;
  min-width:0;
}
.ledger-tools button {
  white-space:nowrap;
}
.business-filter {
  margin-top:8px;
}
.asset-status {
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
}
.market-source {
  display:block;
  margin-top:6px;
}
.market-source a,.asset-status a {
  color:inherit;
}
.share-explanation {
  margin-top:10px;
  color:var(--muted);
  line-height:1.8;
}
.sheet .share-option {
  display:flex;
  align-items:center;
  gap:8px;
}
.share-option input {
  width:auto;
  accent-color:var(--pink);
}
.row+.progress {
  margin:0 0 12px;
}
.row .details+span {
  text-align:end;
}
@media (min-width:720px) {
  .dashboard {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
  }
  nav {
    width:min(100%,600px);
    align-self:center;
  }
}
@media (hover:hover) {
  .chip:hover,.metric:hover,.quick-action:hover,.nav-item:hover,#header-menu:hover {
    filter:brightness(1.15);
  }
}
@media (prefers-reduced-motion:no-preference) {
  .chip,.metric,.quick-action,.nav-item,#header-menu {
    transition:filter .16s ease;
  }
}
