/* Base Page & Topography Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #EBF2FA;
    color: #333;
    overflow-x: hidden;
}

/* Sidebar Dashboard App Framework */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Side Navigation Bar in Deep Navy Blue (#051B3E) */
.sidebar {
    width: 250px;
    background-color: #051B3E;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.brand {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    font-size: 2rem;
}

.brand-text h2 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-text p {
    font-size: 0.7rem;
    opacity: 0.5;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    color: #ffffff;
    background-color: #0B3C5D;
}

.nav-item.active {
    border-left: 4px solid #F5A623;
    padding-left: 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    background-color: rgba(0, 0, 0, 0.15);
}

.sidebar-footer .badge-text .title {
    font-weight: 700;
    color: #ffffff;
}

.sidebar-footer .badge-text .subtitle {
    opacity: 0.5;
    font-size: 0.7rem;
}

/* Right Side Content Container Layout */
.content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-header {
    background-color: #051B3E;
    color: #ffffff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.header-title p {
    font-size: 0.8rem;
    opacity: 0.7;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    font-size: 1.6rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 700;
    font-size: 0.85rem;
}

.user-role {
    font-size: 0.7rem;
    opacity: 0.5;
}

.logout-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.dashboard-container {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex-grow: 1;
}

/* Custom Cards & Sections styles */
.dashboard-card {
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #D0DCE5;
}

.dashboard-card .card-header {
    background-color: #F8FAF5;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-card .card-header h3 {
    font-size: 0.85rem;
    font-weight: 800;
    color: #051B3E;
    text-transform: uppercase;
}

.dashboard-card .card-body {
    padding: 20px;
}

.card-header.border-bottom {
    border-bottom: 1px solid #D5E1E9;
}

.inline-card {
    margin-bottom: 0;
}

.row-bar {
    display: flex;
    gap: 24px;
}

/* Custom In-Line selector and radio button alignment */
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #051B3E;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #051B3E;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background-color: #0B3C5D;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Manual Logging form workspace card */
.grid-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-row {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #555;
    text-transform: uppercase;
}

input {
    padding: 10px 14px;
    border: 1px solid #D0DCE5;
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
}

input:focus {
    border-color: #051B3E;
    box-shadow: 0 0 0 3px rgba(5, 27, 62, 0.1);
}

.signature-block {
    margin-top: 20px;
}

.signature-block .label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 8px;
}

canvas {
    border: 2px dashed #051B3E;
    border-radius: 4px;
    background: #FAFAFA;
}

.sig-buttons {
    margin-top: 6px;
}

.secondary-btn {
    background-color: #6C7A89;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: bold;
}

.secondary-btn:hover {
    background-color: #5a6673;
}

.file-attach-block {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-attach-block label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #555;
    text-transform: uppercase;
}

.primary-btn {
    margin-top: 20px;
    background-color: #051B3E;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
}

.primary-btn:hover {
    background-color: #0B3C5D;
}

/* Split multi-panel hardware view scan desk panel */
.card-header.justify-between {
    justify-content: space-between;
}

.hardware-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    background: #EAEEF3;
    color: #4B6584;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.hardware-status.active {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    background-color: #778CA3;
    border-radius: 50%;
}

.hardware-status.active .indicator-dot {
    background-color: #2E7D32;
}

