/* ============================================
   Modern Dark Theme - Design System
   Bybit-inspired Clean Design
   ============================================ */

/* Pretendard 폰트 (한글) */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  /* Color Palette */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-card-hover: rgba(255, 255, 255, 0.04);

  /* Accent Colors */
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-green: #10b981;
  --accent-green-light: #34d399;
  --accent-red: #ef4444;
  --accent-red-light: #f87171;
  --accent-yellow: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;

  /* Text Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Border Colors */
  --border-primary: rgba(255, 255, 255, 0.08);
  --border-secondary: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(59, 130, 246, 0.5);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.3);
  --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.3);
  --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.3);

  /* Gradients */
  --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-red: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}

/* ============================================
   Reset & Base
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum' on, 'lnum' on;  /* 숫자 정렬 */
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Links */
a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-blue);
}

/* Selection */
::selection {
  background: var(--accent-blue);
  color: white;
}

/* ============================================
   Navbar
   ============================================ */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  backdrop-filter: blur(12px);
  padding: 0 var(--space-lg);
  height: 64px;
  border-bottom: 1px solid var(--border-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.user-nav {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #16213e 100%);
}

.nav-brand a {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-brand a::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: var(--shadow-glow-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.nav-links {
  display: flex;
  gap: var(--space-xs);
}

.nav-links a {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 2px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-user span {
  color: var(--text-secondary);
  font-size: 14px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-secondary);
  transition: border-color var(--transition-fast);
}

.user-avatar:hover {
  border-color: var(--accent-blue);
}

/* ============================================
   Container
   ============================================ */

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-lg);
}

/* 넓은 컨테이너 (포지션 테이블 등) */
.container-wide {
  max-width: 1800px;
}

/* ============================================
   Typography
   ============================================ */

h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.5px;
  color: var(--text-primary);
  font-family: 'Pretendard', sans-serif;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin: var(--space-xl) 0 var(--space-md);
  color: var(--text-primary);
  font-family: 'Pretendard', sans-serif;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-family: 'Pretendard', sans-serif;
}

/* ============================================
   Stats Grid (Dashboard Cards)
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--gradient-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-secondary), transparent);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-lg);
}

.stat-card.warning {
  border-left: 3px solid var(--accent-yellow);
}

.stat-card.danger {
  border-left: 3px solid var(--accent-red);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: -0.5px;
  font-family: 'Pretendard', sans-serif;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-value.positive { color: var(--accent-green); }
.stat-value.negative { color: var(--accent-red); }
.stat-value.inline { flex-direction: row; gap: 12px; }

.stat-value-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-value-sub.positive { color: var(--accent-green); opacity: 0.8; }
.stat-value-sub.negative { color: var(--accent-red); opacity: 0.8; }

/* ============================================
   Tables
   ============================================ */

.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

/* 테이블 셀 줄바꿈 방지 */
.table td, .table th {
  white-space: nowrap;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
  font-family: 'Pretendard', sans-serif;
  font-variant-numeric: tabular-nums;
}

.table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  position: sticky;
  top: 0;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--bg-card-hover);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Table cell states */
.pnl-positive {
  color: var(--accent-green) !important;
  font-weight: 600;
}

.pnl-negative {
  color: var(--accent-red) !important;
  font-weight: 600;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Pretendard', sans-serif;
  cursor: pointer;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient-blue);
  border: none;
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow-blue);
  filter: brightness(1.1);
}

.btn-success {
  background: var(--gradient-green);
  border: none;
  color: white;
}

.btn-success:hover {
  box-shadow: var(--shadow-glow-green);
  filter: brightness(1.1);
}

.btn-danger {
  background: var(--gradient-red);
  border: none;
  color: white;
}

