/* التداول الآلي بالذكاء الاصطناعي — طبقة UX للنظام */
:root {
  --auto: #38b8b5;
  --auto-light: #5ecfc8;
}

/* شريط تمرير متناسق مع خلفية الصفحة الداكنة */
.desk-details,
.desk-simple__positions,
#bot-decisions,
#bot-trades,
#bot-logs,
#bot-approvals {
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 184, 181, 0.5) rgba(5, 5, 6, 0.85);
}

.desk-details::-webkit-scrollbar,
.desk-simple__positions::-webkit-scrollbar,
#bot-decisions::-webkit-scrollbar,
#bot-trades::-webkit-scrollbar,
#bot-logs::-webkit-scrollbar,
#bot-approvals::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.desk-details::-webkit-scrollbar-track,
.desk-simple__positions::-webkit-scrollbar-track,
#bot-decisions::-webkit-scrollbar-track,
#bot-trades::-webkit-scrollbar-track,
#bot-logs::-webkit-scrollbar-track,
#bot-approvals::-webkit-scrollbar-track {
  background: #050506;
}

.desk-details::-webkit-scrollbar-thumb,
.desk-simple__positions::-webkit-scrollbar-thumb,
#bot-decisions::-webkit-scrollbar-thumb,
#bot-trades::-webkit-scrollbar-thumb,
#bot-logs::-webkit-scrollbar-thumb,
#bot-approvals::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(56, 184, 181, 0.65), rgba(56, 184, 181, 0.3));
  border-radius: 999px;
  border: 2px solid #050506;
}

#capital-form[hidden] {
  display: none !important;
}

@media (min-width: 1100px) {
  .desk-playbook {
    grid-template-columns: repeat(3, 1fr);
  }
  .desk-onboarding {
    grid-template-columns: repeat(3, 1fr);
  }
  .desk-simple__bot .strategy-pick {
    grid-template-columns: 1fr 1fr;
  }
}

.desk-onboarding {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

@media (max-width: 720px) {
  .desk-onboarding {
    grid-template-columns: 1fr;
  }
}

.desk-step {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  background: rgba(0, 0, 0, 0.22);
  transition: border-color 0.2s, background 0.2s;
}

.desk-step.is-done {
  border-color: rgba(61, 154, 106, 0.4);
  background: rgba(61, 154, 106, 0.08);
}

.desk-step.is-active {
  border-color: rgba(56, 184, 181, 0.5);
  background: rgba(56, 184, 181, 0.1);
}

.desk-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted, #8a8a92);
  margin-bottom: 0.35rem;
}

.desk-step.is-done .desk-step__num {
  background: rgba(61, 154, 106, 0.25);
  color: #3d9a6a;
}

.desk-step.is-active .desk-step__num {
  background: rgba(56, 184, 181, 0.3);
  color: var(--auto-light, #5ecfc8);
}

.desk-step strong {
  display: block;
  font-size: 0.88rem;
  color: var(--auto, #38b8b5);
  margin-bottom: 0.2rem;
}

.desk-step span {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted, #8a8a92);
}

.halt-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(196, 92, 92, 0.45);
  background: rgba(196, 92, 92, 0.12);
  color: #e8b4b4;
  line-height: 1.55;
}

.halt-banner strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #f0c0c0;
}

.halt-banner .row-actions {
  margin: 0.65rem 0 0;
}

.desk-playbook {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}

@media (max-width: 560px) {
  .desk-playbook {
    grid-template-columns: 1fr;
  }
}

.playbook-cell {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.78rem;
}

