/* AMT Journal — Parámetros (prefijo .st-): subnavegación + secciones apiladas en cards. */

.st-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }

/* ---------- subnavegación ---------- */
.st-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 1px; }
.st-nav-link {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  white-space: nowrap;
  transition: background .14s, color .14s;
}
.st-nav-link .ic { flex: none; color: var(--text-3); transition: color .14s; }
.st-nav-link:hover { background: var(--hover); color: var(--text); }
.st-nav-link:hover .ic { color: var(--text-2); }
.st-nav-link.is-active { background: var(--active); color: var(--text); }
.st-nav-link.is-active .ic { color: var(--text); }
.st-nav-short { display: none; }
.st-nav-dot { flex: none; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px var(--warn-line); }

/* ---------- contenido ---------- */
.st-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; max-width: 980px; }
.st-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-bottom: 2px; }
.st-head-text { min-width: 0; }
.st-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.st-sub { margin-top: 3px; max-width: 620px; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.st-sep { margin: 0 7px; color: var(--text-4); }

.st-form { padding: 18px; }
.st-content .card-foot { flex-wrap: wrap; }
.st-note { display: inline-flex; align-items: flex-start; gap: 8px; min-width: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.st-note .ic { flex: none; margin-top: 2px; color: var(--text-4); }

/* campos bloqueados (demo, correo de solo lectura) */
.st-content .input:disabled,
.st-content .select:disabled,
.st-content .input[readonly] {
  color: var(--text-3);
  -webkit-text-fill-color: var(--text-3);
  background-color: rgba(255, 255, 255, .015);
  border-color: var(--line-soft);
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}
.st-content .input[readonly] { cursor: default; }
.st-content .check:has(input:disabled) { opacity: .5; cursor: not-allowed; }

/* ---------- perfil ---------- */
.st-identity { display: flex; align-items: center; gap: 14px; padding: 18px; border-bottom: 1px solid var(--line-soft); }
.st-avatar { flex: none; width: 44px; height: 44px; font-size: 16px; }
.st-identity-text { flex: 1; min-width: 0; }
.st-identity-name { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.st-identity-sub { margin-top: 2px; font-size: 12.5px; color: var(--text-3); }

.st-phone { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
/* selector con valor propio: se pinta el texto que queremos y encima va un <select> transparente */
.st-pick {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  min-width: 0; height: 36px; padding: 0 10px 0 12px;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13.5px; white-space: nowrap;
  transition: border-color .16s, box-shadow .16s;
}
.st-pick > .ic { flex: none; margin-left: auto; color: var(--text-3); }
.st-pick:hover { border-color: var(--line-strong); }
.st-pick:focus-within { border-color: rgba(61, 123, 255, .65); box-shadow: 0 0 0 3px rgba(61, 123, 255, .14); }
.st-pick-val { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.st-pick-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text-3); }
.st-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; appearance: none; -webkit-appearance: none; }
.st-pick select option, .st-pick select optgroup { background: var(--bg-2); color: var(--text); }
.st-pick.is-disabled { color: var(--text-3); background: rgba(255, 255, 255, .015); border-color: var(--line-soft); }
.st-pick.is-disabled select { cursor: not-allowed; }
.st-dial { min-width: 92px; }

/* ---------- cuentas ---------- */
.st-acc-tbl td { padding-top: 12px; padding-bottom: 12px; }
.st-acc-name { display: flex; align-items: center; gap: 8px; max-width: 260px; font-weight: 600; }
.st-cell-sub { margin-top: 2px; max-width: 260px; font-size: 12px; font-weight: 400; color: var(--text-3); }
.st-strong { font-weight: 600; }
.st-acc-tbl .st-col-menu { width: 1%; padding-left: 0; }
.st-row-archived td { color: var(--text-3); }
.st-row-archived .st-acc-name { font-weight: 500; color: var(--text-2); }
.st-row-busy { opacity: .5; pointer-events: none; }
.st-foot-hint { text-align: right; }
/* elemento de menú no disponible (última cuenta activa) */
.menu-item.st-mi-disabled, .menu-item.st-mi-disabled:hover { background: none; color: var(--text-4); cursor: not-allowed; }
.menu-item.st-mi-disabled .menu-ic { color: var(--text-4); }

/* ---------- parámetros de trading ---------- */
.st-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.st-list { display: flex; flex-direction: column; }
.st-list .card-body { flex: 1; display: flex; flex-direction: column; }
.st-list [data-chips] { flex: 1; }
.st-count { margin-left: 8px; padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, .05); font-size: 11px; font-weight: 500; color: var(--text-3); }

.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chip {
  display: inline-flex; align-items: center; gap: 2px;
  max-width: 100%; height: 26px; padding: 0 3px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .03);
  font-size: 12.5px; font-weight: 500; color: var(--text);
  animation: fade-in .2s ease both;
}
.st-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-chip-x { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: var(--r-xs); color: var(--text-3); transition: background .14s, color .14s; }
.st-chip-x:hover { background: var(--active); color: var(--text); }