.btn-danger:hover {
  box-shadow: var(--shadow-glow-red);
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-secondary);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ============================================
   Badges
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  font-family: 'Pretendard', sans-serif;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-yellow);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-info {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-primary {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-secondary {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.violation-badge {
  background: var(--accent-red);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
}

/* ============================================
   Forms
   ============================================ */

.form {
  max-width: 640px;
  background: var(--gradient-card);
  backdrop-filter: blur(10px);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Pretendard', sans-serif;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  border-color: var(--border-secondary);
}

.form-group input[readonly] {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-primary);
}

.form-section-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-primary);
}

hr {
  border: none;
  border-top: 1px solid var(--border-primary);
  margin: var(--space-lg) 0;
}

/* ============================================
   Filter Form
   ============================================ */

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  align-items: flex-end;
}

.filter-form .filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-form .filter-group label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.filter-form select,
.filter-form input {
  padding: 8px 14px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  min-width: 140px;
  transition: all var(--transition-fast);
}

.filter-form select:focus,
.filter-form input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

/* Filter Input (검색 입력창) */
.filter-input {
  padding: 10px 14px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.filter-input:hover {
  border-color: var(--border-secondary);
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.filter-input::placeholder {
  color: var(--text-muted);
}

/* Native Select 스타일 */
select {
  padding: 10px 14px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Pretendard', sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  padding-right: 36px;
}

select:hover {
  border-color: var(--border-secondary);
}

select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px;
}

/* Multi-select Dropdown */
.multi-select {
  position: relative;
  min-width: 160px;
}

.multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.multi-select-trigger:hover {
  border-color: var(--border-secondary);
}

.multi-select-trigger.active {
  border-color: var(--accent-blue);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.multi-select-trigger::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-muted);
  transition: transform var(--transition-fast);
}

.multi-select-trigger.active::after {
  transform: rotate(180deg);
}

.multi-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-blue);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.multi-select-dropdown.show {
  display: block;
  animation: slideDown 0.15s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.multi-select-option:hover {
  background: var(--bg-card-hover);
}

.multi-select-option input {
  min-width: auto;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
}

.multi-select-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 200px;
}

.multi-select-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--accent-blue);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* ============================================
   Alerts
   ============================================ */

.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-red-light);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent-green-light);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent-yellow);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--accent-red-light);
}

/* ============================================
   Login Page
   ============================================ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, var(--bg-secondary) 0%, var(--bg-primary) 70%);
}

.login-container {
  text-align: center;
  padding: var(--space-xl) 48px;
  background: var(--gradient-card);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 100%;
}

.login-container h1 {
  margin-bottom: var(--space-sm);
  font-size: 24px;
}

.login-container > p {
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

/* Login Form */
.login-form {
  text-align: left;
}

.login-form .form-group {
  margin-bottom: var(--space-md);
}

.login-form .form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.login-form .form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.login-form .form-group input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-form .form-group input:hover {
  border-color: var(--border-secondary);
}

.btn-block {
  width: 100%;
  margin-top: var(--space-lg);
}

.discord-login {
  margin: var(--space-lg) 0;
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: #5865F2;
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-discord:hover {
  background: #4752C4;
  transform: translateY(-2px);
}

.btn-discord:active {
  transform: translateY(0);
}

.btn-discord svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   Error Page
   ============================================ */

.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.error-container {
  text-align: center;
  padding: var(--space-xl);
}

.error-container h1 {
  font-size: 48px;
  color: var(--accent-red);
}

/* ============================================
   Symbol Settings
   ============================================ */

.symbol-settings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.symbol-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  transition: all var(--transition-fast);
}

.symbol-row:hover {
  border-color: var(--border-secondary);
  background: var(--bg-tertiary);
}

.symbol-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 100px;
}

.symbol-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-blue);
}

.symbol-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.symbol-investment {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.symbol-investment label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.symbol-investment input {
  width: 100px;
  padding: 8px 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  text-align: right;
  transition: all var(--transition-fast);
}

.symbol-investment input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

/* ============================================
   Progress Bar (TP/SL)
   ============================================ */

.progress-container {
  width: 100%;
  max-width: 200px;
}

.progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar-inner {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-normal);
}

