:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #647080;
  --line: #d9e0e7;
  --panel: #ffffff;
  --bg: #f4f7f8;
  --accent: #0f766e;
  --accent-2: #b45309;
  --danger: #b42318;
  --good: #087443;
  --nav: #13231f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eaf1ee;
}

.login-screen[hidden],
.app-shell[hidden],
.admin-only[hidden],
[hidden] {
  display: none !important;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(23, 32, 42, 0.12);
}

.login-card h1 {
  margin: 8px 0 0;
}

.login-card p {
  color: var(--muted);
  margin-bottom: 4px;
}

.login-brand {
  margin-bottom: 0;
}

.login-brand span {
  color: var(--muted);
}

.login-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

.login-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.password-toggle-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-card .password-toggle-button {
  margin-top: -6px;
}

.password-modal .password-toggle-button,
.user-form .password-toggle-button {
  justify-self: start;
  min-width: 74px;
}

.password-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 20, 28, 0.42);
  backdrop-filter: blur(3px);
}

.password-modal-overlay[hidden] {
  display: none;
}

.password-modal {
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(7, 20, 28, 0.2);
}

.password-modal h2 {
  margin: 4px 0 6px;
  font-size: 28px;
}

.password-modal p,
.password-modal small {
  color: var(--muted);
  line-height: 1.5;
}

.password-modal label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.password-modal label span {
  font-size: 14px;
}

.modal-eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.password-modal-actions {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: var(--nav);
  color: #f6fbf8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand span,
.eyebrow,
.panel-header span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.brand span {
  color: #b9c8c0;
}

.nav {
  display: grid;
  gap: 14px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-parent {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 12px;
  color: #8fa39a;
  font-size: 12px;
  font-weight: 900;
}

.nav-parent::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.nav a {
  position: relative;
  color: #dce8e2;
  text-decoration: none;
  padding: 10px 12px 10px 34px;
  border-radius: 8px;
  font-size: 14px;
}

.nav-child::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: rgba(220, 232, 226, 0.16);
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.09);
}

.nav a.active::before {
  background: #11b69e;
}

.user-card {
  margin-top: 26px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.user-card span,
.user-card small {
  display: block;
  color: #b9c8c0;
}

.user-card strong {
  display: block;
  margin: 4px 0;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.ghost-button,
form button,
.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 40px;
  padding: 0 14px;
}

form button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
}

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

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 18px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.content-grid:has(.page:not([hidden]).wide) {
  grid-template-columns: 1fr;
}

.wide {
  grid-column: 1 / -1;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.entry-form,
.stack-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.entry-form {
  grid-template-columns: 150px minmax(120px, 1fr) repeat(3, minmax(110px, 0.8fr)) 88px 88px 88px;
}

.purchase-form {
  grid-template-columns: 150px 150px minmax(120px, 1fr) repeat(3, minmax(110px, 0.7fr)) 88px;
}

.import-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.file-import input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-import span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.position-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 160px 140px auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.position-tools span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.price-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.price-status.positive {
  color: var(--good);
}

.price-status.negative {
  color: var(--danger);
}

.stack-form {
  grid-template-columns: 1fr;
}

.split-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #edf7f5;
  color: #0b5f59;
  font-size: 12px;
  font-weight: 800;
}

.pill.neutral {
  background: #f2f5f7;
  color: #52606d;
}

.pill.good {
  background: #ecfdf3;
  color: #067647;
}

.pill.warning {
  background: #fff7ed;
  color: #b45309;
}

.empty-cell {
  padding: 32px 10px;
  text-align: center;
  color: var(--muted);
}

.danger-button {
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 6px;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.edit-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 6px;
}

.inline-delete {
  margin-top: 8px;
  padding-left: 0;
}

.muted-line {
  color: var(--muted);
  margin-top: 6px;
}

.positive {
  color: var(--good);
}

.negative {
  color: var(--danger);
}

.allocation,
.target-list,
.strategy-list,
.profit-list,
.role-grid,
.log-list,
.trend-grid {
  display: grid;
  gap: 10px;
}

.allocation-row,
.target-item,
.strategy-item,
.profit-row,
.role-card,
.log-item,
.trend-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.plan-workbench {
  display: grid;
  gap: 18px;
}

.plan-section {
  display: grid;
  gap: 18px;
}

