* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* === SIDEBAR === */
.sidebar {
    width: 260px;
    background: #16213e;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #0f3460;
}

.logo {
    padding: 24px 20px;
    border-bottom: 1px solid #0f3460;
    text-align: center;
}

.sidebar-logo {
    width: 80px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.logo h1 {
    font-size: 22px;
    color: #e94560;
}

.logo .subtitle {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    display: block;
}

nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: #1a1a3e;
    color: #fff;
}

.nav-item.active {
    background: #0f3460;
    color: #e94560;
    border-left: 3px solid #e94560;
}

.nav-item .icon {
    font-size: 18px;
}

/* === STATUS PANEL === */
.status-panel {
    padding: 16px 20px;
    border-top: 1px solid #0f3460;
    font-size: 13px;
}

.status-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #888;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.status-online { color: #4caf50; }
.status-offline { color: #f44336; }

/* === MAIN CONTENT === */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section {
    display: none;
    flex: 1;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
}

.section.active {
    display: flex;
}

.section h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #fff;
}

.section-desc {
    color: #888;
    margin-bottom: 24px;
    font-size: 14px;
}

.section-desc code {
    background: #0f3460;
    padding: 2px 8px;
    border-radius: 4px;
    color: #e94560;
}

/* === CHAT === */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-welcome {
    text-align: center;
    color: #666;
    margin: auto;
    font-size: 15px;
    line-height: 1.8;
}

.chat-msg {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-msg.user {
    align-self: flex-end;
    background: #0f3460;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg.ai {
    align-self: flex-start;
    background: #1e2a4a;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

.chat-msg.ai .sources {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #333;
    font-size: 12px;
    color: #888;
}

.chat-msg.ai .sources span {
    display: inline-block;
    background: #0f3460;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px 4px 2px 0;
    color: #aaa;
}

.chat-msg.ai .meta {
    margin-top: 8px;
    font-size: 11px;
    color: #555;
}

.chat-msg.loading {
    color: #888;
    font-style: italic;
}

/* === CHAT INPUT === */
.chat-input-area {
    padding: 16px 0 0;
    border-top: 1px solid #0f3460;
}

.input-options {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-options select {
    background: #16213e;
    color: #ccc;
    border: 1px solid #0f3460;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-row textarea {
    flex: 1;
    background: #16213e;
    color: #e0e0e0;
    border: 1px solid #0f3460;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
}

.input-row textarea:focus {
    border-color: #e94560;
}

.input-row button, button {
    background: #e94560;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.input-row button:hover, button:hover {
    background: #c73650;
}

button:disabled {
    background: #555;
    cursor: not-allowed;
}

/* === REINDEX === */
.reindex-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.reindex-card {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 24px;
}

.reindex-card h3 {
    margin-bottom: 8px;
    color: #e94560;
}

.reindex-card p {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}

.reindex-card select {
    width: 100%;
    background: #1a1a2e;
    color: #ccc;
    border: 1px solid #0f3460;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

.reindex-options {
    margin-bottom: 16px;
    font-size: 13px;
    color: #aaa;
}

.reindex-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.reindex-log {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 20px;
}

.reindex-log h3 {
    margin-bottom: 12px;
    color: #e94560;
}

.reindex-log pre {
    background: #0d1b2a;
    padding: 16px;
    border-radius: 8px;
    font-size: 13px;
    overflow-x: auto;
    color: #aaa;
    line-height: 1.6;
}

/* === STATS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #e94560;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: #888;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.cat-card {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cat-card .cat-name {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
}

.cat-card .cat-count {
    font-size: 20px;
    font-weight: 700;
    color: #e94560;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #0f3460;
    border-radius: 3px;
}
