/* FTD Bot Dashboard — dark theme */

* { box-sizing: border-box; }

body.dark {
  background: #0e0e10;
  color: #e4e4e7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", Roboto, sans-serif;
  margin: 0;
  padding: 0;
}

.topbar {
  background: #18181b;
  border-bottom: 1px solid #27272a;
  padding: 12px 0;
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-size: 18px;
  font-weight: 700;
  color: #fafafa;
  text-decoration: none;
}
.nav {
  display: flex;
  gap: 20px;
  align-items: center;
}
.nav a {
  color: #a1a1aa;
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover { color: #fafafa; }
.nav .user {
  color: #71717a;
  font-size: 13px;
  padding: 4px 8px;
  background: #27272a;
  border-radius: 4px;
}
.nav .logout {
  color: #ef4444;
}

.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Login */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
.login-card {
  background: #18181b;
  padding: 40px;
  border-radius: 12px;
  border: 1px solid #27272a;
  text-align: center;
  max-width: 400px;
}
.login-card h1 { margin-top: 0; }
.login-card .hint {
  margin-top: 24px;
  font-size: 12px;
  color: #71717a;
}
.login-card code {
  background: #27272a;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Dashboard */
.dashboard {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .dashboard { grid-template-columns: 1fr; }
}

.scan-sidebar {
  background: #18181b;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #27272a;
  max-height: 80vh;
  overflow-y: auto;
}
.scan-sidebar h3 { margin: 0 0 12px; font-size: 14px; color: #a1a1aa; }
.scan-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.scan-list li {
  border-radius: 6px;
  margin-bottom: 4px;
}
.scan-list li.active { background: #27272a; }
.scan-list a {
  display: block;
  padding: 10px 12px;
  color: #e4e4e7;
  text-decoration: none;
  font-size: 13px;
}
.scan-list a:hover { background: #27272a; border-radius: 6px; }
.scan-time { font-weight: 600; }
.scan-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #71717a;
  margin-top: 4px;
}
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  background: #3f3f46;
  color: #d4d4d8;
}
.badge.scheduled { background: #1e40af; color: #dbeafe; }
.badge.manual { background: #166534; color: #dcfce7; }

.scan-main {
  background: #18181b;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #27272a;
}
.scan-header { margin-bottom: 20px; border-bottom: 1px solid #27272a; padding-bottom: 16px; }
.scan-header h2 { margin: 0 0 8px; }
.scan-header p { margin: 4px 0; color: #a1a1aa; font-size: 14px; }
.scan-header .comparison {
  background: #27272a;
  padding: 8px 12px;
  border-radius: 6px;
  color: #fbbf24;
  font-size: 13px;
}

.signal-table, .ftd-table, .history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.signal-table th, .signal-table td,
.ftd-table th, .ftd-table td,
.history-table th, .history-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #27272a;
}
.signal-table th, .ftd-table th, .history-table th {
  background: #1f1f23;
  font-weight: 600;
  color: #a1a1aa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.signal-table tbody tr:hover, .ftd-table tbody tr:hover, .history-table tbody tr:hover {
  background: #1f1f23;
}
.signal-table .ratio, .symbol-meta .ratio {
  color: #f87171;
  font-weight: 700;
}
.signal-table .symbol {
  color: #60a5fa;
  font-weight: 600;
  text-decoration: none;
}
.signal-table .symbol:hover { text-decoration: underline; }

.btn-detail {
  color: #60a5fa;
  text-decoration: none;
  font-size: 12px;
}
.btn-detail:hover { text-decoration: underline; }

/* Symbol page */
.back-link {
  color: #a1a1aa;
  text-decoration: none;
  font-size: 13px;
  display: inline-block;
  margin-bottom: 16px;
}
.back-link:hover { color: #fafafa; }

.symbol-header {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.symbol-header h1 {
  margin: 0 0 12px;
  font-size: 28px;
}
.symbol-header .company {
  color: #71717a;
  font-size: 16px;
  font-weight: normal;
  margin-left: 12px;
}
.symbol-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.symbol-meta div {
  background: #1f1f23;
  padding: 12px;
  border-radius: 6px;
}
.symbol-meta span {
  display: block;
  font-size: 11px;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.chart-section, .ftd-history {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.chart-section h2, .ftd-history h2 { margin: 0 0 12px; font-size: 16px; }
.chart-meta {
  color: #71717a;
  font-size: 12px;
  margin: 0 0 16px;
}
.chart-meta code {
  background: #27272a;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fbbf24;
}

.history-page h1 { margin-bottom: 20px; }

/* FTD 상세 표 (ChartExchange 스타일) */
.ftd-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}
.ftd-detail-table th {
  background: #1f1f23;
  color: #a1a1aa;
  font-weight: 600;
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid #3f3f46;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ftd-detail-table td {
  padding: 8px;
  border-bottom: 1px solid #27272a;
  color: #e4e4e7;
}
.ftd-detail-table tbody tr:hover {
  background: #1f1f23;
}
.ftd-detail-table .pos { color: #22c55e; font-weight: 600; }
.ftd-detail-table .neg { color: #ef4444; font-weight: 600; }
.ftd-detail-table .muted { color: #52525b; }
.ftd-table-footnote {
  margin-top: 12px;
  font-size: 11px;
  color: #71717a;
  line-height: 1.6;
}

.muted-small {
  font-size: 11px;
  color: #71717a;
}
