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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

header {
    background: #1e293b;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}

header h1 {
    font-size: 1.5rem;
    color: #38bdf8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.online { background: #065f46; color: #6ee7b7; }
.status-badge.offline { background: #7f1d1d; color: #fca5a5; }

.mode-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.mode-badge.training { background: #713f12; color: #fde047; }
.mode-badge.production { background: #14532d; color: #86efac; }

.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    background: #334155;
    color: #94a3b8;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-small:hover { background: #475569; }

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel {
    background: #1e293b;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #334155;
}

.panel h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #94a3b8;
}

.panel h3 {
    font-size: 0.95rem;
    margin: 1rem 0 0.5rem;
    color: #94a3b8;
}

/* Training hint text */
.training-hint {
    background: #1a1a2e;
    border-left: 3px solid #eab308;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #94a3b8;
    border-radius: 0 6px 6px 0;
}

/* Training-only elements: hidden in production mode */
body.production-mode .training-only {
    display: none !important;
}

/* Info grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.info-card {
    background: #0f172a;
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
}

.info-card .label {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.info-card .value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #f1f5f9;
}

/* Progress bar */
.progress-container {
    margin-bottom: 1rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.progress-bar {
    height: 8px;
    background: #0f172a;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #22c55e);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.empty-state p {
    margin-bottom: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.6rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #38bdf8;
}

.form-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
}

/* Buttons */
button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:hover { opacity: 0.85; }

.btn-primary { background: #2563eb; color: white; }
.btn-secondary { background: #334155; color: #e2e8f0; }
.btn-danger { background: #dc2626; color: white; }
.btn-success { background: #16a34a; color: white; }

.session-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    padding: 0.5rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid #1e293b;
}

th {
    color: #64748b;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    background: #0f172a;
    position: sticky;
    top: 0;
}

td { color: #cbd5e1; }

.table-scroll {
    max-height: 300px;
    overflow-y: auto;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.chart-container {
    background: #0f172a;
    border-radius: 8px;
    padding: 0.8rem;
    height: 250px;
}

/* Responsive */
@media (max-width: 768px) {
    .charts-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: repeat(2, 1fr); }
    header { padding: 0.8rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
    main { padding: 1rem; }
    .header-right { flex-wrap: wrap; }
    .session-actions { flex-direction: column; }
}
