/* ============================================================
   create.css — стили для страницы создания заявки
   ============================================================ */

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #2d3748;
    --success: #48bb78;
    --warning: #f6ad55;
    --danger: #f56565;
    --light-bg: #f7fafc;
    --border: #e2e8f0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.main-content { max-width: 1200px; margin: 0 auto; padding: 20px; }
.container {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ===== ПЛАШКА ТЕСТИРОВАНИЯ ===== */
.test-banner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    border-radius: 16px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.test-banner .icon { font-size: 2rem; color: #f59e0b; }
.test-banner .text { flex: 1; font-size: 0.95rem; color: #78350f; }
.test-banner .btn-report {
    background: white; color: #92400e; border: 2px solid #f59e0b;
    padding: 8px 20px; border-radius: 30px; text-decoration: none;
    font-weight: 600;
}
.test-banner .btn-report:hover { background: #f59e0b; color: white; }

/* ===== ПЛАШКА ИНФОРМАЦИИ ОБ ОТПРАВКЕ ===== */
.email-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #0d47a1;
    margin-top: 8px;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== ПЛАШКА ЗАПОЛНЕНИЯ ===== */
.fill-banner {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.fill-banner .icon { color: #16a34a; font-size: 1.3rem; }
.fill-banner .title { color: #15803d; font-size: 0.95rem; }
.fill-banner .sub {
    color: #166534;
    font-size: 0.8rem;
    display: block;
    margin-top: 2px;
}
.fill-btn {
    background: #16a34a;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.fill-btn:hover { background: #15803d; }

/* ===== ШАПКА ===== */
.page-header {
    background: white;
    border-radius: 24px;
    padding: 15px 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.header-left h1 {
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.5rem;
}
.header-left h1 i { color: var(--primary); }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== КНОПКИ ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 50px; text-decoration: none;
    font-weight: 600; font-size: 0.9rem; transition: all 0.3s;
    border: 2px solid transparent; cursor: pointer;
}
.btn-outline { background: white; color: #4a5568; border-color: var(--border); }
.btn-outline:hover { background: var(--light-bg); border-color: #cbd5e0; }
.btn-primary {
    background: linear-gradient(135deg, #667eea, #5a67d8);
    color: white; box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-sm { padding: 6px 16px; font-size: 0.8rem; }
.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white; box-shadow: 0 4px 15px rgba(72,187,120,0.3);
}
.btn-success:hover { transform: translateY(-2px); }
.btn-save {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white; box-shadow: 0 4px 15px rgba(72,187,120,0.3);
}
.btn-save:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(72,187,120,0.4); }
.btn-cancel {
    background: white; color: #4a5568; border: 2px solid var(--border);
}
.btn-cancel:hover { background: var(--light-bg); border-color: #cbd5e0; }

/* ===== АЛЕРТЫ ===== */
.alert {
    padding: 12px 18px; border-radius: 16px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 12px; border-left: 4px solid;
    background: white; box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.alert-error { border-left-color: var(--danger); color: #dc2626; }
.alert-error i { color: var(--danger); }

/* ===== ФОРМА ===== */
.form-section {
    margin-bottom: 28px; padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.section-title {
    font-size: 1.05rem; margin-bottom: 16px; display: flex;
    align-items: center; gap: 10px; color: var(--secondary); font-weight: 700;
}
.section-title i { color: var(--primary); width: 22px; }
.section-title .badge-required {
    font-size: 0.65rem; background: var(--danger); color: white;
    padding: 2px 10px; border-radius: 20px; font-weight: 600; margin-left: auto;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block; font-weight: 600; color: var(--secondary);
    font-size: 0.85rem; margin-bottom: 4px;
}
.form-group label .required { color: var(--danger); margin-left: 2px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border);
    border-radius: 12px; font-size: 0.95rem; background: white;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group .hint {
    font-size: 0.75rem; color: #94a3b8; margin-top: 4px;
    display: flex; align-items: flex-start; gap: 4px;
}
.form-group .hint i { color: var(--primary); margin-top: 2px; font-size: 0.7rem; }
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    padding-right: 36px;
}
.lab-select-wrapper { max-width: 400px; }

.form-actions {
    margin-top: 30px; padding-top: 25px; padding-bottom: 15px;
    border-top: 1px solid var(--border); display: flex; gap: 12px; flex-wrap: wrap;
}
.btn-action {
    flex: 1; min-width: 0; padding: 13px 20px; border-radius: 14px;
    font-weight: 600; font-size: 0.95rem; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; border: none; text-decoration: none;
}

/* ===== ТАБЛИЦА СИ ===== */
.items-table-wrapper {
    overflow-x: auto; border: 1px solid var(--border);
    border-radius: 12px; margin-top: 10px;
}
.items-table {
    width: 100%; border-collapse: collapse; font-size: 0.82rem;
    min-width: 900px;
}
.items-table th {
    padding: 8px 8px; text-align: left; background: #f8fafc;
    font-weight: 600; color: #4a5568; font-size: 0.7rem;
    border-bottom: 2px solid var(--border);
}
.items-table td { padding: 4px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.items-table input, .items-table select {
    width: 100%; padding: 5px 6px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 0.78rem; background: white;
}
.items-table input:focus, .items-table select:focus { outline: none; border-color: var(--primary); }
.items-table .remove-btn {
    background: none; border: none; color: var(--danger);
    cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.items-table .row-number {
    font-weight: 700; color: var(--primary); text-align: center; font-size: 0.8rem;
}
.items-table .extra-toggle {
    background: none; border: none; color: #94a3b8; cursor: pointer;
    padding: 2px 6px; font-size: 0.7rem; border-radius: 4px;
}
.items-table .extra-toggle:hover { background: #f1f5f9; color: var(--primary); }
.items-table .extra-toggle.active { color: var(--primary); }
.items-table .extra-row-hidden { display: none; }

.btn-add-item {
    margin-top: 12px; padding: 8px 16px; border-radius: 30px;
    background: var(--light-bg); border: 1px dashed var(--border);
    color: var(--secondary); font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-add-item:hover { border-color: var(--primary); color: var(--primary); background: #f0f4ff; }

.quick-add-section {
    background: var(--light-bg); border-radius: 12px;
    padding: 12px 16px; margin-bottom: 12px; border: 1px solid var(--border);
}

/* ===== ПРОМО ===== */
.promo-section {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    border-radius: 16px;
    padding: 25px 30px;
    text-align: center;
    margin-bottom: 20px;
}
.promo-section h3 { color: #92400e; font-size: 1.3rem; margin-bottom: 10px; }
.promo-section p { color: #78350f; font-size: 0.95rem; margin-bottom: 15px; }
.promo-section .benefits {
    display: flex; justify-content: center; gap: 30px; flex-wrap: wrap;
    margin-top: 15px;
}
.promo-section .benefit-item {
    display: flex; align-items: center; gap: 8px;
    color: #78350f; font-size: 0.85rem;
}
.promo-section .benefit-item i { color: #f59e0b; font-size: 1.1rem; }

/* ===== МОДАЛКА ===== */
.modal-overlay {
    display: none; position: fixed; z-index: 10000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
.modal-content {
    background: white; border-radius: 24px; padding: 30px;
    width: 700px; max-width: 92%; max-height: 80vh; overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.modal-header h2 { margin: 0; color: var(--secondary); font-size: 1.3rem; }
.modal-header h2 i { color: var(--primary); }
.modal-close {
    background: none; border: none; font-size: 1.5rem;
    cursor: pointer; color: #a0aec0; padding: 0 8px;
}
.modal-close:hover { color: #4a5568; }
.search-box-modal {
    display: flex; gap: 8px; margin-bottom: 12px;
}
.search-box-modal input {
    flex: 1; padding: 10px 12px; border: 2px solid var(--border);
    border-radius: 12px; font-size: 0.9rem;
}
.search-box-modal input:focus { outline: none; border-color: var(--primary); }
.instrument-select-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background 0.2s;
}
.instrument-select-item:hover { background: var(--light-bg); }
.instrument-select-item input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--primary);
    flex-shrink: 0; cursor: pointer;
}
.instrument-select-item .inst-name {
    font-weight: 600; color: var(--secondary); font-size: 0.9rem;
}
.instrument-select-item .inst-meta { font-size: 0.75rem; color: #94a3b8; }
.inst-already-added { opacity: 0.5; pointer-events: none; }
.inst-already-added .inst-name::after {
    content: ' (уже добавлено)'; font-size: 0.7rem;
    color: var(--success); font-weight: 400;
}
.modal-footer {
    margin-top: 20px; display: flex; gap: 10px;
    justify-content: flex-end; flex-wrap: wrap;
}
.btn-close-modal {
    background: var(--border); color: #4a5568; border: none;
    padding: 10px 20px; border-radius: 12px; font-weight: 600;
    font-size: 0.9rem; cursor: pointer;
}
.btn-close-modal:hover { background: #cbd5e0; }

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .main-content { padding: 12px; }
    .container { padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; }
    .btn-action { width: 100%; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .lab-select-wrapper { max-width: 100%; }
    .items-table { min-width: 700px; font-size: 0.72rem; }
    .items-table th { font-size: 0.6rem; padding: 4px 4px; }
    .items-table td { padding: 3px 4px; }
    .items-table input, .items-table select { font-size: 0.7rem; padding: 3px 4px; }
    .modal-content { padding: 20px; width: 100%; }
    .promo-section .benefits { flex-direction: column; align-items: center; gap: 10px; }
    .test-banner { flex-direction: column; text-align: center; }
    .test-banner .btn-report { width: 100%; justify-content: center; }
    .fill-banner { flex-direction: column; align-items: stretch; }
    .fill-btn { justify-content: center; }
}