/* ============================================================
   LIBRARY BOOK SCAN — ЕДИНЫЙ ГИБРИДНЫЙ CSS
   @version 23.0
   ============================================================ */

/* ============================================================
   ОБЩАЯ ОБЁРТКА
   ============================================================ */

#library-book-scan-module {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1f2937;
}

#library-book-scan-module .badge {
    font-weight: 500;
    font-size: .78rem;
    padding: .35rem .7rem;
    border-radius: 50px;
}
#library-book-scan-module .badge i { margin-right: 4px; }

/* ============================================================
   КАРТОЧКИ
   ============================================================ */

#library-book-scan-module .card {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    background: #ffffff;
    overflow: hidden;
}
#library-book-scan-module .card-header {
    padding: 12px 20px;
    font-weight: 600;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: .95rem;
}
#library-book-scan-module .card-body { padding: 20px 24px; }
#library-book-scan-module .card-body.py-2 { padding: .55rem .9rem; }
#library-book-scan-module .card .h4 { font-weight: 700; line-height: 1.2; margin: 0; }
#library-book-scan-module .card .small { font-size: .78rem; }

/* ============================================================
   ИНФОРМАЦИЯ О КНИГЕ
   ============================================================ */

#library-book-scan-module #bookInfoContainer .bg-light {
    background: #f9fafb !important;
    border-radius: 10px;
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#library-book-scan-module #bookInfoContainer .bg-light .h6 {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 6px;
}
#library-book-scan-module #bookInfoContainer .bg-light .h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 4px 0;
}
#library-book-scan-module #bookInfoContainer .bg-light .h2.text-success { color: #22c55e !important; }
#library-book-scan-module #bookInfoContainer .bg-light .h2.text-danger  { color: #ef4444 !important; }

/* ============================================================
   ПЛАШКИ
   ============================================================ */

#library-book-scan-module .alert-warning {
    background: #fffbeb !important;
    border-color: #fcd34d !important;
    color: #92400e !important;
}
#library-book-scan-module .alert-info {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1e40af !important;
}
#library-book-scan-module .alert-danger {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

/* ============================================================
   ФОРМА
   ============================================================ */

#library-book-scan-module .form-label {
    font-size: .92rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}
#library-book-scan-module .form-control,
#library-book-scan-module .form-select {
    border-radius: 8px;
    border: 1.5px solid #d1d5db;
    font-size: 0.95rem;
    padding: 0.55rem 0.85rem;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}
#library-book-scan-module .form-control-sm,
#library-book-scan-module .form-select-sm {
    font-size: .85rem;
    padding: .35rem .6rem;
}
#library-book-scan-module .form-control:focus,
#library-book-scan-module .form-select:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .1);
    outline: none;
}
#library-book-scan-module .form-check-input:checked {
    background-color: #dc3545;
    border-color: #dc3545;
}
#library-book-scan-module .form-text { font-size: .82rem; color: #6b7280; }

/* ============================================================
   БЛОК СИГЛЫ + РАСШИФРОВКА
   ============================================================ */

#library-book-scan-module #siglaInfoBox .alert {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #334155;
}
#library-book-scan-module #siglaInfoBox .alert strong { color: #0f172a; }
#library-book-scan-module #siglaInfoPhoneLink {
    color: #0f766e;
    font-weight: 700;
    font-size: 1.05rem;
}
#library-book-scan-module #siglaInfoPhoneLink:hover {
    color: #115e59;
    text-decoration: underline !important;
}
#library-book-scan-module #siglaInfoType {
    font-weight: 600;
    font-size: .72rem;
    padding: .25rem .55rem;
    letter-spacing: .3px;
}
#library-book-scan-module #siglaInfoDecode {
    color: #475569;
    font-style: italic;
    line-height: 1.35;
}

/* ============================================================
   КНОПКИ
   ============================================================ */

#library-book-scan-module .btn {
    border-radius: 8px;
    padding: 0.55rem 1.4rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}
#library-book-scan-module .btn-sm {
    padding: .3rem .7rem;
    font-size: .82rem;
    border-radius: 6px;
}
#library-book-scan-module .btn-danger {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}
#library-book-scan-module .btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220,53,69,.3);
}
#library-book-scan-module .btn-danger:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
#library-book-scan-module .btn-outline-primary {
    color: #7c3aed;
    border-color: #7c3aed;
}
#library-book-scan-module .btn-outline-primary:hover {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, .25);
}
#library-book-scan-module .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, .25);
}
#library-book-scan-module .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(34, 197, 94, .25);
}
#library-book-scan-module .btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(245, 158, 11, .25);
}
#library-book-scan-module .btn-outline-success:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}
#library-book-scan-module .btn-outline-warning:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}
#library-book-scan-module .btn-outline-danger:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}
#library-book-scan-module .btn-outline-secondary:hover {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
}
#library-book-scan-module .btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================================
   БЛОК УСПЕХА
   ============================================================ */

