/* ==========================================================================
   GATEPASS PRINT — THEME-ALIGNED STYLES (Light & Dark Compatible)
   ========================================================================== */

.gpp-page-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 2.5rem;
}

/* ── Hero Banner ─────────────────────────────────────────────────────────── */
.gpp-hero-banner {
    background: var(--dash-surface, #ffffff);
    border: 1px solid var(--dash-border, #e2e8f0);
    border-radius: var(--dash-radius, 12px);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.gpp-hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--dash-primary, #3b82f6), #6366f1);
}

.gpp-hero-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gpp-hero-avatar {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--dash-primary, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gpp-hero-avatar svg {
    width: 24px;
    height: 24px;
}

.gpp-hero-heading h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dash-text, #0f172a);
    letter-spacing: -0.01em;
}

.gpp-hero-heading p {
    margin: 0.2rem 0 0 0;
    font-size: 0.8125rem;
    color: var(--dash-text-muted, #64748b);
}

/* ── Quick Search Input in Hero ─────────────────────────────────────────── */
.gpp-quick-search-wrap {
    display: flex;
    align-items: center;
    background: var(--dash-surface-2, #f8fafc);
    border: 1px solid var(--dash-border, #e2e8f0);
    border-radius: 8px;
    padding: 3px 5px;
    width: 340px;
    max-width: 100%;
    transition: all 0.2s ease;
}

.gpp-quick-search-wrap:focus-within {
    border-color: var(--dash-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.gpp-quick-search-field {
    background: transparent;
    border: none;
    outline: none;
    color: var(--dash-text, #0f172a);
    font-size: 0.875rem;
    padding: 0.45rem 0.65rem;
    flex: 1;
}

.gpp-quick-search-field::placeholder {
    color: var(--dash-text-muted, #94a3b8);
}

.gpp-quick-btn {
    background: var(--dash-primary, #3b82f6);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.15s ease;
}

.gpp-quick-btn:hover {
    background: var(--dash-primary-hover, #2563eb);
}

/* ── Filter Card ─────────────────────────────────────────────────────────── */
.gpp-card {
    background: var(--dash-surface, #ffffff);
    border: 1px solid var(--dash-border, #e2e8f0);
    border-radius: var(--dash-radius, 12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
}

.gpp-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) 110px 100px;
    gap: 1rem;
    align-items: end;
}

@media (max-width: 1024px) {
    .gpp-filter-row {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

.gpp-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
}

.gpp-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dash-text-muted, #64748b);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.gpp-form-control {
    background: var(--dash-surface, #ffffff);
    border: 1px solid var(--dash-border, #cbd5e1);
    border-radius: 8px;
    color: var(--dash-text, #0f172a);
    font-size: 0.875rem;
    padding: 0.55rem 0.75rem;
    outline: none;
    transition: all 0.15s ease;
    width: 100%;
}

.gpp-form-control:focus {
    border-color: var(--dash-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ── Autocomplete Suggestion Dropdown ────────────────────────────────────── */
.gpp-autocomplete-container {
    position: relative;
}

.gpp-suggestions-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--dash-surface, #ffffff);
    border: 1px solid var(--dash-border, #cbd5e1);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}

.gpp-suggestions-menu.open {
    display: block;
}

.gpp-suggestion-item {
    padding: 0.6rem 0.85rem;
    font-size: 0.8125rem;
    color: var(--dash-text, #0f172a);
    cursor: pointer;
    border-bottom: 1px solid var(--dash-border, #f1f5f9);
    transition: background 0.12s ease;
}

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

.gpp-suggestion-item:hover, .gpp-suggestion-item.highlighted {
    background: var(--dash-surface-2, #f1f5f9);
    color: var(--dash-primary, #3b82f6);
}

.gpp-suggestion-empty {
    padding: 0.75rem;
    font-size: 0.8125rem;
    color: var(--dash-text-muted, #94a3b8);
    text-align: center;
}

/* ── Action Buttons ──────────────────────────────────────────────────────── */
.gpp-btn-primary {
    background: var(--dash-primary, #3b82f6);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.58rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background 0.15s ease;
    width: 100%;
}

.gpp-btn-primary:hover {
    background: var(--dash-primary-hover, #2563eb);
}

.gpp-btn-outline {
    background: transparent;
    color: var(--dash-text-muted, #64748b);
    border: 1px solid var(--dash-border, #cbd5e1);
    border-radius: 8px;
    padding: 0.58rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    width: 100%;
}

.gpp-btn-outline:hover {
    background: var(--dash-surface-2, #f8fafc);
    color: var(--dash-text, #0f172a);
}

/* ── Data Table ──────────────────────────────────────────────────────────── */
.gpp-table-container {
    overflow-x: auto;
    border-radius: 8px;
}

.gpp-grid-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.gpp-grid-table th {
    background: var(--dash-surface-2, #f8fafc);
    color: var(--dash-text-muted, #64748b);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--dash-border, #e2e8f0);
}

.gpp-grid-table td {
    padding: 0.85rem 1rem;
    color: var(--dash-text, #0f172a);
    border-bottom: 1px solid var(--dash-border, #f1f5f9);
    vertical-align: middle;
}

.gpp-grid-table tbody tr:hover td {
    background: rgba(59, 130, 246, 0.03);
}

.gpp-tag-gatepass {
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0284c7;
    background: #e0f2fe;
    padding: 3px 8px;
    border-radius: 6px;
}

.gpp-tag-delv {
    font-family: monospace;
    font-size: 0.8125rem;
    color: #7c3aed;
    background: #ede9fe;
    padding: 2px 7px;
    border-radius: 6px;
}

.gpp-tbl-btn {
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.775rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.gpp-tbl-btn.view {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.gpp-tbl-btn.view:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.gpp-tbl-btn.print {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

.gpp-tbl-btn.print:hover {
    background: #10b981;
    color: #ffffff;
}

/* ==========================================================================
   PREVIEW MODAL
   ========================================================================== */
.gpp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
}

.gpp-modal-overlay.active {
    display: flex;
}

.gpp-modal-sheet {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 880px;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: gpp-zoomIn 0.25s ease-out;
}

@keyframes gpp-zoomIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.gpp-modal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: #0f172a;
    color: #ffffff;
}

.gpp-modal-topbar h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
}

.gpp-modal-btn-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.gpp-action-print {
    background: #10b981;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s ease;
}

.gpp-action-print:hover {
    background: #059669;
}

.gpp-action-close {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
}

.gpp-action-close:hover {
    background: rgba(239, 68, 68, 0.8);
}

.gpp-modal-content-area {
    padding: 1.5rem;
    background: #475569;
    overflow-y: auto;
    display: flex;
    justify-content: center;
}

/* ==========================================================================
   AUTHENTIC A4 PRINT PAPER REPLICA
   ========================================================================== */
.gpp-document-paper {
    background: #ffffff;
    color: #000000;
    width: 100%;
    max-width: 780px;
    padding: 35px 42px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.45;
}

/* Title */
.gpp-doc-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 0 0 22px 0;
    text-transform: uppercase;
    color: #000000;
}

/* Top Meta Grid */
.gpp-doc-meta-table {
    display: grid;
    grid-template-columns: 180px 1fr;
    row-gap: 4px;
    column-gap: 12px;
    font-size: 13px;
    margin-bottom: 22px;
}

.gpp-doc-meta-table .m-label {
    font-weight: 700;
    color: #000000;
}

.gpp-doc-meta-table .m-value {
    font-weight: 500;
    color: #000000;
}

/* Security Officer Notice */
.gpp-doc-notice {
    margin-bottom: 22px;
    line-height: 1.5;
    color: #000000;
}

.gpp-doc-notice-head {
    font-weight: 700;
    margin-bottom: 4px;
}

.gpp-doc-notice-body strong {
    font-weight: 800;
}

/* 2-Column Addresses + Order Meta */
.gpp-doc-address-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1fr;
    gap: 18px;
    margin-bottom: 22px;
    font-size: 12.5px;
    line-height: 1.35;
    color: #000000;
}

.gpp-doc-addr-col h5 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 700;
    color: #000000;
}

.gpp-doc-addr-lines {
    white-space: pre-line;
    font-weight: 500;
    color: #000000;
}

.gpp-doc-order-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gpp-doc-order-row {
    display: flex;
    justify-content: space-between;
}

.gpp-doc-order-row span:first-child {
    font-weight: 700;
}

/* Goods Items Table (No Packing Details) */
.gpp-doc-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 22px;
    font-size: 12.5px;
}

.gpp-doc-items-table th {
    background: #dbeafe; /* light blue tint */
    border: 1px solid #bfdbfe;
    padding: 6px 10px;
    font-weight: 700;
    text-align: left;
    color: #000000;
}

.gpp-doc-items-table th.right-align, .gpp-doc-items-table td.right-align {
    text-align: right;
}

.gpp-doc-items-table td {
    border: 1px solid #cbd5e1;
    padding: 8px 10px;
    vertical-align: top;
    color: #000000;
}

/* Footer & Remarks */
.gpp-doc-footer-meta {
    font-size: 12.5px;
    line-height: 1.45;
    margin-bottom: 28px;
    color: #000000;
}

.gpp-doc-footer-row {
    margin-bottom: 4px;
}

.gpp-doc-footer-row strong {
    font-weight: 700;
}

/* Signatures */
.gpp-doc-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 36px;
    row-gap: 18px;
    margin-top: 25px;
    font-size: 12px;
    color: #000000;
}

.gpp-doc-sig-field {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 12px;
}

.gpp-doc-underline {
    flex: 1;
    border-bottom: 1px solid #000000;
    height: 16px;
}

/* ==========================================================================
   @MEDIA PRINT SPECIFICATION
   ========================================================================== */
@media print {
    body * {
        visibility: hidden !important;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    #gppPrintPaper, #gppPrintPaper * {
        visibility: visible !important;
    }

    #gppPrintPaper {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 12mm 16mm !important;
        box-shadow: none !important;
        margin: 0 !important;
    }

    @page {
        size: A4 portrait;
        margin: 8mm;
    }

    .gpp-doc-items-table th {
        background-color: #e2e8f0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