.playbook-cell span {
  display: block;
  color: var(--muted, #8a8a92);
  margin-bottom: 0.15rem;
  font-size: 0.68rem;
}

.playbook-cell strong {
  color: #ddd8ce;
  font-weight: 650;
  line-height: 1.35;
}

.health-board {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(56, 184, 181, 0.28);
  background:
    linear-gradient(165deg, rgba(56, 184, 181, 0.1), transparent 45%),
    rgba(12, 12, 14, 0.92);
}

.health-board__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.health-board__head strong {
  color: var(--auto-light, #5ecfc8);
  font-size: 0.95rem;
}

.health-board__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

@media (max-width: 720px) {
  .health-board__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.health-cell {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: rgba(0, 0, 0, 0.22);
}

.health-cell span {
  display: block;
  font-size: 0.68rem;
  color: var(--muted, #8a8a92);
  margin-bottom: 0.2rem;
}

.health-cell strong {
  font-size: 0.86rem;
  line-height: 1.35;
  color: #ddd8ce;
}

.health-cell.is-ok {
  border-color: rgba(61, 154, 106, 0.4);
  background: rgba(61, 154, 106, 0.08);
}

.health-cell.is-warn {
  border-color: rgba(196, 150, 70, 0.45);
  background: rgba(196, 150, 70, 0.08);
}

.health-cell.is-bad {
  border-color: rgba(196, 92, 92, 0.45);
  background: rgba(196, 92, 92, 0.1);
}

.health-board__note {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.desk-quick-lane {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.desk-quick-lane a {
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--auto, #38b8b5);
  border: 1px solid rgba(56, 184, 181, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: rgba(56, 184, 181, 0.06);
}

.desk-quick-lane a:hover {
  background: rgba(56, 184, 181, 0.14);
}

button.is-busy,
button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.approval-warn {
  margin: 0 0 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px dashed rgba(196, 120, 70, 0.45);
  background: rgba(196, 120, 70, 0.08);
  font-size: 0.8rem;
  color: #d4a574;
  line-height: 1.5;
}

.bot-tick-hint {
  font-size: 0.75rem;
  color: var(--muted, #8a8a92);
  margin: 0.25rem 0 0;
}

.wrap--simple {
  max-width: 720px;
}

.hero--compact h1 {
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  margin-bottom: 0.35rem;
}

.hero--compact p {
  margin-bottom: 0.85rem;
  max-width: 28rem;
}

.desk-simple__bot {
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.desk-simple__son {
  min-height: 1.3em;
}

.desk-simple__positions {
  max-height: 9rem;
  overflow: auto;
}

.desk-details-toggle {
  width: 100%;
  margin-top: 1rem;
  border-radius: 12px !important;
  border: 1px dashed rgba(56, 184, 181, 0.45) !important;
  background: rgba(56, 184, 181, 0.08) !important;
  color: var(--auto-light, #5ecfc8) !important;
  font-weight: 700;
  padding: 0.65rem 1rem !important;
}

.desk-details-toggle[aria-expanded="true"] {
  border-style: solid !important;
  background: rgba(56, 184, 181, 0.14) !important;
}

.desk-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.desk-details[hidden] {
  display: none !important;
}

.desk-details .desk-onboarding {
  margin-bottom: 0.85rem;
}

.desk-details .engine-row {
  margin-bottom: 0.75rem;
}

.trade-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.75rem 0 0.25rem;
}

.strategy-pick {
  display: grid;
  gap: 0.55rem;
  margin: 0.85rem 0 0.35rem;
}

.firm-note {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  line-height: 1.55;
}

.strategy-option {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.55rem;
  row-gap: 0.12rem;
  align-items: start;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.strategy-option input {
  accent-color: var(--auto, #38b8b5);
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.22rem;
  grid-row: 1 / span 2;
}

.strategy-option__title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text, #f3efe6);
  letter-spacing: 0.01em;
}

.strategy-option__desc {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted, #8a8a92);
}

.strategy-option.is-recommended {
  border-color: rgba(56, 184, 181, 0.45);
}

.strategy-option:has(input:checked) {
  border-color: var(--auto, #38b8b5);
  background: rgba(56, 184, 181, 0.12);
}

.strategy-option:has(input:checked) .strategy-option__title {
  color: var(--auto-light, #5ecfc8);
}

.trade-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--auto-light, #5ecfc8);
  border: 1px solid rgba(56, 184, 181, 0.35);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: rgba(56, 184, 181, 0.08);
  cursor: pointer;
  user-select: none;
}

.trade-flag input {
  accent-color: var(--auto, #38b8b5);
  width: 1rem;
  height: 1rem;
}

.trade-flag:has(input:not(:checked)) {
  color: var(--muted, #8a8a92);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
}
