body {
  background: #f8fafc;
}

body.modal-open {
  overflow: hidden;
}

.page-shell {
  position: relative;
}

.hero-panel,
.panel,
.metric-card {
  position: relative;
}

.hero-panel,
.panel,
.metric-card,
.mini-panel,
.simple-card {
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.hero-panel {
  border-radius: 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.35rem 0.7rem;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-card {
  border-radius: 20px;
  padding: 1.2rem;
}

.metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.metric-value {
  margin-top: 0.5rem;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  color: #0f172a;
}

.metric-sub {
  margin-top: 0.45rem;
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.5;
}

.panel {
  border-radius: 24px;
  padding: 1.5rem;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.panel-kicker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.panel-title {
  margin-top: 0.35rem;
  font-family: "Inter", sans-serif;
  font-size: 1.08rem;
  line-height: 1.4;
  color: #0f172a;
}

.meta-chip {
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 0.45rem 0.8rem;
  color: #475569;
  font-size: 0.72rem;
  white-space: nowrap;
}

.mini-panel {
  border-radius: 18px;
  padding: 1rem;
}

.simple-card {
  border-radius: 18px;
  padding: 1rem;
}

.simple-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.simple-value {
  margin-top: 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0f172a;
}

.simple-detail {
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.5;
}

.field {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.72rem 0.85rem;
  color: #0f172a;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.flatpickr-input[readonly] {
  background: #ffffff;
  cursor: pointer;
}

.flatpickr-alt-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.72rem 0.85rem;
  color: #0f172a;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.flatpickr-alt-input:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.table-head {
  padding: 0.82rem 1rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.head-with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

.tooltip-box {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.55rem);
  z-index: 20;
  width: 14rem;
  transform: translateX(-50%);
  border-radius: 12px;
  background: #0f172a;
  padding: 0.65rem 0.75rem;
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.tooltip-box::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #0f172a transparent;
}

.tooltip-wrap:hover .tooltip-box,
.tooltip-wrap:focus-visible .tooltip-box,
.tooltip-wrap:focus-within .tooltip-box {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-2px);
}

.auth-body {
  background:
    radial-gradient(circle at top left, rgba(148, 163, 184, 0.18), transparent 28rem),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.auth-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 28rem;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
  padding: 2rem;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.auth-back-link:hover {
  color: #0f172a;
}

.auth-field {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  font-size: 1rem;
}

.auth-otp-field {
  text-align: center;
  letter-spacing: 0.5rem;
  font-weight: 700;
}

.auth-primary-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #0f172a;
  padding: 0.9rem 1rem;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 180ms ease, transform 180ms ease;
}

.auth-primary-button:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

.transaction-page {
  background:
    radial-gradient(circle at top left, rgba(148, 163, 184, 0.18), transparent 28rem),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.transaction-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem 2.5rem;
}

.transaction-card {
  width: 100%;
  max-width: 32rem;
  border: 1px solid #e2e8f0;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
  padding: 1.5rem;
}

.transaction-card-wide {
  max-width: 72rem;
}

.transaction-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.transaction-back-link {
  display: inline-flex;
  align-items: center;
  color: #475569;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.transaction-back-link:hover {
  color: #0f172a;
}

.transaction-logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  background: #ffffff;
  padding: 0.65rem 1rem;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.transaction-logout-button:hover {
  border-color: #94a3b8;
  color: #0f172a;
  background: #f8fafc;
}

.transaction-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.transaction-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.35rem 0.8rem;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.transaction-tablist {
  display: inline-flex;
  width: fit-content;
  gap: 0.55rem;
  padding: 0.35rem;
  border-radius: 18px;
  background: #e2e8f0;
}

.transaction-tab {
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.82rem 1.15rem;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.transaction-tab.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.transaction-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.trade-card,
.transaction-select-card,
.transaction-meta-card {
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: #ffffff;
}

.trade-card {
  padding: 1.4rem;
}

.trade-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.trade-card-kicker {
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 500;
}

.trade-card-title {
  margin-top: 0.4rem;
  color: #0f172a;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.trade-card-limit {
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.5;
}

.trade-amount-row {
  margin-top: 1.25rem;
}

.trade-label {
  display: block;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.trade-input {
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #0f172a;
  outline: none;
}

.trade-input::placeholder {
  color: #94a3b8;
}

.trade-input-large {
  padding: 0;
  background: transparent;
  color: #0f172a;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.05;
}

.trade-divider {
  height: 1px;
  margin: 1.35rem 0;
  background: rgba(148, 163, 184, 0.14);
}

.trade-summary-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  margin-top: 0.7rem;
}

.trade-summary-label {
  color: #334155;
  font-size: 0.98rem;
  font-weight: 600;
}

.trade-summary-value {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
}

.trade-summary-detail {
  margin-top: 0.4rem;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.55;
}

.transaction-select-card {
  padding: 1.15rem 1.2rem;
}

.transaction-select-label {
  display: block;
  margin-bottom: 0.75rem;
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 600;
}

.transaction-select-wrap {
  position: relative;
}

.transaction-select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #ffffff;
  padding: 1rem 1rem;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
}

.transaction-detail-grid {
  display: grid;
  gap: 0.95rem;
}

.transaction-info-grid {
  display: grid;
  gap: 0.95rem;
}

.transaction-info-item {
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  padding: 1rem;
}

.transaction-info-label {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}

.transaction-info-value {
  margin-top: 0.45rem;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.transaction-field-label {
  display: block;
  margin-bottom: 0.55rem;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}

.transaction-detail-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #ffffff;
  padding: 0.95rem 1rem;
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 500;
  outline: none;
}

.transaction-detail-input::placeholder {
  color: #94a3b8;
}

.transaction-detail-textarea {
  min-height: 7rem;
  resize: vertical;
}

.transaction-meta-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 1rem;
}

