/* ==========================================================================
   Doa Ibu Journal — Accounts Manager (Halaman Akun)
   Apple HIG Inset Grouped & Champagne Gold Luxury Theme
   TraderWaves UI Integration: Multi-Broker Master Account Connect & Table View
   ========================================================================== */

#accounts-section {
  animation: iosFadeIn 0.25s var(--ios-smooth, cubic-bezier(0.32, 0.72, 0, 1));
}

@keyframes iosFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Base Container */
.tw-accounts-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

/* ==========================================================================
   1. Top Navigation Bar: Tabs + Right Actions (Matching TraderWaves)
   ========================================================================== */
.tw-accounts-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 4px;
}

.tw-nav-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.light .tw-nav-tabs {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

.tw-nav-tab {
  border: none;
  background: transparent;
  color: rgba(235, 235, 245, 0.65);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

body.light .tw-nav-tab {
  color: rgba(0, 0, 0, 0.6);
}

.tw-nav-tab:hover {
  color: #ffffff;
}

body.light .tw-nav-tab:hover {
  color: #111113;
}

.tw-nav-tab.active {
  background: rgba(200, 169, 106, 0.18);
  color: var(--ios-gold, #C8A96A);
  border: 1px solid rgba(200, 169, 106, 0.4);
  box-shadow: 0 2px 10px rgba(200, 169, 106, 0.15);
}

.tw-badge-pro {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e6c565, #c8a96a);
  color: #121316;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Nav Actions (Right side: 1/3, + Add Account, Sync All) */
.tw-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tw-counter-badge {
  font-size: 12px;
  font-weight: 700;
  color: rgba(235, 235, 245, 0.6);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
}

body.light .tw-counter-badge {
  color: rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

.tw-btn-add-account {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e6c565, #c8a96a);
  color: #121316;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px -2px rgba(200, 169, 106, 0.4);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.tw-btn-add-account:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.tw-btn-add-account:active {
  transform: scale(0.96);
}

.tw-plus-icon {
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.tw-btn-sync-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(235, 235, 245, 0.85);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

body.light .tw-btn-sync-all {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.8);
}

.tw-btn-sync-all:hover {
  background: rgba(200, 169, 106, 0.15);
  border-color: rgba(200, 169, 106, 0.4);
  color: var(--ios-gold, #C8A96A);
}

/* ==========================================================================
   2. Active Account Banner
   ========================================================================== */
.tw-active-acct-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(200, 169, 106, 0.12), rgba(255, 255, 255, 0.02) 70%);
  border: 1px solid rgba(200, 169, 106, 0.3);
}

body.light .tw-active-acct-banner {
  background: linear-gradient(135deg, rgba(200, 169, 106, 0.15), rgba(255, 255, 255, 0.8) 70%);
  border-color: rgba(200, 169, 106, 0.35);
}

.tw-active-acct-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tw-active-star {
  color: var(--ios-gold, #C8A96A);
  font-size: 14px;
}

.tw-active-label {
  font-size: 12px;
  color: rgba(235, 235, 245, 0.6);
  font-weight: 500;
}

body.light .tw-active-label {
  color: rgba(0, 0, 0, 0.55);
}

.tw-active-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

body.light .tw-active-name {
  color: #111113;
}

.tw-active-type-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(200, 169, 106, 0.18);
  border: 1px solid rgba(200, 169, 106, 0.4);
  color: var(--ios-gold, #C8A96A);
  letter-spacing: 0.04em;
}

.tw-active-stat {
  font-size: 12px;
  color: rgba(235, 235, 245, 0.5);
  font-variant-numeric: tabular-nums;
}

body.light .tw-active-stat {
  color: rgba(0, 0, 0, 0.5);
}

.tw-status-text {
  font-size: 12px;
  color: rgba(235, 235, 245, 0.7);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.light .tw-status-text {
  color: rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   3. Table Card & Elements (Matching Screenshot 2)
   ========================================================================== */
.tw-table-card {
  background: #0d0f14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 40px -15px rgba(0, 0, 0, 0.6);
}

body.light .tw-table-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

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

.tw-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.tw-th {
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(235, 235, 245, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

body.light .tw-th {
  color: rgba(0, 0, 0, 0.5);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.tw-th-right {
  text-align: right;
}

.tw-tr {
  transition: background 0.15s ease;
}

.tw-tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

body.light .tw-tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

.tw-tr.is-active-row {
  background: linear-gradient(90deg, rgba(200, 169, 106, 0.08) 0%, transparent 100%);
}

.tw-tr.is-active-row:hover {
  background: linear-gradient(90deg, rgba(200, 169, 106, 0.12) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.tw-td {
  padding: 16px 18px;
  color: rgba(235, 235, 245, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  white-space: nowrap;
}

body.light .tw-td {
  color: rgba(0, 0, 0, 0.85);
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

.tw-tr:last-child .tw-td {
  border-bottom: none;
}

/* Platform cell */
.tw-platform-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tw-platform-title {
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
}

body.light .tw-platform-title {
  color: #111113;
}

/* Name cell */
.tw-name-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tw-account-name {
  font-weight: 600;
  color: #ffffff;
}

body.light .tw-account-name {
  color: #111113;
}

.tw-active-chip {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(200, 169, 106, 0.2);
  border: 1px solid rgba(200, 169, 106, 0.45);
  color: var(--ios-gold, #C8A96A);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tw-acct-number {
  font-size: 11px;
  color: rgba(235, 235, 245, 0.4);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  margin-top: 3px;
}

body.light .tw-acct-number {
  color: rgba(0, 0, 0, 0.4);
}

/* Type badge (DEMO in red/coral, LIVE in green/emerald) */
.tw-badge-type {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tw-type-demo {
  color: #ff5252;
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.25);
}

.tw-type-live {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Provider cell */
.tw-td-provider {
  color: rgba(235, 235, 245, 0.65);
  font-size: 13px;
}

body.light .tw-td-provider {
  color: rgba(0, 0, 0, 0.6);
}

/* Balance cell */
.tw-td-balance {
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  font-variant-numeric: tabular-nums lining-nums;
}

body.light .tw-td-balance {
  color: #111113;
}

/* Last Sync cell */
.tw-sync-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(235, 235, 245, 0.65);
}

body.light .tw-sync-wrapper {
  color: rgba(0, 0, 0, 0.55);
}

.tw-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.tw-sync-dot.is-connected {
  background: #2dd4bf;
  box-shadow: 0 0 6px #2dd4bf;
}

.tw-sync-dot.is-disconnected {
  background: #6b7280;
}

.tw-sync-dot.is-syncing {
  background: var(--ios-gold, #C8A96A);
  box-shadow: 0 0 8px rgba(200, 169, 106, 0.7);
  animation: pulseSync 1s infinite alternate;
}

@keyframes pulseSync {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.tw-syncing-text {
  color: var(--ios-gold, #C8A96A);
  font-weight: 600;
  font-size: 12px;
}

/* Actions cell (Icons for Sync, Rename, Delete, Set-Active) */
.tw-td-actions {
  text-align: right;
}

.tw-actions-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.tw-btn-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(235, 235, 245, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

body.light .tw-btn-action {
  color: rgba(0, 0, 0, 0.45);
}

.tw-btn-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

body.light .tw-btn-action:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #111113;
}

.tw-btn-action.sync:hover {
  color: var(--ios-gold, #C8A96A);
  background: rgba(200, 169, 106, 0.12);
}

.tw-btn-action.sync.spinning svg {
  animation: spinAction 1s linear infinite;
}

@keyframes spinAction {
  100% { transform: rotate(360deg); }
}

.tw-btn-action.set-active:hover {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.12);
}

.tw-btn-action.delete:hover {
  color: #ff5252;
  background: rgba(255, 82, 82, 0.12);
}

/* EA Accordion / Subrow */
.tw-ea-row td {
  padding: 0 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tw-ea-accordion {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(200, 169, 106, 0.15);
  font-size: 11.5px;
}

.tw-ea-label {
  color: var(--ios-gold, #C8A96A);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
}

.tw-ea-token {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: 6px;
  color: #e2e8f0;
}

.tw-ea-btn {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(235, 235, 245, 0.8);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.tw-ea-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.tw-ea-btn.primary {
  background: rgba(200, 169, 106, 0.18);
  color: var(--ios-gold, #C8A96A);
  border: 1px solid rgba(200, 169, 106, 0.3);
}

.tw-ea-link {
  border: none;
  background: transparent;
  color: var(--ios-gold, #C8A96A);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}

.tw-ea-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   4. Table Pagination Footer (Matching Screenshot 2)
   ========================================================================== */
.tw-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: rgba(235, 235, 245, 0.5);
  flex-wrap: wrap;
  gap: 12px;
}

body.light .tw-table-footer {
  border-top-color: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.5);
}

.tw-footer-pagesize {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tw-select-pagesize {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(235, 235, 245, 0.8);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  outline: none;
}

body.light .tw-select-pagesize {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.8);
}

.tw-footer-pagination {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tw-pagination-count {
  font-variant-numeric: tabular-nums;
}

.tw-pagination-arrows {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tw-btn-page {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(235, 235, 245, 0.4);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: not-allowed;
}

body.light .tw-btn-page {
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.35);
}

.tw-page-current {
  padding: 0 8px;
  color: rgba(235, 235, 245, 0.7);
  font-weight: 500;
}

body.light .tw-page-current {
  color: rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   5. MT5 / MT4 Direct Connect Dialog (Matching Screenshot 1)
   ========================================================================== */
.tw-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: iosFadeIn 0.2s ease;
}

.tw-dialog-card {
  width: 100%;
  max-width: 480px;
  background: #11141c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.8),
              0 0 40px -10px rgba(200, 169, 106, 0.15);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

body.light .tw-dialog-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.15);
}

/* Top Back & Close buttons */
.tw-dialog-mt-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tw-btn-back {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.tw-btn-back:hover {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.08);
}

.tw-dialog-close {
  background: none;
  border: none;
  color: #ff5252;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 6px;
  transition: background 0.15s;
}

.tw-dialog-close:hover {
  background: rgba(255, 82, 82, 0.12);
}

/* Center Platform Logo & Title */
.tw-dialog-logo-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 22px;
}

.tw-dialog-platform-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

body.light .tw-dialog-platform-name {
  color: #111113;
}

/* Form inputs & controls */
.tw-form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tw-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tw-form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(235, 235, 245, 0.85);
}

body.light .tw-form-label {
  color: rgba(0, 0, 0, 0.8);
}

.tw-req {
  color: #ff5252;
}

.tw-form-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
  box-sizing: border-box;
}

body.light .tw-form-input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: #111113;
}

.tw-form-input:focus {
  border-color: var(--ios-gold, #C8A96A);
  box-shadow: 0 0 0 3px rgba(200, 169, 106, 0.2);
}

.tw-form-input.tw-input-error {
  border-color: #ff5252 !important;
  box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.2) !important;
}

.tw-form-counter {
  font-size: 11px;
  color: rgba(235, 235, 245, 0.4);
  margin-top: 2px;
}

body.light .tw-form-counter {
  color: rgba(0, 0, 0, 0.4);
}

.tw-form-subtext {
  font-size: 11px;
  color: rgba(235, 235, 245, 0.5);
  margin-top: 3px;
  line-height: 1.4;
}

body.light .tw-form-subtext {
  color: rgba(0, 0, 0, 0.5);
}

/* Server select & dropdown */
.tw-server-select-wrap {
  position: relative;
}

.tw-server-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #171a24;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  overflow-y: auto;
  max-height: 180px;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
}

body.light .tw-server-dropdown {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.tw-server-item {
  padding: 10px 14px;
  font-size: 13px;
  color: rgba(235, 235, 245, 0.85);
  cursor: pointer;
  transition: background 0.12s;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}

body.light .tw-server-item {
  color: rgba(0, 0, 0, 0.8);
}

.tw-server-item:hover {
  background: rgba(200, 169, 106, 0.15);
  color: var(--ios-gold, #C8A96A);
}

/* 2 Column Row for Account ID & Password */
.tw-form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 420px) {
  .tw-form-row-2 {
    grid-template-columns: 1fr;
  }
}

/* Password eye toggle */
.tw-pw-wrap {
  position: relative;
}

.tw-pw-wrap .tw-form-input {
  padding-right: 40px;
}

.tw-btn-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(235, 235, 245, 0.45);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.tw-btn-eye:hover,
.tw-btn-eye.active {
  color: var(--ios-gold, #C8A96A);
}

/* Modal Footer Actions (Cancel, Confirm) */
.tw-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  gap: 12px;
}

.tw-btn-dialog-cancel {
  padding: 10px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(235, 235, 245, 0.75);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

body.light .tw-btn-dialog-cancel {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.7);
}

.tw-btn-dialog-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.tw-btn-dialog-confirm {
  padding: 10px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e6c565, #c8a96a);
  color: #121316;
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(200, 169, 106, 0.35);
  transition: transform 0.15s, filter 0.15s;
}

.tw-btn-dialog-confirm:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.tw-btn-dialog-confirm:active {
  transform: scale(0.96);
}

/* ==========================================================================
   6. Platform Choice Modal
   ========================================================================== */
.tw-dialog-select-platform {
  max-width: 440px;
}

.tw-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tw-dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

body.light .tw-dialog-title {
  color: #111113;
}

.tw-dialog-desc {
  font-size: 12.5px;
  color: rgba(235, 235, 245, 0.6);
  margin: 0 0 18px 0;
  line-height: 1.45;
}

body.light .tw-dialog-desc {
  color: rgba(0, 0, 0, 0.6);
}

.tw-platform-choice-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tw-platform-choice-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.18s ease;
}

body.light .tw-platform-choice-item {
  background: rgba(0, 0, 0, 0.025);
  border-color: rgba(0, 0, 0, 0.08);
}

.tw-platform-choice-item:hover {
  background: rgba(200, 169, 106, 0.12);
  border-color: rgba(200, 169, 106, 0.45);
  transform: translateX(3px);
}

.tw-choice-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tw-choice-info {
  flex: 1;
}

.tw-choice-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

body.light .tw-choice-name {
  color: #111113;
}

.tw-choice-rec {
  font-size: 9.5px;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}

.tw-choice-sub {
  font-size: 11px;
  color: rgba(235, 235, 245, 0.5);
  margin-top: 2px;
}

body.light .tw-choice-sub {
  color: rgba(0, 0, 0, 0.5);
}

.tw-choice-arrow {
  color: rgba(235, 235, 245, 0.35);
  font-size: 20px;
  font-weight: 300;
}

/* ==========================================================================
   7. Helper Components & Legacy Support
   ========================================================================== */
.acct-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 8px #2dd4bf;
  display: inline-block;
}

.acct-status-dot.disconnected {
  background: #9ca3af;
  box-shadow: none;
}

.ios-active-acct-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
  transition: all 0.2s ease;
}

body.light .ios-active-acct-pill {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

.acct-type-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.light .acct-type-pill {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  color: #111113;
}

.acct-migration-box {
  background: rgba(45, 212, 191, 0.06);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.acct-migration-text {
  font-size: 12.5px;
  color: #a7f3d0;
  line-height: 1.4;
}

.btn-acct-rollback {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-token-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e0e0e6;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-token-act.primary {
  background: rgba(200, 169, 106, 0.15);
  border-color: rgba(200, 169, 106, 0.4);
  color: var(--ios-gold, #C8A96A);
}

/* EA Guide Modal */
.ea-guide-modal-ov {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ea-guide-modal-card {
  background: #17171c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.ea-guide-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ea-guide-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.ea-guide-modal-close {
  background: none;
  border: none;
  color: #9898a6;
  font-size: 18px;
  cursor: pointer;
}

.ea-guide-tabs {
  display: flex;
  padding: 10px 20px 0;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ea-guide-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #9898a6;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.ea-guide-tab.active {
  color: var(--ios-gold, #C8A96A);
  border-bottom-color: var(--ios-gold, #C8A96A);
}

.ea-guide-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ea-step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.ea-step-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(200, 169, 106, 0.15);
  border: 1px solid rgba(200, 169, 106, 0.35);
  color: var(--ios-gold, #C8A96A);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ea-step-text {
  font-size: 12.5px;
  color: rgba(235, 235, 245, 0.7);
  line-height: 1.5;
}

.ea-code-box {
  background: #0d0d10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ios-gold, #C8A96A);
}

.ea-code-box-val {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ea-btn-copy-code {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
}

.ea-guide-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
}

.ea-guide-btn-done {
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--ios-gold, #C8A96A);
  color: #121316;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

/* Reflection modal */
.acct-refl-modal .acct-refl-modal-dialog {
  width: 100%;
  max-width: 560px;
  background: #14161f;
  border: 1px solid rgba(200, 169, 106, 0.25);
  border-radius: 24px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.acct-refl-modal-header {
  padding: 18px 22px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.acct-refl-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 2px 0 4px;
}

.acct-refl-subtitle {
  font-size: 12px;
  color: rgba(235, 235, 245, 0.6);
  margin: 0;
}

.acct-refl-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: auto;
}

.acct-refl-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(235, 235, 245, 0.7);
  cursor: pointer;
}

.acct-refl-tab.active {
  background: rgba(200, 169, 106, 0.2);
  border-color: rgba(200, 169, 106, 0.5);
  color: var(--ios-gold, #C8A96A);
}

.acct-refl-list {
  padding: 16px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acct-refl-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.acct-refl-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
}

.acct-refl-source-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(200, 169, 106, 0.15);
  color: var(--ios-gold, #C8A96A);
  font-weight: 700;
}

.acct-refl-pair {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.acct-refl-footer {
  padding: 12px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
}

.btn-refl-dismiss {
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
}

/* ==========================================================================
   v17.05.1 — Real MT Connect: status heartbeat, chip broker, status live EA
   ========================================================================== */
.tw-sync-dot.is-pending {
  background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.7); animation: pulseSync 1s infinite alternate;
}
.tw-sync-dot.is-mismatch { background: #ff5252; box-shadow: 0 0 6px rgba(255, 82, 82, 0.7); }
.tw-mismatch-text { color: #ff5252; font-weight: 600; font-size: 12px; }
.tw-type-pending { color: rgba(235, 235, 245, 0.55); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); }
body.light .tw-type-pending { color: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.12); }
.tw-sub-equity { font-size: 11px; font-weight: 500; opacity: 0.6; margin-top: 2px; }
.tw-btn-sync-all:disabled { opacity: 0.45; cursor: not-allowed; }
.tw-ea-token.is-masked { letter-spacing: 0.04em; }
.tw-ea-accordion { flex-wrap: wrap; }

.tw-ea-status {
  margin-top: 6px; padding: 7px 12px; border-radius: 10px; font-size: 11.5px; line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.03); color: rgba(235, 235, 245, 0.75);
}
body.light .tw-ea-status { border-color: rgba(0, 0, 0, 0.08); background: rgba(0, 0, 0, 0.03); color: rgba(0, 0, 0, 0.65); }
.tw-ea-status.is-connected { border-color: rgba(45, 212, 191, 0.3); background: rgba(45, 212, 191, 0.08); }
.tw-ea-status.is-connected b { color: #2dd4bf; }
.tw-ea-status.is-pending { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.08); }
.tw-ea-status.is-offline { border-color: rgba(156, 163, 175, 0.3); }
.tw-ea-status.is-mismatch { border-color: rgba(255, 82, 82, 0.4); background: rgba(255, 82, 82, 0.08); color: #ff8a8a; }

/* Chip broker di form hubungkan akun */
.tw-broker-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tw-broker-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); color: rgba(235, 235, 245, 0.8);
  cursor: pointer; transition: all 0.15s;
}
.tw-broker-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--bc, #9ca3af); }
.tw-broker-chip:hover { border-color: var(--bc, #C8A96A); }
.tw-broker-chip.active { background: color-mix(in srgb, var(--bc, #C8A96A) 18%, transparent); border-color: var(--bc, #C8A96A); color: #fff; }
body.light .tw-broker-chip { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.12); color: rgba(0, 0, 0, 0.75); }
body.light .tw-broker-chip.active { color: #111113; }
.tw-server-tag { float: right; font-family: -apple-system, system-ui, sans-serif; font-size: 10px; font-weight: 700; color: var(--bc, #C8A96A); opacity: 0.9; }
.tw-secure-note {
  font-size: 11.5px; line-height: 1.5; padding: 9px 12px; border-radius: 10px;
  background: rgba(45, 212, 191, 0.08); border: 1px solid rgba(45, 212, 191, 0.25); color: rgba(235, 235, 245, 0.8);
}
body.light .tw-secure-note { color: rgba(0, 0, 0, 0.7); }
.tw-form-error {
  font-size: 12px; padding: 8px 12px; border-radius: 10px; color: #ff6b6b;
  background: rgba(255, 82, 82, 0.1); border: 1px solid rgba(255, 82, 82, 0.35);
}
.tw-dialog-mt-connect { max-height: 92vh; overflow-y: auto; }

/* Status koneksi live di modal setup EA */
.ea-live { margin: 0 20px 4px; padding: 11px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); }
.ea-live-title { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ea-live-sub { font-size: 11.5px; opacity: 0.75; margin-top: 3px; line-height: 1.45; word-break: break-word; }
.ea-live.is-connected { border-color: rgba(45, 212, 191, 0.45); background: rgba(45, 212, 191, 0.1); }
.ea-live.is-connected .ea-live-title { color: #2dd4bf; }
.ea-live.is-pending { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }
.ea-live.is-pending .ea-live-title { color: #f59e0b; }
.ea-live.is-mismatch { border-color: rgba(255, 82, 82, 0.5); background: rgba(255, 82, 82, 0.1); }
.ea-live.is-mismatch .ea-live-title { color: #ff6b6b; }
.ea-spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: eaSpin 0.8s linear infinite; }
@keyframes eaSpin { to { transform: rotate(360deg); } }
.ea-test-result { font-size: 11.5px; }
.ea-test-result.ok { color: #2dd4bf; }
.ea-test-result.bad { color: #ff6b6b; }
.ea-step-text code { background: rgba(255, 255, 255, 0.08); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
