:root{
  --font:"IRANSansWeb",Tahoma,Arial,sans-serif;
  --container-desktop:1672px;
  --container-mobile:941px;

  --green:#69d653;
  --red:#ff5d58;
  --blue:#4aa3ff;
  --warn:#f0a51a;

  --radius-xl:22px;
  --radius-lg:18px;
  --radius-md:14px;
  --gold:#c98b22;
  --gold-bright:#f0b93e;
  --gold-soft:rgba(201,139,34,.12);
  --transition:.18s ease;
}

html[data-theme="dark"]{
  --bg:#111415;
  --bg-soft:#111415;
  --surface:#101519;
  --surface-2:#12191d;
  --surface-3:#171d20;
  --line:#2b2d2a;
  --border:rgba(194,137,34,.38);
  --border-strong:rgba(214,156,46,.55);
  --text:#f4f1ea;
  --muted:#a8a9a8;
  --muted-2:#767b7c;
  --card-shadow:0 22px 60px rgba(0,0,0,.35);
  --soft-shadow:0 14px 45px rgba(0,0,0,.22);
  --header-grad:radial-gradient(circle at 82% -30%,rgba(215,151,35,.25),transparent 28%),
                linear-gradient(180deg,rgba(20,26,30,.98),rgba(11,16,19,.98));
}

html[data-theme="light"]{
  --bg:#e8e1d5;
  --bg-soft:#e8e1d5;
  --surface:#ffffff;
  --surface-2:#fffdfa;
  --surface-3:#fffaf2;
  --line:#eee6da;
  --border:rgba(205,145,38,.22);
  --border-strong:rgba(201,139,34,.42);
  --text:#1f1f1d;
  --muted:#72706b;
  --muted-2:#96918a;
  --card-shadow:0 14px 42px rgba(97,71,28,.10);
  --soft-shadow:0 10px 30px rgba(97,71,28,.08);
  --header-grad:radial-gradient(circle at 88% -35%,rgba(217,161,57,.18),transparent 31%),
                linear-gradient(180deg,#fff,#fffdfa);
}

*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  font-family:var(--font);
  background:
    radial-gradient(circle at 92% 0%,var(--bg-soft),transparent 28%),
    linear-gradient(180deg,var(--bg),var(--bg-soft));
  color:var(--text);
  direction:rtl;
  -webkit-font-smoothing:antialiased;
  text-rendering:geometricPrecision;
}
a{text-decoration:none;color:inherit}
button{font-family:inherit}
.text-green{color:var(--green)!important}
.text-red{color:var(--red)!important}
.text-blue{color:var(--blue)!important}
.text-warn{color:var(--warn)!important}

/* ---------- Common components ---------- */
.page{
  margin-inline:auto;
  padding:8px;
}
.desktop-page{max-width:var(--container-desktop)}
.mobile-page{max-width:var(--container-mobile);padding:0 10px 16px}

.glass-card{
  background:
    radial-gradient(circle at 100% 0%,rgba(201,139,34,.06),transparent 28%),
    linear-gradient(145deg,var(--surface),var(--surface-2));
  border:1px solid var(--border);
  box-shadow:var(--soft-shadow);
  border-radius:var(--radius-xl);
}

.logo{
  display:flex;
  align-items:center;
  gap:13px;
}
.logo-bars{
  width:82px;
  height:52px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  align-items:end;
  gap:6px;
  flex:0 0 auto;
}
.logo-bars span,
.summary-bars span{
  display:block;
  border-radius:8px 8px 3px 3px;
  background:linear-gradient(145deg,#fff0a7 0%,#f7c247 34%,#c98b22 72%,#8a5c14 100%);
  box-shadow:0 6px 18px rgba(201,139,34,.26);
}
.logo-bars span{height:26px}
.logo-bars span:nth-child(2){height:38px}
.logo h1{
  margin:0;
  font-size:25px;
  line-height:1;
  font-weight:950;
  color:var(--gold-bright);
  letter-spacing:-1.5px;
}
.logo p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
}