#library-book-scan-module #requestSuccessBox {
    border: 2px solid #22c55e !important;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.15);
}
#library-book-scan-module #requestSuccessBox .card-header {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    border-radius: 10px 10px 0 0;
}
#library-book-scan-module #successRequestNumber {
    background: #dcfce7;
    color: #14532d;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 1.15em;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-block;
    border: 1px solid #86efac;
}
#library-book-scan-module #emailRegisteredRequest {
    border-color: #7c3aed;
    color: #7c3aed;
}
#library-book-scan-module #emailRegisteredRequest:hover {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, .3);
}

/* ============================================================
   ТАБЛИЦЫ
   ============================================================ */

#library-book-scan-module .table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    max-height: 68vh;
    overflow-y: auto;
}
#library-book-scan-module .table {
    margin-bottom: 0;
    font-size: .88rem;
}
#library-book-scan-module .table thead th {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    color: #374151;
    font-weight: 600;
    font-size: .76rem;
    padding: .55rem .7rem;
    position: sticky;
    top: 0;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}
#library-book-scan-module .table tbody td {
    padding: .6rem .7rem;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
}
#library-book-scan-module .table tbody tr:hover { background: #f9fafb; }
#library-book-scan-module .table .badge {
    font-size: .72rem;
    padding: .28rem .6rem;
    border-radius: 50px;
    font-weight: 500;
    vertical-align: middle;
}
#library-book-scan-module .table tbody tr.opacity-75 { opacity: .7; }
#library-book-scan-module .table tbody tr.opacity-75 td { color: #9ca3af; }
#library-book-scan-module .table code {
    background: #eef2ff;
    color: #3730a3;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .82em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
#library-book-scan-module .table td.text-nowrap { white-space: nowrap; }
#library-book-scan-module .badge.bg-danger {
    background: #ef4444 !important;
    color: #fff;
    padding: .35rem .7rem;
    font-weight: 500;
    font-size: .75rem;
    border-radius: 50px;
}

/* ============================================================
   ПЕРЕКЛЮЧАТЕЛЬ РЕЖИМОВ (Заявитель / Оператор)
   ============================================================ */

#library-book-scan-module .scan-mode-panel {
    animation: scanFadeIn .2s ease;
}

@keyframes scanFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

#library-book-scan-module .scan-mode-tabs {
    border-bottom: 2px solid #e5e7eb;
    gap: 4px;
}

#library-book-scan-module .scan-mode-tabs .nav-item {
    margin-bottom: -2px;
}

#library-book-scan-module .scan-mode-tabs .nav-link {
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    font-size: .95rem;
    padding: .7rem 1.5rem;
    border-bottom: 3px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px 8px 0 0;
    transition: all .15s;
    cursor: pointer;
}

#library-book-scan-module .scan-mode-tabs .nav-link i {
    font-size: 1.05rem;
}

#library-book-scan-module .scan-mode-tabs .nav-link:hover {
    color: #1f2937;
    background: #f9fafb;
}

#library-book-scan-module .scan-mode-tabs .nav-link.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
    background: transparent;
    font-weight: 600;
}

/* ============================================================
   ВКЛАДКИ РОЛЕЙ (главные)
   ============================================================ */

#library-book-scan-module .role-tabs {
    border-bottom: 3px solid #4f46e5;
    gap: 6px;
    margin-bottom: 0;
}

#library-book-scan-module .role-tabs .nav-link {
    border: none;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
    font-size: .95rem;
    padding: .7rem 1.4rem;
    border-radius: 10px 10px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all .15s;
    margin-bottom: -3px;
    cursor: pointer;
}

#library-book-scan-module .role-tabs .nav-link:hover {
    background: #e0e7ff;
    color: #3730a3;
}

#library-book-scan-module .role-tabs .nav-link.active {
    background: #4f46e5;
    color: #fff;
    border-bottom: 3px solid #4f46e5;
    box-shadow: 0 -2px 6px rgba(79,70,229,.2);
}

