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

body {
    font-family: 'Montserrat', 'Arial', sans-serif;
    background: #171e38;
    color: white;
    min-height: 100vh;
    padding: 10px;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    min-height: 60px;
}

.logo {
    max-width: 80%;
    max-height: 60px;
    height: auto;
    width: auto;
    object-fit: contain;
}

.video-section {
    background: #090c19;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.video-container {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 4/3;
    margin-bottom: 12px;
}

#processedImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(9, 12, 25, 0.9);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f23325;
}

.status-indicator.active {
    background: #20CBDD;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.controls-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.btn {
    border: none;
    flex: 1;
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    min-width: 100px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20%;
    height: 100%;
    pointer-events: none;
}

.btn-center {
    justify-content: center;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #036AFF 0%, #1a7eff 25%, #2a92ff 50%, #3ba6ff 75%, #4db9ff 100%);
    color: white;
    box-shadow: 0 3px 8px rgba(3, 106, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 106, 255, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, #ff8f43 0%, #ff9a55 25%, #ffa567 50%, #ffb079 75%, #ffbb8b 100%);
    color: white;
    box-shadow: 0 3px 8px rgba(255, 143, 67, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 143, 67, 0.6);
}

.btn-danger {
    background: linear-gradient(135deg, #f23325 0%, #f44a3d 25%, #f66155 50%, #f8786d 75%, #fa8f85 100%);
    color: white;
    box-shadow: 0 3px 8px rgba(242, 51, 37, 0.4);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(242, 51, 37, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #036AFF 0%, #1a7eff 25%, #2a92ff 50%, #3ba6ff 75%, #4db9ff 100%);
    color: white;
    text-align: center;
    justify-content: center;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(32, 203, 221, 0.6);
}

.btn-warning {
    background: linear-gradient(135deg, #353a4e 0%, #42475c 25%, #4f546a 50%, #5c6178 75%, #696e86 100%);
    color: white;
    box-shadow: 0 3px 8px rgba(53, 58, 78, 0.4);
    text-align: center;
    justify-content: center;
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(53, 58, 78, 0.6);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.detected-defects-section {
    background: #090c19;
    border-radius: 8px;
    padding: 20px 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    min-height: 120px;
    max-height: 350px;
    overflow-y: auto;
}

.detected-defects-section::-webkit-scrollbar {
    width: 5px;
}

.detected-defects-section::-webkit-scrollbar-track {
    background: #535973;
    border-radius: 3px;
}

.detected-defects-section::-webkit-scrollbar-thumb {
    background: #20CBDD;
    border-radius: 3px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    margin-top: 10px;
    color: #036AFF;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    padding: 10px 0;
}

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

.defect-card[data-type="0"] { border-left: 4px solid #353a4e; }
.defect-card[data-type="1"] { border-left: 4px solid #ff8f43; }
.defect-card[data-type="2"] { border-left: 4px solid #f23325; }
.defect-card[data-type="3"] { border-left: 4px solid #036AFF; }
.defect-card[data-type="4"] { border-left: 4px solid #20CBDD; }
.defect-card[data-type="5"] { border-left: 4px solid #ff8f43; }
.defect-card[data-type="6"] { border-left: 4px solid #353a4e; }
.defect-card[data-type="7"] { border-left: 4px solid #f23325; }
.defect-card[data-type="8"] { border-left: 4px solid #036AFF; }

.defect-card {
    background: rgba(53, 58, 78, 0.3);
    border-radius: 6px;
    padding: 12px;
    transition: all 0.2s;
}

.defect-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    background: #535973;
}

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

.defect-name {
    font-weight: 600;
    color: white;
    font-size: 14px;
}

.defect-time {
    font-size: 10px;
    color: #20CBDD;
    background: rgba(9, 12, 25, 0.7);
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.defect-preview {
    font-size: 12px;
    color: #b0b5c8;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
    text-align: left;
}

.defect-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.defect-actions .btn {
    padding: 6px 10px;
    font-size: 11px;
    min-height: 32px;
    flex: none;
    min-width: auto;
}

.empty-state {
    text-align: center;
    padding: 25px 15px;
    color: #8a9ba8;
    font-size: 13px;
}

.empty-state svg {
    width: 45px;
    height: 45px;
    margin-bottom: 12px;
    color: #20CBDD;
    opacity: 0.4;
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(23, 30, 56, 0.95);
    display: none;
    justify-content: center;
    align-items: flex-start;
    z-index: 1000;
    padding: 15px;
    backdrop-filter: blur(8px);
    padding-top: 3vh;
}

.modal-content {
    background: rgba(23, 30, 56, 0.95);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    margin-top: 1vh;
}

.modal-header,
.modal-footer {
    flex-shrink: 0;
}

.modal-header {
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(23, 30, 56, 0.5);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #036AFF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-close {
    background: rgba(53, 58, 78, 0.5);
    font-size: 22px;
    color: #036AFF;
    cursor: pointer;
    padding: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(32, 203, 221, 0.2);
    color: white;
}

.modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
    padding: 18px;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.text-editor {
    width: 100%;
    min-height: 200px;
    padding: 14px;
    background: rgba(53, 58, 78, 0.2);
    border: 2px solid rgba(53, 58, 78, 0.5);
    border-radius: 8px;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.2s;
}

.text-editor:focus {
    outline: none;
}

.modal-footer {
    padding: 18px;
    border-top: 1px solid rgba(53, 58, 78, 0.5);
    display: flex;
    gap: 10px;
    background: rgba(23, 30, 56, 0.5);
}

.modal-footer .btn {
    flex: 1;
}

.snapshot-preview {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(53, 58, 78, 0.5);
    max-height: 250px;
    min-height: 120px;
}

.snapshot-preview img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    background: #090c19;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes highlight {
    0% { background: rgba(32, 203, 221, 0.2); box-shadow: 0 0 15px rgba(32, 203, 221, 0.4); }
    100% { background: rgba(53, 58, 78, 0.3); box-shadow: none; }
}

.defect-card.new {
    animation: highlight 1s ease-out;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    padding: 14px 20px;
    border-radius: 8px;
    z-index: 999;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    animation: slideInTop 0.4s ease-out;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Montserrat', sans-serif;
}

.notification-success {
    background: linear-gradient(60deg, #20CBDD 20%, #1899b5 80%);
    color: white;
}

.notification-error {
    background: linear-gradient(60deg, #f23325 20%, #d32f2f 80%);
    color: white;
}

.notification-warning {
    background: linear-gradient(60deg, #ff8f43 20%, #e67e00 80%);
    color: white;
}

@keyframes slideInTop {
    from { transform: translateY(-40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideOutTop {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-40px); opacity: 0; }
}

.btn-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon img {
    width: 100%;
    height: 100%;
    filter: brightness(0) invert(1);
}

/* ===== ВЫБОР КРИТИЧНОСТИ ===== */
.severity-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0;
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

.sev-btn {
    display: block;
    width: 100%;
    padding: 18px 8px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0.3px;
    font-family: 'Montserrat', sans-serif;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
    position: relative;
    z-index: 20;
    color: white;
    text-align: center;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.sev-btn:active {
    opacity: 0.75;
    transform: scale(0.98);
}

.sev-critical {
    background: linear-gradient(135deg, #e53935 0%, #f44336 50%, #ef5350 100%);
    box-shadow: 0 3px 10px rgba(229, 57, 53, 0.45);
}
.sev-significant {
    background: linear-gradient(135deg, #e65100 0%, #f57c00 50%, #fb8c00 100%);
    box-shadow: 0 3px 10px rgba(230, 81, 0, 0.45);
}
.sev-minor {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #388e3c 100%);
    box-shadow: 0 3px 10px rgba(27, 94, 32, 0.45);
}
.sev-other {
    background: #535973;
    color: #ffffff;
}

/* ===== СЕКЦИЯ РЕДАКТОРА ===== */
.editor-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.selected-severity-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: white;
}

.badge-critical {
    background: linear-gradient(135deg, #FE2502 0%, #FF1518 50%, #FF0035 100%);
    box-shadow: 0 3px 10px rgba(229, 57, 53, 0.45);
}
.badge-significant {
    background: linear-gradient(135deg, #FF6702 0%, #FF8900 50%, #FFb900 100%);
    box-shadow: 0 3px 10px rgba(230, 81, 0, 0.45);
}
.badge-minor {
    background: linear-gradient(135deg, #0D7407 0%, #359C03 50%, #7ACA09 100%);
    box-shadow: 0 3px 10px rgba(27, 94, 32, 0.45);
}
.badge-other {
    background: rgba(53, 58, 78, 0.8);
    border: 1px solid rgba(120, 125, 145, 0.4);
}

.defect-name-label {
    font-size: 14px;
    font-weight: 700;
    color: #c8cdd8;
    padding: 0 2px;
    font-family: 'Montserrat', sans-serif;
}

.back-to-severity-row {
    padding: 0 18px 16px 18px;
}

.btn-back {
    width: 100%;
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 600;
    background: transparent;
    border: none;
    color: #8a9ba8;
    cursor: pointer;
    transition: color 0.2s;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    letter-spacing: 0.2px;
}
.btn-back:hover {
    color: #c8cdd8;
}

.severity-dropdown-wrapper {
    margin-bottom: 20px;
}

.dropdown-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #c8cdd8;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif;
}

.custom-dropdown {
    position: relative;
    width: 100%;
    z-index: 10;
}

.dropdown-toggle {
    width: 100%;
    padding: 14px 16px;
    background: #1a2035;
    border: 2px solid rgba(53, 58, 78, 0.6);
    border-radius: 8px;
    color: #a8b2c1;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
    text-align: left;
}

.dropdown-toggle:hover {
    border-color: rgba(53, 58, 78, 0.9);
    background: #1f2540;
}

.dropdown-toggle.active {
    border-color: #036AFF;
    background: #1f2540;
}

.dropdown-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1a2035;
    border: 2px solid rgba(53, 58, 78, 0.6);
    border-radius: 8px;
    overflow-y: auto !important;
    max-height: 180px !important;
    -webkit-overflow-scrolling: touch;
    z-index: 1001;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s;
}

body.modal-open,
html.modal-open {
    overflow: hidden;
}

.dropdown-menu.open-upwards {
    top: auto;
    bottom: 100%;
    transform: translateY(10px);
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu.show.open-upwards {
    transform: translateY(0);
}

.dropdown-item {
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    text-align: left;
    border-bottom: 1px solid rgba(53, 58, 78, 0.3);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.severity-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.item-critical {
    background: linear-gradient(to right, rgba(229, 57, 53, 0.15), transparent);
}
.item-critical:hover {
    background: linear-gradient(to right, rgba(229, 57, 53, 0.25), transparent);
}
.dot-critical {
    background: #e53935;
    box-shadow: 0 0 8px rgba(229, 57, 53, 0.6);
}

.item-significant {
    background: linear-gradient(to right, rgba(230, 81, 0, 0.15), transparent);
}
.item-significant:hover {
    background: linear-gradient(to right, rgba(230, 81, 0, 0.25), transparent);
}
.dot-significant {
    background: #e65100;
    box-shadow: 0 0 8px rgba(230, 81, 0, 0.6);
}

.item-minor {
    background: linear-gradient(to right, rgba(27, 94, 32, 0.15), transparent);
}
.item-minor:hover {
    background: linear-gradient(to right, rgba(27, 94, 32, 0.25), transparent);
}
.dot-minor {
    background: #1b5e20;
    box-shadow: 0 0 8px rgba(27, 94, 32, 0.6);
}

.item-other {
    background: linear-gradient(to right, rgba(83, 89, 115, 0.15), transparent);
}
.item-other:hover {
    background: linear-gradient(to right, rgba(83, 89, 115, 0.25), transparent);
}
.dot-other {
    background: #535973;
    box-shadow: 0 0 8px rgba(83, 89, 115, 0.4);
}

@keyframes dropdownSlideIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu.show .dropdown-item {
    animation: dropdownSlideIn 0.3s ease-out forwards;
}

.dropdown-menu.show .dropdown-item:nth-child(1) { animation-delay: 0.05s; }
.dropdown-menu.show .dropdown-item:nth-child(2) { animation-delay: 0.1s; }
.dropdown-menu.show .dropdown-item:nth-child(3) { animation-delay: 0.15s; }
.dropdown-menu.show .dropdown-item:nth-child(4) { animation-delay: 0.2s; }

.selected-severity-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: white;
    gap: 10px;
}

.selected-severity-badge::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.badge-critical::before {
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.badge-significant::before {
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.badge-minor::before {
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.badge-other::before {
    background: #c8cdd8;
}

.modal-overlay.dropdown-open {
    overflow: visible;
}

.dropdown-menu {
    max-height: none !important;
    overflow-y: visible !important;
}

.modal-content {
    transition: max-height 0.2s ease;
}

.modal-content.dropdown-expanded {
    max-height: 95vh;
}
/* ===== ПЛАВАЮЩАЯ КНОПКА МЕНЮ ===== */
.fab-menu-btn {
    position: fixed;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(9, 12, 25, 0.85);
    border: 1.5px solid rgba(3, 106, 255, 0.35);
    color: #a8b2c1;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
    line-height: 1;
    letter-spacing: -1px;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.fab-menu-btn:hover,
.fab-menu-btn.open {
    background: rgba(3, 106, 255, 0.15);
    border-color: #036AFF;
    color: white;
    box-shadow: 0 4px 20px rgba(3, 106, 255, 0.3);
}

/* Попап меню */
.fab-popup {
    position: fixed;
    top: 62px;
    right: 14px;
    width: 210px;
    background: rgba(9, 12, 25, 0.97);
    border: 1.5px solid rgba(53, 58, 78, 0.7);
    border-radius: 12px;
    z-index: 8999;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0,0,0,0.6);
    backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.fab-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fab-popup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: #c8cdd8;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    border-bottom: 1px solid rgba(53, 58, 78, 0.4);
}

.fab-popup-item:last-child {
    border-bottom: none;
}

.fab-popup-item:hover {
    background: rgba(53, 58, 78, 0.45);
    color: white;
}

.fab-popup-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.75;
}

.fab-popup-item:hover svg {
    opacity: 1;
}

.fab-popup-item.item-logout:hover {
    background: rgba(242, 51, 37, 0.15);
    color: #f88;
}
.fab-popup-item.item-logout:hover svg {
    color: #f88;
}

/* Разделитель */
.fab-popup-divider {
    height: 1px;
    background: rgba(53, 58, 78, 0.5);
    margin: 0;
}

/* Бэкдроп (закрывает меню по клику вне) */
.fab-backdrop {
    position: fixed;
    inset: 0;
    z-index: 8998;
    display: none;
}
.fab-backdrop.show {
    display: block;
}

/* ===== СВЕТЛАЯ ТЕМА ===== */
body.light-theme {
    background: #f0f2f8;
    color: #1a2035;
}

body.light-theme .video-section,
body.light-theme .detected-defects-section {
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

body.light-theme .video-overlay {
    background: rgba(255,255,255,0.92);
    color: #1a2035;
}

body.light-theme .defect-card {
    background: rgba(53, 58, 78, 0.07);
}

body.light-theme .defect-card:hover {
    background: rgba(53, 58, 78, 0.15);
}

body.light-theme .defect-name {
    color: #1a2035;
}

body.light-theme .modal-overlay {
    background: rgba(200, 210, 235, 0.95);
}

body.light-theme .modal-content {
    background: rgba(240, 242, 248, 0.98);
}

body.light-theme .modal-header,
body.light-theme .modal-footer {
    background: rgba(220, 225, 245, 0.6);
}

body.light-theme .text-editor {
    background: rgba(53, 58, 78, 0.07);
    border-color: rgba(53, 58, 78, 0.2);
    color: #1a2035;
}

body.light-theme .dropdown-toggle,
body.light-theme .dropdown-menu {
    background: #e8eaf4;
    border-color: rgba(53, 58, 78, 0.2);
    color: #1a2035;
}

body.light-theme .dropdown-toggle:hover,
body.light-theme .dropdown-toggle.active {
    background: #dde0f0;
}

body.light-theme .dropdown-item {
    color: #1a2035;
}

body.light-theme .fab-menu-btn {
    background: rgba(255,255,255,0.9);
    border-color: rgba(3, 106, 255, 0.25);
    color: #535973;
}

body.light-theme .fab-popup {
    background: rgba(240, 242, 248, 0.98);
    border-color: rgba(53, 58, 78, 0.2);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

body.light-theme .fab-popup-item {
    color: #1a2035;
    border-color: rgba(53, 58, 78, 0.15);
}

body.light-theme .fab-popup-item:hover {
    background: rgba(53, 58, 78, 0.1);
}

body.light-theme .empty-state {
    color: #535973;
}

body.light-theme .defect-preview {
    color: #535973;
}

body.light-theme .defect-name-label {
    color: #1a2035;
}

body.light-theme .dropdown-label {
    color: #535973;
}