.icon-box{
  width:50px;
  height:50px;
  border-radius:15px;
  border:1px solid var(--border);
  color:var(--gold-bright);
  background:var(--gold-soft);
  display:grid;
  place-items:center;
  font-size:24px;
  flex:0 0 auto;
}
.icon-btn{
  width:46px;
  height:46px;
  border:0;
  background:transparent;
  color:var(--text);
  display:grid;
  place-items:center;
  font-size:24px;
  border-radius:14px;
  position:relative;
}
.icon-btn:hover{background:var(--gold-soft);color:var(--gold-bright)}
.badge-notif{
  position:absolute;
  top:3px;
  left:0;
  background:var(--gold-bright);
  color:#1f1604;
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  border-radius:50%;
  font-size:12px;
  font-weight:900;
}
.action-button{
  border:1px solid var(--border-strong);
  background:linear-gradient(180deg,var(--gold-soft),rgba(201,139,34,.05));
  color:var(--gold-bright);
  border-radius:12px;
  padding:0 22px;
  min-height:44px;
  min-width:128px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-weight:850;
  transition:var(--transition);
}
.action-button:hover{border-color:var(--gold-bright);transform:translateY(-1px)}
.action-button.fill{
  color:#241704;
  border-color:transparent;
  background:linear-gradient(135deg,#f8cf68,#bd7d16);
}
.user-mini{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:260px;
}
.avatar{
  width:54px;
  height:54px;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:var(--gold-bright);
  border:1px solid var(--border);
  background:var(--gold-soft);
  font-size:24px;
}
.user-mini strong{
  display:block;
  font-size:15px;
  font-weight:850;
  margin-bottom:5px;
  white-space:nowrap;
}
.user-mini span{
  color:var(--muted);
  font-size:13px;
}
.user-mini span i{color:var(--gold-bright);margin-left:5px}

.summary-card{
  min-height:134px;
  padding:22px 24px;
  display:flex;
  flex-direction:row-reverse;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.summary-card .label{
  color:var(--text);
  font-weight:800;
  font-size:18px;
  margin:0 0 12px;
}
.summary-card h2{
  margin:0;
  font-size:34px;
  font-weight:950;
  letter-spacing:-1px;
}
.summary-card h2 small{
  font-size:14px;
  color:var(--text);
  font-weight:500;
  margin-right:8px;
}
.summary-card .sub{
  display:block;
  margin-top:12px;
  color:var(--muted);
  font-size:14px;
}
.summary-card .mini-outline{
  margin-top:10px;
  border:1px solid var(--border-strong);
  color:var(--gold-bright);
  background:transparent;
  border-radius:9px;
  padding:6px 20px;
  font-weight:800;
}
.summary-bars{
  width:52px;
  height:42px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  align-items:end;
  gap:4px;
}
.summary-bars span{height:18px}
.summary-bars span:nth-child(2){height:28px}

.notice{
  min-height:68px;
  padding:14px 22px;
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:center;
  gap:20px;
  margin-top:16px;
}
.notice-title{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--gold-bright);
  font-size:18px;
  font-weight:900;
  white-space:nowrap;
}
.notice p{
  margin:0;
  color:var(--text);
  text-align:center;
  line-height:2;
}

.section-panel{
  margin-top:18px;
  padding:20px 22px;
}
.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:16px;
}
.section-head h2{
  margin:0;
  font-size:22px;
  font-weight:900;
}
.category{
  margin-top:8px;
}
.category-title{
  display:flex;
  align-items:center;
  color:var(--gold-bright);
  font-size:18px;
  font-weight:900;
  margin:0 0 14px;
}
.category-title::after{
  content:"";
  height:1px;
  flex:1;
  margin-right:14px;
  background:linear-gradient(90deg,transparent,var(--border-strong));
}
.product-grid{
  display:grid;
  gap:18px;
}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-4{grid-template-columns:repeat(4,1fr)}
.product-card{
  min-height:126px;
  padding:18px;
  border-radius:16px;
  border:1px solid var(--border-strong);
  background:
    radial-gradient(circle at 50% -20%,rgba(201,139,34,.08),transparent 48%),
    linear-gradient(145deg,var(--surface),var(--surface-2));
  box-shadow:0 12px 30px rgba(0,0,0,.10);
}
.product-card h3{
  margin:0 0 16px;
  font-size:19px;
  font-weight:900;
  text-align:center;
}
.price-pair{
  display:grid;
  grid-template-columns:1fr 1px 1fr;
  align-items:center;
  gap:12px;
}
.price-divider{
  height:46px;
  background:var(--line);
}
.price-side{
  text-align:center;
}
.price-side small{
  display:block;
  font-size:13px;
  font-weight:850;
  margin-bottom:5px;
}
.price-side strong{
  font-size:21px;
  line-height:1.1;
  font-weight:950;
}
.buy small,.buy strong{color:var(--green)}
.sell small,.sell strong{color:var(--red)}
.validity{
  min-height:29px;
  margin-top:14px;
  padding:4px 12px;
  border:1px solid var(--border-strong);
  border-radius:999px;
  color:var(--gold-bright);
  background:var(--gold-soft);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  font-size:13px;
  font-weight:850;
  white-space:nowrap;
}

