/* Shared portal styles. Loaded by login/dashboard/symbols/etc. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, system-ui, 'Helvetica Neue', Arial, sans-serif;
  background: #fafafa;
  color: #0a0a0a;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px;
  font-size: 14px; font-weight: 500;
  border-radius: 6px;
  transition: all .15s;
  cursor: pointer;
  border: 1px solid transparent;
  background: #ffffff;
  font-family: inherit;
  white-space: nowrap;
}
.btn:focus { outline: 2px solid #0a0a0a; outline-offset: 2px; }
.btn-primary { background: #0a0a0a; color: #ffffff; }
.btn-primary:hover:not(:disabled) { background: #262626; }
.btn-primary:disabled { background: #a3a3a3; cursor: not-allowed; }
.btn-secondary { color: #0a0a0a; border-color: #d4d4d4; }
.btn-secondary:hover { border-color: #0a0a0a; }
.btn-danger { color: #b91c1c; border-color: #fecaca; background: #fff; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ---- Inputs ---- */
label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: #404040;
  margin-bottom: 6px;
}
.input, .select, textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px; font-family: inherit;
  background: #ffffff;
  color: #0a0a0a;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  transition: border-color .15s;
}
.input:focus, .select:focus, textarea:focus {
  outline: none;
  border-color: #0a0a0a;
}
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }
.field-hint {
  margin-top: 4px;
  font-size: 11.5px;
  color: #737373;
  line-height: 1.45;
}
.field-hint code {
  background: #f5f5f5;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}
.section-divider {
  margin: 20px 0 12px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #737373;
  padding-bottom: 6px;
  border-bottom: 1px solid #e5e5e5;
}

/* Collapsible "Advanced" panel, hides MT5-style mode/currency
   overrides that 95% of brokers never touch. */
.advanced-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none;
  color: #525252; font-size: 13px; font-weight: 500;
  cursor: pointer; padding: 8px 0;
  font-family: inherit;
}
.advanced-toggle:hover { color: #0a0a0a; }
.advanced-toggle .chevron {
  transition: transform .15s;
  font-size: 10px;
}
.advanced-toggle.open .chevron { transform: rotate(180deg); }
.advanced-panel {
  display: none;
  padding: 14px 16px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  margin-top: 8px;
}
.advanced-panel.open { display: block; }

/* Inline info button + popover. Click the (i) to toggle a small panel
   under the field with a longer explanation, leaving the form itself
   uncluttered. */
.info-btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 16px; height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid #d4d4d4;
  background: #ffffff;
  color: #525252;
  font-size: 10px; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  vertical-align: -2px;
  transition: all .15s;
  padding: 0; line-height: 1;
}
.info-btn:hover { border-color: #0a0a0a; color: #0a0a0a; }
.info-pop {
  display: none;
  margin-top: 8px;
  padding: 12px 14px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 12.5px;
  color: #404040;
  line-height: 1.55;
}
.info-pop.open { display: block; }
.info-pop strong { color: #0a0a0a; }
.info-pop table {
  margin-top: 8px;
  border-collapse: collapse;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.info-pop th, .info-pop td {
  text-align: left;
  padding: 3px 14px 3px 0;
}
.info-pop th { color: #737373; font-weight: 600; }
.info-pop td:last-child { color: #0a0a0a; }
.info-pop .note {
  margin-top: 8px;
  color: #737373; font-size: 11.5px;
}

/* ---- Form messages ---- */
.error-banner {
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}
.success-banner {
  padding: 12px 16px;
  background: #fafafa;
  border: 1px solid #d4d4d4;
  color: #404040;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ---- Top nav (shared, post-auth) ---- */
.app-nav {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
}
.app-nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.app-logo {
  font-weight: 600; font-size: 15px; letter-spacing: -0.005em;
}
.app-nav-right { display: flex; gap: 16px; align-items: center; font-size: 13px; color: #525252; }
.app-nav-right .me { color: #0a0a0a; font-weight: 500; }

/* ---- Layout: sidebar + main ---- */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 53px);
}
.app-sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e5e5;
  padding: 20px 12px;
}
.app-sidebar-section {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #737373;
  padding: 12px 12px 6px;
}
.app-sidebar-link {
  display: block;
  padding: 8px 12px;
  font-size: 14px; color: #404040;
  border-radius: 6px;
  margin-bottom: 2px;
}
.app-sidebar-link:hover { background: #f5f5f5; color: #0a0a0a; }
.app-sidebar-link.active { background: #0a0a0a; color: #ffffff; }
.app-main { padding: 28px 36px; }
/* No max-width on app-main: pages use the full viewport width minus the
   220px sidebar. Individual pages may opt back in (e.g. /onboard's
   wizard intentionally caps itself narrow) but admin / monitoring pages
   should breathe across the full screen. */
.app-main h1 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.app-main h1 + .subhead {
  color: #525252; font-size: 14px; margin-bottom: 24px;
}

/* ---- Tables ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
}
.data-table th, .data-table td {
  padding: 10px 14px;
  font-size: 13px;
  text-align: left;
  border-bottom: 1px solid #f5f5f5;
}
.data-table th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #525252;
  background: #fafafa;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: #fafafa; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}
.toolbar .left { font-size: 14px; color: #525252; }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-backdrop.open,
.modal-backdrop.show { display: flex; }
.modal {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  width: min(640px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e5e5e5;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e5e5;
  display: flex; justify-content: flex-end; gap: 8px;
}
.close-x {
  font-size: 22px; color: #737373; cursor: pointer;
  background: none; border: none; padding: 0; line-height: 1;
}
.close-x:hover { color: #0a0a0a; }