.split-workspace {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

.preview-panel {
    background: #F4F7F9;
    border: 1px solid #D0DCE5;
    border-radius: 4px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.preview-header {
    font-size: 0.68rem;
    font-weight: 850;
    color: #778CA3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.scanner-image-area {
    flex-grow: 1;
    background: #ffffff;
    border: 1px solid #D0DCE5;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hardware-mock {
    font-size: 3rem;
}

.scanner-model {
    font-size: 0.75rem;
    font-weight: 700;
    color: #4B6584;
    margin: 8px 0;
}

.document-thumb-card {
    background: #ffffff;
    border: 1px solid #C4D3DE;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    padding: 8px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.thumb-paper {
    font-size: 1.5rem;
}

.thumb-title {
    font-size: 0.6rem;
    font-weight: 800;
    text-align: left;
}

.thumb-title span {
    font-weight: 500;
    color: #778CA3;
}

.crop-overlay {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    border: 2px solid #006837;
    background-color: rgba(0, 104, 55, 0.08);
    color: #006837;
    font-weight: bold;
    font-size: 0.65rem;
    padding: 4px;
    border-radius: 3px;
    text-align: center;
}

.action-btn-large {
    margin-top: 15px;
    width: 100%;
    background-color: #051B3E;
    color: #ffffff;
    border: none;
    padding: 10px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.ocr-panel {
    background: #ffffff;
    border: 1px solid #D0DCE5;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.ocr-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 15px;
}

.form-row label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #051B3E;
    text-align: right;
}

.input-with-badge {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-badge input {
    flex-grow: 1;
    padding: 8px 10px;
    border: 1px solid #D0DCE5;
    background-color: #fcfcfc;
    font-size: 0.85rem;
    color: #111;
    font-weight: 600;
    border-radius: 4px;
}

.conf-badge {
    position: absolute;
    right: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #2E7D32;
}

.ocr-signature {
    margin-top: 5px;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 15px;
}

.ocr-signature label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #051B3E;
    text-align: right;
    align-self: center;
}

.sig-display-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sig-canvas-placeholder {
    border: 1px solid #D0DCE5;
    border-radius: 4px;
    background-color: #fafafa;
    height: 60px;
    width: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #888;
}

.sig-canvas-placeholder img {
    max-height: 45px;
}

.sig-valid-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2E7D32;
    background: #E8F5E9;
    padding: 4px 8px;
    border-radius: 4px;
}

.ocr-action-row {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #EAEEF3;
    padding-top: 15px;
}

.btn-green {
    background-color: #2E7D32;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.btn-blue {
    background-color: #0275D8;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.btn-outline {
    background-color: transparent;
    color: #4B6584;
    border: 1px solid #4B6584;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

/* Bulk Queue items list Section */
.badge-count {
    font-size: 0.75rem;
    color: #0275D8;
    font-weight: 600;
    margin-left: 5px;
    text-transform: none;
}

.compact-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
}

.queue-item {
    font-size: 0.85rem;
    color: #4B6584;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.queue-item .badge {
    background: #E8F5E9;
    color: #2E7D32;
    font-size: 0.75rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.queue-item .file {
    font-weight: 700;
    color: #051B3E;
}

.status-active {
    color: #2E7D32;
    font-weight: 700;
}

.margin-top {
    margin-top: 24px;
}

/* In-line aligned Filter & Report bar toolbar */
.toolbar {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #D5E1E9;
}

.search-wrap {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.95rem;
}

#searchInput {
    width: 100% !important;
    height: 42px !important;
    padding-left: 36px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
}

.print-btn {
    height: 42px !important;
    padding: 0 20px !important;
    background-color: #28A745 !important;
    color: #ffffff !important;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

.print-btn:hover {
    background-color: #218838 !important;
}

/* Base list tables */
table {
    width: 100% !important;
    border-collapse: collapse;
    display: table !important;
}

th {
    background-color: #051B3E;
    color: #ffffff;
    padding: 12px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.85rem;
    vertical-align: middle;
}

tr:hover {
    background-color: #f8fafc;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2E7D32;
    background: #E8F5E9;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.75rem;
}

.action-cells {
    display: flex;
    gap: 5px;
}

.edit-btn {
    background-color: #0275D8;
    color: #ffffff;
    border: none;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
}

.delete-btn {
    background-color: #DC3545;
    color: #ffffff;
    border: none;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
}

/* Log Audit Tray Panel Section */
.audit-card {
    margin-top: 24px;
}

.clear-audit-btn {
    background-color: #DC3545;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
}

#auditTable th {
    background-color: #495057;
}

#auditTable {
    background-color: #FAFBFD;
}

/* User authentication module modals overlay */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #EBF2FA;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-box {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    width: 350px;
    border-top: 5px solid #051B3E;
}

.logo-preview {
    font-size: 3rem;
    margin-bottom: 10px;
}

.login-box h2 {
    color: #051B3E;
}

.login-box .subtitle {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 2px;
}

.login-box .company {
    font-size: 0.9rem;
    font-weight: bold;
    color: #0B3C5D;
}

.login-box input {
    margin: 10px 0;
    padding: 12px;
    width: 100%;
}

#loginBtn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
}

.auth-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 10px;
}

/* Custom In-App Action Confirmation Dialog overlays */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    width: 340px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.modal-title {
    color: #dc3545;
    margin-top: 0;
    font-size: 1.15rem;
}

.modal-message {
    font-size: 0.9em;
    color: #444;
    margin: 15px 0;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-cancel {
    background-color: #6C7A89;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-proceed {
    background-color: #dc3545;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* Media styling adjustments */
@media print {
    /* completely slice off unneeded layout parts on PDF prints */
    #loginOverlay,
    #confirmModal,
    .sidebar,
    .top-header button,
    .mode-bar,
    .input-section,
    .scanner-workbench,
    .toolbar,
    .action-cells,
    .audit-section,
    #userSessionDisplay {
        display: none !important;
        visibility: hidden !important;
    }

    body {
        background-color: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        color: #000000 !important;
    }

    .app-layout {
        display: block !important;
    }

    .content-area {
        margin: 0 !important;
        padding: 0 !important;
    }

    .container,
    .dashboard-container,
    .dashboard-card {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .top-header {
        border-bottom: 2px solid #000000 !important;
        margin-bottom: 20px !important;
        padding-bottom: 5px !important;
        background: transparent !important;
        color: #000000 !important;
    }

    .top-header h1 {
        font-size: 1.5rem !important;
    }

    #logTable {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 15px !important;
    }

    #logTable th {
        background-color: #051B3E !important;
        color: #ffffff !important;
        border: 1px solid #222 !important;
        padding: 8px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #logTable td {
        border: 1px solid #444 !important;
        color: #000000 !important;
        padding: 8px !important;
    }

    #logTable img {
        max-height: 40px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body::after {
        content: "CONFIDENTIAL";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
        font-size: 80pt;
        color: rgba(5, 27, 62, 0.1);
        font-weight: bold;
        z-index: -1;
        pointer-events: none;
        white-space: nowrap;
        border: 12px solid rgba(5, 27, 62, 0.1);
        padding: 20px;
        border-radius: 20px;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}