:root {
    --bg-gradient: linear-gradient(135deg, #0b0914 0%, #120e25 50%, #08060d 100%);
    --card-bg: rgba(22, 18, 41, 0.55);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-border-hover: rgba(138, 43, 226, 0.35);
    
    --primary: #7c3aed;
    --primary-gradient: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    --primary-hover: #6d28d9;
    --primary-glow: rgba(124, 58, 237, 0.3);
    
    --accent: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    
    --sidebar-bg: rgba(9, 7, 18, 0.95);
    --input-bg: rgba(10, 8, 20, 0.7);
    --input-border: rgba(255, 255, 255, 0.08);
    --input-focus: #7c3aed;
    
    --font-main: 'Inter', sans-serif;
    --font-header: 'Outfit', sans-serif;
    
    --sidebar-width: 280px;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 스크롤바 커스텀 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.4);
}

/* 공통 클래스 및 버튼 */
.hide {
    display: none !important;
}

.mobile-bottom-nav {
    display: none;
}

.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-info { color: var(--color-info) !important; }

.btn {
    font-family: var(--font-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
}

.primary-btn {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}
.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.5);
}
.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.text-btn {
    background: transparent;
    color: var(--text-muted);
}
.text-btn:hover {
    color: var(--text-main);
}

.icon-btn {
    padding: 8px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
}
.icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.square-btn {
    border-radius: 8px;
    padding: 8px;
}

.btn-full {
    width: 100%;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
}

/* 폼 인풋 및 레이블 */
label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
select {
    width: 100%;
    min-width: 0;
    padding: 11px 14px;
    min-height: 43px; /* 빈 값일 때도 칸 높이가 축소되는 현상 방지 */
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-speed) ease;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

/* 글래스 카드 컴포넌트 */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: border-color var(--transition-speed) ease;
    min-width: 0;
    overflow: hidden;
}
.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Align header-right elements to far right */
.card-header .header-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.card-header h3 {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 600;
}

.header-icon {
    color: var(--primary);
    font-size: 1.3rem;
}

.card-body-padding {
    padding: 24px;
}

/* 오버레이 (로그인 화면) */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(16, 12, 34, 0.96) 0%, rgba(5, 4, 10, 0.99) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    width: 380px;
    padding: 40px 30px;
    text-align: center;
}

.brand {
    margin-bottom: 30px;
}

