* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-color: #000000;
    --primary-color: #3390ec;
    --primary-hover: #2878c4;
    --secondary-color: #6c757d;
    --border-color: #e0e0e0;
    --error-color: #dc3545;
    --success-color: #28a745;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

header h1 {
    font-size: 24px;
    font-weight: 600;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}

.view {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.list-item-order-controls {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 24px;
    margin-right: 12px;
}

.list-item:hover {
    background: #e9ecef;
    box-shadow: var(--shadow);
}

.list-item.active {
    border-color: var(--primary-color);
    background: #e7f3ff;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.list-item-subtitle {
    font-size: 12px;
    color: var(--secondary-color);
}

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

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 18px;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.form {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.checklists-section,
.tasks-section {
    margin-top: 24px;
}

.task-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-order-controls {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 24px;
    margin-right: 8px;
}

.order-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    color: var(--text-color);
}

.order-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.order-btn:active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.order-btn:disabled,
.order-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.checklist-order-controls {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 24px;
    margin-right: 8px;
}

.task-content {
    flex: 1;
}

.task-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}

.task-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.task-actions {
    display: flex;
    gap: 4px;
}

.error {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--error-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 1000;
    max-width: 90%;
    text-align: center;
}

.success {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 1000;
    max-width: 90%;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 600px) {
    .container {
        padding: 12px;
    }

    header h1 {
        font-size: 20px;
    }

    .toolbar {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