.progress-bar-inner.positive {
  background: var(--gradient-green);
  box-shadow: var(--shadow-glow-green);
}

.progress-bar-inner.negative {
  background: var(--gradient-red);
  box-shadow: var(--shadow-glow-red);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

/* Position Progress (SL - Entry - TP) */
.position-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 180px;
}

.position-progress-bar {
  height: 6px;
  background: linear-gradient(90deg,
    var(--accent-red) 0%,
    var(--bg-tertiary) 30%,
    var(--bg-tertiary) 70%,
    var(--accent-green) 100%
  );
  border-radius: 3px;
  position: relative;
}

.position-progress-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--accent-cyan);
  border: 2px solid var(--bg-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
  transition: left var(--transition-normal);
}

.position-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}

.position-progress-labels .sl { color: var(--accent-red); }
.position-progress-labels .entry { color: var(--text-muted); }
.position-progress-labels .tp { color: var(--accent-green); }

/* ============================================
   Real-time Price Display
   ============================================ */

.price-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.price-current {
  font-size: 14px;
  font-weight: 600;
  font-family: 'Pretendard', sans-serif;
  font-variant-numeric: tabular-nums;
}

.price-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.price-up { color: var(--accent-green); }
.price-down { color: var(--accent-red); }

/* PnL Display - Bybit Style */
.pnl-cell {
  text-align: center;
}

.pnl-display {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.pnl-dollar {
  font-size: 14px;
  font-weight: 600;
  font-family: 'Pretendard', sans-serif;
  letter-spacing: -0.3px;
  min-width: 60px;
  text-align: right;
}

.pnl-krw {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'Pretendard', sans-serif;
  text-align: right;
}

.pnl-percent {
  font-size: 12px;
  font-weight: 500;
  font-family: 'Pretendard', sans-serif;
  margin-top: 2px;
  text-align: right;
}

.pnl-percent.positive {
  color: var(--accent-green);
}

.pnl-percent.negative {
  color: var(--accent-red);
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  max-width: 400px;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.hiding {
  animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

.toast-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
}

.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

.toast-warning .toast-icon {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-yellow);
}

.toast-message {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* ============================================
   Loading States
   ============================================ */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-secondary);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg,
    var(--bg-tertiary) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   Connection Status
   ============================================ */

.connection-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 12px;
  color: var(--text-muted);
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.connection-dot.connected {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}

.connection-dot.disconnected {
  background: var(--accent-red);
}

.connection-dot.connecting {
  background: var(--accent-yellow);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================
   Utilities
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--accent-green); }
.text-danger { color: var(--accent-red); }
.text-warning { color: var(--accent-yellow); }
.text-info { color: var(--accent-cyan); }

.font-mono {
  font-family: 'Pretendard', -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
}
.font-bold { font-weight: 700; }

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

.gap-1 { gap: var(--space-xs); }
.gap-2 { gap: var(--space-sm); }
.gap-3 { gap: var(--space-md); }
.gap-4 { gap: var(--space-lg); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.hidden { display: none; }
.invisible { visibility: hidden; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-details code {
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  font-family: 'Pretendard', monospace;
}

/* Action Buttons Group */
.action-buttons {
  display: flex;
  gap: var(--space-sm);
}

/* Confirm Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 400px;
  width: 90%;
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.modal-overlay.show .modal {
  transform: scale(1);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.modal-body {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
}

/* Form Controls in Modal */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Pretendard', sans-serif;
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input:hover {
  border-color: var(--border-secondary);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.page-header h1 {
  margin-bottom: 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    height: auto;
    padding: var(--space-md);
    gap: var(--space-md);
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .container {
    padding: var(--space-md);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filter-form {
    flex-direction: column;
  }

  .table {
    font-size: 13px;
  }

  .table th,
  .table td {
    padding: var(--space-sm);
  }
}
