* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0e17;
    color: #e0e6ed;
}

a { color: inherit; }

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-card {
    background: #111927;
    border: 1px solid #1a2a3a;
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
}
.auth-card h1 { font-size: 22px; margin-bottom: 8px; color: #00d4ff; }
.auth-subtitle { color: #8a9bb5; font-size: 13px; margin-bottom: 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #8a9bb5; }

input, select, button, textarea {
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #1a2a3a;
    background: #0a0e17;
    color: #e0e6ed;
}
button {
    background: #00d4ff;
    color: #0a0e17;
    font-weight: 600;
    border: none;
    cursor: pointer;
    margin-top: 4px;
}
button:hover { opacity: 0.9; }
.btn-danger { background: #ff6b6b; color: #0a0e17; }
.btn-success { background: #2ecc71; color: #0a0e17; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: rgba(255,107,107,0.15); color: #ff6b6b; border: 1px solid rgba(255,107,107,0.3); }
.alert-success { background: rgba(0,212,255,0.15); color: #00d4ff; border: 1px solid rgba(0,212,255,0.3); }

/* Admin shell */
.admin-wrapper { min-height: 100vh; display: flex; }

.sidebar {
    width: 250px;
    min-height: 100vh;
    background: #111927;
    border-right: 1px solid #1a2a3a;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
}
.sidebar-brand h2 {
    font-size: 20px;
    color: #00d4ff;
    margin: 0;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-nav a,
.sidebar-end a {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    color: #8a9bb5;
    text-decoration: none;
    background: #0a101a;
    border: 1px solid #1a2a3a;
    transition: background 0.2s, color 0.2s;
    font-size: 14px;
}
.sidebar-nav a.active,
.sidebar-nav a:hover,
.sidebar-end a:hover {
    background: #1a2a3a;
    color: #00d4ff;
}
.sidebar-end {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}
.sidebar-toggle-btn {
    display: none;
    background: transparent;
    border: 1px solid #1a2a3a;
    color: #e0e6ed;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
}
.sidebar.open {
    left: 0;
}

.top-bar {
    padding-bottom: 20px;
    border-bottom: 1px solid #1a2a3a;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.top-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.top-bar h1 { font-size: 26px; font-weight: 600; margin: 0; }
.top-bar-status { display: flex; gap: 10px; flex-wrap: wrap; }

.badge { display: inline-block; font-size: 11px; padding: 6px 10px; border-radius: 999px; }
.badge-safe { background: rgba(0,212,255,0.15); color: #00d4ff; }
.badge-danger { background: rgba(231,76,60,0.18); color: #e74c3c; font-weight: bold; }

.main-content { margin-left: 250px; padding: 20px 30px; width: 100%; }

.panel {
    background: #111927; border: 1px solid #1a2a3a; border-radius: 12px;
    padding: 20px; margin: 20px 0;
}
.panel h3 { font-size: 16px; margin-bottom: 10px; color: #e0e6ed; }
.hint { color: #8a9bb5; font-size: 13px; margin-bottom: 14px; line-height: 1.5; }
.hint code { background: #0a0e17; padding: 2px 6px; border-radius: 4px; }

.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.form-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #8a9bb5; flex: 1; min-width: 160px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 20px 0; }
.stat-card { background: #111927; border: 1px solid #1a2a3a; border-radius: 12px; padding: 20px; }
.stat-label { font-size: 12px; color: #8a9bb5; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 26px; font-weight: 700; }

.chart-section { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin: 20px 0; }
.chart-container { background: #111927; border: 1px solid #1a2a3a; border-radius: 12px; padding: 20px; }
.chart-container h3 { font-size: 14px; margin-bottom: 15px; color: #8a9bb5; }

.trades-section { background: #111927; border: 1px solid #1a2a3a; border-radius: 12px; padding: 20px; margin: 20px 0; }
.trades-table { width: 100%; border-collapse: collapse; }
.trades-table th {
    text-align: left; padding: 10px 14px; font-size: 11px; text-transform: uppercase;
    color: #8a9bb5; border-bottom: 1px solid #1a2a3a; letter-spacing: 0.5px;
}
.trades-table td { padding: 10px 14px; border-bottom: 1px solid #1a2a3a; font-size: 13px; }
.status-buy, .status-trade { color: #00d4ff; }
.status-sell, .status-error { color: #ff6b6b; }
.status-warning { color: #f5a623; }
.status-info { color: #8a9bb5; }
.text-center { text-align: center; color: #8a9bb5; }
.pnl-positive { color: #2ecc71; }
.pnl-negative { color: #ff6b6b; }

@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-section { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .admin-wrapper { flex-direction: column; }
    .sidebar { position: fixed; top: 0; left: -100%; width: 240px; min-height: 100vh; border-right: 1px solid #1a2a3a; border-bottom: none; padding: 18px 14px; transition: left 0.2s ease; z-index: 1000; }
    .sidebar.open { left: 0; }
    .main-content { margin-left: 0; padding: 18px 16px; }
    .sidebar-nav a,
    .sidebar-end a { font-size: 13px; }
    .sidebar-toggle-btn { display: inline-flex; }
    body.sidebar-open { overflow: hidden; }
    .stats-grid { grid-template-columns: 1fr; }
}