.plan-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1.2fr);
  gap: 16px;
  padding: 22px;
  border: 1px solid #dfeaf0;
  border-radius: 8px;
  background: #fbfdfe;
}

.plan-hero > div:first-child span,
.plan-summary-grid span,
.operation-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.plan-hero > div:first-child strong {
  color: #071c28;
  font-size: 38px;
  line-height: 1;
}

.plan-summary-grid,
.operation-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plan-summary-grid article,
.operation-summary article {
  padding: 14px;
  border: 1px solid #e2edf2;
  border-radius: 8px;
  background: #fff;
}

.plan-summary-grid strong,
.operation-summary strong {
  font-size: 24px;
}

.target-entry-form {
  grid-template-columns: 110px minmax(190px, 1fr) 130px 140px 140px 120px 110px;
}

.operation-entry-form {
  grid-template-columns: 130px 160px 120px minmax(120px, 1fr) 90px 120px 110px 110px minmax(180px, 1fr) 110px 110px;
}

.target-table {
  min-width: 760px;
  border-collapse: collapse;
}

.target-table th {
  background: #e8f1fb;
  color: #17202a;
  font-size: 15px;
}

.target-table th,
.target-table td {
  border: 1px solid #bdd0e3;
}

.target-table td {
  background: #edf5ff;
  font-size: 16px;
}

.target-table td:first-child span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.target-total-row {
  font-weight: 900;
}

.target-total-row td {
  background: #dfeeff;
}

.operation-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profit-query-tools {
  min-width: 160px;
}

.profit-query-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.profit-query-summary article {
  padding: 16px;
  border: 1px solid #dfeaf0;
  border-radius: 8px;
  background: #fbfdfe;
}

.profit-query-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.profit-query-summary strong {
  font-size: 22px;
}

.strategy-timeline {
  display: grid;
  gap: 16px;
}

.strategy-batch {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dfeaf0;
  border-radius: 8px;
  background: #fbfdfe;
}

.batch-summary-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(130px, 1fr));
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}

.batch-summary-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.batch-summary-row strong {
  font-size: 18px;
}

.batch-steps {
  display: grid;
  gap: 10px;
}

.strategy-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid #e2edf2;
  border-radius: 8px;
  background: #fff;
}

.step-index {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8f7ff;
  color: #0b85c8;
  font-weight: 900;
}

.status-chip {
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f5f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.operation-result {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0;
}

.strategy-step p {
  margin: 0;
  color: var(--ink);
}

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

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

.line-chart {
  min-height: 280px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.compact-chart {
  min-height: 196px;
  margin-top: 12px;
  padding: 10px;
}

.line-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.trend-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.trend-summary strong {
  font-size: 18px;
}

.trend-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-area {
  opacity: 0.12;
}

.trend-up.trend-line,
.trend-points.trend-up {
  stroke: var(--good);
}

.trend-up.trend-area {
  fill: var(--good);
}

.trend-down.trend-line {
  stroke: var(--danger);
}

.trend-points.trend-down {
  stroke: var(--danger);
}

.trend-down.trend-area {
  fill: var(--danger);
}

.trend-points circle {
  fill: #fff;
  stroke-width: 2;
}

.trend-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.empty-state {
  color: var(--muted);
  min-height: 120px;
  display: grid;
  place-items: center;
}

.change-log {
  margin-top: 18px;
}

.compact-header {
  margin-top: 0;
}

.log-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 140px;
  gap: 12px;
  align-items: start;
}

.log-item strong,
.log-item span {
  display: block;
}

.log-item span,
.log-item small {
  color: var(--muted);
  font-size: 13px;
}

.role-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.user-summary-grid article {
  padding: 16px;
  border: 1px solid #dbe6ec;
  border-radius: 8px;
  background: #fbfdfe;
}

.user-summary-grid span,
.section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.user-summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.user-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  margin-bottom: 16px;
}

.user-create,
.role-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.user-form {
  display: grid;
  gap: 12px;
}

.user-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.user-form small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}

.user-form button {
  margin-top: 2px;
}

.user-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 10px;
  margin-bottom: 12px;
}

.role-card strong {
  display: block;
}

.role-card span {
  color: var(--muted);
  font-size: 13px;
}

.role-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.permission-list span {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf7f5;
  color: #0b5f59;
  font-weight: 800;
}

