* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

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

header h1 {
    margin: 0;
    color: #333;
    font-size: 28px;
}

.btn-logout {
    background: #666;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #555;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section h2 {
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    color: #333;
}

.section h3 {
    color: #555;
    margin-top: 0;
}

.step {
    margin-bottom: 20px;
}

.description {
    color: #666;
    font-size: 14px;
    margin: 0 0 20px 0;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    background: #e0e0e0;
    color: #333;
}

.btn:hover {
    background: #d0d0d0;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

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

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-group .btn {
    flex: 1;
}

.sims-list {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.sims-list label {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.sims-list label:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

.sims-list input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

.period-options {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.radio {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

.radio input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
}

.calendar-wrap {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.calendar-wrap input[type="date"],
.calendar-wrap input[type="text"],
.form-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.calendar-wrap small {
    color: #777;
    font-size: 12px;
}

.form-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.form-field {
    display: grid;
    gap: 6px;
}

.form-field span {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.progress-container {
    margin-bottom: 15px;
}

progress {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    border: none;
    background: #e0e0e0;
}

progress::-webkit-progress-bar {
    background: #e0e0e0;
}

progress::-webkit-progress-value {
    background: #667eea;
}

progress::-moz-progress-bar {
    background: #667eea;
}

.progress-text {
    color: #666;
    font-size: 14px;
    margin: 10px 0;
}

.report {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    font-size: 12px;
    line-height: 1.5;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 15px 0;
    color: #333;
}

/* ──── Статистика скачивания ──── */

.stats-row {
    display: flex;
    gap: 12px;
    margin: 15px 0;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    background: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.stat-ok .stat-value { color: #2e7d32; }
.stat-skip .stat-value { color: #e65100; }
.stat-err .stat-value { color: #c62828; }

@media (max-width: 600px) {
    .stats-row {
        flex-wrap: wrap;
    }
    .stat-item {
        flex: 1 1 45%;
    }
}

/* ──── Автоматический режим ──── */

.auto-control {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 15px;
}

.checkbox input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.checkbox span {
    font-weight: 500;
}

.schedule-settings {
    background: white;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 15px;
}

.schedule-group {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.schedule-group label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.schedule-group label span {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.schedule-group input {
    width: 80px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

.auto-status {
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    margin: 0;
    color: #666;
}

.auto-status.enabled {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.auto-status.disabled {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    header h1 {
        font-size: 24px;
    }

    .btn-group {
        flex-direction: column;
    }

    .schedule-group {
        flex-direction: column;
        gap: 10px;
    }

    .schedule-group input {
        width: 100%;
    }
}