.st-list-empty { border: 1px dashed var(--line); border-radius: var(--r-md); }
.st-list-empty .empty { padding: 14px 16px; }
.st-list-empty .empty-title { font-size: 13px; }
.st-list-empty .empty-text { margin-top: 3px; font-size: 12.5px; line-height: 1.5; }

.st-add { display: flex; gap: 8px; margin-top: 14px; }
.st-add .input { height: 34px; font-size: 13px; }
.st-add .btn { flex: none; }
.st-add-err { display: block; margin-top: 6px; font-size: 12px; color: var(--neg); }
.st-lists-note { margin-top: -4px; }

.st-pair { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.st-rt { margin-top: 14px; border-top: 1px solid var(--line-soft); }
.st-rt .stat-row:last-child { padding-bottom: 0; }

.st-savebar {
  position: sticky; bottom: 20px; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px 9px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  animation: fade-up .3s var(--ease) both;
}
.st-savebar-dot { flex: none; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px var(--warn-line); }
.st-savebar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.st-savebar.is-error .st-savebar-dot { background: var(--neg); box-shadow: 0 0 8px var(--neg-line); }
.st-savebar.is-error .st-savebar-text { color: var(--neg); }

/* ---------- filas de acción (datos) y lista de hechos (seguridad) ---------- */
.st-rows { margin-top: 12px; }
.st-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--line-soft); }
.st-row-ic {
  flex: none;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
  color: var(--text-2);
}
.st-row-text { flex: 1; min-width: 0; }
.st-row-title { font-size: 13.5px; font-weight: 600; }
.st-row-desc { margin-top: 2px; max-width: 600px; font-size: 12.5px; line-height: 1.55; color: var(--text-3); text-wrap: pretty; }
.st-row-meta { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.st-row-action { flex: none; }

.st-danger { border-color: rgba(240, 97, 109, .2); }
.st-danger .st-row-ic { color: var(--neg); border-color: rgba(240, 97, 109, .2); background: var(--neg-soft); }

.st-facts { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.st-fact { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--line-soft); }
.st-fact:nth-child(odd) { border-right: 1px solid var(--line-soft); }

/* ---------- modal de importación ---------- */
.st-import-tbl th, .st-import-tbl td { padding: 9px 0 9px 16px; }
.st-import-tbl th:first-child, .st-import-tbl td:first-child { padding-left: 0; white-space: normal; }
.st-import-tbl th:last-child, .st-import-tbl td:last-child { padding-right: 0; }
.st-import-tbl tbody tr:hover { background: none; }
.st-import-tbl tbody tr:last-child td { border-bottom: 1px solid var(--line-soft); }
.st-import-note { margin-top: 14px; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }

/* ============================================================
   Responsive
   ============================================================ */
/* por debajo de 1420px la tabla de cuentas ya no cabe junto a la subnavegación */
@media (max-width: 1420px) {
  .st-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .st-content { max-width: none; }
  /* la subnavegación pasa a pestañas horizontales */
  .st-nav {
    position: relative; top: auto;
    flex-direction: row; gap: 24px;
    overflow-x: auto; scrollbar-width: none;
    box-shadow: inset 0 -1px 0 var(--line-soft);
  }
  .st-nav::-webkit-scrollbar { display: none; }
  .st-nav-link { flex: none; gap: 8px; height: 40px; padding: 0; border-radius: 0; color: var(--text-3); }
  .st-nav-link:hover, .st-nav-link.is-active { background: none; }
  .st-nav-link:hover { color: var(--text-2); }
  .st-nav-link.is-active { color: var(--text); }
  .st-nav-link.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--text); }
  .st-nav-dot { margin-left: 0; }
}
@media (max-width: 1100px) {
  .st-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .st-lists, .st-facts { grid-template-columns: minmax(0, 1fr); }
  .st-fact:nth-child(odd) { border-right: none; }
  .st-foot-hint { text-align: left; }
}
@media (max-width: 640px) {
  .st-nav { gap: 20px; }
  .st-nav-link .ic { display: none; }
  .st-nav-long { display: none; }
  .st-nav-short { display: inline; }
  .st-grid-gap { display: none; }
  .st-form { padding: 16px; }
  .st-identity { padding: 16px; }
  .st-row { flex-wrap: wrap; align-items: flex-start; padding: 16px; }
  .st-row-action { width: 100%; padding-left: 48px; }
  .st-savebar { bottom: 12px; padding-left: 12px; }
  .st-savebar-text { white-space: normal; font-size: 12.5px; line-height: 1.3; }
  .st-import-tbl th { white-space: normal; line-height: 1.35; vertical-align: bottom; }
  .st-import-tbl th, .st-import-tbl td { padding-left: 10px; }
}

.st-voice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-voice .btn svg { margin-right: 6px; }