/* Под-вкладки статусов */
#library-book-scan-module .op-status-tabs {
    border-bottom: 1px solid #e5e7eb;
    gap: 4px;
    padding-bottom: 0;
}

#library-book-scan-module .op-status-tabs .nav-link {
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    font-size: .9rem;
    padding: .5rem 1rem;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s;
    border-radius: 0;
    cursor: pointer;
}

#library-book-scan-module .op-status-tabs .nav-link:hover {
    color: #1f2937;
    background: #f9fafb;
}

#library-book-scan-module .op-status-tabs .nav-link.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
    font-weight: 600;
    background: transparent;
}

#library-book-scan-module .op-status-tabs .badge {
    font-size: .7rem;
    padding: .18rem .5rem;
    border-radius: 50px;
}

/* ============================================================
   ВКЛАДКИ (общие)
   ============================================================ */

#library-book-scan-module .nav-tabs {
    border-bottom: 2px solid #e5e7eb;
    gap: 4px;
}
#library-book-scan-module .nav-tabs .nav-link {
    border: none;
    color: #6b7280;
    font-weight: 500;
    font-size: .92rem;
    padding: .6rem 1.1rem;
    border-bottom: 3px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px 8px 0 0;
    transition: all .15s;
    cursor: pointer;
}
#library-book-scan-module .nav-tabs .nav-link i { font-size: 1rem; }
#library-book-scan-module .nav-tabs .nav-link:hover {
    color: #1f2937;
    background: #f9fafb;
}
#library-book-scan-module .nav-tabs .nav-link.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
    background: transparent;
    font-weight: 600;
}
#library-book-scan-module .nav-tabs .nav-link .badge {
    font-size: .68rem;
    padding: .18rem .5rem;
    border-radius: 50px;
}

/* ============================================================
   TIMELINE (РЕГЛАМЕНТ)
   ============================================================ */

.scan-timeline { position: relative; padding-left: 8px; }
.scan-timeline-item { position: relative; display: flex; gap: 16px; padding-bottom: 20px; }
.scan-timeline-item:last-child { padding-bottom: 0; }
.scan-timeline-item::before {
    content: '';
    position: absolute;
    left: 21px; top: 44px; bottom: -4px;
    width: 2px;
    background: #e5e7eb;
}
.scan-timeline-item:last-child::before { display: none; }

.scan-timeline-marker {
    width: 44px; height: 44px; min-width: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    z-index: 2;
    background: #6b7280;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.scan-timeline-secondary .scan-timeline-marker { background: #6b7280; }
.scan-timeline-info     .scan-timeline-marker { background: #0ea5e9; }
.scan-timeline-primary  .scan-timeline-marker { background: #4f46e5; }
.scan-timeline-warning  .scan-timeline-marker { background: #f59e0b; }
.scan-timeline-success  .scan-timeline-marker { background: #22c55e; }
.scan-timeline-danger   .scan-timeline-marker { background: #ef4444; }

.scan-timeline-body {
    flex: 1;
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
}
.scan-timeline-step {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 2px;
}
.scan-timeline-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 6px;
}
.scan-timeline-text {
    font-size: .9rem;
    color: #4b5563;
    margin: 0 0 8px;
    line-height: 1.45;
}
.scan-timeline-who {
    font-size: .82rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}
.scan-timeline-who i { color: #4f46e5; }

/* ============================================================
   МОДАЛКИ
   ============================================================ */

#library-book-scan-module .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
#library-book-scan-module .modal-header {
    padding: 14px 20px;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #e5e7eb;
}
#library-book-scan-module .modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
#library-book-scan-module .modal-body { padding: 20px 22px; }
#library-book-scan-module .modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
}
#library-book-scan-module .modal-header.bg-danger  { border-bottom: none; }
#library-book-scan-module .modal-header.bg-warning { border-bottom: none; }

/* Модалка регламента */
#regulationsModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
#regulationsModal .modal-header {
    border-bottom: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
}
#regulationsModal .modal-body { padding: 24px 28px; }

/* Модалка печати */
#printModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    max-height: 90vh;
}
#printModal .modal-body {
    background: #f1f5f9;
    padding: 24px;
    overflow-y: auto;
    max-height: 70vh;
}
#printModal .modal-body .printable-request {
    display: block;
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    font-family: 'Times New Roman', Times, serif;
    color: #000;
    line-height: 1.4;
}
#printModal .modal-body .printable-request .printable-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #000;
    padding-bottom: 12px;
}
#printModal .modal-body .printable-request .printable-university { font-size: 11pt; font-weight: 700; }
#printModal .modal-body .printable-request .printable-library    { font-size: 10pt; margin-bottom: 8px; }
#printModal .modal-body .printable-request .printable-title {
    font-size: 14pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 8px 0;
}
#printModal .modal-body .printable-request .printable-date   { font-size: 10pt; text-align: right; }
#printModal .modal-body .printable-request .printable-status { font-size: 10pt; text-align: right; margin-top: 4px; font-style: italic; }