.brand-icon {
    font-size: 3rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.brand h2 {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.brand p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.input-group input {
    padding-left: 38px;
}

.error-msg {
    color: var(--color-danger);
    font-size: 0.8rem;
    margin-top: 10px;
    margin-bottom: 16px;
    text-align: left;
}

.default-pw-hint {
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
code {
    font-family: var(--font-main);
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 0.9em;
}


/* 앱 전체 레이아웃 */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* 사이드바 스타일링 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 35px;
    padding-left: 8px;
}

.sidebar-brand h1 {
    font-family: var(--font-header);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex: 1;
    overflow-y: auto;
}

.nav-section h3 {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-left: 8px;
}

/* 메뉴 항목 */
.nav-menu-item {
    font-family: var(--font-main);
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-align: left;
    margin-bottom: 4px;
}

.nav-menu-item .material-icons-round {
    font-size: 1.25rem;
}

.nav-menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.nav-menu-item.active {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    border-left: 3px solid var(--primary);
    padding-left: 11px;
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    margin-right: 4px;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sidebar-widget {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 8px;
}

.range-value-container {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.value-highlight {
    color: #a78bfa;
    font-weight: 700;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px var(--primary-glow);
    transition: transform 0.1s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

/* 사용자 인포 위젯 */
.user-info-widget .user-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-info-widget .user-meta .material-icons-round {
    font-size: 2rem;
    color: var(--text-muted);
}
.username-display {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
}
.role-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(124, 58, 237, 0.2);
    color: #c084fc;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.menu-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-btn {
    font-family: var(--font-main);
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-align: left;
}
.nav-btn .material-icons-round {
    font-size: 1.1rem;
}
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.sidebar-footer {
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
}

/* 메인 패널 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.main-header h2 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* API 호출 쿼터 모니터링 바 */
.api-usage-bar-container {
    width: 180px;
}
.usage-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
    border-radius: 3px;
    transition: width var(--transition-speed) ease;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-col-2 {
    grid-column: span 2;
}

/* 탭 스타일링 */
.tabs {
    display: flex;
    gap: 8px;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    background: transparent;
    border: none;
    font-family: var(--font-main);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 14px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed) ease;
}
.tab-btn .material-icons-round {
    font-size: 1.15rem;
}
.tab-btn:hover {
    color: var(--text-main);
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* 예약 폼 */
.task-form-layout {
    padding: 24px;
}

.form-row {
    position: relative;
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.input-container {
    flex: 1;
}

.flex-shrink-0 {
    flex: 0 0 auto;
}

.swap-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 40px;
    margin: 0;
}

.swap-btn {
    width: 40px;
    height: 40px;
    margin-bottom: 2px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}
.swap-btn:hover {
    border-color: var(--primary);
    color: var(--text-main);
    background: rgba(124, 58, 237, 0.15);
    transform: scale(1.05);
}
.swap-btn:active {
    transform: scale(0.95);
}

.input-with-icon {
    position: relative;
    width: 100%;
}
.input-with-icon .material-icons-round {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.15rem;
}
.input-with-icon input,
.input-with-icon select {
    padding-left: 38px;
}

.form-footer {
    display: flex;
    justify-content: center;
}

/* 태스크 리스트 & 카드 레이아웃 */
.task-list-scroll {
    max-height: 320px;
    overflow-y: auto;
    padding: 20px 24px;
}

.task-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all var(--transition-speed) ease;
}
.task-card:hover {
    border-color: var(--card-border-hover);
    background: rgba(255, 255, 255, 0.03);
}

.task-info-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.task-type-badge {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}
.task-type-badge.srt-badge {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
}
.task-type-badge.bus-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.route-text {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
}
.route-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 6px;
}

.date-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.train-type-tag {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-size: 0.75rem;
}

.task-status-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.badge-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.status-monitoring {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.status-error {
    background: rgba(239, 104, 104, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 104, 104, 0.2);
}
.status-stopped {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.task-card-message {
    font-size: 0.78rem;
    max-width: 250px;
    text-align: right;
    word-break: keep-all;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state .material-icons-round {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}
.empty-state p {
    font-size: 0.85rem;
}

/* 터미널 로그 */
.logs-header {
    justify-content: space-between;
}
.logs-header h3 {
    font-family: var(--font-header);
}

.terminal-container {
    padding: 0 24px 24px 24px;
}

.terminal-body {
    background: rgba(7, 5, 15, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    height: 180px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    padding: 14px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #c9c3e6;
}

.log-line {
    margin-bottom: 4px;
}
.log-line.system { color: #818cf8; }
.log-line.error { color: #f87171; }
.log-line.success { color: #34d399; }
.log-line.warning { color: #fbbf24; }

/* 모달 공통 스타일 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 4, 10, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    backdrop-filter: blur(8px);
}

.modal-card {
    width: 480px;
    max-width: 90%;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
    font-family: var(--font-header);
    font-size: 1.15rem;
}

.modal-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.4;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.form-group-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 18px;
    margin-bottom: 18px;
}
.form-group-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.form-group-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.input-row {
    display: flex;
    gap: 12px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.15);
}

/* 터미널 애칭 선택 리스트 */
.ambiguous-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.ambiguous-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}
.ambiguous-item:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--primary);
}

/* AI 채팅방 컴포넌트 */
.chat-container-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 150px);
    overflow: hidden;
    grid-column: span 2;
}

.chat-room-header {
    justify-content: space-between;
    padding: 16px 24px;
}

.bot-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    font-size: 2.2rem;
    color: var(--primary);
    background: rgba(124, 58, 237, 0.1);
    padding: 6px;
    border-radius: 50%;
}

.status-indicator {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chat-quota-summary {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.chat-quota-summary strong {
    color: var(--primary);
}

.chat-messages-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-bubble {
    display: flex;
    gap: 12px;
    max-width: 75%;
}

.chat-bubble.bot {
    align-self: flex-start;
}

.chat-bubble.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bubble-avatar {
    font-size: 1.8rem;
    color: var(--primary);
    background: rgba(255,255,255,0.04);
    padding: 4px;
    border-radius: 50%;
    align-self: flex-end;
}

.bubble-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 14px 18px;
    border-radius: 16px 16px 16px 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-main);
    word-break: keep-all;
    overflow-wrap: break-word;
}

.chat-bubble.user .bubble-content {
    background: var(--primary-gradient);
    border: none;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.chat-input-bar {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-input-bar input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
}

.send-chat-btn {
    padding: 0 20px;
}

/* 사용자 관리 테이블 */
.user-list-scroll {
    padding: 24px;
    max-height: 380px;
    overflow-y: auto;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.user-table th, 
.user-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.user-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* 비트코인 모의 카드 */
.alert-box-info {
    display: flex;
    gap: 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #93c5fd;
    font-size: 0.85rem;
    line-height: 1.4;
}

.alert-box-info .material-icons-round {
    color: #60a5fa;
}

.mock-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mock-stat-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 14px;
}

.stat-title {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stat-val {
    font-size: 0.92rem;
    font-weight: 700;
}

.toggle-switch-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

.mock-graph-container {
    padding: 50px 20px;
    color: var(--text-muted);
}

.mock-chart-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    opacity: 0.15;
}

/* 애니메이션 */
.animate-fade-in {
    animation: fadeIn var(--transition-speed) ease;
}
.animate-scale-in {
    animation: scaleIn var(--transition-speed) ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

/* 반응형 모바일 대응 */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 20px 8px;
    }
    .sidebar-brand h1,
    .nav-section h3,
    .nav-menu-item span:not(.material-icons-round),
    .sidebar-footer,
    .widget-section,
    .nav-btn span:not(.material-icons-round),
    .api-usage-bar-container {
        display: none;
    }
    .main-content {
        margin-left: 80px;
    }
    .content-grid {
        grid-template-columns: 1fr;
    }
    .grid-col-2 {
        grid-column: span 1;
    }
    .chat-container-layout {
        grid-column: span 1;
    }
}

/* 햄버거 토글 버튼 및 오버레이 기본 스타일 */
#btn-toggle-sidebar {
    display: none;
    margin-right: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
#btn-toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 4, 10, 0.6);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 1;
    transition: opacity var(--transition-speed) ease;
}
.sidebar-overlay.hide {
    display: none !important;
}

/* 768px 이하 모바일 전용 대응 */
@media (max-width: 768px) {
    #btn-toggle-sidebar {
        display: inline-flex;
    }
    
    .sidebar {
        width: 280px;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: rgba(11, 8, 22, 0.98);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* 1024px 이하에서 display:none 되었던 사이드바 구성요소들을 슬라이드인 상태에서는 다시 활성화 */
    .sidebar-brand h1,
    .nav-section h3,
    .nav-menu-item span:not(.material-icons-round),
    .sidebar-footer,
    .widget-section,
    .nav-btn span:not(.material-icons-round) {
        display: block !important;
    }
    
    .nav-menu-item {
        display: flex !important;
    }
    
    .nav-btn {
        display: flex !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px 16px;
        width: 100%;
    }
    
    .main-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
    }
    
    .header-right {
        width: auto;
        margin-left: auto;
        justify-content: flex-end;
    }
    
    .api-usage-bar-container {
        display: none !important;
    }
    
    #btn-toggle-sidebar {
        display: inline-flex !important;
    }

    .main-content {
        padding-bottom: 80px; /* Make room for bottom nav */
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        box-sizing: border-box;
        background: rgba(11, 8, 22, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1000;
        justify-content: space-between;
        padding: 6px 0;
        padding-bottom: env(safe-area-inset-bottom, 6px);
    }
    
    .bottom-nav-item {
        flex: 1;
        min-width: 0;
        background: transparent;
        border: none;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 6px 0;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .bottom-nav-item .material-icons-round {
        font-size: 1.5rem;
    }
    
    .bottom-nav-item span:not(.material-icons-round) {
        font-size: 0.65rem;
        font-weight: 500;
    }
    
    .bottom-nav-item.active {
        color: #a78bfa;
    }
    
    .bottom-nav-item.active .material-icons-round {
        color: var(--primary);
    }
    
    .api-usage-bar-container {
        width: 100%;
        max-width: 240px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .login-card {
        width: 100%;
        max-width: 360px;
        margin: 0 16px;
        padding: 30px 20px;
    }
    
    .task-form-layout {
        padding: 16px;
    }
    
    /* 예약 폼 모바일 최적화 (수평 한 줄 배치) */
    .form-row {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-end;
    }
    
    /* 출발지-스왑버튼-도착지 한 행 가로 정렬 */
    .form-row:first-of-type .input-container {
        flex: 1;
        min-width: 0;
    }
    

    
    /* 탑승날짜-출발시각 한 행 가로 정렬 */
    .form-row:nth-of-type(2) .input-container {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
    }
    
    /* 열차종류는 모바일 공간 확보를 위해 단독 행으로 아래 배치 */
    .form-row:nth-of-type(2) #train-type-container {
        flex: 1 1 100%;
        margin-top: 4px;
    }
    
    /* 탭 메뉴 가로 스크롤 허용 */
    .tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding: 0 16px;
        -webkit-overflow-scrolling: touch;
    }
    .tab-btn {
        padding: 12px 14px;
        font-size: 0.8rem;
        flex-shrink: 0;
    }
    
    /* AI 채팅방 모바일 화면 최적화 */
    .chat-container-layout {
        height: calc(100vh - 200px);
    }
    .chat-messages-area {
        padding: 16px;
    }
    .chat-bubble {
        max-width: 85%;
    }
    .bubble-content {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    .chat-input-bar {
        padding: 12px 16px;
    }
    
    /* 모달 크기 */
    .modal-card {
        width: 95%;
        margin: 0 auto;
    }
    .modal-body {
        padding: 16px;
    }
    .input-row {
        flex-direction: column;
        gap: 12px;
    }
    .modal-footer {
        padding: 12px 16px;
    }
}

/* Safari / Chrome date/time input indicator reset for mobile layout stability */
.input-with-icon input[type="date"],
.input-with-icon input[type="time"] {
    position: relative;
}

.input-with-icon input[type="date"]::-webkit-calendar-picker-indicator,
.input-with-icon input[type="time"]::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* Prevent native WebKit rendering issues for date/time inputs */
input[type="date"],
input[type="time"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Custom autocomplete dropdown styles */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(16, 12, 34, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    z-index: 1000;
    margin-top: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: background var(--transition-speed) ease;
}

.autocomplete-item:hover {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
}

.autocomplete-item.active {
    background: rgba(124, 58, 237, 0.3);
    color: #a78bfa;
}

.autocomplete-item.no-result {
    color: var(--text-muted);
    cursor: default;
    font-size: 0.85rem;
    text-align: center;
    padding: 12px;
}

/* ===== 어바웃미 임직원몰 ===== */

.aboutme-status-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.aboutme-product-area {
    padding: 20px 24px;
    min-height: 120px;
}

.aboutme-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.aboutme-table thead th {
    text-align: left;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.aboutme-table tbody td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.aboutme-table tbody tr {
    transition: background var(--transition-speed) ease;
}

.aboutme-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.aboutme-table tbody tr:last-child td {
    border-bottom: none;
}

.product-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

.product-link:hover {
    color: #a78bfa;
    text-decoration: underline;
}

.price-orig {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.82rem;
    white-space: nowrap;
}

.price-sale {
    color: var(--color-success);
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}

.discount-rate {
    color: #f59e0b;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}

.aboutme-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-new {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-changed {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.row-highlight-new {
    background: rgba(16, 185, 129, 0.05) !important;
    border-left: 3px solid var(--color-success);
}

.row-highlight-changed {
    background: rgba(245, 158, 11, 0.05) !important;
    border-left: 3px solid var(--color-warning);
}

/* 종료 상품 */
.aboutme-removed-area {
    padding: 16px 24px;
}

.removed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.removed-item:last-child {
    border-bottom: none;
}

.removed-price {
    margin-left: auto;
    font-size: 0.82rem;
    text-decoration: line-through;
}

/* 반응형: 모바일에서 테이블 가로 스크롤 및 헤더 수정 */
@media (max-width: 768px) {
    .aboutme-product-area {
        overflow-x: hidden !important; /* 가로 스크롤 완전 차단 */
        padding: 10px 4px;
    }
    .aboutme-table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        font-size: 0.72rem !important;
    }
    .aboutme-table thead th, 
    .aboutme-table tbody td {
        padding: 8px 2px !important;
    }
    
    /* 1열: 상품명 (줄바꿈 허용, 강제 줄바꿈) */
    .aboutme-table th:nth-child(1),
    .aboutme-table td:nth-child(1) { 
        width: 44% !important;
        white-space: normal !important;
        word-break: break-all !important;
    }
    
    /* 2,3,4열: 가격 및 할인율 (줄바꿈 금지, 좁은 공간 할당) */
    .aboutme-table th:nth-child(2),
    .aboutme-table td:nth-child(2) { width: 21% !important; white-space: nowrap !important; }
    .aboutme-table th:nth-child(3),
    .aboutme-table td:nth-child(3) { width: 19% !important; white-space: nowrap !important; }
    .aboutme-table th:nth-child(4),
    .aboutme-table td:nth-child(4) { width: 16% !important; white-space: nowrap !important; }
    /* 카드 헤더 모바일 레이아웃: 한 줄로 유지하면서 제목 말줄임표 처리 (단, 내용이 길면 줄바꿈 허용) */
    .dashboard-panel .card-header {
        flex-direction: row;
        flex-wrap: wrap; /* 필수: 헤더 내용이 길어 카드 전체 폭을 넓히는 현상 방지 */
        align-items: center;
        gap: 8px;
        padding: 16px 14px;
    }
    .dashboard-panel .card-header .header-left {
        flex: 1;
        min-width: 0;
    }
    .dashboard-panel .card-header .header-right {
        margin-left: auto;
        width: auto;
        justify-content: flex-end;
    }
    .dashboard-panel .card-header h3 {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 어바웃미 카드 헤더 모바일 레이아웃 최적화 */
    #panel-aboutme .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 14px;
    }
    #panel-aboutme .card-header .header-left {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    #panel-aboutme .card-header .header-right {
        width: 100%;
        margin-left: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 10px;
    }
    #panel-aboutme .card-header h3 {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }
}

/* ===== 주식 자동매매 봇 ===== */
.stock-control-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.stock-control-row-single {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.stock-control-row-single .stock-status-box {
    flex: 1;
    min-width: 0;
    height: 42px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.stock-control-row-single .btn {
    height: 42px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.stock-control-row-single .btn-icon-only {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
}

/* Physical pressed states for control buttons */
.stock-control-row-single .btn.active {
    transform: scale(0.94) translateY(2px);
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(0, 0, 0, 0.15) !important;
    opacity: 0.9;
}

.stock-control-row-single .success-btn.active {
    background: #047857 !important;
    border: 1px solid #10b981 !important;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.65), 0 0 8px rgba(16, 185, 129, 0.4) !important;
}

.stock-control-row-single .danger-btn.active {
    background: #b91c1c !important;
    border: 1px solid #ef4444 !important;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.65), 0 0 8px rgba(239, 68, 68, 0.4) !important;
}

.stock-control-row-single .primary-btn.active {
    background: #1d4ed8 !important;
    border: 1px solid #3b82f6 !important;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.65), 0 0 8px rgba(59, 130, 246, 0.4) !important;
}

.stock-control-row-single .btn-emergency.active {
    background: linear-gradient(135deg, #991b1b, #7f1d1d) !important;
    border: 1px solid #ef4444 !important;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.75), 0 0 12px rgba(239, 68, 68, 0.6) !important;
}

.stock-status-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
}

.stock-status-box span:first-child {
    color: var(--text-muted);
}

.btn-emergency {
    background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700 !important;
}
.btn-emergency:hover {
    background: linear-gradient(135deg, #f87171, #dc2626) !important;
}

.regime-status-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.regime-title {
    font-family: var(--font-header);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.regime-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.regime-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
}

.regime-stats-grid .stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.regime-stats-grid .stat-val {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.stock-assets-summary {
    background: var(--primary-gradient);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.asset-total-value .total-label,
.asset-yield .yield-label {
    display: block;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.asset-total-value .total-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
}

.asset-yield .yield-val {
    font-size: 1.4rem;
    font-weight: 800;
}

.asset-details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 16px;
}

.asset-details-list .detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
}

.asset-details-list .detail-item span:first-child {
    color: var(--text-muted);
}

.asset-details-list .detail-item .detail-val {
    font-weight: 600;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.stock-table th,
.stock-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.stock-table th {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stock-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.stock-code-badge {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    font-family: monospace;
}

.scrollable-table-y {
    max-height: 280px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .stock-control-row-single {
        gap: 8px;
        width: 100%;
    }
    
    .stock-control-row-single .stock-status-box {
        height: 38px;
        padding: 0 8px;
        font-size: 0.75rem !important;
    }
    
    .stock-control-row-single .btn {
        height: 38px;
        padding: 0 10px;
        font-size: 0.75rem !important;
        gap: 4px;
    }
    
    .stock-control-row-single .btn-icon-only {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        padding: 0;
    }
    
    .stock-control-row-single .btn .material-icons-round {
        font-size: 0.95rem;
    }
    
    .stock-table {
        font-size: 0.75rem;
    }
    
    .stock-table th,
    .stock-table td {
        padding: 10px 8px;
    }
    
    /* 비상정지 버튼 모바일 반응형 처리 */
    .emergency-text {
        display: none;
    }
    .emergency-stop-group {
        margin-left: 4px !important;
        gap: 6px !important;
    }
}

/* 레짐별 전용 배경 테마 */
.regime-card-cash {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.15) 0%, rgba(30, 41, 59, 0.25) 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    box-shadow: 0 0 20px rgba(148, 163, 184, 0.08) !important;
}

.regime-card-leverage {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(180, 83, 9, 0.2) 100%) !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1) !important;
}

.regime-card-top10 {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(4, 120, 87, 0.2) 100%) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1) !important;
}

/* 지표 배지 스타일 */
.indicator-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}
.indicator-badge.pass {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #34d399 !important;
}
.indicator-badge.fail {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #f87171 !important;
}

/* 거래 내역 신호 테이블 스크롤 및 고정 헤더 */
.trades-table-scroll {
    max-height: 485px !important;
    overflow-y: auto;
}
.trades-table-scroll thead th {
    position: sticky;
    top: 0;
    background: #161229; /* A solid background matching the card to prevent rows from scrolling behind it visually */
    z-index: 10;
}

/* 시장 레짐 신호등 스타일 */
.traffic-light-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 5px 8px;
    border-radius: 12px;
}
.traffic-light-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0.18;
    filter: grayscale(40%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.traffic-light-dot.red-light {
    background-color: #ef4444;
}
.traffic-light-dot.orange-light {
    background-color: #f59e0b;
}
.traffic-light-dot.green-light {
    background-color: #10b981;
}

/* 활성화 상태 (빛남 효과) */
.traffic-light-dot.red-light.active {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.95), inset 0 0 2px rgba(255, 255, 255, 0.5);
    border-color: rgba(239, 68, 68, 0.4);
}
.traffic-light-dot.orange-light.active {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.95), inset 0 0 2px rgba(255, 255, 255, 0.5);
    border-color: rgba(245, 158, 11, 0.4);
}
.traffic-light-dot.green-light.active {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.95), inset 0 0 2px rgba(255, 255, 255, 0.5);
    border-color: rgba(16, 185, 129, 0.4);
}
\n
/* ===== 주식 장세 필터 테이블 스타일 ===== */
.regime-filter-table,
.regime-filter-table tr,
.regime-filter-table th, 
.regime-filter-table td,
.regime-filter-table .active-column {
    transition: none !important;
    box-sizing: border-box;
}

/* 활성 컬럼 하이라이트 스타일 (Excel 박스처럼 테두리 및 배경 강조) */
.regime-filter-table th.active-column {
    color: var(--text-main) !important;
    font-weight: 800 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}
.regime-filter-table td.active-column {
    background: rgba(255, 255, 255, 0.04) !important;
}

.regime-filter-table tr:last-child td.active-column {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* 테두리선으로 Excel 형태의 활성 컬럼 테두리 구현 */
.regime-filter-table .active-column {
    border-left: 2px solid rgba(255, 255, 255, 0.22) !important;
    border-right: 2px solid rgba(255, 255, 255, 0.22) !important;
}
.regime-filter-table th.active-column {
    border-top: 2px solid rgba(255, 255, 255, 0.22) !important;
}
.regime-filter-table tr:last-child td.active-column {
    border-bottom: 2px solid rgba(255, 255, 255, 0.22) !important;
}

/* 필터 조건 텍스트 및 O 동적 색상 */
.filter-name.pass {
    color: #34d399 !important; /* emerald green */
}
.filter-name.fail {
    color: #f87171 !important; /* soft red */
}
.cell-o-pass {
    color: #34d399 !important;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}
.cell-o-fail {
    color: #f87171 !important;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
}

/* ===== 모바일 반응형 필터 테이블 스타일 개선 ===== */
@media (max-width: 768px) {
    .regime-indicators-box {
        margin-top: 16px !important;
        padding-top: 14px !important;
    }
    .regime-filter-table {
        font-size: 0.7rem !important;
    }
    .regime-filter-table th, 
    .regime-filter-table td {
        padding: 8px 4px !important;
    }
    .regime-filter-table td.filter-name {
        padding-left: 6px !important;
        word-break: keep-all;
        overflow-wrap: break-word;
        line-height: 1.25;
    }
    .regime-filter-table td:not(.filter-name) {
        font-size: 0.95rem !important;
    }
    
    /* 모바일 사용자 테이블 가로 스크롤 보장 및 줄바꿈 방지 */
    .user-list-scroll {
        width: 100% !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        display: block !important;
        -webkit-overflow-scrolling: touch; /* iOS에서 부드러운 스크롤 */
    }
    .user-table {
        width: 100% !important;
        min-width: 600px !important; /* 테이블 최소 너비 확실히 보장 */
        border-collapse: collapse !important;
        table-layout: auto !important; /* 열 너비를 텍스트 길이에 맞춰 자동 계산 */
    }
    .user-table th, 
    .user-table td {
        white-space: nowrap !important; /* 줄바꿈 절대 방지 */
        word-break: keep-all !important;
        overflow: visible !important;
        padding: 10px 8px !important;
        font-size: 0.75rem !important;
    }
}

/* 비활성 컬럼 O 지표 스타일 (회색 처리, 글로우 제거) */
.cell-o-inactive {
    color: var(--text-muted) !important;
    opacity: 0.45 !important;
    text-shadow: none !important;
    font-weight: 500 !important;
}
