﻿:root {
  --bg1: #f7f7f0;
  --bg2: #d9e6f2;
  --card: rgba(255, 255, 255, 0.9);
  --line: #c9d5e0;
  --text: #0b132b;
  --accent: #3a506b;
  --hot: #c1121f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Tahoma, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 20%, var(--bg2) 0%, var(--bg1) 65%);
}

.bg-shape {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, rgba(58,80,107,.28), rgba(58,80,107,0));
  pointer-events: none;
}

.wrap {
  width: min(100% - 28px, 1440px);
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 10px 24px rgba(11,19,43,.06);
}

.grid { display: grid; gap: 10px; }
.hidden { display: none; }
.login-card { margin-top: 48px; }
.login-logo {
  display: block;
  width: 76px !important;
  height: 76px !important;
  max-width: 76px !important;
  max-height: 76px !important;
  object-fit: contain;
  margin: 0 auto 10px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #d5dfeb;
  padding: 8px;
}
.login-card form.grid { max-width: 420px; margin-inline: auto; }
.business-address {
  max-width: 420px;
  margin: 0 auto 12px;
  color: #52677f;
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}
.link-button {
  display: block;
  max-width: 420px;
  margin: 10px auto 0;
  background: transparent;
  color: #1c2541;
  border: 1px solid #9fb3c8;
}
.register-form {
  max-width: 420px;
  margin: 12px auto 0;
  padding-top: 12px;
  border-top: 1px dashed #b4c3d3;
}
.register-form input[readonly] {
  background: #eef3f7;
}
.login-rules-box {
  border: 1px solid #e0b35b;
  background: #fff8e6;
  color: #3d2d0a;
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.8;
  text-align: right;
}
.login-rules-box p {
  max-height: 190px;
  overflow-y: auto;
  margin: 0 0 10px;
  padding-inline-end: 4px;
  white-space: pre-wrap;
}
.login-rules-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.login-rules-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 4px;
}
.muted { color: #4d5f77; }
.error { color: var(--hot); min-height: 20px; }
.form-feedback {
  margin: 8px auto 0;
  max-width: 520px;
  font-size: 13px;
  border-radius: 10px;
  padding: 8px 10px;
}
.form-feedback.error {
  color: #9f1d1d;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}
.form-feedback.success {
  color: #14532d;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 8px;
  z-index: 30;
  backdrop-filter: blur(8px);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-logo {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #d4deea;
  padding: 5px;
}
.topbar-business-address {
  display: block;
  margin-top: 4px;
  color: #52677f;
  font-size: 11px;
  max-width: 440px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill { background: var(--accent); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.pill-market {
  background: linear-gradient(135deg, #0f766e, #0ea5a4);
}
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.tab { display: none; }
.tab.active { display: block; }
.app-body {
  display: grid;
  gap: 12px;
}
.app-main {
  min-width: 0;
}
.pages-sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(11,19,43,.06);
}
.pages-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed #cbd7e6;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.pages-menu-list {
  display: grid;
  gap: 6px;
}
.pages-menu-list button {
  width: 100%;
  text-align: right;
  background: #f8fbff;
  color: #15324f;
  border: 1px solid #d4deea;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
}
.pages-menu-list button:hover {
  background: #eef5ff;
  border-color: #b6cae0;
}
.cms-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.cms-page-head h3 {
  margin: 0;
}
.cms-page-content {
  line-height: 2;
  white-space: normal;
  background: #fbfdff;
  border: 1px solid #d7e1ec;
  border-radius: 12px;
  padding: 12px;
}

.tab .card form.grid,
.tab .card form.trade-sheet,
.tab .card > textarea,
.tab .card > input,
.tab .card > select {
  max-width: 680px;
  margin-inline: auto;
}

#settings-form.settings-form {
  max-width: 560px;
  margin-inline: auto;
  gap: 12px;
}
.settings-section {
  border: 1px solid #d4deea;
  border-radius: 14px;
  background: #f8fbff;
  padding: 10px;
  display: grid;
  gap: 10px;
}
.settings-section-title {
  margin: 0 0 2px;
  font-size: 14px;
  color: #1f3c5d;
  border-bottom: 1px dashed #cbd7e6;
  padding-bottom: 6px;
}
.settings-note {
  background: #eef5ff;
  border: 1px solid #d1e3ff;
  color: #234a7a;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
}
.settings-subgrid {
  display: grid;
  gap: 10px;
}
.settings-advanced {
  border: 1px dashed #c7d5e8;
  border-radius: 12px;
  padding: 8px 10px;
  background: #fcfdff;
}
.settings-advanced > summary {
  cursor: pointer;
  font-weight: 700;
  color: #2a4b73;
  margin-bottom: 8px;
}

.live-price-card {
  position: relative;
  overflow: hidden;
}
.live-price-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14,165,164,.08), rgba(250,204,21,.08));
  pointer-events: none;
}
.live-price-card > * {
  position: relative;
}
.live-price-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.live-price-head h3 {
  margin: 0;
}
.live-badge {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #8bd8c8;
  background: #ecfdf5;
  color: #047857;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.live-badge span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,.5);
  animation: livePulse 1.6s infinite;
}
.live-updated {
  display: block;
  color: #52677f;
  margin-bottom: 10px;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

#settings-form .form-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 10px;
  margin: 0;
}