#printModal .modal-body .printable-request .printable-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 11pt;
}
#printModal .modal-body .printable-request .printable-table td {
    border: 1px solid #000;
    padding: 6px 10px;
    vertical-align: top;
}
#printModal .modal-body .printable-request .printable-table td.lbl {
    width: 35%;
    background: #f0f0f0;
    font-weight: 700;
}
#printModal .modal-body .printable-request .printable-note {
    border: 1px dashed #000;
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 10pt;
    background: #fffbea;
}
#printModal .modal-body .printable-request .printable-signatures {
    margin-top: 30px;
    font-size: 11pt;
}
#printModal .modal-body .printable-request .printable-signatures div { margin-bottom: 14px; }

/* ============================================================
   PDF DROP ZONE
   ============================================================ */

#library-book-scan-module .op-pdf-drop {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 26px 18px;
    text-align: center;
    color: #64748b;
    cursor: pointer;
    transition: all .2s;
    background: #f8fafc;
    user-select: none;
}
#library-book-scan-module .op-pdf-drop:hover,
#library-book-scan-module .op-pdf-drop.op-pdf-drop-active {
    border-color: #4f46e5;
    background: #eef2ff;
    color: #4f46e5;
}
#library-book-scan-module .op-pdf-drop.op-pdf-drop-active {
    transform: scale(1.01);
    box-shadow: 0 4px 14px rgba(79,70,229,.18);
}
#library-book-scan-module .op-pdf-drop i { transition: transform .2s; }
#library-book-scan-module .op-pdf-drop:hover i,
#library-book-scan-module .op-pdf-drop.op-pdf-drop-active i { transform: scale(1.1); }
#library-book-scan-module #opPdfName { font-size: .85rem; word-break: break-all; }
#library-book-scan-module #opPdfInfo {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
}
#library-book-scan-module #opPdfHash {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .74rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   СТАТИСТИКА (вкладка admin)
   ============================================================ */

#library-book-scan-module #opStatsContainer .border {
    border-color: #e5e7eb !important;
    border-radius: 10px;
    transition: box-shadow .15s;
}
#library-book-scan-module #opStatsContainer .border:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
#library-book-scan-module #opStatsContainer .badge { font-size: .8rem; }
#library-book-scan-module #opStatsContainer table td,
#library-book-scan-module #opStatsContainer table th {
    padding: .5rem .7rem;
    vertical-align: middle;
}

/* ============================================================
   MEGAPRO
   ============================================================ */

#library-book-scan-module .alert-info .btn-primary,
#library-book-scan-module .alert-info .btn-primary:visited {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
    text-decoration: none;
}
#library-book-scan-module .alert-info .btn-primary:hover {
    background: #4338ca;
    border-color: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
}
#library-book-scan-module .badge.bg-info {
    background: #cff4fc !important;
    color: #055160 !important;
    border: 1px solid #9eeaf9;
    font-weight: 600;
    padding: .4rem .8rem;
}
#library-book-scan-module .badge.bg-info i { margin-right: 4px; }

/* ============================================================
   УВЕДОМЛЕНИЯ
   ============================================================ */

.scan-notification { font-weight: 500; animation: scanSlideIn .3s ease; }
@keyframes scanSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes scanSlideOut {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* ============================================================
   ПЕЧАТНАЯ ФОРМА (скрыта в обычном режиме)
   ============================================================ */

#printableRequest.printable-request,
.printable-request#printableRequest {
    display: none;
}
#library-book-scan-module > #printableRequest {
    display: none;
}

/* ============================================================
   РЕАЛЬНАЯ ПЕЧАТЬ
   ============================================================ */