.transactions{
  margin-top:18px;
  padding:18px 22px;
}
.transactions h2{
  margin:0 0 14px;
  font-size:22px;
  font-weight:900;
}
.table{
  --bs-table-bg:transparent;
  --bs-table-color:var(--text);
  --bs-table-border-color:var(--line);
  color:var(--text);
}
.table thead th{
  color:var(--muted);
  background:rgba(127,127,127,.05);
  font-size:13px;
  font-weight:850;
  padding:12px 14px;
  white-space:nowrap;
}
.table tbody td{
  padding:12px 14px;
  font-size:14px;
  color:var(--text);
  white-space:nowrap;
}
.status{
  display:inline-flex;
  align-items:center;
  gap:7px;
  font-weight:900;
}
.status.success{color:var(--green)}
.status.pending{color:var(--warn)}
.more-btn{
  margin-top:8px;
  border:1px solid var(--border-strong);
  color:var(--gold-bright);
  background:transparent;
  border-radius:10px;
  padding:8px 22px;
  font-weight:850;
  display:inline-flex;
  align-items:center;
  gap:10px;
}

/* ---------- Desktop layout exactly close to provided desktop frames ---------- */
.desktop-header{
  min-height:86px;
  border-radius:14px;
  padding:14px 26px;
  background:var(--header-grad);
  border:1px solid var(--border);
  display:grid;
  grid-template-columns:auto 1fr auto auto;
  align-items:center;
  gap:20px;
  box-shadow:var(--soft-shadow);
}
.desktop-header .logo{min-width:280px}
.desktop-header .top-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
}
.desktop-header .top-icons{
  display:flex;
  align-items:center;
  gap:8px;
}
.desktop-summary{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:26px;
  margin-top:26px;
}
.desktop-market{margin-top:18px}
.desktop-market .product-card{min-height:125px}
.desktop-market .category + .category{margin-top:20px}

