/* ============================================================
   КВАНТОВЫЙ ОРАКУЛ — ADMIN PANEL CSS
   ============================================================ */

body {
    background: #0a0818;
    color: #f0e8ff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.container-fluid { max-width: 1400px; }

.card {
    background: rgba(30, 22, 56, 0.85);
    border: 1px solid rgba(180, 150, 230, 0.3);
    border-radius: 16px;
}
.card-header { background: rgba(0,0,0,0.25); border-bottom: 1px solid rgba(180, 150, 230, 0.2); }

.nav-tabs { border-bottom: 1px solid rgba(180, 150, 230, 0.3); flex-wrap: wrap; }
.nav-tabs .nav-link { color: #d8c8f8 !important; border: none; padding: 10px 18px; font-weight: 600; font-size: 0.95rem; }
.nav-tabs .nav-link:hover { color: #ffffff !important; background: rgba(180, 150, 230, 0.15); border-radius: 8px 8px 0 0; }
.nav-tabs .nav-link.active { color: #ffffff !important; background: rgba(200, 176, 240, 0.25) !important; border-bottom: 3px solid #c8b0f0 !important; }

.btn-primary { background: linear-gradient(135deg, #7a5ac0, #9a7ad8); border: none; color: #fff; font-weight: 600; }
.btn-primary:hover { background: linear-gradient(135deg, #8a6ad0, #aa8ae8); color: #fff; }
.btn-secondary { background: rgba(100, 80, 160, 0.6); border: 1px solid rgba(180, 150, 230, 0.4); color: #f0e8ff; font-weight: 500; }
.btn-secondary:hover { background: rgba(120, 100, 180, 0.9); color: #ffffff; }
.btn-success { background: linear-gradient(135deg, #4a9a6a, #6aba8a); border: none; color: #fff; font-weight: 600; }
.btn-danger { background: linear-gradient(135deg, #c05050, #e07070); border: none; color: #fff; }
.btn-outline-success { color: #80e0a0; border-color: #80e0a0; }
.btn-outline-success:hover { background: #80e0a0; color: #1a1430; }
.btn-outline-warning { color: #ffd060; border-color: #ffd060; }
.btn-outline-warning:hover { background: #ffd060; color: #1a1430; }
.btn-outline-secondary { color: #d0c8e8; border-color: rgba(180, 150, 230, 0.5); }
.btn-outline-secondary:hover { background: rgba(180, 150, 230, 0.25); color: #ffffff; }
.btn-outline-danger { color: #ff9090; border-color: #ff9090; }
.btn-outline-danger:hover { background: rgba(255, 144, 144, 0.25); color: #ffffff; }

.log-box {
    background: #0d0a1a;
    border-radius: 8px;
    padding: 12px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #e0d4f5;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

.test-result { padding: 10px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; color: #f0e8ff; }
.test-pass { background: rgba(74, 154, 106, 0.2); border-left: 4px solid #4a9a6a; }
.test-fail { background: rgba(192, 80, 80, 0.2); border-left: 4px solid #c05050; }

.chat-box { max-height: 400px; overflow-y: auto; background: #0d0a1a; border-radius: 8px; padding: 15px; }
.chat-msg { margin-bottom: 10px; padding: 10px 14px; border-radius: 8px; color: #f0e8ff; }
.chat-user { background: rgba(160, 130, 210, 0.2); color: #e0d0ff; }
.chat-bot { background: rgba(74, 154, 106, 0.15); color: #b0e0c0; }

.stat-number { font-size: 2.2rem; font-weight: bold; color: #e0d0ff; }
.stat-label { color: #d0c0e8; font-size: 0.9rem; font-weight: 500; }

.resource-card {
    background: rgba(20, 15, 40, 0.7);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid rgba(180, 150, 230, 0.25);
}
.resource-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #d0c0e8;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.resource-value { font-size: 1.5rem; font-weight: bold; color: #f0e8ff; }

.progress { height: 10px; background: #1a1430; border-radius: 5px; }
.progress-bar { border-radius: 5px; font-weight: 600; }

table.table-dark { background: transparent; color: #f0e8ff; }
table.table-dark th {
    color: #e0d0ff;
    border-color: rgba(180, 150, 230, 0.3);
    font-weight: 700;
    font-size: 0.9rem;
}
table.table-dark td {
    border-color: rgba(180, 150, 230, 0.15);
    color: #f0e8ff;
    font-size: 0.9rem;
}

.badge { color: #ffffff !important; font-weight: 600; padding: 6px 10px; }
.badge-admin { background: #7a5ac0; }
.badge-user { background: #4a4060; }

.form-control {
    background: rgba(12, 10, 26, 0.9) !important;
    border: 1px solid rgba(180, 150, 230, 0.4) !important;
    color: #ffffff !important;
}
.form-control:focus {
    border-color: #c8b0f0 !important;
    box-shadow: 0 0 0 3px rgba(200, 176, 240, 0.25) !important;
    color: #ffffff !important;
}
.form-control::placeholder { color: #b0a0c8 !important; }

p, span, li, div { color: #f0e8ff; }
.text-muted { color: #c0b0d8 !important; }
h1, h2, h3, h4, h5, h6 { color: #f0e8ff; }
strong { color: #ffffff; }
small { color: #d0c0e8; }

/* ===== ГРАФИКИ ===== */
.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}
.chart-container-sm { position: relative; height: 180px; width: 100%; }
.chart-container-lg { position: relative; height: 350px; width: 100%; }

.chart-container canvas,
.chart-container-sm canvas,
.chart-container-lg canvas {
    max-height: 100% !important;
    width: 100% !important;
}

/* ===== RAG / ИСТОЧНИКИ ===== */
.rag-item {
    background: rgba(20, 15, 40, 0.6);
    border: 1px solid rgba(180, 150, 230, 0.2);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.rag-query {
    color: #e0d0ff;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.rag-hits {
    color: #80e0a0;
    font-size: 0.85rem;
    background: rgba(128, 224, 160, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
}

.rag-when {
    color: #a090c0;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.rag-source {
    background: rgba(12, 10, 26, 0.7);
    border-left: 3px solid #7a5ac0;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.rag-source a {
    color: #c8b0f0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}

.rag-source a:hover {
    color: #e0d0ff;
    text-decoration: underline;
}

.rag-summary {
    color: #d0c0e8;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 6px;
}