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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.section {
    padding: 20px;
}

.auth-form {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-form input, .auth-form select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.auth-form button {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    background: white;
    border-radius: 10px;
    padding: 10px;
}

.tab-button {
    padding: 10px 20px;
    margin: 0 5px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 5px;
}

.tab-button.active {
    background: #007bff;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#task-form input, #task-form textarea, #task-form select {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.chat-container {
    background: white;
    border-radius: 10px;
    height: 600px;
    display: flex;
    flex-direction: column;
}

#chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.chat-input {
    display: flex;
    padding: 20px;
    border-top: 1px solid #eee;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
}

.ai-chat-container {
    background: white;
    border-radius: 10px;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.ai-chat-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

#ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.ai-chat-input {
    display: flex;
    padding: 20px;
    border-top: 1px solid #eee;
}

.ai-chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
}

button:disabled {
    background: #ccc !important;
    cursor: not-allowed;
}

.message {
    margin: 10px 0;
    padding: 10px;
    border-radius: 5px;
}

.message.user {
    background: #e3f2fd;
    margin-left: 50px;
}

.message.ai {
    background: #f3e5f5;
    margin-right: 50px;
}

.task-item {
    background: white;
    margin: 10px 0;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #007bff;
}

.task-item.completed {
    opacity: 0.7;
    border-left-color: #28a745;
}

.code-block {
    position: relative;
    background: #1e1e1e;
    color: #fff;
    border-radius: 5px;
    margin: 10px 0;
    padding: 10px;
}

.code-block pre {
    margin: 0;
    overflow-x: auto;
}

.copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #007bff;
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 500px;
}

#ai-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 10px;
}

.message.ai.typing {
    color: #666;
    font-style: italic;
    animation: blink 1s step-end infinite;
}

.message.ai.streaming {
    background: #f0f0f0;
    transition: all 0.2s ease;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

/* Добавьте этот стиль для плавного скрытия/показа */
.tab-button {
    transition: all 0.3s ease;
}

/* Стиль для скрытой кнопки */
.tab-button.hidden {
    display: none !important;
}

/* Убедитесь, что табы правильно выравниваются при скрытии элемента */
.tabs {
    display: flex;
    gap: 5px;
}

.admin-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.user-management {
    display: flex;
    gap: 30px;
}

.add-user-form {
    flex: 1;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.add-user-form input, 
.add-user-form select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.add-user-form label {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.add-user-form input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.user-list {
    flex: 2;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.user-item:last-child {
    border-bottom: none;
}

.user-info {
    flex: 1;
}

.user-actions button {
    margin-left: 5px;
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.delete-user-btn {
    background: #dc3545;
    color: white;
}

.delete-user-btn:hover {
    background: #c82333;
}

.user-role {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
}

.user-role.admin {
    background: #dc3545;
}

.user-role.manager {
    background: #28a745;
}

@media (max-width: 768px) {
    .user-management {
        flex-direction: column;
    }
}

/* Add these styles for the admin button and panel */

#admin-panel-btn {
    margin: 0 10px;
    background: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

#admin-panel-btn:hover {
    background: #218838;
}

.admin-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.user-management {
    display: flex;
    gap: 30px;
}

.add-user-form {
    flex: 1;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.add-user-form input, 
.add-user-form select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.add-user-form label {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.add-user-form input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.user-list {
    flex: 2;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.user-item:last-child {
    border-bottom: none;
}

.user-info {
    flex: 1;
}

.user-actions button {
    margin-left: 5px;
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.delete-user-btn {
    background: #dc3545;
    color: white;
}

.delete-user-btn:hover {
    background: #c82333;
}

.user-role {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
}

.user-role.admin {
    background: #dc3545;
}

.user-role.manager {
    background: #28a745;
}

@media (max-width: 768px) {
    .user-management {
        flex-direction: column;
    }
}