/* Базовые стили админки */
.admin-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Боковая панель */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.version {
    margin: 4px 0 0 0;
    font-size: 12px;
    opacity: 0.7;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    display: none;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Навигация */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 20px 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: #60a5fa;
    font-weight: 500;
}

.nav-icon {
    margin-right: 12px;
    flex-shrink: 0;
}

.nav-text {
    font-size: 14px;
}

/* Подвал sidebar */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.user-role {
    font-size: 12px;
    opacity: 0.7;
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-header {
    background: white;
    padding: 24px 32px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
}

.header-left p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.quick-actions {
    display: flex;
    gap: 12px;
}

/* Контент страниц */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Статистические карточки */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stats-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stats-card.primary {
    border-left: 4px solid #2563eb;
}

.stats-card.success {
    border-left: 4px solid #059669;
}

.stats-card.warning {
    border-left: 4px solid #d97706;
}

.stats-card.info {
    border-left: 4px solid #0891b2;
}

.stats-icon {
    font-size: 32px;
    margin-right: 20px;
}

.stats-content {
    flex: 1;
}

.stats-number {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #1e293b;
}

.stats-label {
    margin: 0 0 8px 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.stats-change {
    font-size: 12px;
    font-weight: 500;
}

.stats-change.positive {
    color: #059669;
}

.stats-change.negative {
    color: #dc2626;
}

.stats-change.neutral {
    color: #64748b;
}

/* Быстрые действия */
.quick-actions-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #1e293b;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.action-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.action-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.action-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.action-card h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.action-card p {
    margin: 0 0 16px 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.action-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.action-btn:hover {
    background: #1d4ed8;
}

.action-btn.danger {
    background: #dc2626;
}

.action-btn.danger:hover {
    background: #b91c1c;
}

/* Последние события */
.recent-activity {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.recent-activity .section-title {
    padding: 24px 24px 0 24px;
}

.activity-list {
    padding: 0 24px;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 16px;
}

.activity-icon.booking {
    background: #dbeafe;
}

.activity-icon.user {
    background: #d1fae5;
}

.activity-icon.phase {
    background: #fef3c7;
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.activity-content p {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #64748b;
}

.activity-time {
    font-size: 12px;
    color: #94a3b8;
}

.view-all-btn {
    width: 100%;
    margin: 16px 0;
}

/* Редактор сообщений */
.editor-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    height: calc(100vh - 180px);
}

.editor-sidebar {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    overflow-y: auto;
}

.editor-sidebar h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.category-item:hover {
    background: #f1f5f9;
}

.category-item.active {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 500;
}

.editor-main {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.editor-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

.editor-input {
    display: flex;
    flex-direction: column;
}

.editor-input label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

#messageText {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
}

#messageText:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.message-placeholders {
    margin-top: 12px;
}

.placeholder-chip {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin: 2px;
    cursor: pointer;
}

.placeholder-chip:hover {
    background: #c7d2fe;
}

.editor-preview {
    display: flex;
    flex-direction: column;
}

.editor-preview h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.preview-content {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px;
    background: #f9fafb;
    font-size: 14px;
    line-height: 1.5;
    overflow-y: auto;
}

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 100px 20px;
    color: #64748b;
}

.coming-soon h2 {
    font-size: 32px;
    margin-bottom: 16px;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90%;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.modal-body {
    padding: 20px;
}

.modal-actions {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Уведомления */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #2563eb;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
}

.notification.success {
    border-left-color: #059669;
}

.notification.error {
    border-left-color: #dc2626;
}

.notification.warning {
    border-left-color: #d97706;
}

/* Загрузочный экран */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

/* Кнопки */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

/* Iframe контейнер */
.page-wrapper {
    height: calc(100vh - 180px);
}

.iframe-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Анимации */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Адаптивность */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        height: 100%;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .main-header {
        padding-left: 60px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .editor-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .editor-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 16px;
    }

    .main-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-left h1 {
        font-size: 20px;
    }
} 