* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #232d50 0%, #2d2336 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 760px;
    width: 100%;
    padding: 40px;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 26px;
    text-align: center;
}

.phase {
    margin-bottom: 24px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
}

.phase h2 {
    color: #444;
    font-size: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.phase-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.phase.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

select,
input[type="text"] {
    padding: 10px 14px;
    border: 1.5px solid #d6ddea;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1f2a44;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23667eea" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
}

input[type="text"] {
    background-image: none;
}

select:focus,
input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

select:disabled,
input:disabled {
    background: #f1f3f6;
    color: #9aa3b6;
    cursor: not-allowed;
}

.custom-select {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-select select {
    display: none;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1.5px solid #d6ddea;
    border-radius: 8px;
    background: #fff;
    color: #1f2a44;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
}

.custom-select-trigger:hover:not(.disabled) {
    border-color: #667eea;
}

.custom-select-trigger.open {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.custom-select-trigger.disabled {
    background: #f1f3f6;
    color: #9aa3b6;
    cursor: not-allowed;
}

.custom-select-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid #d6ddea;
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-top: -1.5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
}

.custom-select-options.open {
    display: block;
}

.custom-select-option {
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color 0.15s;
    color: #1f2a44;
    font-size: 13px;
}

.custom-select-option:hover {
    background: #f0f4ff;
}

.custom-select-option.selected {
    background: #e8ecff;
    color: #667eea;
    font-weight: 500;
}

.custom-select-option.disabled {
    color: #9aa3b6;
    cursor: not-allowed;
}

.custom-select-option.disabled:hover {
    background: transparent;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-export {
    background: #667eea;
    color: white;
}

.btn-export:hover:not(:disabled) {
    background: #5568d3;
}

.btn-import {
    background: #10b981;
    color: white;
}

.btn-import:hover:not(:disabled) {
    background: #059669;
}

.status-box {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.status-box.info {
    display: block;
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.status-box.success {
    display: block;
    background: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.status-box.error {
    display: block;
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#authBar {
    position: fixed;
    top: 12px;
    right: 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    display: none;
    align-items: center;
    gap: 8px;
}

#authBar button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    padding: 3px 10px;
    cursor: pointer;
}

@media (max-width: 560px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}