/* ==================== QR СКАНЕР - ВСЕ СТИЛИ ==================== */

/* Box-sizing для QR элементов */
.qr-modal-overlay,
.qr-modal-overlay *,
.qr-modal,
.qr-modal *,
.toast-notification,
.toast-notification * {
    box-sizing: border-box;
}

/* ==================== QR МОДАЛКА - СОВРЕМЕННЫЙ СТИЛЬ ==================== */
.qr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qr-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.qr-modal.modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
    border-radius: 0;
    box-shadow: 
        0 -10px 40px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(15, 23, 42, 0.08);
    padding: 24px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
}

.qr-modal.modern.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Заголовок QR модалки */
.qr-header.modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    flex-shrink: 0;
}

.qr-header.modern .header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qr-header.modern .header-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, #fff8e4 0%, #ffe8ad 100%);
    border: 1px solid rgba(232, 169, 32, 0.35);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c38b0a;
    box-shadow: none;
}

.qr-header.modern .header-icon svg {
    width: 24px;
    height: 24px;
}

.qr-header.modern .header-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.qr-header.modern .header-subtitle {
    margin: 0;
    font-size: 13px;
    color: #475569;
    margin-top: 2px;
}

.close-btn.modern {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: #475569;
}

.close-btn.modern:hover {
    background: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

.close-btn.modern:active {
    transform: scale(0.95);
}

/* Контейнер сканера */
.qr-scanner-container.modern {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
    position: relative;
    min-height: 0;
    overflow: auto;
}

/* Окно сканирования */
.qr-view.modern {
    flex: 1;
    background: #000000;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 520px;
    height: calc(100dvh - 240px);
    max-height: 74dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

#reader {
    width: 100% !important;
    height: 100% !important;
    border-radius: 18px !important;
}

#reader video {
    border-radius: 18px !important;
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}

/* Рамка сканирования */
#reader__scan_region {
    border: 2px solid rgba(232, 169, 32, 0.6) !important;
    border-radius: 16px !important;
    box-shadow: none !important;
}

#reader__shaded_region {
    background: rgba(0, 0, 0, 0.18) !important;
}

/* Подсветка камеры (torch) — только если браузер сообщает capabilities.torch (часто Android) */
.qr-torch-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 20;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    color: #f8fafc;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}
.qr-torch-btn:hover {
    background: rgba(15, 23, 42, 0.75);
}
.qr-torch-btn:active {
    transform: scale(0.95);
}
.qr-torch-btn.active {
    background: rgba(255, 199, 44, 0.95);
    color: #0f172a;
    box-shadow: 0 0 0 2px rgba(255, 199, 44, 0.4), 0 4px 20px rgba(255, 199, 44, 0.35);
}

/* Инструкция - современный стиль */
.scan-instruction.modern {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 14px 22px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(15, 23, 42, 0.12);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 28px);
    text-align: center;
    justify-content: center;
}

.scan-instruction.modern .scan-icon {
    opacity: 0.9;
}

.qr-purpose.modern {
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.qr-purpose.modern h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #0f172a;
    font-weight: 700;
}

.qr-purpose.modern p {
    margin: 0;
    color: #334155;
    font-size: 14px;
    line-height: 1.45;
}

/* Loader - современный */
.loader.modern {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    text-align: center;
}