#settings-form .form-row > span {
  font-size: 13px;
  color: #23364d;
  font-weight: 700;
}

#settings-form .form-row.form-row-check {
  grid-template-columns: 1fr auto;
  background: #f1f5f9;
  border: 1px solid #d2dbe6;
  border-radius: 12px;
  padding: 10px 12px;
}

#settings-form .form-row.form-row-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

input, textarea, select, button {
  width: 100%;
  border: 1px solid #9fb3c8;
  border-radius: 12px;
  font-size: 14px;
  padding: 10px;
}

textarea { min-height: 84px; }
button {
  background: linear-gradient(135deg, #1c2541, #3a506b);
  color: #fff;
  border: none;
}
button.ghost { background: #495867; width: 90px; }
.tabs button.active { background: #c1121f; }
.item { border-bottom: 1px dashed #b4c3d3; padding: 8px 0; }
.item .meta { display: inline-block; margin-inline-start: 6px; color: #546377; font-size: 12px; }
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.data-actions {
  justify-content: flex-start;
}
.list-toolbar select {
  width: auto;
  min-width: 74px;
  padding: 6px 8px;
  border-radius: 9px;
}
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.user-row.user-verified {
  background: #e9f8ef;
  border: 1px solid #9dd8b2;
  border-radius: 10px;
  padding: 8px;
}
.user-row .user-row-main {
  flex: 1 1 280px;
}
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.row-actions button {
  width: auto;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 9px;
}
.mono { font-family: Consolas, "Courier New", monospace; }
.hidden-field { display: none; }
.clock-box {
  margin: 0 0 8px 0;
  background: #e2e8f0;
  border: 1px solid #c1d0e1;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  color: #1e293b;
}
.sparkline {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 18px;
  letter-spacing: 1px;
  color: #0f172a;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.overview-box {
  border: 1px solid #cfdae6;
  border-radius: 12px;
  padding: 10px;
  background: #f8fbff;
}
.overview-box small {
  display: block;
  color: #4e6078;
  margin-bottom: 6px;
}
.overview-box b {
  font-size: 18px;
}

#tab-dashboard .card {
  width: min(100%, 760px);
  margin-inline: auto;
}

#tab-dashboard .dashboard-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 760px);
  margin-inline: auto;
}

#tab-dashboard .dashboard-row .card {
  width: 100%;
  margin-bottom: 0;
}

#tab-dashboard .card h3 {
  margin-top: 4px;
  margin-bottom: 10px;
}

#tab-dashboard .overview-box {
  padding: 8px 10px;
  border-radius: 10px;
}

#tab-dashboard .overview-box small {
  margin-bottom: 4px;
  font-size: 12px;
}

#tab-dashboard .overview-box b {
  font-size: 16px;
}

.report-grid {
  max-width: 760px !important;
  gap: 8px;
}

#report-filter-form.report-grid {
  max-width: 680px !important;
  margin-inline: auto;
}

#report-filter-form.report-grid .form-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #f9fbff, #eef3fa);
  border: 1px solid #d4dfed;
  border-radius: 12px;
  padding: 7px 10px;
}

