:root {
    --primary: #00ffdd;
    --secondary: #ffeb3b;
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --border: #333;
    --text: #efefef;
    --danger: #ff4d4d;
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background-color: var(--bg-dark); color: var(--text); margin: 0; font-size: 16px; line-height: 1.6; }
h1, h2, h3 { color: var(--primary); margin-top: 0; }
.important-metric { font-size: 24px; font-weight: 800; color: var(--primary); text-shadow: 0 0 10px rgba(0, 255, 221, 0.3); }

/* News Ticker */
#news-ticker-container { background: #1a1a1a; border-bottom: 1px solid #333; overflow: hidden; white-space: nowrap; padding: 5px 0; }
#news-ticker { display: inline-block; padding-left: 100%; animation: ticker 25s linear infinite; color: var(--secondary); font-weight: bold; }
@keyframes ticker { 0% { transform: translate(0, 0); } 100% { transform: translate(-100%, 0); } }

/* Header & Sidebar */
header { background-color: #0d0d0d; padding: 10px 0; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; }
.header-container { display: flex; justify-content: space-between; align-items: center; max-width: 1400px; margin: 0 auto; padding: 0 30px; }
.container { display: flex; max-width: 1400px; margin: 0 auto; min-height: calc(100vh - 70px); }
.sidebar { width: 260px; background-color: #1a1a1a; padding: 20px 0; border-right: 1px solid var(--border); flex-shrink: 0; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar a { color: #888; text-decoration: none; padding: 12px 25px; display: flex; justify-content: space-between; align-items: center; border-left: 4px solid transparent; transition: 0.2s; }
.sidebar a:hover, .sidebar a.active { background-color: #252525; color: white; border-left-color: var(--primary); }
.sidebar a.active { font-weight: bold; color: var(--primary); }
.sub-menu { max-height: 0; overflow: hidden; transition: 0.3s ease-out; background-color: #151515; }
.menu-item.open .sub-menu { max-height: 500px; }
.sub-menu a { padding-left: 45px; font-size: 0.95rem; }
.chevron::before { content: '▶'; font-size: 0.7rem; transition: 0.3s; }
.menu-item.open .chevron::before { content: '▼'; color: var(--primary); }
.menu-group { border-top: 1px solid var(--border); margin-top: 15px; padding-top: 10px; }

/* Content Area & Centering */
.content-area { 
    flex-grow: 1; 
    padding: 15px 30px; /* 40px에서 15px로 대폭 축소 */
    background-color: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center; /* 가로 중앙 정렬 */
}

.view { 
    display: none; 
    width: 100%;
    max-width: 1200px; /* 화면 활용도를 위해 소폭 확장 */
}
.view.active { display: block; }

/* Trading Panel Styles */
.trading-panel-horizontal { 
    background: var(--bg-panel); 
    border-radius: 15px; 
    border: 1px solid var(--border); 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    margin-top: 20px;
}
.trade-tabs-horizontal { display: flex; width: 200px; border-bottom: 1px solid var(--border); }
.trade-tab { flex: 1; padding: 12px; border: none; background: transparent; color: #888; font-weight: bold; cursor: pointer; transition: 0.3s; }
.trade-tab.active { color: white; border-bottom: 3px solid var(--primary); background: rgba(0, 255, 221, 0.05); }
.trade-tab:nth-child(2).active { border-bottom-color: #2196f3; background: rgba(33, 150, 243, 0.05); }

.trade-content-horizontal { 
    display: grid; 
    grid-template-columns: 1fr 1fr 1fr; 
    gap: 30px; 
    padding: 20px; 
    align-items: center;
}

.trade-section { display: flex; flex-direction: column; gap: 10px; }
.info-section { border-right: 1px solid #333; padding-right: 30px; }
.order-section { border-right: 1px solid #333; padding-right: 30px; }

.input-group-horizontal label { font-size: 0.85rem; color: #888; margin-bottom: 5px; display: block; }
.trade-summary-horizontal { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.summary-item { display: flex; justify-content: space-between; align-items: center; }
.summary-item .label { font-size: 0.85rem; color: #888; }
.summary-item .value { font-weight: bold; }

.holdings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.holding-item { display: flex; flex-direction: column; }
.holding-item .label { font-size: 0.8rem; color: #888; }
.holding-item .value { font-weight: bold; font-size: 1rem; }

.trade-submit-buy { background: #f44336 !important; color: white !important; font-size: 1.1rem; border-radius: 10px !important; }
.trade-submit-sell { background: #2196f3 !important; color: white !important; font-size: 1.1rem; border-radius: 10px !important; }

/* Dashboard Cards */
.asset-status { background: var(--bg-panel); padding: 25px; border-radius: 15px; border: 1px solid var(--border); margin-top: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.asset-status h3 { font-size: 1.1rem; color: #888; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 15px; }

/* Shop & Items */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 20px; }
.item-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 15px; padding: 20px; text-align: center; }
.item-price { font-size: 1.4rem; color: var(--primary); font-weight: bold; display: block; margin: 10px 0; }

/* Inventory Grid */
.inventory-section { margin-top: 30px; width: 100%; }
/* Stock Search Bar Top */
.stock-search-bar-top {
    background: var(--bg-panel);
    border: 1px solid var(--border);
}

.stock-search-bar-top input {
    background: #0d0d0d;
    border: 1px solid #333;
    color: var(--primary);
}

.stock-search-bar-top input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 221, 0.2);
    outline: none;
}

/* Trading Panel Styles */
.trading-panel-horizontal { 
    background: var(--bg-panel); 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
}

.trade-tabs-horizontal { display: flex; width: 200px; border-bottom: 1px solid var(--border); }
.trade-tab { flex: 1; padding: 12px; border: none; background: transparent; color: #888; font-weight: bold; cursor: pointer; transition: 0.3s; }
.trade-tab.active { color: white; border-bottom: 3px solid var(--primary); background: rgba(0, 255, 221, 0.05); }

.trade-content-horizontal { 
    display: grid; 
    grid-template-columns: 1fr 1fr 1fr; 
    gap: 30px; 
    padding: 20px; 
    align-items: center;
}

.trade-section { display: flex; flex-direction: column; gap: 10px; }
.info-section { border-right: 1px solid #333; padding-right: 30px; }
.order-section { border-right: 1px solid #333; padding-right: 30px; }

/* Table Enhancements */
table th {
    background: #1a1a1a;
    color: #888;
    font-size: 0.8rem;
    padding: 15px 10px;
    text-align: left;
    border-bottom: 2px solid #333;
}

td { 
    background: var(--bg-panel); 
    padding: 15px 12px; 
    border-top: 1px solid #2a2a2a;
    vertical-align: middle;
}

.badge-rate {
    background: rgba(255, 77, 77, 0.1);
    color: var(--danger);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.85rem;
}

.text-dim { color: #666; font-size: 0.85rem; }
.text-highlight { color: #fff; font-weight: 700; }
.text-danger { color: var(--danger); font-weight: bold; }

.date-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.2;
}

.date-box .start-date { font-size: 0.75rem; color: #666; }
.date-box .end-date { font-size: 0.85rem; color: var(--secondary); font-weight: bold; }

.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; margin-top: 15px; }
.inventory-item { background: #252525; border: 1px solid #333; padding: 15px; border-radius: 12px; text-align: center; font-size: 0.9rem; }
.inventory-item span { display: block; color: var(--primary); font-weight: bold; margin-bottom: 5px; }

/* FAB */
.fab { position: fixed; bottom: 30px; right: 30px; width: 55px; height: 50px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; z-index: 1500; box-shadow: 0 5px 15px rgba(0,255,221,0.4); }

/* Modals */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); }
.modal-content { background: #2b2b2b; margin: 5% auto; padding: 30px; border: 1px solid var(--primary); border-radius: 15px; position: relative; }
.setting-section { background: #222; padding: 15px; border-radius: 10px; border: 1px solid #333; margin-bottom: 15px; }

/* Utils */
.submit-btn { width: 100%; padding: 12px; background: var(--primary); border: none; font-weight: bold; border-radius: 8px; cursor: pointer; margin-top: 15px; }
input, select { background: #1a1a1a; border: 1px solid var(--border); color: white; padding: 10px; border-radius: 8px; width: 100%; box-sizing: border-box; }
.hidden { display: none !important; }
.log-box { background: #1a1a1a; padding: 15px; border-radius: 10px; border: 1px solid var(--border); overflow-y: auto; font-size: 0.9rem; }
.code-box { background: #1a1a1a; padding: 10px; border: 1px dashed var(--primary); border-radius: 8px; text-align: center; margin-top: 10px; }
table { width: 100%; border-collapse: separate; border-spacing: 0 5px; }
td { background: var(--bg-panel); padding: 12px; border-top: 1px solid #2a2a2a; }