@font-face {
  font-family: "IRANSansXFaNum";
  src: url("font/Farsi-numerals/Webfonts/Woff2/IRANSansXFaNum-Regular.woff2") format("woff2"),
       url("font/Farsi-numerals/Webfonts/Woff/IRANSansXFaNum-Regular.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "IRANSansXFaNum";
  src: url("font/Farsi-numerals/Webfonts/Woff2/IRANSansXFaNum-Bold.woff2") format("woff2"),
       url("font/Farsi-numerals/Webfonts/Woff/IRANSansXFaNum-Bold.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

:root {
  color-scheme: light;
  direction: rtl;
  font-family: "IRANSansXFaNum", Tahoma, Arial, sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  text-align: right;
}

body,
button,
input,
select,
textarea,
optgroup,
option {
  font-family: "IRANSansXFaNum", Tahoma, Arial, sans-serif;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
}

.shell > .customer-nav, .shell > .admin-nav {
  border-radius: 0;
  margin-bottom: 0;
}

@supports (padding: max(0px)) {
  .shell {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}

.shell > section,
.shell > main > section {
  padding: 20px;
  margin: 0 auto;
}

.shell > section:first-of-type {
  padding-top: 20px;
}

.shell > .customer-nav,
.shell > .admin-nav {
  margin-bottom: 0;
  padding: 8px 20px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 22px;
}

.admin-trade-controls {
  align-items: stretch;
  display: flex;
  gap: 12px;
}

.manual-trading-control {
  background: #fff8ee;
  border: 1px solid #ead6b5;
  border-radius: 10px;
  display: grid;
  gap: 6px;
  min-width: 250px;
  padding: 10px 12px;
}

.manual-trading-control.open {
  background: #eefaf3;
  border-color: #a7d9bc;
}

.manual-trading-status {
  align-items: center;
  color: #855b18;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
}

.manual-trading-control.open .manual-trading-status {
  color: #096b3a;
}

.manual-trading-status i {
  background: #b97c20;
  border-radius: 50%;
  height: 8px;
  width: 8px;
}

.manual-trading-control.open .manual-trading-status i {
  background: #0b8b4b;
  box-shadow: 0 0 0 4px rgba(11, 139, 75, 0.12);
}

.manual-trading-toggle {
  background: #8b5f1b;
  border-color: #8b5f1b;
  margin: 0;
  white-space: nowrap;
}

.manual-trading-control.open .manual-trading-toggle {
  background: #9b2c2c;
  border-color: #9b2c2c;
}

.manual-trading-control small {
  color: var(--ink-600, #637381);
  font-size: 11px;
}

.trade-new-alert {
  background: #fff7d6;
  border: 1px solid #e2c57f;
  border-radius: 8px;
  color: #6d501d;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 12px 14px;
}

@media (max-width: 640px) {
  .admin-trade-controls {
    flex-direction: column;
    width: 100%;
  }

  .manual-trading-control {
    min-width: 0;
  }

}

.account-links {
  align-items: center;
  display: flex;
  gap: 12px;
}

.account-links a {
  color: #146c94;
  font-weight: 700;
  text-decoration: none;
}

.customer-nav, .admin-nav {
  align-items: center;
  background: linear-gradient(135deg, #146c94 0%, #0f4c6d 100%);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(20, 108, 148, 0.15);
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 20px;
  padding: 8px 6px;
  position: relative;
}

.admin-nav {
  background: linear-gradient(135deg, #1a3a52 0%, #0f2840 100%);
}

.customer-nav a, .detail-link {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.customer-nav a {
  align-items: center;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  flex-shrink: 1;
  font-size: 14px;
  gap: 6px;
  padding: 8px 12px;
  position: relative;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-link-with-badge {
  position: relative;
}

.badge {
  align-items: center;
  background: #ff4757;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 4px;
  position: absolute;
  right: -8px;
  top: -8px;
  animation: badge-pulse 2s infinite;
}

.badge-red {
  background: #ff4757;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@media (max-width: 768px) {
  .customer-nav, .admin-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }

  .customer-nav a, .admin-nav a {
    border-radius: 0;
    padding: 12px 14px;
    font-size: 13px;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .customer-nav a:last-child, .admin-nav a:last-child {
    border-bottom: 0;
  }

  .customer-nav a:hover, .admin-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
  }
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 17px;
  margin-bottom: 14px;
}

p {
  color: #637381;
  margin-top: 4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.stat {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  padding: 16px;
}

.stat span {
  color: #637381;
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
}

.stat strong {
  font-size: 24px;
}

.filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.panel {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(17, 30, 45, 0.05);
}

.detail-header {
  align-items: center;
  border-bottom: 1px solid #eef2f5;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.notice {
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 8px;
  color: #6f4300;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.steps {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.step {
  background: #eef2f5;
  border-radius: 6px;
  color: #52616f;
  font-size: 12px;
  padding: 8px;
  text-align: center;
}

.step.active {
  background: #146c94;
  color: #fff;
}

.summary {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.summary div {
  align-items: center;
  border-bottom: 1px solid #eef2f5;
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.summary span {
  color: #637381;
}

.history-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-grid h3 {
  border-bottom: 1px solid #eef2f5;
  font-size: 15px;
  margin: 0;
  padding-bottom: 10px;
}

.help-list {
  display: grid;
  gap: 14px;
}

.help-list div {
  border-bottom: 1px solid #eef2f5;
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
}

.help-list span {
  color: #637381;
}

.pending-box {
  background: #f7fafc;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 18px;
  text-align: center;
}

.pending-box h3 {
  font-size: 16px;
  margin: 0 0 12px;
}

.pending-box.trade-confirmed {
  background: #edf9f1;
  border-color: #7ecf9b;
}

.pending-box.trade-cancelled,
.pending-box.trade-expired {
  background: #fff4f2;
  border-color: #e4a49c;
}

.transaction-result-status {
  color: #0b7a42;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 8px;
}

.trade-cancelled .transaction-result-status,
.trade-expired .transaction-result-status {
  color: #a23b32;
}

.transaction-update-message {
  background: #edf9f1;
  border: 1px solid #7ecf9b;
  border-radius: 6px;
  color: #0b6b3c;
  font-weight: 700;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.transaction-detail-status {
  border-radius: 6px;
  display: block;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.transaction-customer {
  align-items: center;
  background: #eef6fb;
  border-right: 4px solid #146c94;
  border-radius: 5px;
  display: flex;
  gap: 8px;
  margin: 9px 0;
  padding: 8px 10px;
}

.transaction-customer span {
  color: #516574;
  font-size: 12px;
}

.transaction-customer strong {
  color: #0d4968;
  font-size: 15px;
}

.trade-near-expiry {
  border-color: #e2a52b;
  box-shadow: inset 3px 0 0 #e2a52b;
}

.expiry-warning {
  background: #fff3cd;
  border-radius: 4px;
  color: #795b00;
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
  padding: 8px 10px;
}

.admin-decision-box {
  background: #f7fafc;
  border: 1px solid #cbd8e2;
  border-radius: 8px;
  margin-top: 16px;
  padding: 14px;
}

.admin-decision-box h3 {
  font-size: 17px;
  margin: 0 0 12px;
}

.compact-summary {
  margin-bottom: 12px;
}

.search-result {
  display: grid;
  gap: 6px;
}

.admin-note-panel textarea {
  min-height: 76px;
  margin-bottom: 10px;
}

.admin-note {
  border-top: 1px solid #e4e9ee;
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
}

.admin-note strong {
  color: #637381;
  font-size: 12px;
}

.customer-cancel-box {
  background: #fff8f4;
  border: 1px solid #efc8b5;
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 14px;
}

.customer-cancel-box h2,
.transaction-timeline h2 {
  font-size: 17px;
  margin: 0 0 12px;
}

.customer-cancel-box textarea {
  min-height: 82px;
  resize: vertical;
}

.transaction-timeline {
  border-top: 1px solid #e4e9ee;
  margin-top: 18px;
  padding-top: 18px;
}

.transaction-timeline ol {
  list-style: none;
  margin: 0;
  padding: 0 8px 0 0;
}

.transaction-timeline li {
  border-right: 2px solid #d9e0e7;
  display: grid;
  gap: 4px;
  margin-right: 0;
  padding: 0 16px 16px 0;
  position: relative;
}

.transaction-timeline li:last-child {
  border-right-color: transparent;
  padding-bottom: 0;
}

.transaction-timeline li::before {
  background: #146c94;
  border: 3px solid #fff;
  border-radius: 50%;
  content: "";
  height: 10px;
  position: absolute;
  right: -7px;
  top: 2px;
  width: 10px;
}

.transaction-timeline time,
.timeline-reason {
  color: #637381;
  font-size: 12px;
}

.pending-box p {
  color: #43515c;
  margin: 0 0 12px;
}

.timer {
  color: #146c94;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.2;
}

.check-row {
  align-items: center;
  display: flex;
  gap: 8px;
  grid-template-columns: none;
}

.check-row input {
  min-height: auto;
  width: auto;
}

.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-panel {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(17, 30, 45, 0.08);
  max-width: 420px;
  padding: 24px;
  width: 100%;
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin: -6px auto 22px;
  color: #102d35;
  text-align: center;
}

.auth-brand strong {
  margin-top: 6px;
  color: #102d35;
  font-size: 22px;
  line-height: 1.2;
}

.auth-brand small {
  color: #8b6829;
  font-size: 11px;
}

.auth-panel h1 {
  margin-bottom: 18px;
}

.auth-panel a {
  color: #146c94;
}

.home-gateway {
  text-align: center;
}

.home-gateway p {
  margin-top: 8px;
}

.home-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
}

.home-actions a {
  align-items: center;
  border: 1px solid #146c94;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  text-decoration: none;
}

.home-actions .primary-link {
  background: #146c94;
  color: #fff;
}

.home-actions .secondary-link {
  background: #fff;
}

.error {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  border-radius: 6px;
  color: #a8071a;
  margin-bottom: 14px;
  padding: 10px 12px;
  white-space: pre-line;
}

.hint {
  font-size: 12px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 2px;
  color: #52616f;
  font-size: 13px;
}

select, input, button {
  min-height: 40px;
  border: 1px solid #c8d2dc;
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
}

select option {
  background-color: #fff !important;
  color: #17202a !important;
}

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

.checkline input {
  min-height: auto;
  width: 18px;
}

input[type="number"] {
  width: 100%;
}

button {
  cursor: pointer;
  background: #146c94;
  color: white;
  border-color: #146c94;
  margin-left: 8px;
}

pre {
  direction: rtl;
  font-family: inherit;
  white-space: pre-wrap;
  background: #f7fafc;
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  padding: 12px;
  min-height: 96px;
}

.item {
  border-top: 1px solid #eef2f5;
  padding: 12px 0;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-item {
  background: #fbfcfd;
  border: 1px solid #eef2f5;
  border-radius: 8px;
  padding: 12px 14px;
}

.compact-summary {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.compact-summary div {
  align-items: start;
  border: 0;
  display: grid;
  gap: 4px;
  justify-content: stretch;
  padding: 0;
}

.compact-summary span {
  color: #637381;
  font-size: 11px;
}

.compact-summary strong {
  font-size: 14px;
}

.compact-grid {
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.compact-grid label {
  margin-bottom: 0;
}

.compact-actions,
.trade-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.compact-actions > *,
.trade-actions > * {
  margin: 0;
}

.customer-admin-row {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  overflow: hidden;
}

.customer-admin-row + .customer-admin-row {
  margin-top: 8px;
}

.customer-admin-summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 4px 12px;
    grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 1fr) 110px minmax(110px, 1fr) 120px 150px;
    list-style: none;
    min-height: 68px;
    padding: 10px 14px;
}

.customer-admin-summary::-webkit-details-marker {
  display: none;
}

.customer-admin-summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.customer-admin-summary span {
  color: #637381;
  font-size: 11px;
}

.customer-admin-summary strong {
  overflow-wrap: anywhere;
}

.customer-row-action {
  color: #146c94;
  font-size: 13px;
  font-weight: 700;
  justify-content: end;
  text-align: left;
}

.customer-row-action span {
  color: #146c94;
  font-size: 18px;
  margin-right: 5px;
}

.customer-active {
  color: #0b7a42;
}

.customer-inactive {
  color: #a23b32;
}

.customer-admin-row[open] {
  border-color: #9ec8dc;
  box-shadow: 0 3px 12px rgba(17, 30, 45, 0.06);
}

.customer-admin-row[open] .customer-row-action span {
  display: inline-block;
  transform: rotate(180deg);
}

.customer-admin-row > .compact-summary,
.customer-admin-row > .customer-limits-heading,
.customer-admin-row > .customer-limits-grid,
.customer-admin-row > .customer-admin-actions {
  margin-left: 14px;
  margin-right: 14px;
}

.customer-admin-row > .compact-summary {
  background: #f7fafc;
  border: 1px solid #e5ebef;
  border-radius: 6px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
  padding: 12px;
}

.customer-admin-row > .compact-summary strong {
  overflow-wrap: anywhere;
}

.customer-admin-row > .customer-limits-heading {
  margin-top: 14px;
}

.customer-admin-row > .customer-admin-actions {
  margin-bottom: 14px;
}

.audit-toolbar {
  align-items: end;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.audit-toolbar label {
  flex: 1;
  margin: 0;
}

.audit-toolbar input {
  margin-top: 6px;
}

.report-filter-bar {
  align-items: end;
  display: flex;
  gap: 12px;
}

.report-filter-bar .filter-grid {
  flex: 1;
}

.report-filter-bar .report-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-actions {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 24px;
}

.report-actions > * {
  margin: 0;
}

.report-actions button,
.report-actions select {
  min-height: 48px;
}

.settings-panel select,
.settings-panel select option {
  background-color: #fff;
  color: #17202a;
}

.settings-radio-group {
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  margin: 0 0 2px;
  padding: 10px 12px;
}

.settings-radio-group legend {
  color: #52616f;
  font-size: 13px;
  padding: 0 4px;
}

.settings-radio-option {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 0;
}

.settings-radio-option input[type="radio"] {
  min-height: auto;
  width: 18px;
}

.settings-scope-group {
  display: grid;
  gap: 12px;
  margin: 4px 0;
  padding: 14px;
  border: 1px solid #d8cfbb;
  border-radius: 10px;
  background: #fbf8f0;
}

.settings-time-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-scope-group legend {
  padding: 0 6px;
  color: #8f6825;
  font-size: 14px;
  font-weight: 700;
}

.settings-scope-group > p {
  margin: -2px 0 2px;
  color: #68736f;
  font-size: 12px;
  line-height: 1.9;
}

.shamsi-date-picker {
  display: block;
  position: relative;
}

.shamsi-calendar-popup {
  background: #fff;
  border: 1px solid #c8d2dc;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(17, 30, 45, .18);
  direction: rtl;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 260px;
  z-index: 20;
}

.shamsi-calendar-title,
.shamsi-calendar-week,
.shamsi-calendar-grid {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.shamsi-calendar-title {
  align-items: center;
  grid-template-columns: 34px 1fr 34px;
  margin-bottom: 6px;
}

.shamsi-calendar-title button,
.shamsi-calendar-grid button {
  background: transparent;
  border: 0;
  color: #17202a;
  min-height: 30px;
  padding: 0;
}

.shamsi-calendar-title button {
  color: #146c94;
  font-size: 22px;
}

.shamsi-calendar-week {
  color: #637381;
  font-size: 11px;
  margin-bottom: 3px;
}

.shamsi-calendar-grid button:hover {
  background: #eaf4f8;
  border-radius: 5px;
}

.shamsi-calendar-grid button.outside {
  visibility: hidden;
}

.admin-log-tabs {
  padding-bottom: 12px;
}

.admin-log-tabs .segmented {
  max-width: 360px;
}

.customer-limits-heading {
  align-items: baseline;
  border-bottom: 1px solid #e5ebef;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
}

.customer-limits-heading strong {
  color: #24323d;
  font-size: 14px;
}

.customer-limits-heading span {
  color: #637381;
  font-size: 11px;
}

.customer-limits-grid {
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.customer-limits-grid label {
  background: #fbfcfd;
  border: 1px solid #e2e8ed;
  border-radius: 6px;
  margin: 0;
  padding: 10px;
}

.customer-limits-grid label::after {
  color: #637381;
  display: block;
  font-size: 10px;
  margin-top: 5px;
}

.customer-limits-grid label:nth-child(-n + 3)::after {
  content: "ریال";
}

.customer-limits-grid label:nth-child(4)::after {
  content: "درخواست در روز";
}

.customer-limits-grid input {
  direction: ltr;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.customer-admin-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.customer-admin-actions > * {
  margin: 0;
}

.item:first-child {
  border-top: 0;
}

.transaction-row-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.transaction-trade-details {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.transaction-trade-details > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.transaction-trade-details span,
.transaction-trade-details small {
  color: var(--text-muted, #637381);
  font-size: 12px;
}

.transaction-trade-details strong {
  color: var(--text-strong, #182321);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.transaction-trade-details small {
  flex-basis: 100%;
  text-align: left;
}

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
}

.status-pending {
  background: #fff7d6;
  border: 1px solid #f2cf5b;
  color: #8a6500;
}

.status-confirmed {
  background: #eafaf0;
  border: 1px solid #7ecf9b;
  color: #0b7a42;
}

.status-cancelled {
  background: #ffecec;
  border: 1px solid #ee9a9a;
  color: #a22828;
}

.status-expired {
  background: #f2f4f7;
  border: 1px solid #b9c1ca;
  color: #4d5b67;
}

.meta {
  color: #637381;
  font-size: 13px;
  margin-top: 4px;
}

.payment-row {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.receipt-link {
  color: #146c94;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.inline-error {
  margin: 8px 0 0;
}

.notification-item {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.notification-item.unread {
  background: #f7fafc;
  border-radius: 6px;
  padding: 12px;
}

input, select {
  direction: rtl;
}

input[name="UserName"], input[name="Password"], input[name="ConfirmPassword"] {
  direction: ltr;
  text-align: left;
}

input[name="CurrentPassword"], input[name="NewPassword"], input[name="ConfirmNewPassword"] {
  direction: ltr;
  text-align: left;
}

.trade-shell {
  max-width: 820px;
}

.trade-page-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.trade-page-header h1 {
  font-size: 24px;
}

.market-update {
  color: #637381;
  display: grid;
  flex: 0 0 auto;
  font-size: 11px;
  gap: 2px;
  text-align: left;
}

.market-update strong {
  color: #17202a;
  direction: ltr;
  font-size: 14px;
}

.market-board {
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.market-board-head,
.market-row {
  direction: ltr;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(84px, .72fr) minmax(0, 1fr);
}

.market-board-head {
  align-items: center;
  background: #24323d;
  color: #fff;
  font-size: 13px;
  min-height: 48px;
  padding: 0 10px;
  text-align: center;
}

.buy-heading {
  color: #7be0a4;
  grid-column: 3;
}

.asset-heading {
  color: #d8e0e6;
  grid-column: 2;
}

.sell-heading {
  color: #ff9696;
  grid-column: 1;
}

.market-row {
  align-items: stretch;
  border-top: 1px solid #e8edf1;
  min-height: 72px;
  padding: 8px 10px;
  position: relative;
}

.market-row.selected {
  background: #f7fafc;
}

.market-row.selected::after {
  background: #146c94;
  content: "";
  inset: 8px auto 8px 0;
  position: absolute;
  width: 3px;
}

.market-price {
  align-self: center;
  background: transparent;
  border-radius: 6px;
  direction: ltr;
  font-size: 15px;
  font-weight: 700;
  height: 48px;
  margin: 0;
  min-height: 48px;
  min-width: 0;
  overflow: hidden;
  padding: 0 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-price.buy-price {
  background: #edf9f2;
  border-color: #78c999;
  color: #087a3c;
  grid-column: 3;
}

.market-price.sell-price {
  background: #fff2f2;
  border-color: #e6a1a1;
  color: #b42323;
  grid-column: 1;
}

.market-price:disabled {
  cursor: not-allowed;
  filter: grayscale(.75);
  opacity: .48;
}

.market-asset {
  align-items: center;
  direction: rtl;
  display: flex;
  flex-direction: column;
  grid-column: 2;
  justify-content: center;
  min-width: 0;
  padding: 0 6px;
  text-align: center;
}

.market-asset strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.market-asset span {
  color: #7b8791;
  font-size: 11px;
  margin-top: 3px;
}

.transaction-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.trade-expiry-progress {
  --expiry-color: var(--gold-500, #c89d48);
  margin: 12px 0 6px;
}

.trade-expiry-progress-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: #5f6b67;
  font-size: 12px;
}

.trade-expiry-progress-head strong {
  color: var(--expiry-color);
  direction: ltr;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.trade-expiry-progress-track {
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(121, 105, 72, .14);
  border-radius: 999px;
  background: #e8e3d8;
  box-shadow: inset 0 1px 3px rgba(18, 43, 44, .08);
}

.trade-expiry-progress-fill {
  display: block;
  height: 100%;
  margin-left: auto;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--expiry-color) 74%, #fff), var(--expiry-color));
  box-shadow: 0 0 10px color-mix(in srgb, var(--expiry-color) 35%, transparent);
  transition: width 320ms ease-out, background-color 180ms ease-out;
}

.trade-expiry-progress.is-warning {
  --expiry-color: #c77b19;
}

.trade-expiry-progress.is-critical {
  --expiry-color: var(--sell, #a33f3a);
}

.pending-box .trade-expiry-progress {
  margin-top: 16px;
}

.admin-decision-box .trade-expiry-progress {
  margin: 14px 0 4px;
}

.transaction-asset-name {
  color: #075985;
  font-size: 1.05em;
  font-weight: 800;
}

.summary .transaction-asset-name {
  color: #075985;
  font-weight: 900;
}

.market-unit,
.market-empty {
  color: #637381;
  font-size: 11px;
  padding: 10px 12px;
  text-align: center;
}

.market-unit {
  background: #f7fafc;
  border-top: 1px solid #e8edf1;
}

.trade-entry {
  margin-bottom: 20px;
  scroll-margin-top: 12px;
}

.trade-entry-title {
  align-items: start;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.trade-entry-title h2 {
  margin-bottom: 3px;
}

.trade-entry-title p {
  font-size: 12px;
}

.trade-mode {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}

.trade-mode.buy {
  background: #edf9f2;
  color: #087a3c;
}

.trade-mode.sell {
  background: #fff2f2;
  color: #b42323;
}

.field-label {
  color: #52616f;
  font-size: 13px;
  margin: 14px 0 7px;
}

.segmented {
  background: #eef2f5;
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
}

.segmented button {
  background: transparent;
  border-color: transparent;
  color: #52616f;
  margin: 0;
  min-height: 38px;
}

.segmented button.active {
  background: #fff;
  border-color: #c8d2dc;
  color: #17202a;
  box-shadow: 0 1px 3px rgba(17, 30, 45, .08);
}

.segmented button.active.buy {
  color: #087a3c;
}

.segmented button.active.sell {
  color: #b42323;
}

.trade-value-label {
  margin-top: 16px;
}

.trade-value-input {
  align-items: center;
  border: 1px solid #c8d2dc;
  border-radius: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
}

.trade-value-input input {
  border: 0;
  direction: ltr;
  font-size: 18px;
  font-weight: 700;
  min-width: 0;
  text-align: left;
}

.trade-value-input span {
  border-right: 1px solid #e2e8ed;
  color: #637381;
  padding: 0 12px;
}

.selected-rate {
  align-items: center;
  background: #f7fafc;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  margin: 12px 0;
  padding: 10px 12px;
}

.selected-rate span {
  color: #637381;
  font-size: 12px;
}

.selected-rate strong {
  direction: ltr;
  font-size: 14px;
}

.trade-submit {
  border: 0;
  margin: 4px 0 0;
  min-height: 48px;
  width: 100%;
}

.trade-submit.buy {
  background: #087a3c;
}

.trade-submit.sell {
  background: #b42323;
}

.trade-submit:disabled {
  background: #9aa6af;
  cursor: not-allowed;
}

.trade-progress {
  margin-top: 8px;
}

.trade-review-actions {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trade-review-actions button,
.trade-review-actions .detail-link {
  align-items: center;
  display: flex;
  justify-content: center;
  margin: 0;
  min-height: 44px;
  text-align: center;
}

.secondary-button {
  background: #fff;
  border-color: #c8d2dc;
  color: #52616f;
}

.load-more-button {
  display: block;
  margin: 16px auto 0;
  min-width: 160px;
}

.admin-assets-grid {
  grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr);
}

.asset-editor {
  align-self: start;
}

.asset-number-grid,
.asset-price-pair {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.asset-price-adjustment {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #dfdacd;
  border-radius: 9px;
  background: #fbfaf5;
}

.asset-price-adjustment h3 {
  margin: 0 0 12px;
  color: #102f37;
  font-size: 14px;
}

.asset-price-adjustment .hint {
  margin: 8px 0 0;
}

.asset-adjustment-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: -4px 0 12px;
  color: #68736f;
  font-size: 11px;
}

.asset-permissions {
  background: #f7fafc;
  border: 1px solid #e2e8ed;
  border-radius: 6px;
  margin-top: 14px;
  padding: 12px;
}

.asset-permissions label:last-child {
  margin-bottom: 0;
}

.asset-admin-item {
  border-top: 1px solid #e2e8ed;
  padding: 16px 0;
}

.asset-admin-item:first-of-type {
  border-top: 0;
}

.asset-admin-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.asset-admin-head > div {
  display: grid;
  gap: 3px;
}

.asset-admin-head span:not(.status-badge) {
  color: #637381;
  font-size: 12px;
}

.status-badge {
  border: 1px solid;
  border-radius: 6px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
}

.status-badge.enabled {
  background: #edf9f2;
  border-color: #9bd5b2;
  color: #087a3c;
}

.status-badge.disabled {
  background: #fff2f2;
  border-color: #e6b1b1;
  color: #a61b1b;
}

.asset-price-pair {
  margin: 12px 0;
}

.asset-price-pair div {
  background: #f7fafc;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.asset-price-pair span {
  color: #637381;
  font-size: 11px;
}

.asset-price-pair strong {
  direction: ltr;
  text-align: right;
}

.asset-status-row,
.asset-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.asset-admin-actions {
  margin-top: 12px;
}

.asset-admin-actions button {
  font-size: 12px;
  margin: 0;
  min-height: 36px;
}

@media (max-width: 760px) {
  .shell {
    padding: 0;
  }

  .shell > .customer-nav,
  .shell > .admin-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    margin-bottom: 0;
    border-radius: 0;
  }

  .shell > .customer-nav a,
  .shell > .admin-nav a {
    border-radius: 0;
    padding: 12px 16px;
    font-size: 13px;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-grow: 0;
  }

  .shell > .customer-nav a:last-child,
  .shell > .admin-nav a:last-child {
    border-bottom: 0;
  }

  .shell > .customer-nav a:hover,
  .shell > .admin-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .shell > section,
  .shell > main > section {
    border-radius: 0;
    margin: 0;
  }

  .shell > section:first-of-type {
    border-radius: 0;
  }

  .toolbar, .grid, .history-grid, .stat-grid, .filter-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .trade-shell {
    padding: 12px;
  }

  .trade-page-header {
    padding: 12px 2px 16px;
  }

  .trade-page-header h1 {
    font-size: 21px;
  }

  .trade-page-header p {
    font-size: 12px;
  }

  .trade-entry {
    padding: 16px;
  }

  .admin-assets-grid,
  .asset-number-grid {
    grid-template-columns: 1fr;
  }

  .customer-admin-summary {
    grid-template-columns: 1fr 1fr;
  }

  .audit-toolbar,
  .report-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-row-action {
    justify-content: start;
    text-align: right;
  }

  .customer-admin-row > .compact-summary {
    grid-template-columns: 1fr 1fr;
  }

  .customer-limits-heading {
    align-items: start;
    flex-direction: column;
    gap: 3px;
  }

  .customer-limits-grid {
    grid-template-columns: 1fr;
  }

  .customer-limits-grid label:last-child {
    grid-column: auto;
    max-width: none;
  }
}

@media (min-width: 600px) {
  .market-price {
    font-size: 19px;
  }

  .market-asset strong {
    font-size: 16px;
  }
}

/* --------------------------------------------------------------------------
   Zarrin trading desk design system
   -------------------------------------------------------------------------- */

:root {
  --ink-950: #0b242b;
  --ink-900: #102f37;
  --ink-800: #19434a;
  --gold-700: #8f6825;
  --gold-600: #ad8030;
  --gold-500: #c89d48;
  --gold-300: #e6ca8c;
  --gold-100: #f7eed9;
  --paper: #fffdf8;
  --stone-50: #f8f6f0;
  --stone-100: #f0ede5;
  --stone-200: #dfdacd;
  --text-strong: #182321;
  --text-muted: #68736f;
  --buy: #14754a;
  --buy-soft: #edf8f2;
  --sell: #a33f3a;
  --sell-soft: #fff1ef;
  --focus: #d1a64f;
  --desk-shadow: 0 18px 45px rgba(18, 43, 44, 0.08);
}

html {
  background: var(--stone-50);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 9% 2%, rgba(200, 157, 72, 0.12), transparent 24rem),
    linear-gradient(180deg, #f8f6f0 0, #f2f0e9 46rem, #f7f5ef 100%);
  color: var(--text-strong);
}

a,
button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
.primary-button,
.secondary-button,
input,
select,
textarea {
  min-height: 44px;
}

button,
a,
input,
select,
textarea {
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(200, 157, 72, 0.3);
  outline-offset: 2px;
}

.shell {
  width: min(100% - 36px, 1280px);
  max-width: 1280px;
  margin-inline: auto;
  padding: 18px 0 48px;
}

.trade-shell {
  max-width: 1180px;
}

.panel,
.market-board {
  border-color: var(--stone-200);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 10px 28px rgba(18, 43, 44, 0.05);
}

.notice {
  border-color: #e2c57f;
  background: var(--gold-100);
  color: #6d501d;
  box-shadow: 0 8px 20px rgba(143, 104, 37, 0.07);
}

.error {
  border-color: #e6aaa5;
  background: var(--sell-soft);
  color: #8f302b;
  box-shadow: 0 8px 20px rgba(163, 63, 58, 0.06);
}

.panel h1,
.panel h2,
.panel h3,
.trade-page-header h1 {
  color: var(--ink-950);
  letter-spacing: -0.025em;
}

/* Navigation */
.app-nav.customer-nav,
.app-nav.admin-nav {
  position: sticky;
  z-index: 30;
  top: 12px;
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0;
  min-height: 70px;
  margin: 0 0 28px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(230, 202, 140, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.04), transparent 32%),
    var(--ink-900);
  box-shadow: 0 15px 35px rgba(11, 36, 43, 0.18);
}

.app-nav .nav-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  min-width: 190px;
  padding: 10px 18px;
  border-left: 1px solid rgba(230, 202, 140, 0.2);
  color: #fff9ea;
  text-decoration: none;
}

.diako-logo {
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 50px;
  overflow: visible;
  border: 0;
  background-color: transparent;
  background-image: url('/images/diako-logo-transparent.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  box-shadow: none;
}

.diako-logo-large {
  width: 76px;
  height: 108px;
  background-position: center;
  background-size: contain;
  box-shadow: none;
}

.password-control {
  display: grid;
  gap: 6px;
  margin-bottom: 2px;
}

.password-control > label {
  margin: 0;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 10px;
  padding-left: 48px;
}

.password-visibility-toggle {
  position: absolute;
  inset-block: 0;
  right: auto;
  left: 3px;
  display: grid;
  width: 42px;
  min-height: 0;
  margin: 3px 0;
  padding: 8px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: #52616f;
}

.password-visibility-toggle:hover,
.password-visibility-toggle[aria-pressed="true"] {
  background: #f0ede5;
  color: #8f6825;
}

.password-visibility-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-nav .brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.35;
}

.app-nav .brand-copy strong {
  font-size: 15px;
}

.app-nav .brand-copy small {
  color: var(--gold-300);
  font-size: 10px;
}

.app-nav .nav-links {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-nav .nav-links::-webkit-scrollbar {
  display: none;
}

.app-nav .nav-links > a,
.app-nav .nav-logout {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 76px;
  padding: 0 13px;
  border: 0;
  border-radius: 0;
  color: #dce6e3;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.app-nav .nav-links > a::after {
  position: absolute;
  right: 22%;
  bottom: 0;
  left: 22%;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
  content: "";
}

.app-nav .nav-links > a:hover,
.app-nav .nav-links > a.active {
  background: rgba(255, 255, 255, 0.055);
  color: #fff7e5;
}

.app-nav .nav-links > a.active::after {
  background: var(--gold-500);
  box-shadow: 0 -2px 9px rgba(200, 157, 72, 0.4);
}

.app-nav .nav-logout {
  min-width: 72px;
  border-right: 1px solid rgba(230, 202, 140, 0.18);
  color: var(--gold-300);
}

.app-nav .nav-logout:hover {
  background: rgba(163, 63, 58, 0.2);
  color: #ffd7d2;
}

.app-nav .badge {
  min-width: 18px;
  height: 18px;
  margin-right: 5px;
  padding: 1px 5px;
  border: 1px solid var(--ink-900);
  font-size: 9px;
  line-height: 14px;
}

/* Trading page */
.trade-page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 4px 24px;
}

.page-eyebrow,
.section-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-700);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.trade-page-header h1 {
  margin: 0 0 5px;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.35;
}

.trade-page-header p {
  max-width: 650px;
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.market-update {
  display: grid;
  flex: 0 0 auto;
  gap: 1px;
  padding: 10px 14px;
  border-right: 2px solid var(--gold-500);
  background: rgba(255, 253, 248, 0.58);
  color: var(--text-muted);
}

.market-update strong {
  color: var(--ink-900);
  font-size: 14px;
}

.trade-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr);
  align-items: start;
  gap: 18px;
}

.trade-market-column,
.trade-order-column {
  min-width: 0;
}

.trade-order-column {
  position: sticky;
  top: 102px;
}

.market-board,
.trade-entry.panel {
  overflow: hidden;
  border: 1px solid var(--stone-200);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--desk-shadow);
}

.market-board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 73px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--stone-200);
  background: linear-gradient(90deg, rgba(247, 238, 217, 0.82), rgba(255, 253, 248, 0.35));
}

.market-board-title strong {
  color: var(--ink-950);
  font-size: 17px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--buy);
  font-size: 11px;
  font-weight: 700;
}

.live-indicator i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--buy);
  box-shadow: 0 0 0 5px rgba(20, 117, 74, 0.12);
}

.live-indicator.closed {
  color: var(--sell);
}

.live-indicator.closed i {
  background: var(--sell);
  box-shadow: 0 0 0 5px rgba(185, 45, 45, 0.12);
}

.market-board-head {
  min-height: 42px;
  padding-inline: 14px;
  border-bottom: 1px solid rgba(223, 218, 205, 0.8);
  background: var(--ink-900);
  color: #f8f3e7;
  font-size: 11px;
}

.market-board-head .buy-heading {
  color: #75d1a4;
}

.market-board-head .sell-heading {
  color: #f09a93;
}

.market-row {
  min-height: 71px;
  padding: 8px 10px;
  border-bottom-color: var(--stone-100);
  background: transparent;
}

.market-row:hover {
  background: #fbfaf5;
}

.market-row.selected {
  background: linear-gradient(90deg, rgba(247, 238, 217, 0.46), transparent);
  box-shadow: inset -3px 0 0 var(--gold-500);
}

.market-price {
  min-height: 48px;
  border-width: 1px;
  border-radius: 9px;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.market-price.buy-price {
  border-color: #8ccdaf;
  background: var(--buy-soft);
  color: var(--buy);
}

.market-price.sell-price {
  border-color: #e6aaa5;
  background: var(--sell-soft);
  color: var(--sell);
}

.market-price:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(18, 43, 44, 0.09);
}

.market-price.melted-gold-price {
  align-content: center;
  display: grid;
  gap: 1px;
  min-height: 64px;
  padding-block: 5px;
}

.market-price.melted-gold-price strong {
  font-size: 16px;
  line-height: 1.25;
}

.market-price-kind,
.market-price.melted-gold-price small {
  direction: rtl;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  opacity: .8;
}

.market-asset strong {
  color: var(--ink-950);
}

.market-asset span,
.market-unit {
  color: var(--text-muted);
}

.market-unit {
  border-top: 1px solid var(--stone-100);
  background: #faf8f2;
}

.trade-entry.panel {
  margin: 0;
  padding: 20px;
}

.trade-entry-title {
  align-items: start;
  margin-bottom: 19px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--stone-100);
}

.trade-entry-title h2 {
  margin: 0;
  font-size: 21px;
}

.trade-entry-title p {
  margin-top: 4px;
  color: var(--text-muted);
}

.customer-limit-card {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 13px;
  border: 1px solid #e2cc99;
  border-radius: 10px;
  background: #fbf6e8;
}

.customer-limit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customer-limit-heading strong {
  color: var(--ink-950);
  font-size: 13px;
}

.customer-limit-heading span {
  color: var(--text-muted);
  font-size: 9px;
}

.customer-limit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.customer-limit-grid > div {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid rgba(200, 157, 72, 0.2);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.82);
}

.customer-limit-grid span {
  color: var(--text-muted);
  font-size: 9px;
}

.customer-limit-grid strong {
  color: var(--gold-700);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.settlement-note {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 13px 15px;
  border-right: 3px solid var(--gold-500);
  border-radius: 8px;
  background: var(--gold-100);
}

.settlement-note strong {
  color: var(--gold-700);
  font-size: 13px;
}

.settlement-note span {
  color: #665c47;
  font-size: 12px;
  line-height: 1.8;
}

.trade-mode {
  border: 1px solid currentColor;
  background: transparent;
  font-weight: 700;
}

.trade-mode.buy {
  color: var(--buy);
}

.trade-mode.sell {
  color: var(--sell);
}

.field-label,
.trade-value-label > span {
  color: #56625e;
  font-size: 11px;
  font-weight: 700;
}

.segmented {
  padding: 4px;
  border: 1px solid var(--stone-200);
  border-radius: 10px;
  background: var(--stone-100);
}

.segmented button {
  border: 0;
  border-radius: 7px;
  color: var(--text-muted);
}

.segmented button.active {
  background: var(--paper);
  color: var(--ink-950);
  box-shadow: 0 2px 8px rgba(18, 43, 44, 0.08), inset 0 -2px 0 var(--gold-500);
}

.trade-value-input {
  overflow: hidden;
  border-color: var(--stone-200);
  border-radius: 10px;
  background: #fff;
}

.trade-value-input:focus-within {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 157, 72, 0.14);
}

.trade-value-input input {
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.trade-value-input > span {
  border-right-color: var(--stone-200);
  background: #faf8f2;
  color: var(--text-muted);
}

.selected-rate {
  min-height: 51px;
  border: 1px solid var(--stone-100);
  border-radius: 9px;
  background: #faf9f5;
}

.selected-rate strong {
  color: var(--ink-950);
  font-variant-numeric: tabular-nums;
}

.selected-rate.trade-result {
  border-color: #e2cc99;
  background: var(--gold-100);
}

.selected-rate.trade-result strong {
  color: var(--gold-700);
  font-size: 16px;
}

.trade-submit {
  min-height: 50px;
  border-radius: 9px;
  box-shadow: 0 8px 18px rgba(18, 43, 44, 0.12);
  font-weight: 800;
}

.trade-submit.buy {
  background: var(--buy);
}

.trade-submit.sell {
  background: var(--sell);
}

.trade-submit:not(:disabled):hover {
  filter: brightness(0.94);
  transform: translateY(-1px);
}

/* Shared product surfaces */
.stat,
.card,
.summary > div,
.compact-summary > div {
  border-color: var(--stone-200);
  background: var(--paper);
}

table {
  border-color: var(--stone-200);
  background: var(--paper);
}

th {
  background: var(--ink-900);
  color: #f8f3e7;
}

tr:nth-child(even) td {
  background: rgba(240, 237, 229, 0.42);
}

input,
select,
textarea {
  border-color: #cfc9bb;
  background-color: #fffefb;
  color: var(--text-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 157, 72, 0.14);
}

.primary-button,
button.primary,
.report-filter-bar button,
.audit-toolbar button {
  background: var(--ink-900);
  color: #fff9ea;
}

@media (max-width: 1040px) {
  .app-nav .nav-brand {
    min-width: auto;
    padding-inline: 13px;
  }

  .app-nav .brand-copy {
    display: none;
  }

  .trade-workspace {
    grid-template-columns: 1fr;
  }

  .trade-order-column {
    position: static;
  }
}

@media (max-width: 760px) {
  .shell,
  .trade-shell {
    width: 100%;
    padding: 0 12px 30px;
  }

  .app-nav.customer-nav,
  .app-nav.admin-nav {
    position: relative;
    top: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 58px;
    margin-inline: -12px;
    margin-bottom: 20px;
    overflow: hidden;
    border-width: 0 0 1px;
    border-radius: 0;
  }

  .app-nav .nav-brand {
    min-width: 58px;
    padding: 8px 10px;
  }

  .app-nav .diako-logo {
    width: 42px;
    height: 48px;
  }

  .app-nav .nav-links {
    flex-direction: row;
    width: auto;
  }

  .app-nav .nav-links > a,
  .app-nav .nav-logout {
    width: auto;
    min-width: 68px;
    min-height: 58px;
    padding: 0 10px;
    text-align: center;
  }

  .trade-page-header {
    align-items: start;
    padding: 4px 2px 18px;
  }

  .trade-page-header p {
    font-size: 12px;
  }

  .market-update {
    padding: 7px 10px;
    font-size: 9px;
  }

  .trade-workspace {
    gap: 13px;
  }

  .market-board-title {
    min-height: 64px;
  }

  .market-board,
  .trade-entry.panel {
    border-radius: 11px;
  }

  .market-row {
    grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
    gap: 7px;
    padding-inline: 7px;
  }

  .market-price {
    padding-inline: 5px;
    font-size: 15px;
  }

  .market-asset strong {
    font-size: 13px;
  }

  .trade-entry.panel {
    padding: 16px;
  }

  .customer-limit-heading {
    align-items: start;
    flex-direction: column;
    gap: 2px;
  }

  .customer-limit-grid {
    grid-template-columns: 1fr;
  }
}

.admin-trades-workspace {
  direction: ltr;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(500px, .92fr);
  grid-template-areas: "queue pricing";
  align-items: start;
  gap: 18px;
}

.admin-trades-queue {
  direction: rtl;
  display: grid;
  grid-area: queue;
  gap: 16px;
  min-width: 0;
}

.admin-trades-queue > .panel,
.admin-trades-list {
  margin: 0;
}

.trade-balance-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  overflow: hidden;
}

.trade-balance-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.trade-balance-heading h2 {
  margin: 2px 0 0;
  font-size: 17px;
}

.trade-balance-scope {
  flex: none;
  padding: 5px 9px;
  border: 1px solid rgba(200, 157, 72, .34);
  border-radius: 999px;
  background: rgba(200, 157, 72, .09);
  color: var(--gold-700);
  font-size: 10px;
  font-weight: 800;
}

.trade-balance-help {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.8;
}

.trade-net-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 10px;
}

.trade-net-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--stone-100);
  border-radius: 13px;
  background: #faf9f6;
}

.money-net-card {
  border-color: rgba(200, 157, 72, .32);
  background: rgba(200, 157, 72, .07);
}

.trade-net-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trade-net-card-title h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 14px;
}

.trade-net-card-title > span,
.balance-state {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.trade-net-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  direction: ltr;
}

.trade-net-value strong {
  overflow-wrap: anywhere;
  font-size: clamp(22px, 3vw, 30px);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.trade-net-value span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.balance-positive > strong,
.balance-positive .trade-net-value strong,
.balance-positive .balance-state {
  color: var(--buy);
}

.balance-negative > strong,
.balance-negative .trade-net-value strong,
.balance-negative .balance-state {
  color: var(--sell);
}

.balance-neutral > strong,
.balance-neutral .trade-net-value strong,
.balance-neutral .balance-state {
  color: var(--text-strong);
}

.gold-net-list {
  display: grid;
  gap: 7px;
}

.gold-net-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(95px, auto) 42px;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--paper);
}

.gold-net-row > span {
  min-width: 0;
  color: var(--text-strong);
  font-size: 11px;
  font-weight: 800;
}

.gold-net-row > strong {
  direction: ltr;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.gold-net-row > strong small {
  color: inherit;
  font-size: 9px;
}

.admin-trade-filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-trade-filters > label {
  min-width: 0;
}

.admin-trade-filters > label:nth-child(3) {
  grid-column: 1 / -1;
}

.admin-trade-filters input,
.admin-trade-filters select,
.admin-trade-filters .shamsi-date-picker {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.admin-price-desk {
  direction: rtl;
  grid-area: pricing;
  min-width: 0;
  position: sticky;
  top: 102px;
}

.admin-manual-price-board {
  margin: 0;
}

.manual-price-step {
  direction: rtl;
  padding: 6px 9px;
  border: 1px solid rgba(200, 157, 72, .34);
  border-radius: 999px;
  background: rgba(255, 253, 248, .8);
  color: var(--gold-700);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-price-help {
  margin: 0;
  padding: 9px 14px;
  border-bottom: 1px solid var(--stone-100);
  background: #faf8f2;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.admin-price-row {
  grid-template-columns: minmax(0, 1fr) minmax(76px, .55fr) minmax(0, 1fr);
  gap: 7px;
  min-height: 86px;
  padding-inline: 8px;
}

.manual-price-control {
  align-self: center;
  direction: ltr;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  grid-column: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e6aaa5;
  border-radius: 10px;
  background: var(--sell-soft);
  position: relative;
}

.manual-price-control.buy-price {
  grid-column: 3;
  border-color: #8ccdaf;
  background: var(--buy-soft);
}

.manual-price-control button {
  width: 38px;
  min-width: 38px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .58);
  box-shadow: none;
  color: var(--sell);
  font-family: Arial, sans-serif;
  font-size: 21px;
  font-weight: 700;
}

.manual-price-control.buy-price button {
  color: var(--buy);
}

.manual-price-control button:hover {
  background: rgba(255, 255, 255, .95);
  transform: none;
}

.manual-price-control button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.manual-price-control input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 3px;
  border: 0;
  border-right: 1px solid rgba(163, 63, 58, .17);
  border-left: 1px solid rgba(163, 63, 58, .17);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--sell);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.manual-price-value {
  align-content: center;
  display: grid;
  min-width: 0;
}

.manual-price-value.melted-gold-price {
  gap: 1px;
  padding-block: 3px;
}

.manual-price-value.melted-gold-price input {
  height: 30px;
}

.manual-price-value span,
.manual-price-value small {
  color: inherit;
  direction: rtl;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  opacity: .78;
  text-align: center;
}

.manual-price-control.buy-price input {
  border-inline-color: rgba(20, 117, 74, .17);
  color: var(--buy);
}

.manual-price-control:focus-within {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 157, 72, .14);
}

.manual-price-control input:focus {
  box-shadow: none;
  outline: 0;
}

.manual-price-control input::-webkit-outer-spin-button,
.manual-price-control input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.manual-price-control input[type="number"] {
  appearance: textfield;
}

.admin-price-asset {
  padding-inline: 2px;
}

.price-save-status {
  display: block;
  margin-top: 4px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.45;
}

.price-save-status.saved-state {
  color: var(--buy);
}

.price-save-status.pending-state {
  color: var(--gold-700);
}

.price-save-status.error-state {
  color: var(--sell);
}

@media (max-width: 1120px) {
  .admin-trades-workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "pricing"
      "queue";
  }

  .admin-price-desk {
    position: static;
  }

  .manual-price-control {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }

  .manual-price-control button {
    width: 48px;
    min-width: 48px;
  }

  .manual-price-control input {
    font-size: 16px;
  }
}

@media (max-width: 620px) {
  .trade-balance-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .trade-balance-scope {
    align-self: start;
  }

  .trade-net-grid {
    grid-template-columns: 1fr;
  }

  .gold-net-row {
    grid-template-columns: minmax(90px, 1fr) minmax(85px, auto) 40px;
  }

  .admin-trade-filters {
    grid-template-columns: 1fr;
  }

  .admin-trade-filters > label:nth-child(3) {
    grid-column: auto;
  }

  .admin-price-board-head {
    display: none;
  }

  .admin-price-row {
    grid-template-areas:
      "asset asset"
      "sell buy";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
    padding-block: 10px;
  }

  .admin-price-row .admin-price-asset {
    grid-area: asset;
    min-height: 42px;
  }

  .admin-price-row .manual-price-control.sell-price {
    grid-area: sell;
  }

  .admin-price-row .manual-price-control.buy-price {
    grid-area: buy;
  }

  .manual-price-control {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    margin-top: 19px;
  }

  .manual-price-control::before {
    position: absolute;
    bottom: calc(100% + 3px);
    inset-inline: 0;
    color: var(--text-muted);
    content: attr(data-label);
    direction: rtl;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
  }

  .manual-price-control button {
    width: 44px;
    min-width: 44px;
  }

  .manual-price-control input {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Responsive navigation: compact hamburger menu for tablet and mobile */
.app-nav .nav-menu {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.app-nav .nav-toggle {
  display: none;
}

@media (max-width: 1040px) {
  .app-nav.customer-nav,
  .app-nav.admin-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 64px;
    overflow: visible;
  }

  .app-nav .nav-brand {
    min-width: 0;
    min-height: 64px;
    border-left: 0;
  }

  .app-nav .brand-copy {
    display: grid;
  }

  .app-nav .nav-toggle {
    display: grid;
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    margin-left: 10px;
    padding: 11px;
    place-content: center;
    gap: 5px;
    border: 1px solid rgba(230, 202, 140, 0.38);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    color: #fff9ea;
    cursor: pointer;
  }

  .app-nav .nav-toggle:hover,
  .app-nav .nav-toggle:focus-visible,
  .app-nav .nav-toggle[aria-expanded="true"] {
    border-color: var(--gold-300);
    background: rgba(200, 157, 72, 0.16);
  }

  .app-nav .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform-origin: center;
  }

  .app-nav .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .app-nav .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .app-nav .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .app-nav .nav-menu {
    display: none;
    grid-column: 1 / -1;
    min-width: 100%;
    border-top: 1px solid rgba(230, 202, 140, 0.18);
    background: rgba(4, 26, 31, 0.42);
  }

  .app-nav .nav-menu.open {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-nav .nav-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
  }

  .app-nav .nav-links > a,
  .app-nav .nav-logout {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    white-space: normal;
  }

  .app-nav .nav-links > a::after {
    right: 20%;
    left: 20%;
  }

  .app-nav .nav-logout {
    border-right: 0;
    color: #f1c9c5;
  }
}

@media (max-width: 620px) {
  .app-nav .nav-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 370px) {
  .app-nav .brand-copy small {
    display: none;
  }

  .app-nav .nav-links {
    grid-template-columns: 1fr;
  }
}