/* ---------- Mobile layout exactly close to provided mobile frames ---------- */
.mobile-header{
  padding:28px 28px 0;
}
.mobile-topline{
  display:grid;
  grid-template-columns:1fr auto;
  align-items:start;
  gap:16px;
}
.mobile-notifications{
  display:flex;
  align-items:center;
  gap:12px;
}
.mobile-notifications .icon-btn{
  width:58px;height:58px;
  background:var(--surface);
  border:1px solid var(--border);
  box-shadow:var(--soft-shadow);
}
.mobile-header .logo h1{font-size:42px}
.mobile-header .logo p{font-size:14px}
.mobile-user{
  display:flex;
  align-items:center;
  gap:14px;
  margin-top:12px;
}
.mobile-user .avatar{width:56px;height:56px}
.mobile-user strong{font-size:20px;display:block;margin-bottom:6px}
.mobile-user span{color:var(--muted);font-size:16px}
.mobile-actions{
  margin-top:24px;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
}
.mobile-actions .action-button{
  min-width:0;
  min-height:68px;
  font-size:17px;
  flex-direction:column-reverse;
  gap:6px;
  border-radius:14px;
}
.mobile-summary{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin-top:18px;
}
.mobile-summary .summary-card{
  padding:18px;
  min-height:158px;
  display:block;
  text-align:center;
}
.mobile-summary .summary-card .icon-box{
  width:50px;height:50px;font-size:23px;
  margin:0 auto 12px;
}
.mobile-summary .summary-card .label{
  font-size:18px;
}
.mobile-summary .summary-card h2{
  font-size:31px;
}
.mobile-summary .summary-card .sub{
  font-size:13px;
}
.mobile-summary .mini-outline{width:100%;margin-top:14px}
.mobile-notice{
  margin-top:18px;
  min-height:82px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:16px;
  padding:16px 22px;
}
.mobile-notice .notice-title{
  display:block;
  text-align:right;
  font-size:18px;
}
.mobile-notice p{
  text-align:right;
}
.mobile-time{
  color:var(--muted);
  white-space:nowrap;
}
.dot{
  width:10px;height:10px;border-radius:50%;
  background:var(--green);
  display:inline-block;
  margin-inline-end:8px;
}
.mobile-market{
  margin-top:18px;
  padding:20px 18px;
}
.mobile-market .section-head h2{
  font-size:21px;
}
.mobile-market .product-grid{gap:14px}
.mobile-market .grid-3{grid-template-columns:repeat(3,1fr)}
.mobile-market .grid-4{grid-template-columns:repeat(4,1fr)}
.mobile-market .product-card{
  min-height:224px;
  padding:16px 12px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.mobile-market .product-card h3{font-size:18px;margin-bottom:8px}
.mobile-market .price-pair{
  grid-template-columns:1fr;
  gap:8px;
}
.mobile-market .price-divider{display:none}
.mobile-market .price-side strong{font-size:22px}
.mobile-market .validity{
  font-size:12px;
  white-space:normal;
  line-height:1.5;
}
.mobile-actions-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:10px;
}
.trade-btn{
  height:38px;
  border-radius:8px;
  font-weight:900;
  border:1px solid;
  background:transparent;
}
.trade-btn.buy{
  color:var(--green);
  border-color:rgba(105,214,83,.55);
  background:rgba(105,214,83,.10);
}
.trade-btn.sell{
  color:var(--red);
  border-color:rgba(255,93,88,.55);
  background:rgba(255,93,88,.10);
}
.mobile-transactions{
  margin-top:18px;
  padding:18px;
}
.mobile-transactions h2{
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:var(--gold-bright);
  margin:0 0 14px;
  font-size:22px;
  font-weight:900;
}
.mobile-tx-row{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:14px;
  align-items:center;
  border-bottom:1px solid var(--line);
  padding:12px 0;
}
.mobile-tx-row:last-child{border-bottom:0}
.mobile-tx-row .date{
  color:var(--muted);
  font-size:14px;
  text-align:left;
}
.mobile-tx-row .mid{
  text-align:center;
  font-weight:850;
}
.mobile-tx-row .amount{
  font-weight:900;
  white-space:nowrap;
}
.bottom-nav{
  position:sticky;
  bottom:8px;
  z-index:10;
  margin:18px 0 0;
  min-height:92px;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:6px;
  padding:10px;
  background:linear-gradient(145deg,var(--surface),var(--surface-2));
  border:1px solid var(--border);
  border-radius:24px;
  box-shadow:var(--card-shadow);
}
.bottom-nav a{
  display:grid;
  place-items:center;
  align-content:center;
  gap:7px;
  color:var(--muted);
  border-radius:18px;
  font-weight:850;
  font-size:15px;
}
.bottom-nav i{font-size:27px}
.bottom-nav a.active{
  background:var(--gold-soft);
  color:var(--gold-bright);
}
i.bi{
    color: var(--bs-text-gray-900) !important;
}
/* Light theme refinements */
html[data-theme="light"] .action-button.fill{
  color:#5b3705;
  background:linear-gradient(135deg,#fff4d6,#f3cc7b);
}
html[data-theme="light"] .mobile-notifications .icon-btn{
  background:#fff;
}
html[data-theme="light"] .product-card{
  box-shadow:0 10px 28px rgba(121,87,28,.07);
}
html[data-theme="light"] .price-divider{
  background:#efe8dd;
}
html[data-theme="light"] .table thead th{
  background:#fbf8f2;
}

/* ---------- Real responsiveness ---------- */
@media (max-width:1200px){
  .desktop-header{
    grid-template-columns:1fr auto;
  }
  .desktop-header .top-actions{
    grid-column:1/-1;
    order:3;
    display:grid;
    grid-template-columns:repeat(4,1fr);
  }
  .desktop-header .action-button{width:100%}
  .desktop-header .top-icons{justify-content:flex-end}
  .desktop-summary{grid-template-columns:1fr}
  .grid-4{grid-template-columns:repeat(2,1fr)}
}

@media (max-width:760px){
  .page{padding:8px}
  .desktop-header,.desktop-summary,.notice,.section-panel,.transactions{
    border-radius:18px;
  }
  .desktop-header{
    grid-template-columns:1fr;
    padding:18px;
  }
  .desktop-header .top-actions{
    grid-template-columns:repeat(2,1fr);
  }
  .user-mini{min-width:0}
  .notice{
    grid-template-columns:1fr;
  }
  .notice p{text-align:right}
  .grid-3,.grid-4{grid-template-columns:1fr}
  .desktop-table{display:none}
  .mobile-table-fallback{display:block!important}
}

@media (max-width:720px){
  .mobile-header{padding:22px 18px 0}
  .mobile-topline{grid-template-columns:1fr}
  .mobile-notifications{order:2}
  .mobile-actions{grid-template-columns:repeat(2,1fr)}
  .mobile-summary{grid-template-columns:1fr}
  .mobile-market .grid-3,
  .mobile-market .grid-4{grid-template-columns:1fr}
  .mobile-market .product-card{min-height:auto}
  .mobile-market .price-pair{grid-template-columns:1fr 1px 1fr}
  .mobile-market .price-divider{display:block}
  .mobile-tx-row{grid-template-columns:1fr}
  .mobile-tx-row .date{text-align:right}
}

.mobile-table-fallback{display:none}
