body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: #f4f6f9;
    color: #333;
    display: flex;
    height: 100vh;
}

/* Login Screen */
#login-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #111a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 300px;
    text-align: center;
}
.login-box h2 { margin-top: 0; color: #111a2e; }
.login-box input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}
.login-box button {
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}
.login-box button:hover { background: #0056b3; }

/* Dashboard Layout */
#dashboard {
    display: flex;
    width: 100%;
    height: 100%;
}
aside {
    width: 250px;
    background: #111a2e;
    color: #fff;
    display: flex;
    flex-direction: column;
}
aside .logo {
    padding: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid #2c3e50;
}
aside nav { flex: 1; padding-top: 20px; }
aside nav button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 15px 20px;
    background: none;
    border: none;
    color: #aab;
    cursor: pointer;
    font-size: 16px;
    transition: 0.2s;
}
aside nav button:hover, aside nav button.active {
    background: #1e2a40;
    color: #fff;
    border-left: 4px solid #007bff;
}
aside .logout-btn {
    padding: 15px 20px;
    background: #c0392b;
    border: none;
    color: white;
    cursor: pointer;
    text-align: left;
}

main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Sections */
section { display: none; }
section.active { display: block; }

h1 { margin-top: 0; border-bottom: 2px solid #ddd; padding-bottom: 10px; }

/* KB Editor */
.kb-controls { margin-bottom: 20px; }
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    background: #007bff;
    color: white;
}
.btn-success { background: #28a745; }
.btn-danger { background: #dc3545; }
.btn-secondary { background: #6c757d; }

.topic-item {
    background: white;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}
.topic-header {
    padding: 10px 15px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}
.topic-header:hover { background: #e9ecef; }
.topic-content {
    padding: 15px;
    display: none;
    border-top: 1px solid #ddd;
}
.topic-content.open { display: block; }

.subtopic-item {
    border: 1px solid #eee;
    margin: 10px 0;
    padding: 10px;
    border-radius: 4px;
}
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.form-group textarea { height: 80px; resize: vertical; }

/* Logs */
#log-viewer {
    background: #222;
    color: #0f0;
    font-family: monospace;
    padding: 15px;
    border-radius: 4px;
    height: 500px;
    overflow-y: scroll;
    white-space: pre-wrap;
}
