/* Ladder + simulator pages. Design tokens come from style.css. */

/* ---------- fluid full-width layout ---------- */

.lad-body .lad-wrap {
  width: 100%;
  max-width: none;
  padding-left: clamp(0.85rem, 2.5vw, 2.5rem);
  padding-right: clamp(0.85rem, 2.5vw, 2.5rem);
  padding-top: clamp(1.1rem, 2vw, 2.5rem);
  padding-bottom: clamp(2rem, 4vw, 4rem);
}

.lad-body .brand p {
  max-width: min(56rem, 100%);
}

.lad-body .brand h1 {
  font-size: clamp(1.65rem, 2.2vw + 1rem, 3.3rem);
}

.lad-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0;
}

@media (min-width: 1100px) {
  .lad-grid-2 {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1.25rem;
    align-items: start;
  }

  .lad-grid-2 .lad-panel {
    margin-top: 1.5rem;
  }
}

.lad-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.lad-badge-live {
  color: #fff;
  background: var(--down);
  border-color: transparent;
}

.lad-badge-sim {
  color: var(--accent-deep);
  background: rgba(15, 122, 90, 0.14);
}

.lad-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.lad-nav a {
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 122, 90, 0.35);
}

.lad-nav a:hover {
  color: var(--ink);
}

.lad-nav-out {
  margin-left: auto;
  color: var(--down) !important;
  border-bottom-color: rgba(180, 35, 24, 0.35) !important;
}

/* ---------- login ---------- */

.lad-login {
  max-width: 420px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.lad-login h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.lad-login-form {
  display: grid;
  gap: 0.5rem;
}

.lad-login-form label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.lad-login-form input {
  padding: 0.75rem 0.9rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-solid);
}

