.portal-switch {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.status-chip.safe { color: #087443; background: #eaf7ef; border-color: #cfe9da; }
.status-chip.warning { color: #8a5b05; background: #fff7e8; border-color: #eedbb4; }
.ops-state.buy { color: #087443; }
.ops-state.sell { color: #b42318; }

.portal-switch a {
  color: #1677c8;
  text-decoration: none;
}

.portal-switch a:hover {
  text-decoration: underline;
}

.execution-panel {
  margin-top: 12px;
}

.daily-plan-panel {
  margin-bottom: 12px;
}

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

.plan-cell {
  min-height: 102px;
  padding: 13px 14px;
  border: 1px solid #dce4ea;
  border-radius: 6px;
  background: #f8fafb;
  display: grid;
  align-content: start;
  gap: 5px;
}

.plan-cell span {
  color: #6b7783;
  font-size: 12px;
}

.plan-cell strong {
  font-size: 20px;
}

.plan-cell small {
  color: #7b8994;
  font-size: 11px;
}

.plan-cell.buy {
  border-left: 4px solid #16834c;
  background: #edf9f2;
}

.plan-cell.sell {
  border-left: 4px solid #b42318;
  background: #fff1f0;
}

.plan-empty {
  grid-column: 1 / -1;
  padding: 14px;
  color: #6b7783;
  background: #f5f8fa;
  border: 1px solid #e3e9ed;
  border-radius: 6px;
}

.manual-trade-tools {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.plan-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.manual-tools-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.manual-tools-heading h3 { margin: 0 0 3px; }

.manual-tools-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.manual-tools-grid button {
  white-space: nowrap;
}

.manual-open-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--green, #16834c);
  background: #f2faf5;
}

.manual-open-heading small { color: #4e6658; }

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

.position-summary > span {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #e3e9ed;
  border-radius: 6px;
  background: #fff;
  display: grid;
  align-content: center;
  gap: 3px;
}

.position-summary small,
.manual-level-switch small {
  color: #768591;
  font-size: 11px;
  line-height: 1.35;
}

.position-summary strong {
  font-size: 15px;
}

.position-summary .position-empty {
  grid-column: 1 / -1;
  color: #6b7783;
}

.position-table-wrap {
  margin-bottom: 14px;
  border: 1px solid #e3e9ed;
  border-radius: 6px;
  background: #fff;
}

.position-table-wrap tr.selected { background: #edf6f7; box-shadow: inset 3px 0 #0f766e; }

.position-table-wrap tr[data-position-ticket] {
  cursor: pointer;
}

.position-table-wrap tr[data-position-ticket]:hover {
  background: #f4f8fb;
}

.positive { color: #087443; }
.negative { color: #b42318; }

.direction {
  font-weight: 750;
}

.direction.buy { color: #087443; }
.direction.sell { color: #b42318; }

.manual-level-switch {
  min-height: 69px;
  padding: 8px 10px;
  border: 1px solid #e3e9ed;
  border-radius: 6px;
  background: #fff;
  align-content: center;
}

.manual-level-switch input {
  width: auto;
  height: auto;
}

.execution-requests {
  display: grid;
  gap: 10px;
}

.request-review { margin-top: 6px; color: #72551a; font-size: 12px; line-height: 1.45; }

.execution-empty {
  padding: 12px 14px;
  color: #6b7783;
  background: #f5f8fa;
  border: 1px solid #e3e9ed;
  border-radius: 6px;
  font-size: 13px;
}

.execution-request {
  padding: 13px 14px;
  border: 1px solid #ead9b3;
  border-left: 4px solid #c58b1b;
  background: #fffaf0;
  border-radius: 6px;
  display: grid;
  gap: 8px;
}

.request-meta {
  margin-left: 12px;
  color: #6b7783;
  font-size: 12px;
}

.request-values {
  color: #4d6070;
  font-size: 13px;
}

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

.danger {
  color: #a0221b !important;
  border: 1px solid #e3b7b2 !important;
  background: #fff5f4 !important;
}

.tenant-create {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.tenant-create button {
  align-self: start;
  justify-self: start;
}

.admin-password-section { margin-top: 25px; padding-top: 23px; border-top: 1px solid #e1e8ed; }
.tenant-password-reset-form { display: grid; grid-template-columns: 1.15fr 1fr 1fr auto; align-items: end; gap: 14px; margin-top: 16px; }
.tenant-password-reset-form button { align-self: end; margin-bottom: 29px; white-space: nowrap; }
.admin-model-section { margin-top: 25px; padding-top: 23px; border-top: 1px solid #e1e8ed; }
.subsection-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.admin-config-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.admin-config-grid button { align-self: end; }
.tenant-budget-form { display: grid; grid-template-columns: 260px auto; align-items: end; gap: 12px; margin-top: 17px; }

@media (max-width: 1100px) {
  .plan-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .tenant-create {
    grid-template-columns: 1fr 1fr;
  }

  .tenant-create button {
    grid-column: span 2;
    margin-top: 0;
  }

  .tenant-password-reset-form { grid-template-columns: 1fr 1fr; }
  .tenant-password-reset-form button { grid-column: span 2; justify-self: start; margin-bottom: 0; }
}

@media (max-width: 560px) {
  .plan-grid,
  .manual-tools-grid,
  .position-summary {
    grid-template-columns: 1fr;
  }

  .manual-tools-heading {
    display: grid;
  }

  .tenant-create {
    grid-template-columns: 1fr;
  }

  .tenant-create button {
    grid-column: auto;
  }

  .tenant-password-reset-form { grid-template-columns: 1fr; }
  .tenant-password-reset-form button { grid-column: auto; width: 100%; }
  .tenant-budget-form { grid-template-columns: 1fr; }
}

.support-panel {
  margin-top: 12px;
  background: #fbfdff;
}

.support-session {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid #dce4ea;
  border-left: 4px solid #7c8b98;
  background: #f5f8fa;
  margin-bottom: 12px;
}

.support-session.requested { border-left-color: #996000; background: #fff8e8; }
.support-session.approved,
.support-session.active { border-left-color: #087443; background: #edf9f2; }
.support-session small { flex-basis: 100%; color: #5d6d79; line-height: 1.45; }
.support-session.empty { color: #6b7783; }
.support-actions { display: flex; gap: 8px; margin-left: auto; }
.support-command-actions { display: flex; flex-basis: 100%; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.support-command-list { display: grid; flex-basis: 100%; gap: 6px; padding-top: 8px; }
.support-command-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 10px; border-top: 1px solid #e5ebee; font-size: 12px; }
.support-command-row strong, .support-command-row small { display: block; }
.support-command-row small { color: #6b7783; margin-top: 3px; }
.support-command-row > span:last-child { color: #52626b; text-align: right; }
.diagnostic-reports { display: grid; gap: 0; }
.diagnostic-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #edf0f2; padding: 11px 0; }
.diagnostic-row div { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.diagnostic-row span { color: #6b7783; font-size: 12px; }
.signal-notice { margin-top: 10px; padding: 9px 10px; border-left: 3px solid #d18b2c; background: #fff8e8; color: #754d0e; font-size: 12px; line-height: 1.5; }