.otp-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.otp-cell code {
  padding: 4px 8px;
  border-radius: 6px;
  background: #f2f5f7;
  color: #52606d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.user-security {
  display: grid;
  gap: 8px;
  white-space: normal;
}

.row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-weight: 800;
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf0;
}

.bar span {
  display: block;
  height: 100%;
  width: var(--value);
  background: var(--accent);
}

.tabs {
  display: inline-grid;
  grid-auto-flow: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.tab {
  border: 0;
  border-radius: 0;
  min-width: 46px;
}

.tab.active {
  background: var(--ink);
  color: #fff;
}

.profit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.crypto-page {
  display: grid;
  gap: 20px;
  overflow: hidden;
}

.crypto-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 24px;
  margin: -4px -4px 0;
  border: 1px solid #d8e9ef;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(15, 118, 110, 0.08)),
    #fbfdfe;
}

.crypto-hero > div:first-child span,
.crypto-summary-grid span,
.crypto-flow-form label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.crypto-hero > div:first-child strong {
  display: block;
  margin-top: 4px;
  color: #061b28;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0;
}

.crypto-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.crypto-actions button {
  min-width: 120px;
  min-height: 42px;
  border: 1px solid #0ea5e9;
  border-radius: 6px;
  background: #0ea5e9;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.2);
}

.crypto-actions .ghost-button {
  background: #fff;
  color: #0b85c8;
  box-shadow: none;
}

.crypto-summary-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.crypto-summary-grid article {
  min-height: 88px;
  padding: 16px;
  border: 1px solid #e2edf2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.crypto-summary-grid strong {
  color: #20323f;
  font-size: 27px;
}

.crypto-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 6px;
  padding: 5px;
  border: 1px solid #dce6ed;
  border-radius: 8px;
  background: #f6fafc;
}

.crypto-tabs .tab {
  min-width: 104px;
  min-height: 36px;
  border-radius: 6px;
  font-weight: 800;
}

.crypto-tabs .tab.active {
  background: #0f2f3d;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 47, 61, 0.14);
}

.crypto-section {
  min-height: 260px;
}

.crypto-table {
  min-width: 920px;
}

.crypto-page .table-wrap {
  border: 1px solid #e2eaf0;
  border-radius: 8px;
  background: #fff;
}

.crypto-table th {
  color: #768391;
  font-size: 12px;
  font-weight: 800;
  background: #f8fbfc;
}

.crypto-table td {
  height: 72px;
}

.crypto-table tbody tr {
  transition: background 0.18s ease, transform 0.18s ease;
}

.crypto-table tbody tr:hover {
  background: #f6fbfd;
}

.asset-cell,
.ratio-cell,
.payment-account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crypto-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--coin);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}

.ratio-cell {
  min-width: 180px;
}

.ratio-cell .bar {
  width: 112px;
  background: #e4f1f7;
}

.ratio-cell strong {
  color: #1677b7;
  font-size: 12px;
}

.crypto-filter-row,
.crypto-recipient-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(2, 160px);
  gap: 12px;
  margin-bottom: 16px;
}

.crypto-filter-row input,
.crypto-filter-row select {
  min-height: 40px;
  background: #fff;
}

.crypto-recipient-form {
  display: grid;
  grid-template-columns: minmax(0, 680px);
  gap: 20px;
  align-items: start;
  margin: 0 auto 24px;
  padding: 28px;
  border: 1px solid #e1ebf1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 47, 61, 0.08);
}

.crypto-recipient-create-view h2 {
  margin: -8px 0 6px;
  color: #071c28;
  font-size: 30px;
  line-height: 1.15;
  text-align: center;
}

