/*   1. Дополнительные стили для админ-панели и модалок */

.admin-panel {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    border: 1px solid #e2e8f0;
    padding: 12px;
    text-align: left;
}

.admin-table th {
    background: #f8fafc;
    font-weight: 600;
}

.status-badge-new {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.status-badge-in_progress {
    background: #f39c12;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.status-badge-completed {
    background: #27ae60;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.btn-small {
    padding: 4px 12px;
    font-size: 0.8rem;
    margin: 2px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.error-notification {
    background: #e74c3c;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.success-notification {
    background: #27ae60;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/*   2. Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
}

body {
    background: #f4f7fc;
    color: #1e2a3e;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background 0.2s;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.main-header {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
}

.logo i {
    color: #2c7da0;
    margin-right: 8px;
}

.highlight {
    color: #2c7da0;
}

.main-nav ul {
    display: flex;
    gap: 28px;
    list-style: none;
}

.main-nav a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: 0.2s;
}

.main-nav a:hover {
    color: #2c7da0;
}

.auth-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid #2c7da0;
    padding: 6px 16px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.btn-outline:hover {
    background: #2c7da0;
    color: white;
}

.user-greeting {
    font-weight: 500;
    color: #2c7da0;
}

.hidden {
    display: none;
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

.hero-section {
    text-align: center;
    padding: 40px 20px;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.btn-primary, .btn-secondary {
    border: none;
    padding: 12px 28px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin: 8px;
    transition: 0.2s;
}

.btn-primary {
    background: #2c7da0;
    color: white;
    box-shadow: 0 2px 6px rgba(44,125,160,0.3);
}

.btn-primary:hover {
    background: #1f5e7a;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #e9ecef;
    color: #2c3e50;
}

.status-badge {
    margin-top: 30px;
    font-size: 0.9rem;
}

.online {
    color: #2ecc71;
    margin-right: 6px;
}

.chat-container {
    display: flex;
    gap: 24px;
    background: white;
    border-radius: 28px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 500px;
}

.chat-sidebar {
    background: #f8fafc;
    width: 260px;
    padding: 24px 16px;
    border-right: 1px solid #e2e8f0;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.quick-btn {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 40px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: 0.1s;
}

.quick-btn:hover {
    background: #eef2ff;
    border-color: #2c7da0;
}

.chat-messages-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.messages-list {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 460px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.bot-message .avatar {
    background: #2c7da0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .bubble {
    background: #2c7da0;
    color: white;
    border-radius: 20px 20px 4px 20px;
}

.bubble {
    background: #f1f3f5;
    padding: 12px 18px;
    border-radius: 20px 20px 20px 4px;
    max-width: 70%;
    word-wrap: break-word;
}

.chat-input-area {
    display: flex;
    padding: 16px;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
    background: white;
}

#userMessageInput {
    flex: 1;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 48px;
    outline: none;
}

.send-btn {
    background: #2c7da0;
    border: none;
    padding: 0 20px;
    border-radius: 40px;
    color: white;
    cursor: pointer;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
    gap: 24px;
    margin-top: 32px;
}

.faq-item {
    background: white;
    padding: 20px;
    border-radius: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.main-footer {
    background: #1e2a3e;
    color: #cbd5e1;
    padding: 32px 0 16px;
    margin-top: 40px;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 32px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 12px;
}

.small-btn {
    background: #2c7da0;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    max-width: 420px;
    width: 90%;
    padding: 28px;
    border-radius: 32px;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 16px;
    font-size: 28px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 18px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border-radius: 48px;
    border: 1px solid #ccc;
}

.error-message {
    color: #e74c3c;
    font-size: 0.75rem;
    margin-top: 4px;
}

.full-width {
    width: 100%;
}

.demo-hint {
    font-size: 0.8rem;
    margin-top: 16px;
    text-align: center;
    background: #f8f9fa;
    padding: 6px;
    border-radius: 24px;
}


/*   1. Стили для админ-панели */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.tab-btn {
    padding: 8px 20px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.tab-btn.active {
    background: #2c7da0;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/*2 Стили для статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c7da0;
}

/* 3. Стили для форм */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

/* 4. Стили для таблиц админки */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    border: 1px solid #e2e8f0;
    padding: 12px;
    text-align: left;
}

.admin-table th {
    background: #f8fafc;
    font-weight: 600;
}

/*   5. Статусы заявок */
.status-badge-new {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.status-badge-in_progress {
    background: #f39c12;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.status-badge-completed {
    background: #27ae60;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
}

/*   6. Кнопки */
.btn-small {
    padding: 4px 12px;
    font-size: 0.8rem;
    margin: 2px;
    cursor: pointer;
    background: #2c7da0;
    color: white;
    border: none;
    border-radius: 4px;
}

/*   7. Стили для дашборда */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card-dash {
    background: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-number-dash {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c7da0;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
/*   8. Стили для подсказок в чате */
.quick-tips {
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 16px;
}

.tips-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #2c7da0;
    font-size: 0.9rem;
}

.tips-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.tip-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.tip-btn:hover {
    background: #eef2ff;
    border-color: #2c7da0;
}

.tips-more-btn {
    background: transparent;
    border: none;
    color: #2c7da0;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 8px;
    width: 100%;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
}

.tips-more-btn:hover {
    background: #eef2ff;
    border-radius: 8px;
}

.more-tips-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.hidden {
    display: none;
}
/*   8. Стили для подсказок в чате */
.quick-tips {
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 16px;
}

.tips-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #2c7da0;
    font-size: 0.9rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.tip-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 0.75rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.tip-btn:hover {
    background: #eef2ff;
    border-color: #2c7da0;
}

.tips-more-btn {
    background: transparent;
    border: none;
    color: #2c7da0;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 8px;
    width: 100%;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
}

.tips-more-btn:hover {
    background: #eef2ff;
    border-radius: 8px;
}

.more-tips-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.more-tips-list.hidden {
    display: none;
}

/*   9. Стили для вкладки Экспорт/Импорт */
.export-import-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.export-card {
    flex: 1;
    min-width: 250px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.export-card h3 {
    margin-bottom: 10px;
    color: #2c7da0;
}

.export-card p {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.export-card .btn-primary {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.9rem;
}

.export-card input[type="file"] {
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    width: 100%;
}

.export-card form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}