@media print {
    body.scan-printing > *:not(#printableRequest):not(.printable-request) {
        display: none !important;
    }

    body.scan-printing #printableRequest,
    body.scan-printing .printable-request {
        display: block !important;
        position: static !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.scan-printing { background: #ffffff !important; }

    #printableRequest,
    .printable-request {
        font-family: 'Times New Roman', Times, serif;
        font-size: 12pt;
        color: #000;
        line-height: 1.4;
    }

    #printableRequest .printable-header,
    .printable-request .printable-header {
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 12px;
    }

    #printableRequest .printable-university,
    .printable-request .printable-university { font-size: 11pt; font-weight: 700; }

    #printableRequest .printable-library,
    .printable-request .printable-library { font-size: 10pt; margin-bottom: 8px; }

    #printableRequest .printable-title,
    .printable-request .printable-title {
        font-size: 14pt;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: 8px 0;
    }

    #printableRequest .printable-date,
    .printable-request .printable-date { font-size: 10pt; text-align: right; }

    #printableRequest .printable-status,
    .printable-request .printable-status {
        font-size: 10pt;
        text-align: right;
        margin-top: 4px;
        font-style: italic;
    }

    #printableRequest .printable-table,
    .printable-request .printable-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
    }

    #printableRequest .printable-table td,
    .printable-request .printable-table td {
        border: 1px solid #000;
        padding: 6px 10px;
        vertical-align: top;
        font-size: 11pt;
    }

    #printableRequest .printable-table td.lbl,
    .printable-request .printable-table td.lbl {
        width: 35%;
        background: #f0f0f0 !important;
        font-weight: 700;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #printableRequest .printable-note,
    .printable-request .printable-note {
        border: 1px dashed #000;
        padding: 10px 14px;
        margin-bottom: 20px;
        font-size: 10pt;
        background: #fffbea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #printableRequest .printable-signatures,
    .printable-request .printable-signatures {
        margin-top: 30px;
        font-size: 11pt;
    }

    #printableRequest .printable-signatures div,
    .printable-request .printable-signatures div {
        margin-bottom: 14px;
    }
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */

@media (max-width: 992px) {
    #library-book-scan-module .table thead th,
    #library-book-scan-module .table tbody td {
        font-size: .78rem;
        padding: .45rem .5rem;
    }
    #library-book-scan-module .card-body { padding: 12px 14px; }
    #library-book-scan-module .card .h4 { font-size: 1.3rem; }
}

@media (max-width: 768px) {
    #library-book-scan-module { padding: 0 8px; }
    #library-book-scan-module h3 { font-size: 1.15rem; }

    #library-book-scan-module .scan-mode-tabs .nav-link {
        padding: .5rem .9rem;
        font-size: .85rem;
    }
    #library-book-scan-module .role-tabs .nav-link {
        padding: .5rem .8rem;
        font-size: .82rem;
    }
    #library-book-scan-module .op-status-tabs .nav-link {
        padding: .4rem .7rem;
        font-size: .8rem;
    }

    #library-book-scan-module .table thead th,
    #library-book-scan-module .table tbody td {
        font-size: .74rem;
        padding: .4rem .45rem;
    }

    #library-book-scan-module .table .btn-sm {
        padding: .25rem .5rem;
        font-size: .72rem;
    }

    #library-book-scan-module .card .h4 { font-size: 1.15rem; }
    #library-book-scan-module .modal-body { padding: 14px 16px; }
    #library-book-scan-module .modal-header,
    #library-book-scan-module .modal-footer { padding: 10px 14px; }

    #library-book-scan-module .op-pdf-drop { padding: 18px 12px; }

    .scan-timeline-marker { width: 36px; height: 36px; min-width: 36px; font-size: 1rem; }
    .scan-timeline-item::before { left: 17px; top: 36px; }
    .scan-timeline-body { padding: 10px 12px; }
    .scan-timeline-title { font-size: .92rem; }
    .scan-timeline-text { font-size: .85rem; }

    #printModal .modal-body { padding: 14px; }
    #printModal .modal-body .printable-request { padding: 14px; }
}

@media (max-width: 480px) {
    #library-book-scan-module .card-body { padding: 10px 12px; }
    #library-book-scan-module .btn-primary,
    #library-book-scan-module .btn-success,
    #library-book-scan-module .btn-danger,
    #library-book-scan-module .btn-warning { width: 100%; }

    #library-book-scan-module .scan-mode-tabs,
    #library-book-scan-module .role-tabs,
    #library-book-scan-module .op-status-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
    }
}

/* ============================================================
   ТЁМНАЯ ТЕМА
   ============================================================ */