.crypto-recipient-page {
  border: 0;
  background:
    linear-gradient(180deg, #f5fbfd 0, #fff 260px),
    #fff;
}

.crypto-recipient-page .crypto-recipient-form {
  padding-top: 28px;
}

.crypto-recipient-create-view .back-link {
  justify-self: start;
  width: fit-content;
  margin: 0;
  color: #526474;
  font-weight: 700;
}

.crypto-recipient-create-view > .form-block:not(.payment-methods):not(.address-fields) {
  min-width: 0;
}

@media (min-width: 1180px) {
  .crypto-recipient-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crypto-recipient-create-view .back-link,
  .crypto-recipient-create-view h2,
  .crypto-recipient-create-view .payment-methods,
  .crypto-recipient-create-view .address-fields,
  .crypto-recipient-create-view .confirm-row,
  .crypto-recipient-create-view .primary-submit {
    grid-column: 1 / -1;
  }

  .crypto-recipient-create-view .segmented-card-row {
    min-height: 46px;
  }
}

.recipient-list-toolbar {
  grid-template-columns: minmax(220px, 1fr) 160px;
}

.crypto-recipient-form button {
  white-space: nowrap;
}

.form-block {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-block > span,
.form-block legend {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.form-block input,
.form-block select {
  min-height: 46px;
  border-color: #dce5ec;
  background: #fff;
}

.form-block input:focus,
.form-block select:focus {
  outline: 0;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.segmented-card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.choice-card,
.payment-choice {
  border: 1px solid #dfe7ee;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  min-height: 52px;
  padding: 14px 16px;
  font-weight: 800;
}

.choice-card:has(input:checked),
.payment-choice:has(input:checked) {
  border-color: #0ea5e9;
  background: #f5fbff;
  box-shadow: 0 0 0 1px #0ea5e9 inset;
}

.choice-card input,
.payment-choice input,
.confirm-row input {
  accent-color: #0ea5e9;
}

.payment-methods {
  gap: 14px;
  padding: 16px;
  border: 1px solid #e4edf3;
  border-radius: 8px;
  background: #f8fbfd;
}

.payment-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  padding: 16px;
  min-height: 112px;
  box-shadow: 0 8px 20px rgba(15, 47, 61, 0.04);
}

.payment-choice strong,
.payment-choice span,
.payment-choice small {
  grid-column: 2;
}

.payment-choice input {
  grid-row: 1 / span 4;
  margin-top: 3px;
}

.payment-choice span,
.payment-choice small {
  color: var(--muted);
}

.address-fields {
  gap: 14px;
  padding: 16px;
  border: 1px solid #e4edf3;
  border-radius: 8px;
  background: #fbfdfe;
}

.address-fields input,
.address-fields select {
  border-width: 0 0 1px;
  border-radius: 0;
  padding-left: 14px;
  background: transparent;
  box-shadow: none;
}

.confirm-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid #dbeaf2;
  border-radius: 8px;
  background: #f7fbfd;
  color: var(--muted);
  line-height: 1.6;
}

.primary-submit {
  width: 132px;
  min-height: 44px;
  justify-self: start;
  background: #0ea5e9;
  color: #fff;
  border-color: #0ea5e9;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.2);
}

.primary-submit:hover,
.crypto-actions button:hover {
  transform: translateY(-1px);
}

.inline-action {
  margin-top: 8px;
  width: fit-content;
  min-height: 34px;
}

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

.recipient-card,
.standard-card,
.crypto-flow {
  border: 1px solid #e2eaf0;
  border-radius: 8px;
  background: #fff;
}

.recipient-card,
.standard-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(23, 32, 42, 0.04);
}

.recipient-card {
  position: relative;
  overflow: hidden;
}

.recipient-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #0ea5e9;
}

.recipient-card p,
.recipient-card span,
.standard-card span {
  margin: 0;
  color: var(--muted);
}

.recipient-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.recipient-actions small {
  color: #0b85c8;
  background: #e8f7ff;
  border-radius: 6px;
  padding: 4px 8px;
}

.crypto-flow-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: start center;
  padding: 28px 16px;
  background: rgba(7, 20, 28, 0.42);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}

.crypto-flow-overlay[hidden] {
  display: none;
}

.crypto-flow {
  width: min(560px, 100%);
  padding: 26px;
  margin-top: 10px;
  box-shadow: 0 24px 70px rgba(7, 20, 28, 0.2);
}

.crypto-flow:has(.crypto-trade-panel:not([hidden])) {
  width: min(570px, 100%);
}

.crypto-flow h2 {
  text-align: center;
  font-size: 30px;
  margin-bottom: 22px;
}

.back-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 0 0 2px;
  margin-bottom: 8px;
}

.back-link::before {
  content: "<";
  margin-right: 6px;
}

.crypto-flow-form {
  display: grid;
  gap: 16px;
}

.crypto-flow-form input,
.crypto-flow-form select {
  min-height: 42px;
}

.crypto-flow-form small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.crypto-address-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dbe8ee;
  border-radius: 8px;
  background: #f8fbfc;
}

.crypto-trade-panel {
  display: grid;
  gap: 18px;
}

