* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 15px;
    text-shadow: 2px 4px 8px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.95;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 2.5em;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #667eea;
}

.stat-card.success .stat-value { color: #4caf50; }
.stat-card.error .stat-value { color: #f44336; }
.stat-card.info .stat-value { color: #2196f3; }

.stat-label {
    font-size: 0.9em;
    color: #777;
    text-transform: uppercase;
}

.status-bar {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.status-bar.error {
    background: #ffebee;
    color: #c62828;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-button {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    background: white;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #667eea;
    transition: all 0.3s;
}

.tab-button:hover {
    background: #f5f5f5;
}

.tab-button.active {
    background: white;
    color: #764ba2;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.9em;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
}

.btn-secondary {
    background: #757575;
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.result.show {
    display: block;
}

.result.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.result.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.result.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #2196f3;
}

.contacts-preview {
    margin-top: 20px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.contacts-preview h3 {
    margin-bottom: 15px;
    color: #667eea;
}

#contactsList {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: white;
    padding: 10px;
}

.contact-item {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    background: #fcfcfc;
}

.activity-log {
    max-height: 400px;
    overflow-y: auto;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid #eee;
}

.log-entry {
    padding: 8px;
    margin-bottom: 5px;
    border-left: 3px solid #667eea;
    background: white;
    border-radius: 4px;
}

.log-entry.success {
    border-left-color: #4caf50;
}

.log-entry.error {
    border-left-color: #f44336;
}

.log-entry time {
    color: #888;
    font-size: 0.85em;
    margin-right: 8px;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    width: 0%;
    height: 20px;
    background-color: #4caf50;
    text-align: center;
    line-height: 20px;
    color: white;
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    font-weight: bold;
    color: #555;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-radius: 8px;
        margin-bottom: 5px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