#report-filter-form.report-grid .form-row > span {
  font-size: 12px;
  font-weight: 700;
  color: #27405f;
}

#report-filter-form.report-grid input,
#report-filter-form.report-grid select {
  max-width: 230px;
  justify-self: end;
  border-radius: 10px;
  border-color: #b4c5d9;
  background: #ffffff;
  font-size: 13px;
  padding: 8px 9px;
}

#report-filter-form.report-grid button[type="submit"] {
  max-width: 320px;
  justify-self: center;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(28, 37, 65, .18);
}

.chart-bars {
  display: grid;
  gap: 10px;
}

.permissions-table-wrap {
  overflow-x: auto;
  border: 1px solid #d5e0eb;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 10px;
}

.permissions-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.permissions-table th,
.permissions-table td {
  border-bottom: 1px solid #edf2f7;
  padding: 8px 10px;
  font-size: 13px;
  text-align: center;
}

.permissions-table th {
  background: linear-gradient(180deg, #eef4fb, #dde8f5);
  color: #1f344d;
  font-weight: 800;
}

.permissions-table td:first-child,
.permissions-table td:nth-child(2) {
  text-align: right;
}
.chart-row {
  display: grid;
  grid-template-columns: 92px 1fr 1fr;
  align-items: center;
  gap: 8px;
}
.chart-row .day {
  font-size: 12px;
  color: #475569;
}
.bar {
  height: 12px;
  border-radius: 999px;
  min-width: 2px;
}
.bar.buy { background: linear-gradient(90deg, #1d4ed8, #60a5fa); }
.bar.sell { background: linear-gradient(90deg, #b91c1c, #f87171); }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.pager .pager-info {
  font-size: 12px;
  color: #53657c;
}
.pager .pager-btns {
  display: flex;
  gap: 6px;
}
.pager .pager-btns button {
  width: auto;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 10px;
}

.orders-table-wrap {
  overflow-x: auto;
  border: 1px solid #d5e0eb;
  border-radius: 14px;
  background: #ffffff;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

.orders-table thead th {
  background: linear-gradient(180deg, #eef4fb, #dde8f5);
  color: #1f344d;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 8px;
  border-bottom: 1px solid #c8d7e8;
}

.orders-table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
  color: #1e293b;
  vertical-align: middle;
  white-space: nowrap;
}

.orders-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.orders-table tbody tr.accounting-row-positive {
  background: #ecfdf3;
}

.orders-table tbody tr.accounting-row-negative {
  background: #fff1f2;
}

.orders-table tbody tr.accounting-row-positive:nth-child(even) {
  background: #dcfce7;
}

.orders-table tbody tr.accounting-row-negative:nth-child(even) {
  background: #ffe4e6;
}

.orders-table tbody tr:hover {
  background: #f1f7ff;
}

.orders-table tbody tr.accounting-row-positive:hover {
  background: #d1fae5;
}

.orders-table tbody tr.accounting-row-negative:hover {
  background: #fecdd3;
}

.order-status-select {
  min-width: 124px;
  width: auto;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #a7bacf;
  background: #fff;
  font-size: 12px;
}

.status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  border: 1px solid transparent;
}
.status-pending { background: #fff7e6; color: #8a6200; border-color: #ecd28f; }
.status-approved { background: #e9f8ef; color: #17643b; border-color: #9dd8b2; }
.status-completed { background: #e8f1ff; color: #1d4f91; border-color: #a9c3ea; }
.status-rejected { background: #fdebec; color: #8f2126; border-color: #ebb1b5; }

.trade-card {
  background: linear-gradient(170deg, #f7f9fc 0%, #edf2f7 100%);
  border: 1px solid #cfd8e3;
  position: relative;
  overflow: hidden;
}
.trade-card::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  left: -70px;
  top: -70px;
  background: radial-gradient(circle, rgba(59,130,246,.17), rgba(59,130,246,0));
  pointer-events: none;
}
.trade-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #0f172a;
}
.trade-sheet {
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  padding: 14px;
  border: 1px solid #d6e0ea;
  backdrop-filter: blur(3px);
}
.order-mode-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.order-mode-box {
  border-radius: 14px;
  background: #d5d9df;
  border: 1px solid #c3cad4;
  padding: 12px 10px;
  text-align: center;
  font-size: 34px;
  font-weight: 800;
}
.order-mode-box.mode-sell {
  color: #be1e2d;
}
.order-mode-box.mode-cash {
  color: #111827;
}
.trade-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.trade-type {
  border-radius: 14px;
  border: 2px solid #ced7e0;
  background: #e8edf3;
  color: #111827;
  padding: 12px 10px;
  font-size: 16px;
  font-weight: 700;
}
.trade-type.active {
  border-color: #1d4ed8;
  background: #e1ecff;
}
.trade-type[data-order-type="buy"] {
  background: #e9f8ef;
  border-color: #9ad7b0;
}
.trade-type[data-order-type="buy"].active {
  background: #d5f5e1;
  border-color: #1f9d55;
  box-shadow: 0 0 0 2px rgba(31, 157, 85, 0.18) inset;
}
.trade-type[data-order-type="sell"] {
  background: #fdebec;
  border-color: #f1a7aa;
}
.trade-type[data-order-type="sell"].active {
  background: #fddde0;
  border-color: #c62828;
  box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.15) inset;
}
.trade-type-title {
  display: block;
}
.trade-sell {
  color: #c02323;
}
.trade-gold {
  display: block;
  margin-top: 4px;
  color: #d4a40a;
  letter-spacing: 1px;
  font-size: 12px;
}
.trade-price-meta {
  background: #e8ebf0;
  border: 1px solid #c8ced8;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.7;
  color: #334155;
}
.trade-price-meta p {
  margin: 0;
}
.coin-prices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.coin-box {
  border-radius: 12px;
  border: 1px solid #ced8e5;
  background: #f8fbff;
  padding: 8px;
  text-align: center;
  font-size: 12px;
}
.trade-input-wrap {
  position: relative;
  display: block;
}
.trade-input-wrap input,
.trade-input-wrap textarea {
  background: #e9eef4;
  border: 1px solid #c8d3df;
  border-radius: 18px;
  padding: 14px 44px 14px 16px;
  text-align: center;
  font-size: 18px;
  color: #334155;
}
.trade-input-wrap textarea {
  min-height: 72px;
  font-size: 18px;
}
.trade-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  opacity: .7;
  z-index: 1;
}
.trade-limits {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
  color: #111827;
}
.trade-limits .min {
  color: #1d4ed8;
}
.trade-limits .max {
  color: #c02323;
}
.order-rules-box {
  border: 1px solid #ef9a9a;
  background: #ffebee;
  color: #7f1d1d;
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.8;
}
.order-rules-box p {
  margin: 0 0 8px;
  white-space: pre-wrap;
}
.order-rules-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.order-rules-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.order-rules-code-wrap {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 8px;
}
.trade-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.trade-actions .btn-buy,
.trade-actions .btn-sell {
  width: 48%;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 800;
  padding: 10px 8px;
}
.trade-actions .btn-buy {
  background: #ecfff4;
  color: #136a3b;
  border: 3px solid #1f9d55;
}
.trade-actions .btn-sell {
  background: #fff1f2;
  color: #9f1d1d;
  border: 3px solid #c62828;
}
.order-status-visual {
  margin-top: 8px;
  border: 1px dashed #c3d0e2;
  border-radius: 12px;
  padding: 10px;
  background: #f8fbff;
}
.order-status-visual .status-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.order-status-visual .status-icon {
  font-size: 24px;
  font-weight: 800;
}
.order-status-visual .status-text {
  font-weight: 700;
  text-align: center;
}
.order-status-visual .status-final-card {
  width: 100%;
  border: 1px solid #d5e0f1;
  background: linear-gradient(135deg, #ffffff, #f1f6ff);
  border-radius: 14px;
  padding: 16px 12px;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.order-status-visual.status-ok .status-final-card {
  border-color: #b7e4c7;
  background: linear-gradient(135deg, #f3fff7, #ecfdf3);
}
.order-status-visual.status-bad .status-final-card {
  border-color: #f1b9bf;
  background: linear-gradient(135deg, #fff5f6, #fff1f2);
}
.order-status-visual .status-final-card .status-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid #d5e0f1;
}
.order-status-visual.status-ok .status-icon,
.order-status-visual.status-ok .status-text {
  color: #11663a;
}
.order-status-visual.status-bad .status-icon,
.order-status-visual.status-bad .status-text {
  color: #9f1d1d;
}
.order-status-visual .countdown-wrap {
  margin-top: 8px;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.order-status-visual .countdown-circle {
  --progress: 100;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: conic-gradient(#2563eb calc(var(--progress) * 1%), #dbe7f8 0);
  display: grid;
  place-items: center;
}
.order-status-visual .countdown-circle > span {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cdd8ea;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: #1e3a8a;
}
.order-market-card {
  width: min(100%, 640px);
  margin-inline: auto;
  background: #d6d8dc;
  border: 1px solid #c5c9d0;
  border-radius: 18px;
  padding: 10px;
}
.order-market-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}
.order-market-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.order-market-toggle button {
  border-radius: 16px;
  border: 2px solid #a8afba;
  background: #babec5;
  color: #3f4653;
  font-size: 28px;
  font-weight: 800;
  padding: 10px 4px;
}
.order-market-toggle button.active {
  background: #f7f7f8;
  border-color: #4b93f2;
  color: #1f68c9;
}
.order-market-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.order-market-side p {
  margin: 0 0 8px;
  font-size: 44px;
  font-weight: 800;
  text-align: center;
}
.order-market-side.sell-side p {
  color: #d73d4f;
}
.order-market-side.buy-side p {
  color: #2aa565;
}
.order-price-box {
  border-radius: 20px;
  border: 2px solid #bdc3cf;
  background: #f8f9fb;
  box-shadow: 0 6px 12px rgba(40, 46, 57, 0.18);
  padding: 12px 10px;
}
.order-price-box.active.sell {
  border-color: #cf3448;
  box-shadow: 0 0 0 3px rgba(207, 52, 72, 0.22) inset;
}
.order-price-box.active.buy {
  border-color: #1f9d55;
  box-shadow: 0 0 0 3px rgba(31, 157, 85, 0.2) inset;
}
.order-price-box b {
  display: block;
  font-size: 32px;
  line-height: 1.15;
}
.order-price-box small {
  display: block;
  font-size: 20px;
  line-height: 1.2;
  margin-top: 2px;
}
.sell-side .order-price-box b,
.sell-side .order-price-box small {
  color: #c53346;
}
.buy-side .order-price-box b,
.buy-side .order-price-box small {
  color: #189558;
}
.trade-sheet-mobile {
  background: #d5d7db;
  border: 1px solid #c5cad1;
  border-radius: 16px;
  padding: 12px;
}
.trade-sheet-mobile .order-mode-box {
  font-size: 48px;
  background: #c6c9cf;
  border-color: #bec3cb;
  padding: 12px 8px;
}
.trade-sheet-mobile .order-mode-box.mode-buy {
  color: #1f9d55;
}
.trade-sheet-mobile .order-mode-box.mode-sell {
  color: #cf3448;
}
.trade-sheet-mobile .order-mode-box.mode-cash {
  color: #1f2630;
}
.order-balance-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.order-balance-summary div {
  background: #eef3f7;
  border: 1px solid #c3ccd8;
  border-radius: 14px;
  padding: 8px 10px;
  text-align: center;
}
.order-balance-summary small {
  display: block;
  color: #4d5f77;
  font-size: 13px;
  margin-bottom: 4px;
}
.order-balance-summary b {
  display: block;
  color: #1f2630;
  font-size: 19px;
  line-height: 1.35;
}
.trade-sheet-mobile .trade-input-wrap input,
.trade-sheet-mobile .trade-input-wrap textarea {
  background: #b9bdc4;
  border: 1px solid #adb3bd;
  border-radius: 18px;
  color: #4c5562;
  font-size: 33px;
  min-height: 72px;
}
.trade-sheet-mobile .trade-input-wrap textarea {
  min-height: 88px;
  padding-top: 20px;
}
.trade-sheet-mobile .trade-icon {
  color: #5b636f;
  font-size: 30px;
}
.trade-sheet-mobile .trade-limits {
  font-size: 33px;
  font-weight: 700;
}
.trade-sheet-mobile .trade-limits .min {
  color: #1e66cf;
}
.trade-sheet-mobile .trade-limits .max {
  color: #ca3044;
}
.trade-actions-mobile {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.btn-close-order {
  background: #f8f8f8;
  color: #b82232;
  border: 3px solid #be2f40;
  border-radius: 18px;
  font-size: 34px;
  font-weight: 800;
  padding: 8px;
}
.btn-continue-order {
  background: #f8f8f8;
  color: #2262c4;
  border: 3px solid #2f74d4;
  border-radius: 18px;
  font-size: 34px;
  font-weight: 800;
  padding: 8px;
}
.order-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px;
}
.order-modal.hidden {
  display: none;
}
.order-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.order-modal-content {
  position: relative;
  z-index: 1;
  width: min(100%, 700px);
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  padding: 6px 2px 14px;
}
.order-modal-close {
  position: sticky;
  top: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  margin-inline-start: auto;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #cbd5e1;
  font-size: 26px;
  line-height: 1;
}
#orders-table-report-wrap {
  margin-top: 10px;
}
.accounting-final-weight {
  margin: 6px 0 10px;
  font-size: 15px;
  font-weight: 700;
}
.accounting-final-weight.positive b {
  color: #136f3a;
}
.accounting-final-weight.negative b {
  color: #b91c1c;
}
.amount-negative {
  color: #b91c1c;
  font-weight: 700;
}
.amount-positive {
  color: #136f3a;
  font-weight: 700;
}
.support-fab {
  position: fixed;
  left: 14px;
  bottom: 18px;
  z-index: 60;
  width: auto;
  min-width: 72px;
  padding: 12px 14px;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid #065f46;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.32);
}

#transfer-balance-box {
  margin-bottom: 10px;
}

#settlement-request-form,
#accounting-search {
  max-width: 520px;
  margin-bottom: 10px;
}

@media (min-width: 860px) {
  .tabs { grid-template-columns: repeat(12, 1fr); }
  .app-body {
    grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
    align-items: start;
  }
  .pages-sidebar.hidden + .app-main {
    grid-column: 1 / -1;
  }
  .pages-sidebar {
    position: sticky;
    top: 86px;
  }
  .order-market-card {
    max-width: 640px;
  }
  .trade-card {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }
  #tab-dashboard #dash-overview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(120% 100% at 100% 0%, #e5ecf9 0%, rgba(229,236,249,0) 60%),
      radial-gradient(140% 120% at 0% 100%, #f8efe2 0%, rgba(248,239,226,0) 65%),
      #f6f8fc;
  }
  .bg-shape {
    width: 260px;
    height: 260px;
    top: -90px;
    left: -70px;
  }
  .wrap {
    max-width: 460px;
    padding: 10px 10px calc(90px + env(safe-area-inset-bottom));
  }
  .card {
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 10px 28px rgba(11, 19, 43, .08);
  }
  .login-card {
    margin-top: 16px;
  }
  .topbar {
    top: 6px;
    border-radius: 14px;
    padding: 10px 12px;
  }
  .topbar #me-name {
    display: block;
    font-size: 15px;
    line-height: 1.2;
  }
  .pill {
    font-size: 11px;
    padding: 2px 8px;
  }
  .tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    margin: 0;
    background: rgba(246, 248, 252, 0.92);
    border-top: 1px solid #d9e2ef;
    backdrop-filter: blur(10px);
  }
  .tabs button {
    min-width: 74px;
    width: auto;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    gap: 3px;
    border-radius: 16px;
    padding: 7px 8px;
    font-size: 11px;
    line-height: 1.2;
    background: #ffffff;
    color: #334155;
    border: 1px solid #d7e0ec;
    box-shadow: 0 3px 10px rgba(11, 19, 43, .08);
  }
  .tabs button::before {
    display: block;
    font-size: 20px;
    line-height: 1;
    color: #3a506b;
  }
  .tabs button[data-tab="dashboard"]::before { content: "⌂"; }
  .tabs button[data-tab="orders"]::before { content: "◆"; }
  .tabs button[data-tab="transfers"]::before { content: "⇄"; }
  .tabs button[data-tab="users"]::before { content: "◉"; }
  .tabs button[data-tab="reports"]::before { content: "▤"; }
  .tabs button[data-tab="accounting"]::before { content: "₮"; }
  .tabs button[data-tab="sms"]::before { content: "✉"; }
  .tabs button[data-tab="settings"]::before { content: "⚙"; }
  .tabs button[data-tab="cms"]::before { content: "□"; }
  .tabs button[data-tab="guide"]::before { content: "?"; }
  .tabs button[style*="display: none"] {
    display: none !important;
  }
  .tabs button.active {
    background: #c1121f;
    color: #fff;
    border-color: #c1121f;
    box-shadow: 0 6px 16px rgba(193, 18, 31, .26);
  }
  .tabs button.active::before {
    color: #fff;
  }
  .tab .card form.grid,
  .tab .card form.trade-sheet,
  .tab .card > textarea,
  .tab .card > input,
  .tab .card > select {
    max-width: none;
  }
  .trade-card {
    max-width: none;
    width: 100%;
  }
  .order-market-card {
    width: 100%;
  }
  .order-modal {
    padding: 8px;
  }
  .order-modal-content {
    width: 100%;
    max-height: calc(100vh - 16px);
  }
  .order-market-side p {
    font-size: 34px;
  }
  .order-price-box b {
    font-size: 26px;
  }
  .order-price-box small {
    font-size: 16px;
  }
  .trade-sheet {
    padding: 11px;
    gap: 8px;
    border-radius: 14px;
  }
  .trade-sheet-mobile .order-mode-box {
    font-size: 34px;
  }
  .trade-sheet-mobile .trade-input-wrap input,
  .trade-sheet-mobile .trade-input-wrap textarea {
    font-size: 24px;
    min-height: 62px;
  }
  .trade-sheet-mobile .trade-limits {
    font-size: 24px;
  }
  .btn-close-order,
  .btn-continue-order {
    font-size: 26px;
  }
  .order-mode-box {
    font-size: 26px;
    padding: 10px 8px;
  }
  .coin-prices {
    grid-template-columns: 1fr;
  }
  .order-rules-code-wrap {
    grid-template-columns: 1fr;
  }
  .trade-input-wrap input,
  .trade-input-wrap textarea {
    border-radius: 14px;
    font-size: 16px;
    padding: 12px 38px 12px 12px;
  }
  .trade-price-meta {
    border-radius: 10px;
    font-size: 12px;
  }
  .trade-actions .btn-buy,
  .trade-actions .btn-sell {
    font-size: 16px;
    border-radius: 14px;
    padding: 10px 6px;
  }

  #settings-form.settings-form {
    max-width: none;
  }

  #settings-form .form-row {
    grid-template-columns: 1fr;
  }

  #settings-form .form-row.form-row-check {
    grid-template-columns: 1fr auto;
  }

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

  #tab-dashboard .dashboard-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }
  #report-filter-form.report-grid .form-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
  }
  #report-filter-form.report-grid input,
  #report-filter-form.report-grid select,
  #report-filter-form.report-grid button[type="submit"] {
    max-width: none;
    justify-self: stretch;
  }
  .orders-table {
    min-width: 760px;
  }
  .orders-table thead th,
  .orders-table tbody td {
    font-size: 12px;
    padding: 8px 6px;
  }
  .pager {
    position: sticky;
    bottom: calc(70px + env(safe-area-inset-bottom));
    background: rgba(246, 248, 252, .95);
    border: 1px solid #d5deeb;
    border-radius: 12px;
    padding: 8px;
    backdrop-filter: blur(8px);
  }
  .support-fab {
    left: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

@media print {
  body {
    background: #fff !important;
  }
  .tabs,
  #logout,
  #refresh-price,
  .list-toolbar,
  .support-fab,
  .topbar {
    display: none !important;
  }
  .tab {
    display: block !important;
  }
  .card {
    border: 1px solid #aaa;
    box-shadow: none;
    page-break-inside: avoid;
  }
}

body #login-card > img#login-logo.login-logo {
  display: block !important;
  width: 76px !important;
  height: 76px !important;
  min-width: 76px !important;
  min-height: 76px !important;
  max-width: 76px !important;
  max-height: 76px !important;
  object-fit: contain !important;
}

body #app .topbar img#topbar-logo.topbar-logo {
  display: block !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  object-fit: contain !important;
  flex: 0 0 44px !important;
}