.lad-login-form button {
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.lad-login-form button:hover {
  background: var(--accent-deep);
}

/* ---------- alerts ---------- */

.lad-alert {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.lad-alert code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.lad-alert-bad {
  color: var(--down);
  background: rgba(180, 35, 24, 0.1);
}

.lad-alert-warn {
  color: var(--wait);
  background: rgba(201, 148, 58, 0.14);
}

.lad-status {
  min-height: 1.4rem;
  margin: 0.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.lad-status.is-good { color: var(--up); }
.lad-status.is-bad { color: var(--down); }

/* ---------- top strip ---------- */

.lad-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.lad-label {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.lad-value {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
}

.lad-value.lad-up { color: var(--up); }
.lad-value.lad-down { color: var(--down); }

.lad-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: middle;
}

.lad-dot.is-live { background: var(--up); box-shadow: 0 0 0 3px rgba(18, 122, 69, 0.18); }
.lad-dot.is-down { background: var(--down); }

/* ---------- panels ---------- */

.lad-panel {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.lad-panel > h2,
.lad-table-head h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

details.lad-panel > summary {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

details.lad-panel > summary small {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

details.lad-panel[open] > summary {
  margin-bottom: 1.25rem;
}

.lad-config-summary {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.lad-field-help {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--muted);
}

.lad-field-help.is-ok { color: var(--up); }
.lad-field-help.is-bad { color: var(--down); }

.lad-quick-symbols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
}

.lad-quick-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-right: 0.25rem;
}

.lad-chip {
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-deep);
  background: rgba(15, 122, 90, 0.08);
  border: 1px solid rgba(15, 122, 90, 0.25);
  border-radius: 999px;
  cursor: pointer;
}

.lad-chip:hover {
  background: rgba(15, 122, 90, 0.16);
}

.lad-chip.is-active {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
}

.lad-grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: clamp(0.75rem, 1.5vw, 1rem);
}

@media (min-width: 1200px) {
  .lad-grid-form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.lad-field {
  display: grid;
  gap: 0.35rem;
}

.lad-field > span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.lad-field input,
.lad-field select {
  padding: 0.6rem 0.7rem;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-solid);
  color: var(--ink);
}

.lad-field-sm input,
.lad-field-sm select {
  padding: 0.4rem 0.5rem;
  font-size: 0.82rem;
}

.lad-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.lad-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

.lad-check-inline {
  margin-top: 1rem;
  font-weight: 500;
  color: var(--muted);
}

.lad-hint {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

.lad-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.lad-actions button {
  padding: 0.65rem 1.05rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 11px;
  cursor: pointer;
}

.lad-actions button:hover { background: var(--accent-deep); }
.lad-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

.lad-actions .ghost-btn {
  color: var(--accent-deep);
  background: transparent;
  border: 1px solid rgba(15, 122, 90, 0.35);
}

.lad-actions .ghost-btn:hover {
  background: rgba(15, 122, 90, 0.08);
}

.lad-btn-good { background: var(--up) !important; }
.lad-btn-bad { background: var(--down) !important; }

/* ---------- dashboard cards ---------- */

.lad-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: clamp(0.75rem, 1.5vw, 1rem);
  margin-top: 1.5rem;
}

@media (min-width: 900px) {
  .lad-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.lad-card {
  display: grid;
  gap: 0.3rem;
  padding: 1.1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.lad-card span {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.lad-card strong {
  font-family: var(--font-mono);
  font-size: 1.2rem;
}

.lad-card small {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.lad-card-key {
  background: linear-gradient(150deg, rgba(15, 122, 90, 0.12), rgba(255, 252, 246, 0.8));
}

/* ---------- table ---------- */

.lad-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lad-table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.lad-export-btn {
  white-space: nowrap;
  margin-bottom: 0.1rem;
}

.lad-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.55);
}

.lad-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: clamp(0.78rem, 0.7rem + 0.2vw, 0.85rem);
}

.lad-table th,
.lad-table td {
  padding: 0.6rem 0.7rem;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.lad-table th:first-child,
.lad-table td:first-child {
  text-align: left;
}

.lad-table th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.lad-table td {
  font-family: var(--font-mono);
}

.lad-table tbody tr:hover {
  background: rgba(15, 122, 90, 0.04);
}

.lad-table tr.is-matured {
  background: rgba(18, 122, 69, 0.1);
}

.lad-table tr.is-sold {
  color: var(--muted);
}

.lad-table tbody tr[class*="lad-sym-"] td:first-child {
  box-shadow: inset 4px 0 0 var(--sym-edge, transparent);
}

.lad-table tbody tr.lad-sym-eth { --sym-bg: rgba(98, 126, 234, 0.07); --sym-edge: #627eea; }
.lad-table tbody tr.lad-sym-sol { --sym-bg: rgba(20, 200, 160, 0.08); --sym-edge: #0f9b7a; }
.lad-table tbody tr.lad-sym-btc { --sym-bg: rgba(247, 147, 26, 0.08); --sym-edge: #f7931a; }
.lad-table tbody tr.lad-sym-bnb { --sym-bg: rgba(243, 186, 47, 0.1); --sym-edge: #c99400; }
.lad-table tbody tr.lad-sym-xrp { --sym-bg: rgba(35, 41, 47, 0.06); --sym-edge: #23292f; }
.lad-table tbody tr.lad-sym-ada { --sym-bg: rgba(0, 51, 173, 0.07); --sym-edge: #0033ad; }
.lad-table tbody tr.lad-sym-doge { --sym-bg: rgba(195, 166, 0, 0.1); --sym-edge: #c3a600; }
.lad-table tbody tr.lad-sym-avax { --sym-bg: rgba(232, 65, 66, 0.07); --sym-edge: #e84142; }
.lad-table tbody tr.lad-sym-link { --sym-bg: rgba(45, 82, 255, 0.07); --sym-edge: #2d52ff; }
.lad-table tbody tr.lad-sym-matic { --sym-bg: rgba(130, 71, 229, 0.08); --sym-edge: #8247e5; }
.lad-table tbody tr.lad-sym-alt-0 { --sym-bg: rgba(219, 39, 119, 0.07); --sym-edge: #db2777; }
.lad-table tbody tr.lad-sym-alt-1 { --sym-bg: rgba(14, 165, 233, 0.08); --sym-edge: #0ea5e9; }
.lad-table tbody tr.lad-sym-alt-2 { --sym-bg: rgba(168, 85, 247, 0.08); --sym-edge: #a855f7; }
.lad-table tbody tr.lad-sym-alt-3 { --sym-bg: rgba(234, 88, 12, 0.08); --sym-edge: #ea580c; }
.lad-table tbody tr.lad-sym-alt-4 { --sym-bg: rgba(5, 150, 105, 0.08); --sym-edge: #059669; }
.lad-table tbody tr.lad-sym-alt-5 { --sym-bg: rgba(79, 70, 229, 0.08); --sym-edge: #4f46e5; }

.lad-table tbody tr[class*="lad-sym-"]:not(.is-matured):not(.is-sold) {
  background: var(--sym-bg);
}

.lad-table tbody tr.lad-date-start td {
  border-top: 3px solid rgba(15, 23, 42, 0.35);
}

.lad-sym-tag {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  background: var(--sym-bg, rgba(15, 23, 42, 0.06));
  color: var(--sym-edge, var(--text));
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.lad-col-act {
  text-align: right;
  white-space: normal;
  min-width: 10.5rem;
  max-width: 15rem;
  vertical-align: top;
}

.lad-col-act .lad-row-btn {
  margin: 0.12rem 0.1rem 0.12rem 0;
}

.lad-empty {
  padding: 1.5rem !important;
  text-align: center !important;
  color: var(--muted);
  font-family: var(--font-body) !important;
}

.lad-up { color: var(--up); font-weight: 600; }
.lad-down { color: var(--down); font-weight: 600; }
.lad-wait { color: var(--wait); }

.lad-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.lad-pill-open { color: var(--wait); background: rgba(201, 148, 58, 0.16); }
.lad-pill-ready { color: #fff; background: var(--up); }
.lad-pill-sold { color: var(--muted); background: rgba(16, 35, 28, 0.08); }

.lad-row-btn {
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.lad-row-btn:hover { background: var(--accent-deep); }
.lad-row-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.lad-row-btn-ready { background: var(--up); }
.lad-row-btn-del {
  margin-left: 0.35rem;
  color: var(--down);
  background: transparent;
  border: 1px solid rgba(180, 35, 24, 0.3);
}
.lad-row-btn-del:hover { background: rgba(180, 35, 24, 0.08); }

.lad-row-btn-force {
  margin-left: 0.15rem;
  color: var(--down);
  background: transparent;
  border: 1px solid rgba(180, 35, 24, 0.45);
  font-size: 0.72rem;
  padding: 0.28rem 0.45rem;
}
.lad-row-btn-force:hover {
  background: rgba(180, 35, 24, 0.1);
  border-color: var(--down);
}

.lad-progress {
  display: block;
  width: 100%;
  min-width: 70px;
  height: 4px;
  margin-top: 0.3rem;
  border-radius: 999px;
  background: rgba(16, 35, 28, 0.1);
  overflow: hidden;
}

.lad-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* ---------- pager / log ---------- */

.lad-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.lad-pager button {
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-deep);
  background: transparent;
  border: 1px solid rgba(15, 122, 90, 0.35);
  border-radius: 10px;
  cursor: pointer;
}

.lad-pager button:disabled { opacity: 0.4; cursor: not-allowed; }

.lad-log {
  margin: 0;
  padding-left: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}

.lad-sim .brand-dot {
  background: linear-gradient(135deg, #6a8fd8, #c9943a);
}

.lad-sim-box {
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  border: 1px dashed rgba(15, 122, 90, 0.35);
  border-radius: 14px;
  background: rgba(15, 122, 90, 0.05);
}

.lad-subhead {
  margin: 1.25rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.lad-price-input {
  width: 7.5rem;
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.lad-cron-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.lad-cron-card {
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.lad-cron-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.lad-cron-card-when {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.lad-cron-card-when strong {
  font-size: 0.95rem;
  word-break: break-word;
}

.lad-cron-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0 0 0.65rem;
}

.lad-cron-stats div {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(15, 122, 90, 0.06);
}

.lad-cron-stats dt {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.lad-cron-stats dd {
  margin: 0.2rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  word-break: break-word;
}

.lad-cron-meta {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
  color: var(--ink);
  word-break: break-word;
}

.lad-cron-pill {
  display: inline-block;
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(15, 122, 90, 0.12);
  color: #0f7a5a;
}

.lad-cron-error .lad-cron-pill {
  background: rgba(176, 48, 48, 0.12);
  color: #b03030;
}

.lad-cron-error {
  border-color: rgba(176, 48, 48, 0.28);
}

.lad-cron-skipped .lad-cron-pill,
.lad-cron-dry .lad-cron-pill {
  background: rgba(100, 100, 100, 0.12);
  color: var(--muted);
}

.lad-cron-action .lad-cron-pill {
  background: rgba(201, 148, 58, 0.18);
  color: #8a6418;
}

.lad-cron-action {
  border-color: rgba(201, 148, 58, 0.35);
}

.lad-cron-msgs {
  margin: 0;
  padding: 0.55rem 0.75rem 0.55rem 1.25rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.lad-cron-msgs li + li {
  margin-top: 0.2rem;
}

.lad-muted {
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  .lad-cron-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lad-table-head {
    flex-direction: column;
    align-items: stretch;
  }

  .lad-table-tools {
    width: 100%;
  }

  .lad-table-tools .lad-field-sm {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 7rem;
  }

  .lad-export-btn {
    width: 100%;
    margin-top: 0.25rem;
  }

  .lad-actions {
    flex-direction: column;
  }

  .lad-actions button {
    width: 100%;
  }

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

@media (min-width: 721px) {
  .lad-table-tools .lad-field-sm {
    min-width: 7.5rem;
  }
}

@media (min-width: 1400px) {
  .lad-table {
    min-width: 0;
  }

  .lad-table th,
  .lad-table td {
    padding: 0.65rem 0.85rem;
  }
}