.crypto-trade-panel[hidden] {
  display: none;
}

.trade-side {
  display: grid;
  gap: 10px;
}

.trade-side > span,
.trade-meta span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.trade-side > small {
  justify-self: end;
  margin-top: -26px;
  color: var(--muted);
  font-weight: 700;
}

.trade-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 160px;
  gap: 12px;
  align-items: center;
}

.trade-input-row input {
  min-height: 48px;
  border-color: transparent;
  background: #f7fafc;
}

.trade-input-row button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: #0b8bd3;
  font-weight: 800;
}

.trade-input-row strong {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-radius: 8px;
  background: #f7fafc;
}

.trade-meta {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.trade-line-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  justify-self: center;
  margin-top: 4px;
  border: 1px solid #0ea5e9;
  border-radius: 999px;
  color: #0b8bd3;
  font-weight: 900;
}

.trade-meta strong,
.trade-meta small,
.trade-meta em {
  display: block;
  margin-top: 6px;
}

.trade-meta strong {
  font-size: 16px;
}

.trade-meta small {
  color: var(--muted);
}

.trade-meta em {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 4px;
  background: #fff1f1;
  color: #d14343;
  font-size: 12px;
  font-style: normal;
}

.trade-actions {
  display: flex;
  gap: 24px;
  padding-top: 10px;
}

.trade-actions button {
  min-width: 120px;
  min-height: 42px;
  font-weight: 800;
}

.trade-actions button[type="submit"] {
  border-color: #9fd0f0;
  background: #9fd0f0;
  color: #fff;
}

.trade-actions button[type="submit"]:not(:disabled) {
  border-color: #0ea5e9;
  background: #0ea5e9;
}

.crypto-address-card span {
  word-break: break-all;
}

.crypto-address-card small {
  color: var(--accent-2);
  line-height: 1.6;
}

.qr-code {
  width: 164px;
  height: 164px;
  margin: 6px auto;
  display: grid;
  place-items: center;
  color: #111827;
  font-weight: 900;
  background:
    linear-gradient(90deg, #111 10px, transparent 10px) 0 0 / 28px 28px,
    linear-gradient(#111 10px, transparent 10px) 0 0 / 28px 28px,
    #fff;
  border: 14px solid #fff;
  box-shadow: inset 0 0 0 2px #111;
}

.payment-account {
  justify-content: space-between;
  padding: 14px;
  border: 1px solid #0ea5e9;
  border-radius: 8px;
  background: #f8fcff;
}

.chart {
  min-height: 260px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(72px, 1fr);
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  overflow-x: auto;
}

.chart-bar {
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 220px;
}

.chart-bar i {
  display: block;
  min-height: 8px;
  height: var(--height);
  border-radius: 8px 8px 2px 2px;
  background: var(--accent-2);
}

.chart-bar span,
.chart-bar strong {
  font-size: 12px;
  text-align: center;
}

.chart-bar strong {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .metrics-grid,
  .content-grid,
  .profit-layout,
  .plan-hero,
  .role-grid,
  .user-summary-grid,
  .user-workbench,
  .trend-grid,
  .crypto-summary-grid,
  .plan-summary-grid,
  .operation-summary,
  .profit-query-summary,
  .recipient-grid,
  .standard-grid {
    grid-template-columns: 1fr;
  }

  .entry-form,
  .target-entry-form,
  .operation-entry-form,
  .user-tools,
  .position-tools,
  .log-item,
  .crypto-filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .crypto-recipient-form {
    grid-template-columns: 1fr;
    padding-inline: 0;
  }

  .crypto-hero {
    grid-template-columns: 1fr;
  }

  .crypto-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .crypto-actions {
    justify-content: flex-start;
  }

  .wide {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-form,
  .split-fields,
  .target-entry-form,
  .operation-entry-form,
  .position-tools,
  .user-summary-grid,
  .profit-query-summary,
  .user-tools,
  .password-modal-actions,
  .log-item,
  .crypto-filter-row,
  .crypto-recipient-form {
    grid-template-columns: 1fr;
  }

  .strategy-step {
    grid-template-columns: 1fr;
  }

  .batch-summary-row {
    grid-template-columns: 1fr;
  }

  .crypto-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .crypto-actions button,
  .crypto-tabs .tab {
    min-width: 0;
  }

  .position-tools span {
    text-align: left;
  }
}
