body.login-page, body.hold-transition.login-page {
    background: linear-gradient(135deg, #2c3e50 0%, #4ca1af 100%);
}
.login-box { width: 420px; }
.login-logo i { font-size: 2.2rem; vertical-align: middle; margin-right: 8px; }
.small-box .icon { top: -10px; }
.qr-box { background:#fff; padding:15px; display:inline-block; border:1px solid #dee2e6; border-radius:6px; }
.table-nowrap td, .table-nowrap th { white-space: nowrap; }
#reader { width: 100%; max-width: 420px; margin: 0 auto; }
.scan-result-card { border-left: 5px solid #17a2b8; }
.scan-result-card:focus { outline: none; box-shadow: 0 0 0 3px rgba(23,162,184,.35); }
@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; }
}

/* Dark mode polish (AdminLTE3 ships partial dark-mode support; fill gaps) */
body.dark-mode { background-color: #1a1d21; }
body.dark-mode .content-wrapper { background-color: #1a1d21; color: #d8d8d8; }
body.dark-mode .card { background-color: #22262b; color: #d8d8d8; }
body.dark-mode .card-header { background-color: #262b31; border-color: #33383e; }
body.dark-mode .table { color: #d8d8d8; }
body.dark-mode .table td, body.dark-mode .table th { border-color: #33383e; }
body.dark-mode .table-hover tbody tr:hover { background-color: #2b3036; }
body.dark-mode .form-control { background-color: #2b3036; border-color: #3a4149; color: #e5e5e5; }
body.dark-mode .form-control:focus { background-color: #2b3036; color: #fff; }
body.dark-mode .modal-content { background-color: #22262b; color: #d8d8d8; }
body.dark-mode .modal-header, body.dark-mode .modal-footer { border-color: #33383e; }
body.dark-mode .close { color: #d8d8d8; }
body.dark-mode .main-footer { background-color: #22262b; color: #d8d8d8; border-color: #33383e; }
body.dark-mode .dataTables_wrapper .dataTables_info,
body.dark-mode .dataTables_wrapper .dataTables_length,
body.dark-mode .dataTables_wrapper .dataTables_filter { color: #d8d8d8; }
body.dark-mode .page-link { background-color: #2b3036; border-color: #3a4149; color: #d8d8d8; }
body.dark-mode .info-box { background-color: #22262b; color: #d8d8d8; }
.incident-thumb { max-width: 100px; max-height: 100px; border-radius: 4px; cursor: pointer; }

/* Notice board rich-text content (from Quill editor) */
.notice-content p { margin-bottom: 0.75rem; }
.notice-content ul, .notice-content ol { margin-bottom: 0.75rem; padding-left: 1.5rem; }
.notice-content img { max-width: 100%; border-radius: 4px; }
.notice-content blockquote { border-left: 3px solid #ccc; padding-left: 12px; color: #666; margin: 0 0 0.75rem; }

/* Brand text: prevent overlap with logo/icon if it can't shrink enough to fit */
.main-sidebar .brand-link .brand-text {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* Global AJAX preloader overlay */
#globalAjaxLoader {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.65);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
#globalAjaxLoader .ajax-loader-box {
    background: #fff;
    border-radius: 8px;
    padding: 20px 26px;
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
#globalAjaxLoader .ajax-loader-box i {
    font-size: 2rem;
    color: #007bff;
}
body.dark-mode #globalAjaxLoader {
    background: rgba(20, 22, 25, 0.65);
}
body.dark-mode #globalAjaxLoader .ajax-loader-box {
    background: #22262b;
    box-shadow: 0 2px 12px rgba(0,0,0,.5);
}

/* ID card scanner: live camera preview with a card-shaped positioning guide */
.id-camera-viewport {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 4 / 3;
    margin: 0 auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
.id-camera-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.id-card-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 82%;
    max-width: 100%;
    aspect-ratio: 1.586 / 1;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    pointer-events: none;
}
.id-card-frame .corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: #28a745;
    border-style: solid;
}
.id-card-frame .corner.tl { top: -2px; left: -2px; border-width: 3px 0 0 3px; border-top-left-radius: 10px; }
.id-card-frame .corner.tr { top: -2px; right: -2px; border-width: 3px 3px 0 0; border-top-right-radius: 10px; }
.id-card-frame .corner.bl { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; border-bottom-left-radius: 10px; }
.id-card-frame .corner.br { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; border-bottom-right-radius: 10px; }
.id-camera-hint {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    margin: 0;
    pointer-events: none;
}
.id-camera-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
@media (max-width: 420px) {
    .id-camera-actions .btn { flex: 1 1 auto; }
}