@media (prefers-color-scheme: dark) {
    #library-book-scan-module { color: #e5e7eb; }
    #library-book-scan-module .card {
        background: #1f2937;
        border-color: #374151;
    }
    #library-book-scan-module .card-header {
        background: #2d3748;
        border-bottom-color: #374151;
        color: #e5e7eb;
    }
    #library-book-scan-module .table thead th {
        background: #2d3748;
        color: #9ca3af;
        border-bottom-color: #374151;
    }
    #library-book-scan-module .table tbody td {
        border-bottom-color: #2d3748;
        color: #d1d5db;
    }
    #library-book-scan-module .table tbody tr:hover { background: #2d3748; }
    #library-book-scan-module .table code {
        background: #312e81;
        color: #c7d2fe;
    }
    #library-book-scan-module .form-control,
    #library-book-scan-module .form-select {
        background: #2d3748;
        border-color: #4b5563;
        color: #e5e7eb;
    }
    #library-book-scan-module .form-label { color: #e5e7eb; }

    #library-book-scan-module .scan-mode-tabs { border-bottom-color: #374151; }
    #library-book-scan-module .scan-mode-tabs .nav-link { color: #9ca3af; }
    #library-book-scan-module .scan-mode-tabs .nav-link:hover { color: #e5e7eb; background: #2d3748; }
    #library-book-scan-module .scan-mode-tabs .nav-link.active {
        color: #a5b4fc;
        border-bottom-color: #6366f1;
    }

    #library-book-scan-module .role-tabs { border-bottom-color: #6366f1; }
    #library-book-scan-module .role-tabs .nav-link {
        background: #312e81;
        color: #c7d2fe;
    }
    #library-book-scan-module .role-tabs .nav-link:hover { background: #3730a3; color: #e0e7ff; }
    #library-book-scan-module .role-tabs .nav-link.active { background: #6366f1; color: #fff; }

    #library-book-scan-module .op-status-tabs { border-bottom-color: #374151; }
    #library-book-scan-module .op-status-tabs .nav-link { color: #9ca3af; }
    #library-book-scan-module .op-status-tabs .nav-link:hover { color: #e5e7eb; background: #2d3748; }
    #library-book-scan-module .op-status-tabs .nav-link.active {
        color: #a5b4fc;
        border-bottom-color: #6366f1;
    }

    #library-book-scan-module .modal-content { background: #1f2937; color: #e5e7eb; }
    #library-book-scan-module .modal-header { border-bottom-color: #374151; }
    #library-book-scan-module .modal-footer { border-top-color: #374151; }
    #library-book-scan-module .btn-close { filter: invert(1); }
    #library-book-scan-module .btn-close-white { filter: none; }

    #library-book-scan-module .op-pdf-drop {
        border-color: #4b5563;
        background: #1f2937;
        color: #9ca3af;
    }
    #library-book-scan-module .op-pdf-drop:hover,
    #library-book-scan-module .op-pdf-drop.op-pdf-drop-active {
        border-color: #818cf8;
        background: #312e81;
        color: #c7d2fe;
    }
    #library-book-scan-module #opPdfInfo {
        background: #2d3748 !important;
        border-color: #374151 !important;
        color: #cbd5e1 !important;
    }

    #library-book-scan-module #opStatsContainer .border {
        border-color: #374151 !important;
        background: #1f2937;
    }

    #library-book-scan-module #bookInfoContainer .bg-light { background: #2d3748 !important; }
    #library-book-scan-module #siglaInfoBox .alert {
        background: #2d3748;
        border-color: #374151;
        color: #cbd5e1;
    }

    .scan-timeline-body { background: #2d3748; border-color: #374151; }
    .scan-timeline-title { color: #e5e7eb; }
    .scan-timeline-text  { color: #9ca3af; }
    .scan-timeline-who   { color: #9ca3af; }

    #regulationsModal .modal-content { background: #1f2937; color: #e5e7eb; }
    #regulationsModal .modal-header  { background: #2d3748 !important; border-bottom-color: #374151; }
    #regulationsModal .btn-close     { filter: invert(1); }

    #printModal .modal-content { background: #1f2937; }
    #printModal .modal-header  { background: #2d3748 !important; border-bottom-color: #374151; color: #e5e7eb; }
    #printModal .modal-title   { color: #e5e7eb; }
    #printModal .modal-body    { background: #111827; }
    #printModal .modal-body .printable-request {
        background: #fff;
        color: #000;
    }
    #printModal .btn-close { filter: invert(1); }
}

/* ============================================================
   Согласие + примечание о цифровизации
   ============================================================ */

#library-book-scan-module .form-check-label.small {
    line-height: 1.4;
}

#library-book-scan-module .alert-info.small {
    font-size: .82rem;
    line-height: 1.4;
    border-radius: 8px;
}