* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.main-section {
    margin-bottom: 40px;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.portal-card {
    min-height: 160px;
    padding: 22px;
    border-radius: 12px;
    background: white;
    color: #25233a;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.portal-icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    margin-bottom: 16px;
}

.portal-title {
    display: block;
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 8px;
}

.portal-description {
    display: block;
    color: #666;
    line-height: 1.45;
}

.import-card,
.data-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.card-header h2 {
    font-size: 1.5em;
    margin: 0;
}

.card-body {
    padding: 30px;
}

.email-info {
    background: #f5f5f5;
    padding: 15px;
    border-left: 4px solid #667eea;
    margin: 20px 0;
    border-radius: 4px;
    line-height: 1.6;
}

/* Кнопка импорта */
.btn {
    padding: 12px 30px;
    font-size: 1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loader {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Статусный блок */
.status-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
    text-align: center;
    margin-top: 20px;
    animation: slideUp 0.5s ease-out;
}

.status-card.success {
    border-left: 5px solid #4caf50;
}

.status-card.error {
    border-left: 5px solid #f44336;
}

.status-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.status-card.success .status-icon::before {
    content: '✓';
    color: #4caf50;
}

.status-card.error .status-icon::before {
    content: '✕';
    color: #f44336;
}

#statusMessage {
    font-size: 1.1em;
    color: #333;
    margin: 0;
}

/* Таблица данных */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table thead {
    background: #f5f5f5;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #667eea;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
}

.data-table tbody tr:hover {
    background: #f9f9f9;
}

.text-center {
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .data-table {
        font-size: 0.9em;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}