.loader.modern.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.spinner.modern {
    border: 4px solid rgba(255, 255, 255, 0.08);
    border-top: 4px solid #e8a920;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Уведомление об успешном сканировании */
.scan-notification {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 14px 18px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    z-index: 25;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    width: calc(100% - 28px);
    max-width: 560px;
}

.scan-notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.scan-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.scan-notification .notif-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.scan-notification .notif-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scan-notification .notif-title {
    font-weight: 700;
    font-size: 14px;
    margin: 0;
}

.scan-notification .notif-message {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
}

/* Результат сканирования - современный */
.scan-result.modern {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 16px;
    border-radius: 16px;
    box-shadow: 
        0 12px 30px rgba(15, 23, 42, 0.16),
        0 0 0 1px rgba(15, 23, 42, 0.1);
    transform: translateY(calc(100% + 20px));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    max-height: calc(100% - 24px);
    overflow-y: auto;
}

.scan-result.modern.active {
    transform: translateY(0);
}

.result-header.modern {
    display: none;
}

.result-icon.modern {
    display: none;
}

.result-content.modern {
    flex: 1;
    min-width: 0;
}

.result-content.modern .result-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.result-data.modern {
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.result-data-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-data-content .result-title-main {
    font-size: 16px;
    font-weight: 700;
    color: #10b981;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-content-body {
    color: #334155;
    line-height: 1.5;
    font-size: 14px;
}

.result-content-body h3 {
    color: #0f172a;
    margin: 8px 0 6px 0;
    font-size: 15px;
}

.result-content-body p {
    margin: 4px 0;
    color: #475569;
    font-size: 13px;
}

.result-content-body strong {
    color: #0f172a;
}

.result-content-body img {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(232, 169, 32, 0.3) !important;
    margin: 4px 0 !important;
}

/* Кнопки действий - современный стиль */
.result-actions.modern {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.result-btn.modern {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.result-btn.modern.primary {
    background: linear-gradient(135deg, #f5c94c 0%, #e8a920 100%);
    color: #0f172a;
    box-shadow: 0 6px 16px rgba(232, 169, 32, 0.35);
}

.result-btn.modern.primary:hover {
    box-shadow: 0 6px 16px rgba(232, 169, 32, 0.4);
    transform: translateY(-1px);
}

.result-btn.modern.secondary {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.result-btn.modern.secondary:hover {
    background: rgba(15, 23, 42, 0.1);
}

.result-btn.modern:active {
    transform: scale(0.98);
}

.result-btn.modern svg {
    width: 16px;
    height: 16px;
}

/* ==================== КАРТОЧКА ИНФОРМАЦИИ О ТЕХНИКЕ ==================== */
.equipment-info-card {
    text-align: center;
    padding: 8px 0;
}

.equipment-type-badge {
    display: inline-block;
    background: rgba(232, 169, 32, 0.2);
    color: #e8a920;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.equipment-name {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.equipment-rent-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.equipment-owner-info,
.equipment-operator-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    text-align: left;
}

.equipment-operator-info {
    background: rgba(232, 169, 32, 0.1);
    border: 1px solid rgba(232, 169, 32, 0.2);
}

.owner-avatar-small,
.operator-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.operator-avatar-small {
    border: 2px solid #e8a920;
}

.owner-details,
.operator-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.owner-label,
.operator-label {
    font-size: 10px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.owner-name,
.operator-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.operator-time {
    font-size: 11px;
    color: #e8a920;
}

.equipment-warning {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 10px;
    border-radius: 10px;
    font-size: 12px;
    margin-top: 10px;
}

/* Кнопки с несколькими действиями */
.result-actions.multi-buttons {
    flex-wrap: wrap;
    gap: 6px;
}

.result-actions.multi-buttons .result-btn.modern {
    flex: 1 1 calc(50% - 3px);
    min-width: calc(50% - 3px);
    padding: 10px 8px;
    font-size: 11px;
}

.result-actions.multi-buttons .result-btn.modern.continue-btn {
    flex: 1 1 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #8b92a0;
    margin-top: 4px;
}

.result-actions.multi-buttons .result-btn.modern.continue-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

/* ==================== ИСТОРИЯ СКАНИРОВАНИЙ ==================== */
.scan-history {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.scan-history-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.scan-history-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
}

.scan-history-title svg {
    color: #e8a920;
}

.scan-history-count {
    background: rgba(232, 169, 32, 0.2);
    color: #e8a920;
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
}

.clear-history-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-history-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

.clear-history-btn:active {
    transform: scale(0.95);
}

#qrModal .scan-history .scan-history-list,
.qr-modal .scan-history .scan-history-list {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 0px !important;
    min-height: 0 !important;
    max-height: 300px !important;
}

#qrModal .scan-history .scan-history-list::-webkit-scrollbar,
.qr-modal .scan-history .scan-history-list::-webkit-scrollbar {
    width: 6px !important;
}

#qrModal .scan-history .scan-history-list::-webkit-scrollbar-track,
.qr-modal .scan-history .scan-history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02) !important;
    border-radius: 3px !important;
}

#qrModal .scan-history .scan-history-list::-webkit-scrollbar-thumb,
.qr-modal .scan-history .scan-history-list::-webkit-scrollbar-thumb {
    background: rgba(232, 169, 32, 0.3) !important;
    border-radius: 3px !important;
}

#qrModal .scan-history-empty,
.qr-modal .scan-history-empty {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 40px 20px !important;
    text-align: center !important;
    color: #8b92a0 !important;
    height: 100% !important;
}

#qrModal .scan-history-empty svg,
.qr-modal .scan-history-empty svg {
    margin-bottom: 16px !important;
    color: #3a4252 !important;
}

#qrModal .scan-history-empty p,
.qr-modal .scan-history-empty p {
    font-size: 15px !important;
    font-weight: 600 !important;
    margin: 0 0 8px 0 !important;
    color: #5a6171 !important;
}

#qrModal .scan-history-empty span,
.qr-modal .scan-history-empty span {
    font-size: 13px !important;
    color: #4a5161 !important;
}

/* История сканирований - специфичные стили для футера */
#qrModal .scan-history .scan-history-item,
.qr-modal .scan-history .scan-history-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 8px !important;
    transition: all 0.2s !important;
    color: inherit !important;
}

#qrModal .scan-history .scan-history-item:hover,
.qr-modal .scan-history .scan-history-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(232, 169, 32, 0.2) !important;
}

#qrModal .scan-history .scan-history-item-icon,
.qr-modal .scan-history .scan-history-item-icon {
    width: 40px !important;
    height: 40px !important;
    background: rgba(232, 169, 32, 0.1) !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #e8a920 !important;
    flex-shrink: 0 !important;
}

#qrModal .scan-history .scan-history-item-content,
.qr-modal .scan-history .scan-history-item-content {
    flex: 1 !important;
    min-width: 0 !important;
}

#qrModal .scan-history .scan-history-item-data,
.qr-modal .scan-history .scan-history-item-data {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    margin-bottom: 2px !important;
    word-break: break-all !important;
    line-height: 1.3 !important;
}

#qrModal .scan-history .scan-history-item-subtitle,
.qr-modal .scan-history .scan-history-item-subtitle {
    font-size: 12px !important;
    color: #e8a920 !important;
    margin-bottom: 4px !important;
    font-weight: 500 !important;
}

#qrModal .scan-history .scan-history-item-time,
.qr-modal .scan-history .scan-history-item-time {
    font-size: 11px !important;
    color: #6b7280 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

#qrModal .scan-history .scan-history-item-time svg,
.qr-modal .scan-history .scan-history-item-time svg {
    width: 12px !important;
    height: 12px !important;
    opacity: 0.7 !important;
}

#qrModal .scan-history .scan-history-item-actions,
.qr-modal .scan-history .scan-history-item-actions {
    display: flex !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

#qrModal .scan-history .scan-history-action-btn,
.qr-modal .scan-history .scan-history-action-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #8b92a0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

#qrModal .scan-history .scan-history-action-btn:hover,
.qr-modal .scan-history .scan-history-action-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

#qrModal .scan-history .scan-history-action-btn.goto,
.qr-modal .scan-history .scan-history-action-btn.goto {
    color: #e8a920 !important;
}

#qrModal .scan-history .scan-history-action-btn.goto:hover,
.qr-modal .scan-history .scan-history-action-btn.goto:hover {
    background: rgba(232, 169, 32, 0.1) !important;
    border-color: rgba(232, 169, 32, 0.2) !important;
}

#qrModal .scan-history .scan-history-action-btn.delete,
.qr-modal .scan-history .scan-history-action-btn.delete {
    color: #ef4444 !important;
}

#qrModal .scan-history .scan-history-action-btn.delete:hover,
.qr-modal .scan-history .scan-history-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

#qrModal .scan-history .scan-history-action-btn:active,
.qr-modal .scan-history .scan-history-action-btn:active {
    transform: scale(0.95) !important;
}

/* ==================== TOAST УВЕДОМЛЕНИЯ ==================== */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    width: calc(100% - 24px);
    max-width: 560px;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 15px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.toast-notification .toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

/* ==================== АДАПТАЦИЯ ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ ==================== */
@media (max-width: 450px) {
    .qr-modal.modern {
        padding: 16px 12px 14px;
        max-height: 100dvh;
    }
    
    .qr-view.modern {
        height: calc(100dvh - 225px);
        min-height: 420px;
        max-height: 70dvh;
    }
    
    #qrModal .scan-history .scan-history-item,
    .qr-modal .scan-history .scan-history-item {
        padding: 10px !important;
    }
    
    #qrModal .scan-history .scan-history-item-icon,
    .qr-modal .scan-history .scan-history-item-icon {
        width: 36px !important;
        height: 36px !important;
    }
    
    #qrModal .scan-history .scan-history-item-data,
    .qr-modal .scan-history .scan-history-item-data {
        font-size: 12px !important;
    }
    
    .result-btn.modern {
        padding: 12px 16px;
        font-size: 13px;
    }

    .toast-notification {
        width: calc(100% - 16px);
        bottom: 90px;
        font-size: 14px;
    }

    .scan-notification {
        width: calc(100% - 16px);
        font-size: 14px;
    }
}

/* ==================== QR МОДАЛКА (светлая тема) ==================== */
[data-theme="light"] .qr-modal.modern {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .qr-header.modern {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .qr-header.modern .header-title h3 {
    color: #1e293b;
}

[data-theme="light"] .qr-header.modern .header-subtitle {
    color: #64748b;
}

[data-theme="light"] .close-btn.modern {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #64748b;
}

[data-theme="light"] .close-btn.modern:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

[data-theme="light"] .scan-instruction.modern {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

[data-theme="light"] .loader-text {
    color: #1e293b;
}

/* ==================== TOAST (светлая тема) ==================== */
[data-theme="light"] .toast-notification {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ==================== КНОПКА «ЗАЧЕМ?» В ХЕДЕРЕ ==================== */
.qr-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 6px 13px;
    color: #a0aab8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.qr-help-btn:hover, .qr-help-btn:active {
    background: rgba(232, 169, 32, 0.1);
    border-color: rgba(232, 169, 32, 0.35);
    color: #e8a920;
}

/* ==================== ИНФО-ПАНЕЛЬ (заместо истории) ==================== */
.qr-info-panel {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.065);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qr-info-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(232, 169, 32, 0.12);
    border: 1px solid rgba(232, 169, 32, 0.25);
    color: #e8a920;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 600;
    width: fit-content;
}

.qr-info-role-chip.owner {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #10b981;
}

.qr-info-role-chip.client {
    background: rgba(129, 140, 248, 0.12);
    border-color: rgba(129, 140, 248, 0.25);
    color: #818cf8;
}

.qr-info-desc {
    font-size: 13px;
    color: #8b92a0;
    line-height: 1.55;
    margin: 0;
}

.qr-info-desc strong {
    color: #c8d0e0;
}

.qr-info-why-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;
    padding: 10px 13px;
    color: #a0aab8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.qr-info-why-btn:hover, .qr-info-why-btn:active {
    background: rgba(232, 169, 32, 0.07);
    border-color: rgba(232, 169, 32, 0.25);
    color: #e8a920;
}

/* ==================== HELP OVERLAY + MODAL ==================== */
.qr-help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10010;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.qr-help-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.qr-help-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10011;
    background: linear-gradient(180deg, #1c2540 0%, #0f172a 100%);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 88dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.qr-help-modal.active {
    transform: translateY(0);
}

/* Drag handle */
.qr-help-modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
}

.qr-help-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.qr-help-topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.qr-help-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8b92a0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.qr-help-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.qr-help-slides-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.qr-help-slides {
    height: 100%;
}

.qr-help-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 28px 8px;
    text-align: center;
    gap: 18px;
    height: 100%;
    box-sizing: border-box;
}

.qr-help-slide.active {
    display: flex;
}

.qrhs-icon {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(232, 169, 32, 0.07);
    border: 1px solid rgba(232, 169, 32, 0.18);
    flex-shrink: 0;
}

.qrhs-icon.owner {
    background: rgba(16, 185, 129, 0.07);
    border-color: rgba(16, 185, 129, 0.18);
}

.qrhs-icon.client {
    background: rgba(129, 140, 248, 0.07);
    border-color: rgba(129, 140, 248, 0.18);
}

.qrhs-title {
    font-size: 19px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
    line-height: 1.28;
    letter-spacing: -0.02em;
}

.qrhs-text {
    font-size: 14px;
    color: #7a8494;
    line-height: 1.65;
    margin: 0;
    max-width: 340px;
}

.qrhs-text strong {
    color: #c0cad8;
    font-weight: 600;
}

.qrhs-text em {
    font-style: normal;
    font-family: 'Courier New', monospace;
    font-size: 11.5px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 6px;
    border-radius: 4px;
}

.qr-help-footer {
    padding: 14px 20px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qr-help-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.qrh-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: all 0.25s;
    display: block;
}

.qrh-dot.active {
    width: 22px;
    background: #e8a920;
}

.qr-help-nav-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

.qrh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.qrh-btn.prev {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #8b92a0;
    padding: 10px 12px;
    border-radius: 10px;
}

.qrh-btn.prev:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.qrh-btn.next {
    background: #e8a920;
    color: #1a1206;
    box-shadow: 0 4px 16px rgba(232, 169, 32, 0.3);
}

.qrh-btn.next:hover {
    background: #f0b830;
}

/* ==================== LIGHT THEME — INFO PANEL & HELP ==================== */
[data-theme="light"] .qr-info-panel {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .qr-info-desc {
    color: #64748b;
}

[data-theme="light"] .qr-info-desc strong {
    color: #1e293b;
}

[data-theme="light"] .qr-info-why-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.09);
    color: #64748b;
}

[data-theme="light"] .qr-info-why-btn:hover {
    background: rgba(232, 169, 32, 0.06);
    border-color: rgba(232, 169, 32, 0.25);
    color: #b7851a;
}

[data-theme="light"] .qr-help-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #64748b;
}

[data-theme="light"] .qr-help-btn:hover {
    background: rgba(232, 169, 32, 0.08);
    border-color: rgba(232, 169, 32, 0.3);
    color: #b7851a;
}

[data-theme="light"] .qr-help-modal {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .qr-help-modal::before {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .qr-help-topbar {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .qr-help-topbar-title {
    color: #0f172a;
}

[data-theme="light"] .qr-help-close {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #64748b;
}

[data-theme="light"] .qrhs-title {
    color: #0f172a;
}

[data-theme="light"] .qrhs-text {
    color: #5a6573;
}

[data-theme="light"] .qrhs-text strong {
    color: #1e293b;
}

[data-theme="light"] .qrhs-text em {
    background: rgba(0, 0, 0, 0.06);
    color: #475569;
}

[data-theme="light"] .qr-help-footer {
    border-top-color: rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .qrh-dot {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .qrh-btn.prev {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #64748b;
}

[data-theme="light"] .qrh-btn.prev:hover {
    background: rgba(0, 0, 0, 0.09);
    color: #1e293b;
}

/* ==================== АДАПТАЦИЯ HELP ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ ==================== */
@media (max-width: 450px) {
    .qrhs-title {
        font-size: 17px;
    }

    .qrhs-text {
        font-size: 13px;
    }

    .qr-help-slide {
        padding: 20px 20px 4px;
        gap: 14px;
    }

    .qrhs-icon {
        width: 70px;
        height: 70px;
        border-radius: 18px;
    }

    .qrh-btn {
        padding: 9px 15px;
        font-size: 13px;
    }
}


/* ==================== ТЯ Т — QR  ==================== */
[data-theme="dark"] .qr-modal.modern {
    background: linear-gradient(180deg, #1a2235 0%, #111827 100%);
    box-shadow:
        0 -10px 40px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .qr-header.modern {
    border-bottom-color: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .qr-header.modern .header-title h3 {
    color: #e8edf5;
}

[data-theme="dark"] .qr-header.modern .header-subtitle {
    color: #8892a4;
}

[data-theme="dark"] .close-btn.modern {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #8892a4;
}

[data-theme="dark"] .close-btn.modern:hover {
    background: rgba(255, 255, 255, 0.11);
    color: #e8edf5;
}

[data-theme="dark"] .scan-instruction.modern {
    background: rgba(22, 28, 45, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e8edf5;
}

[data-theme="dark"] .loader-text {
    color: #e8edf5;
}

[data-theme="dark"] .scan-result.modern {
    background: linear-gradient(180deg, #1e2a3e 0%, #18222f 100%);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .result-content.modern .result-title {
    color: #e8edf5;
}

[data-theme="dark"] .result-data.modern {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: #8892a4;
}

[data-theme="dark"] .result-content-body {
    color: #c8d4e0;
}

[data-theme="dark"] .result-content-body h3 {
    color: #e8edf5;
}

[data-theme="dark"] .result-content-body p {
    color: #8892a4;
}

[data-theme="dark"] .result-content-body strong {
    color: #e8edf5;
}

[data-theme="dark"] .result-btn.modern.secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #c8d4e0;
}

[data-theme="dark"] .result-btn.modern.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e8edf5;
}

[data-theme="dark"] .qr-purpose.modern {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .qr-purpose.modern h4 {
    color: #e8edf5;
}

[data-theme="dark"] .qr-purpose.modern p {
    color: #8892a4;
}