        /* ==============================================================
           БЛОК: СТИЛИ
           ============================================================== */
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            display: flex;
            height: 100vh;
            background: #f0f2f5;
            color: #333;
            overflow: hidden;
        }
        #sidebar {
            width: 240px;
            min-width: 240px;
            background: #2c3e50;
            color: #ecf0f1;
            padding: 15px 0;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            border-right: 2px solid #1a2632;
            height: 100vh;
        }
        #sidebar h3 {
            padding: 0 15px 12px 15px;
            font-weight: 300;
            font-size: 16px;
            letter-spacing: 1px;
            border-bottom: 1px solid #3e5366;
            color: #b0c4d9;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }
        #sidebar h3 button {
            background: #3e5366;
            border: none;
            color: #ecf0f1;
            padding: 2px 12px;
            border-radius: 12px;
            font-size: 16px;
            cursor: pointer;
            font-weight: 700;
            transition: background 0.15s;
        }
        #sidebar h3 button:hover { background: #5a7a95; }
        #tocList {
            flex: 1;
            overflow-y: auto;
            padding: 8px 0;
        }
        .toc-item {
            padding: 6px 12px;
            cursor: pointer;
            border-left: 3px solid transparent;
            font-size: 12px;
            transition: all 0.1s ease;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: transparent;
            border: none;
            color: #d0dae6;
            width: 100%;
            text-align: left;
            min-height: 32px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .toc-item:hover { background: #3e5366; color: #fff; }
        .toc-item.active {
            background: #1a75bc;
            border-left-color: #f1c40f;
            color: #fff;
            font-weight: 500;
        }
        .toc-item .del-btn {
            background: none;
            border: none;
            color: #e74c3c;
            font-size: 14px;
            cursor: pointer;
            opacity: 0.3;
            padding: 0 4px;
            transition: opacity 0.15s;
        }
        .toc-item .del-btn:hover { opacity: 1; }
        .toc-item .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            display: inline-block;
            margin-right: 6px;
            flex-shrink: 0;
        }
        .toc-item .status-dot.complete { background: #27ae60; }
        .toc-item .status-dot.incomplete { background: #e74c3c; }
        .toc-item .status-dot.warning { background: #f39c12; }
        .toc-item .toc-label {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }
        #sidebar .footer-actions {
            padding: 12px 15px;
            border-top: 1px solid #3e5366;
            display: flex;
            flex-direction: column;
            gap: 6px;
            flex-shrink: 0;
        }
        #sidebar .footer-actions button {
            background: #3e5366;
            border: none;
            color: #ecf0f1;
            padding: 6px;
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
            transition: background 0.15s;
        }
        #sidebar .footer-actions button:hover:not(:disabled) { background: #5a7a95; }
        #sidebar .footer-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
        #sidebar .footer-actions button.danger { color: #e74c3c; }
        #sidebar .footer-actions button.danger:hover:not(:disabled) { background: #5a2a2a; }
        #sidebar .footer-actions .storage-warning {
            font-size: 10px;
            color: #f1c40f;
            text-align: center;
            padding: 2px 0;
        }
        #sidebar .footer-actions .storage-info {
            font-size: 10px;
            color: #8899aa;
            text-align: center;
        }
        #main {
            flex: 1;
            padding: 15px 20px;
            overflow-y: auto;
            background: #f0f2f5;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }
        #main h2 {
            font-weight: 300;
            font-size: 20px;
            margin-bottom: 12px;
            color: #1a2632;
            border-bottom: 1px solid #d0d7e2;
            padding-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            flex-shrink: 0;
        }
        #main h2 .badge {
            background: #2c3e50;
            color: #ecf0f1;
            font-size: 13px;
            padding: 2px 12px;
            border-radius: 30px;
            font-weight: 400;
        }
        #main h2 .storage-badge {
            font-size: 12px;
            background: #27ae60;
            color: #fff;
            padding: 2px 10px;
            border-radius: 30px;
            font-weight: 400;
        }
        #main h2 .storage-badge.warning { background: #f39c12; }
        #formContainer {
            flex: 1;
            overflow-y: auto;
            padding-right: 4px;
        }
        .form-section {
            background: #fff;
            border-radius: 8px;
            padding: 14px 18px;
            margin-bottom: 14px;
            box-shadow: 0 1px 4px rgba(0,0,0,0.08);
        }
        .form-section h4 {
            font-weight: 500;
            font-size: 14px;
            margin-bottom: 10px;
            color: #2c3e50;
            border-bottom: 1px solid #e9edf2;
            padding-bottom: 5px;
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .form-section h4 .hint {
            font-weight: 400;
            font-size: 11px;
            color: #8899aa;
        }
        .grid-2, .grid-3, .grid-4, .grid-5 {
            display: grid;
            gap: 8px 14px;
        }
        .grid-2 { grid-template-columns: 1fr 1fr; }
        .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
        .grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
        .grid-5 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr; }
        .field {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .field label {
            font-size: 11px;
            font-weight: 600;
            color: #556677;
            letter-spacing: 0.3px;
        }
        .field label .required { color: #e74c3c; margin-left: 2px; }
        .field label .field-error {
            color: #e74c3c;
            font-weight: 400;
            font-size: 10px;
            margin-left: 6px;
        }
        .field input, .field textarea, .field select {
            padding: 5px 8px;
            border: 1px solid #d0d7e2;
            border-radius: 4px;
            font-size: 12px;
            font-family: inherit;
            background: #fafbfc;
            transition: border 0.15s, background 0.15s;
        }
        .field input:focus, .field textarea:focus, .field select:focus {
            border-color: #1a75bc;
            outline: none;
            background: #fff;
        }
        .field input.error, .field textarea.error {
            border-color: #e74c3c !important;
            background: #fff5f5 !important;
        }
        .field input.valid, .field textarea.valid {
            border-color: #27ae60 !important;
            background: #f0fff4 !important;
        }
        .field input.warning, .field textarea.warning {
            border-color: #f39c12 !important;
            background: #fef9e7 !important;
        }
        .field textarea {
            resize: vertical;
            min-height: 35px;
            font-size: 12px;
        }
        .field .note {
            font-size: 10px;
            color: #8899aa;
        }
        .field-full { grid-column: 1 / -1; }
        .field .btn-calc {
            background: #3498db;
            color: #fff;
            border: none;
            padding: 3px 10px;
            border-radius: 4px;
            font-size: 11px;
            cursor: pointer;
            margin-top: 2px;
            align-self: flex-start;
            white-space: nowrap;
            transition: background 0.15s;
        }
        .field .btn-calc:hover:not(:disabled) { background: #2980b9; }
        .field .btn-calc:disabled { opacity: 0.5; cursor: not-allowed; }
        .table-wrap {
            overflow-x: auto;
            margin-top: 3px;
        }
        .table-wrap table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12px;
            min-width: 500px;
        }
        .table-wrap table th {
            background: #e9edf2;
            color: #2c3e50;
            font-weight: 600;
            padding: 4px 6px;
            text-align: center;
            border: 1px solid #d0d7e2;
            font-size: 10px;
            white-space: nowrap;
        }
        .table-wrap table td {
            padding: 3px 4px;
            border: 1px solid #d0d7e2;
            text-align: center;
            vertical-align: middle;
        }
        .table-wrap table td input {
            width: 100%;
            min-width: 35px;
            padding: 3px 4px;
            border: none;
            background: transparent;
            text-align: center;
            font-size: 12px;
            border-radius: 2px;
            font-family: inherit;
            transition: background 0.15s;
        }
        .table-wrap table td input:focus {
            background: #f0f7ff;
            outline: 2px solid #1a75bc;
        }
        .table-wrap table td input.error {
            background: #fff5f5 !important;
            outline: 1px solid #e74c3c !important;
        }
        .table-wrap table td input.valid {
            background: #f0fff4 !important;
            outline: 1px solid #27ae60 !important;
        }
        .table-wrap table td input.warning {
            background: #fef9e7 !important;
            outline: 1px solid #f39c12 !important;
        }
        .table-wrap table td input[type="text"] { min-width: 60px; }
        .table-wrap .species-row td:first-child input {
            min-width: 100px;
            text-align: left;
            font-style: italic;
        }
        .btn-add-row {
            background: none;
            border: 1px dashed #b0c4d9;
            color: #556677;
            padding: 2px 12px;
            border-radius: 20px;
            font-size: 11px;
            cursor: pointer;
            margin-top: 4px;
            transition: all 0.15s;
        }
        .btn-add-row:hover {
            background: #e9edf2;
            border-color: #8899aa;
        }
        .btn-remove-row {
            background: none;
            border: none;
            color: #e74c3c;
            cursor: pointer;
            font-size: 14px;
            opacity: 0.4;
            padding: 0 3px;
            transition: opacity 0.15s;
        }
        .btn-remove-row:hover { opacity: 1; }
        .table-navigation-hint {
            font-size: 10px;
            color: #8899aa;
            margin-left: 10px;
        }
        .main-actions {
            display: flex;
            gap: 10px;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid #d0d7e2;
            flex-wrap: wrap;
            align-items: center;
            flex-shrink: 0;
        }
        .main-actions button {
            padding: 6px 16px;
            border: none;
            border-radius: 4px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            background: #e9edf2;
            color: #2c3e50;
            transition: all 0.15s;
        }
        .main-actions button:hover:not(:disabled) { opacity: 0.85; }
        .main-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
        .main-actions button.primary {
            background: #1a75bc;
            color: #fff;
        }
        .main-actions button.primary:hover:not(:disabled) { background: #155a94; }
        .main-actions button.success {
            background: #27ae60;
            color: #fff;
        }
        .main-actions button.success:hover:not(:disabled) { background: #1e8449; }
        .main-actions button.danger {
            background: #e74c3c;
            color: #fff;
        }
        .main-actions button.danger:hover:not(:disabled) { background: #c0392b; }
        .main-actions .validation-warning {
            color: #e74c3c;
            font-size: 12px;
            flex: 1;
            text-align: right;
        }
        .main-actions .validation-warning.success { color: #27ae60; }
        .main-actions .validation-warning.warning { color: #f39c12; }
        .main-actions .status-msg {
            padding: 4px 8px;
            font-size: 12px;
            color: #556677;
        }
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        .modal-overlay.hidden { display: none; }
        .modal {
            background: #fff;
            padding: 24px 30px;
            border-radius: 12px;
            max-width: 600px;
            width: 90%;
            box-shadow: 0 10px 40px rgba(0,0,0,0.3);
            max-height: 80vh;
            overflow-y: auto;
        }
        .modal h3 {
            margin-bottom: 10px;
            color: #e74c3c;
            font-size: 18px;
        }
        .modal ul {
            margin: 8px 0 16px 18px;
            color: #555;
            font-size: 13px;
            line-height: 1.6;
            max-height: 250px;
            overflow-y: auto;
        }
        .modal .modal-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }
        .modal .modal-actions button {
            padding: 6px 20px;
            border: none;
            border-radius: 4px;
            font-size: 13px;
            cursor: pointer;
            transition: opacity 0.15s;
        }
        .modal .modal-actions button:hover { opacity: 0.85; }
        .modal .modal-actions .btn-cancel {
            background: #e9edf2;
            color: #333;
        }
        .modal .modal-actions .btn-export {
            background: #27ae60;
            color: #fff;
        }
        .photo-section {
            border: 1px solid #e9edf2;
            border-radius: 6px;
            padding: 10px 12px;
            margin-bottom: 10px;
            background: #fafbfc;
        }
        .photo-section .photo-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
            flex-wrap: wrap;
            gap: 6px;
        }
        .photo-section .photo-header h5 {
            font-weight: 600;
            font-size: 13px;
            color: #2c3e50;
        }
        .photo-section .photo-header .badge-count {
            background: #1a75bc;
            color: #fff;
            border-radius: 30px;
            padding: 1px 8px;
            font-size: 11px;
            font-weight: 600;
        }
        .photo-section .photo-header .badge-count.required { background: #e74c3c; }
        .photo-section .photo-header .badge-count.ok { background: #27ae60; }
        .photo-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 6px;
            min-height: 25px;
        }
        .photo-grid .photo-item {
            position: relative;
            cursor: pointer;
            border: 2px solid #d0d7e2;
            border-radius: 4px;
            overflow: hidden;
            background: #fff;
            transition: border-color 0.15s;
            flex-shrink: 0;
        }
        .photo-grid .photo-item:hover { border-color: #1a75bc; }
        .photo-grid .photo-item img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .photo-grid .photo-item .del-photo {
            position: absolute;
            top: 2px;
            right: 2px;
            background: rgba(231, 76, 60, 0.85);
            color: #fff;
            border: none;
            border-radius: 50%;
            width: 18px;
            height: 18px;
            font-size: 12px;
            line-height: 18px;
            text-align: center;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.15s;
        }
        .photo-grid .photo-item:hover .del-photo { opacity: 1; }
        .photo-grid .photo-item.panorama {
            width: 100%;
            max-width: 100%;
            height: auto;
            aspect-ratio: 16/5;
            border-color: #f39c12;
        }
        .photo-grid .photo-item.panorama img { object-fit: cover; }
        .photo-grid .photo-item.thumb-150 {
            width: 120px;
            height: 120px;
        }
        .photo-grid .photo-item.thumb-50 {
            width: 40px;
            height: 40px;
        }
        .photo-grid .photo-item.thumb-150-var {
            width: 120px;
            height: 120px;
        }
        .photo-upload-btn {
            background: none;
            border: 2px dashed #b0c4d9;
            color: #556677;
            padding: 4px 14px;
            border-radius: 20px;
            font-size: 11px;
            cursor: pointer;
            transition: all 0.15s;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
        .photo-upload-btn:hover:not(:disabled) {
            background: #e9edf2;
            border-color: #8899aa;
        }
        .photo-upload-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .photo-upload-btn input { display: none; }
        .photo-section .photo-requirements {
            font-size: 10px;
            color: #8899aa;
            margin-left: 6px;
        }
        .photo-section .photo-requirements .required { color: #e74c3c; }
        .photo-grid .empty-hint {
            color: #b0c4d9;
            font-size: 12px;
            padding: 6px 0;
            font-style: italic;
        }
        .photo-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.92);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 2000;
            cursor: pointer;
        }
        .photo-modal.hidden { display: none; }
        .photo-modal img {
            max-width: 95%;
            max-height: 95%;
            object-fit: contain;
            border-radius: 4px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.5);
        }
        .photo-modal .close-modal {
            position: absolute;
            top: 20px;
            right: 30px;
            color: #fff;
            font-size: 36px;
            font-weight: 300;
            cursor: pointer;
            background: none;
            border: none;
            transition: color 0.15s;
        }
        .photo-modal .close-modal:hover { color: #e74c3c; }
        .photo-modal .photo-counter {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            color: #fff;
            background: rgba(0,0,0,0.6);
            padding: 4px 14px;
            border-radius: 20px;
            font-size: 13px;
        }
        .photo-modal .nav-arrow {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            color: #fff;
            font-size: 40px;
            cursor: pointer;
            background: none;
            border: none;
            padding: 15px;
            opacity: 0.6;
            transition: opacity 0.15s;
        }
        .photo-modal .nav-arrow:hover { opacity: 1; }
        .photo-modal .nav-arrow.left { left: 10px; }
        .photo-modal .nav-arrow.right { right: 10px; }
        .loader-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 3000;
            flex-direction: column;
            gap: 16px;
        }
        .loader-overlay.hidden { display: none; }
        .loader-spinner {
            width: 50px;
            height: 50px;
            border: 5px solid #f3f3f3;
            border-top: 5px solid #3498db;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        .loader-text {
            color: #fff;
            font-size: 15px;
            font-weight: 300;
            text-align: center;
        }
        .loader-progress {
            color: #fff;
            font-size: 13px;
            background: rgba(0,0,0,0.5);
            padding: 3px 14px;
            border-radius: 20px;
        }
        @media (max-width: 900px) {
            #sidebar { width: 180px; min-width: 180px; }
            .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; }
        }
        @media (max-width: 600px) {
            #sidebar {
                width: 100%;
                min-width: 100%;
                max-height: 180px;
                border-right: none;
                border-bottom: 2px solid #1a2632;
                height: auto;
            }
            body { flex-direction: column; overflow: auto; }
            #main { height: auto; }
            .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
            .photo-modal .nav-arrow { font-size: 28px; padding: 8px; }
            .photo-modal .nav-arrow.left { left: 5px; }
            .photo-modal .nav-arrow.right { right: 5px; }
        }
        .hidden { display: none !important; }
        .text-muted { color: #8899aa; }
        .mt-1 { margin-top: 6px; }
        .mb-1 { margin-bottom: 6px; }
        .flex { display: flex; }
        .flex-center { align-items: center; }
        .gap-1 { gap: 6px; }
        .content-loading {
            padding: 40px;
            text-align: center;
            color: #8899aa;
        }
        .content-loading .spinner {
            display: inline-block;
            width: 30px;
            height: 30px;
            border: 3px solid #e9edf2;
            border-top: 3px solid #3498db;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
