/* NPC Agent — Стили */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0f172a; color: #e2e8f0; height: 100vh; }
.app { display: flex; height: 100vh; }

/* Сайдбар */
.sidebar { width: 260px; background: #1e293b; border-right: 1px solid #334155; display: flex; flex-direction: column; transition: width 0.3s; }
.sidebar-header { padding: 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; }
.sidebar-header h1 { font-size: 18px; color: #38bdf8; }
.menu-btn { background: none; border: none; color: #94a3b8; font-size: 20px; cursor: pointer; }
.sidebar-nav { flex: 1; padding: 12px; }
.nav-btn { width: 100%; padding: 12px; text-align: left; background: none; border: none; color: #94a3b8; font-size: 14px; cursor: pointer; border-radius: 8px; margin-bottom: 4px; }
.nav-btn:hover { background: #334155; color: #e2e8f0; }
.nav-btn.active { background: #38bdf8; color: #0f172a; }
.sidebar-footer { padding: 16px; border-top: 1px solid #334155; }
.user-info { font-size: 13px; color: #94a3b8; margin-bottom: 8px; }
.logout-btn { width: 100%; padding: 8px; background: #ef4444; color: white; border: none; border-radius: 6px; cursor: pointer; }

/* Контент */
.content { flex: 1; overflow-y: auto; padding: 24px; }
.section { display: none; }
.section.active { display: block; }
h2 { margin-bottom: 20px; color: #f1f5f9; }

/* Канбан */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item { background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 12px; display: flex; align-items: center; gap: 12px; }
.task-item input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.task-item.done { opacity: 0.5; }
.task-text { flex: 1; }
.task-deadline { font-size: 12px; color: #94a3b8; }
.task-responsible { font-size: 12px; color: #38bdf8; }

/* Чат с ИИ */
.ai-chat { display: flex; flex-direction: column; height: calc(100vh - 48px); }
.chat-header { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.chat-header select, .chat-header button { padding: 8px 12px; background: #1e293b; border: 1px solid #334155; color: #e2e8f0; border-radius: 6px; cursor: pointer; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 12px 0; }
.message { max-width: 70%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.message.user { align-self: flex-end; background: #38bdf8; color: #0f172a; }
.message.ai { align-self: flex-start; background: #1e293b; border: 1px solid #334155; }
.chat-input { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid #334155; }
.chat-input textarea, .chat-input input { flex: 1; padding: 10px; background: #1e293b; border: 1px solid #334155; color: #e2e8f0; border-radius: 8px; resize: none; font-size: 14px; }
.chat-input button { padding: 10px 20px; background: #38bdf8; color: #0f172a; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }

/* Диалоги */
.chats-layout { display: flex; gap: 20px; height: calc(100vh - 48px); }
.chats-list { width: 280px; overflow-y: auto; }
.chats-list h3 { margin-bottom: 12px; color: #94a3b8; font-size: 13px; text-transform: uppercase; }
.chat-item { padding: 10px; border-radius: 8px; cursor: pointer; margin-bottom: 4px; }
.chat-item:hover { background: #1e293b; }
.chat-item.active { background: #1e293b; border: 1px solid #38bdf8; }
.chat-area { flex: 1; display: flex; flex-direction: column; }
.messages-area { flex: 1; overflow-y: auto; padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }

/* Админ */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.admin-card { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 20px; }
.admin-card h3 { margin-bottom: 12px; color: #38bdf8; }

/* Модалки */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; justify-content: center; align-items: center; }
.modal.show { display: flex; }
.modal-content { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 32px; max-width: 400px; width: 90%; text-align: center; }
.modal-content h2 { margin-bottom: 12px; }
.modal-content p { color: #94a3b8; margin-bottom: 20px; }
.modal-content button { padding: 10px 24px; background: #38bdf8; color: #0f172a; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }

/* Статус */
.status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.status-ok { background: #22c55e20; color: #22c55e; }
.status-wait { background: #eab30820; color: #eab308; }
.status-done { background: #38bdf820; color: #38bdf8; }

/* Скроллбар */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }

/* Мобильная */
@media (max-width: 768px) {
    .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .chats-layout { flex-direction: column; }
    .chats-list { width: 100%; }
}