.transaction-mini-card {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #f8fafc;
  padding: 1rem;
}

.transaction-mini-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.transaction-mini-value {
  margin-top: 0.45rem;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.transaction-submit-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  padding: 1rem 1.2rem;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.3);
}

.transaction-submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.34);
}

.transaction-bottom-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.transaction-bottom-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #ffffff;
  padding: 0.95rem 1rem;
  color: #475569;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.transaction-bottom-link:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a;
}

.transaction-bottom-link.active {
  border-color: #0f172a;
  background: #0f172a;
  color: #ffffff;
}

.transaction-list-shell {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.transaction-list-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.transaction-list-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.2rem;
}

.transaction-list-kicker {
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.transaction-list-title {
  margin-top: 0.35rem;
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}

.transaction-list-caption {
  max-width: 24rem;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: right;
}

.transaction-list-stat {
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.transaction-list-stat-label {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.transaction-list-stat-value {
  margin-top: 0.45rem;
  color: #0f172a;
  font-size: 1.15rem;
  font-weight: 700;
}

.transaction-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.transaction-list-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 24px;
  background: #ffffff;
  padding: 2rem 1rem;
  color: #64748b;
  text-align: center;
  font-size: 0.95rem;
}

.transaction-type-pill,
.transaction-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.transaction-history-card {
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: #ffffff;
  padding: 1.15rem 1.2rem;
  display: grid;
  gap: 1rem;
}

.transaction-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.transaction-history-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.transaction-history-id {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.5;
  word-break: break-all;
  text-align: right;
}

.transaction-history-amount {
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  padding: 1rem;
}

.transaction-history-pair {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.transaction-history-final {
  margin-top: 0.45rem;
  color: #0f172a;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

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

.transaction-history-item,
.transaction-history-note {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #f8fafc;
  padding: 0.95rem 1rem;
}

.transaction-history-label {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.transaction-history-value,
.transaction-history-note-value {
  margin-top: 0.45rem;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.55;
}

@media (max-width: 767px) {
  .auth-card,
  .transaction-card {
    padding: 1.35rem;
  }

  .transaction-payment-grid,
  .transaction-meta-card,
  .transaction-list-summary,
  .transaction-bottom-nav,
  .transaction-history-grid {
    grid-template-columns: 1fr;
  }

  .trade-card-title {
    font-size: 1.35rem;
  }

  .trade-input-large {
    font-size: 2.45rem;
  }

  .transaction-history-head {
    flex-direction: column;
  }

  .transaction-history-id {
    text-align: left;
  }
}

.table-cell {
  padding: 0.85rem 1rem;
  white-space: nowrap;
  color: #0f172a;
  font-size: 0.9rem;
  line-height: 1.5;
}

.time-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.breakdown-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  padding: 0.28rem 0.7rem;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.breakdown-button:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.signal-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.signal-low {
  background: #ecfdf5;
  color: #166534;
}

.signal-high {
  background: #fef2f2;
  color: #991b1b;
}

.signal-neutral {
  background: #f8fafc;
  color: #475569;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 24px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 1.25rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-title {
  margin-top: 0.3rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
}

.modal-subtitle {
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.5;
}

.modal-close {
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  padding: 0.5rem 0.9rem;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
}

.modal-content {
  display: grid;
  gap: 0.9rem;
}

.modal-empty {
  border-radius: 18px;
  border: 1px dashed #cbd5e1;
  padding: 1rem;
  color: #64748b;
  font-size: 0.9rem;
}

.breakdown-item {
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 1rem;
}

.breakdown-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.breakdown-date {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}

.breakdown-spread {
  color: #475569;
  font-size: 0.84rem;
  font-weight: 600;
}

.breakdown-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.breakdown-metric {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0.9rem;
}

.breakdown-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.breakdown-value {
  margin-top: 0.45rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.breakdown-detail {
  margin-top: 0.25rem;
  color: #475569;
  font-size: 0.84rem;
 }

@media (max-width: 768px) {
  .panel,
  .metric-card,
  .hero-panel {
    padding: 1.1rem;
  }

  .metric-value {
    font-size: 1.2rem;
  }

  .modal-card {
    padding: 1rem;
  }

  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}
